""" Схемы для RAG """ from uuid import UUID from pydantic import BaseModel, Field from typing import List, Any class QuestionRequest(BaseModel): conversation_id: UUID question: str = Field(..., min_length=3) top_k: int = 20 rerank_top_n: int = 5 class RAGSource(BaseModel): index: int document_id: str chunk_id: str title: str | None = None class RAGAnswer(BaseModel): answer: str sources: List[RAGSource] = [] usage: dict[str, Any] = {}