Commit Graph

5 Commits

Author SHA1 Message Date
freemo f44060e857 fix(providers): wire OpenAIChatProvider and AnthropicChatProvider into ProviderRegistry
Previously, ProviderRegistry.create_ai_provider() dispatched to dedicated
provider classes only for Google and OpenRouter. For OpenAI and Anthropic,
execution fell through to the generic LangChainChatProvider factory, leaving
OpenAIChatProvider and AnthropicChatProvider as dead code in production.

This commit:
- Adds ProviderType.OPENAI dispatch branch in create_ai_provider() to
  instantiate OpenAIChatProvider with the configured API key and model
- Adds ProviderType.ANTHROPIC dispatch branch in create_ai_provider() to
  instantiate AnthropicChatProvider with the configured API key and model
- Both branches raise ValueError with the missing env var name when the
  API key is not configured, consistent with Google and OpenRouter branches
- Updates src/cleveragents/providers/llm/__init__.py to export all four
  dedicated provider classes (OpenAIChatProvider, AnthropicChatProvider,
  GoogleChatProvider, OpenRouterChatProvider)
- Updates provider_registry_coverage.feature to assert that create_ai_provider
  returns OpenAIChatProvider for openai and AnthropicChatProvider for anthropic
- Adds new scenarios for Anthropic dispatch and missing-key error paths for
  both OpenAI and Anthropic
- Updates the 'AI provider exposes working llm factory' scenario to use groq
  (which still goes through the generic LangChainChatProvider path) since
  OpenAI now uses the dedicated class
- Adds step definitions for OpenAIChatProvider and AnthropicChatProvider
  isinstance assertions

Closes #3427
2026-04-05 18:00:27 +00:00
freemo 0cb4bc3ad3 Feats: Implemented OpenRouter support 2025-12-09 19:28:24 -05:00
freemo 2d64005fec Feats: Added google / Gemini provider 2025-12-09 18:28:14 -05:00
freemo d06051f821 Feat Added ability for PlanService to take per-request providers 2025-12-08 17:45:49 -05:00
freemo 407b7ec53e Feat: Created provider registry 2025-12-05 12:03:58 -05:00