Initial commit: CI Agent competitive-intelligence monitoring app
FastAPI + Celery + Next.js + Postgres/Redis app with company monitoring, source collection, LLM-based change analysis, enrichment, and account security (Turnstile, escalating lockout, email verification).
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
"""Resolves `LLM_PROVIDER` to a concrete provider instance. Never imported
|
||||
directly by prompt task modules or services - always go through
|
||||
`get_llm_provider()` so swapping providers stays a one-line config change.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.analysis.llm.base import LLMProvider
|
||||
from app.analysis.llm.mock import MockLLMProvider
|
||||
from app.core.config import Settings, get_settings
|
||||
|
||||
|
||||
def get_llm_provider(settings: Settings | None = None) -> LLMProvider:
|
||||
settings = settings or get_settings()
|
||||
|
||||
if settings.llm_provider == "anthropic":
|
||||
from app.analysis.llm.anthropic_provider import AnthropicLLMProvider
|
||||
|
||||
return AnthropicLLMProvider(settings)
|
||||
|
||||
if settings.llm_provider == "ollama":
|
||||
from app.analysis.llm.ollama_provider import OllamaLLMProvider
|
||||
|
||||
return OllamaLLMProvider(settings)
|
||||
|
||||
if settings.llm_provider == "gemini":
|
||||
from app.analysis.llm.gemini_provider import GeminiLLMProvider
|
||||
|
||||
return GeminiLLMProvider(settings)
|
||||
|
||||
return MockLLMProvider()
|
||||
Reference in New Issue
Block a user