Skip to content

feat(llm): pluggable LLM-provider abstraction (OpenAI + Anthropic)#5

Merged
royavrahami merged 1 commit into
mainfrom
feat/llm-provider-abstraction
Jun 1, 2026
Merged

feat(llm): pluggable LLM-provider abstraction (OpenAI + Anthropic)#5
royavrahami merged 1 commit into
mainfrom
feat/llm-provider-abstraction

Conversation

@royavrahami

Copy link
Copy Markdown
Owner

Mirror of the QA agent change. Decouples the agent from the OpenAI SDK behind a small LLMProvider protocol (OpenAI today, Anthropic drop-in). New src/llm/ package + all 5 call sites routed through it + provider injection for testability. 107 tests pass, 64% → 65% coverage, ruff clean. OpenAI behaviour unchanged.

🤖 Generated with Claude Code

Mirror of the QA agent change. Decouple the agent from the OpenAI SDK behind a
small LLMProvider protocol so the backend is swappable (OpenAI today, Anthropic
drop-in) without touching the processing/agent code.

- New src/llm/ package: LLMProvider protocol + normalised errors,
  OpenAIProvider, AnthropicProvider (lazy import), get_provider() factory.
- Route all five LLM call sites through the provider: summarizer,
  trend_analyzer, source_discoverer (now injectable via `provider=`) and
  keyword_extractor / report_generator.
- settings: add LLM_PROVIDER (default openai) and ANTHROPIC_API_KEY.
- Tests: summarizer + keyword-extractor tests switch to provider injection;
  new tests/test_llm/ covers the factory + OpenAI error translation.
  107 tests pass, coverage 64% -> 65%, ruff clean. README/.env.example updated.

OpenAI behaviour is unchanged (verified by the existing suite).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@royavrahami royavrahami merged commit 5507f95 into main Jun 1, 2026
1 check passed
@royavrahami royavrahami deleted the feat/llm-provider-abstraction branch June 1, 2026 12:17
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