Skip to content

feat(models): add abstract base model class and refactor OpenAI adapter#3

Merged
runtimebug merged 2 commits into
mainfrom
feat/abstract-base-model
Feb 8, 2026
Merged

feat(models): add abstract base model class and refactor OpenAI adapter#3
runtimebug merged 2 commits into
mainfrom
feat/abstract-base-model

Conversation

@runtimebug

@runtimebug runtimebug commented Feb 8, 2026

Copy link
Copy Markdown
Owner

Summary

Add abstract class that extracts shared logic (~70%) across LLM providers including prompt generation, response parsing, and file filtering.

Changes

  • Create with abstract class
  • Refactor to extend
  • Export and from
  • now only implements provider-specific methods:
  • : Makes actual API call to OpenAI
  • : Returns
  • : Returns identifier string

Add BaseReviewModel abstract class that extracts shared logic (~70%) across
LLM providers including prompt generation, response parsing, and file filtering.

Changes:
- Create src/models/base.ts with BaseReviewModel abstract class
- Refactor OpenAIModel to extend BaseReviewModel
- Export BaseReviewModel and LLMMessage from models/index.ts
- OpenAIModel now only implements provider-specific methods:
  - callLLM(): Makes actual API call to OpenAI
  - supportsStructuredOutput(): Returns true
  - getModelName(): Returns identifier string

This enables easier addition of new providers (Anthropic, Ollama, etc.)
by only implementing the provider-specific API calls.

Relates to EVOLUTION_PLAN.md section 4.3: Multi-Provider Support
@runtimebug
runtimebug merged commit 728a59d into main Feb 8, 2026
3 checks passed
@runtimebug
runtimebug deleted the feat/abstract-base-model branch February 8, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant