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).
27 lines
763 B
Python
27 lines
763 B
Python
"""Search provider interface. Answers "where should we look?" - discovery
|
|
only, never a replacement for the LLM or for a SourceCollector. Every
|
|
company-discovery query (official website, aliases, competitors, HQ) goes
|
|
through this Protocol, never a specific vendor SDK - swapping
|
|
`SEARCH_PROVIDER` changes which class `get_search_provider()` returns and
|
|
nothing else has to change. See app/services/discovery_service.py for the
|
|
only caller.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Protocol
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class SearchResult(BaseModel):
|
|
title: str
|
|
url: str
|
|
snippet: str
|
|
|
|
|
|
class SearchProvider(Protocol):
|
|
provider_name: str
|
|
|
|
async def search(self, query: str, *, count: int = 5) -> list[SearchResult]: ...
|