Split out main module
This commit is contained in:
37
src/knowledge_search_mcp/models.py
Normal file
37
src/knowledge_search_mcp/models.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# ruff: noqa: INP001
|
||||
"""Domain models for knowledge search MCP server."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from typing import TYPE_CHECKING, TypedDict
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from google import genai
|
||||
|
||||
from .clients.vector_search import GoogleCloudVectorSearch
|
||||
from .config import Settings
|
||||
|
||||
|
||||
class SourceNamespace(str, Enum):
|
||||
"""Allowed values for the 'source' namespace filter."""
|
||||
|
||||
EDUCACION_FINANCIERA = "Educacion Financiera"
|
||||
PRODUCTOS_Y_SERVICIOS = "Productos y Servicios"
|
||||
FUNCIONALIDADES_APP_MOVIL = "Funcionalidades de la App Movil"
|
||||
|
||||
|
||||
class SearchResult(TypedDict):
|
||||
"""Structured response item returned by the vector search API."""
|
||||
|
||||
id: str
|
||||
distance: float
|
||||
content: str
|
||||
|
||||
|
||||
@dataclass
|
||||
class AppContext:
|
||||
"""Shared resources initialised once at server startup."""
|
||||
|
||||
vector_search: "GoogleCloudVectorSearch"
|
||||
genai_client: "genai.Client"
|
||||
settings: "Settings"
|
||||
Reference in New Issue
Block a user