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).
22 lines
689 B
Python
22 lines
689 B
Python
"""Resolves `SEARCH_PROVIDER` to a concrete provider instance. Never
|
|
imported directly by discovery_service - always go through
|
|
`get_search_provider()` so swapping providers stays a one-line config
|
|
change."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from app.core.config import Settings, get_settings
|
|
from app.search.base import SearchProvider
|
|
from app.search.mock import MockSearchProvider
|
|
|
|
|
|
def get_search_provider(settings: Settings | None = None) -> SearchProvider:
|
|
settings = settings or get_settings()
|
|
|
|
if settings.search_provider == "brave":
|
|
from app.search.brave import BraveSearchProvider
|
|
|
|
return BraveSearchProvider(settings)
|
|
|
|
return MockSearchProvider()
|