ractogateway.rag._models.retrieval
Retrieval and RAG response models.
- class ractogateway.rag._models.retrieval.RetrievalConfig(**data)[source]
Bases:
BaseModelInput parameters for a vector-store search.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- query: str
- top_k: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ractogateway.rag._models.retrieval.RetrievalResult(**data)[source]
Bases:
BaseModelA single retrieved chunk together with its relevance score.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- chunk: Chunk
- score: float
- rank: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ractogateway.rag._models.retrieval.RAGResponse(**data)[source]
Bases:
BaseModelCombined output from a RAG query (retrieval + generation).
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- answer: LLMResponse
- sources: list[RetrievalResult]
- query: str
- context_used: str
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].