gen_ai_hub.document_grounding.models.vector module¶
Pydantic models for Vector API.
This module defines data models for the Vector API, which provides management and search capabilities for vector-based document collections.
- Model categories:
Collection models (collection configuration and management)
Document and chunk models (content structure with embeddings)
Embedding configuration models (embedding model settings)
Search models (semantic search requests and results)
Status models (collection creation/deletion tracking)
The Vector API enables semantic search across document collections using vector embeddings for similarity-based retrieval.
- class gen_ai_hub.document_grounding.models.vector.VectorKeyValueListPair(*, key: str, value: List[str])¶
Bases:
BaseModel- key: str¶
- value: List[str]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.EmbeddingConfig(*, modelName: str | None = 'text-embedding-3-large')¶
Bases:
BaseModel- modelName: str | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.CollectionCreateRequest(*, title: str | None = None, embeddingConfig: EmbeddingConfig, metadata: List[VectorKeyValueListPair] | None = [])¶
Bases:
BaseModel- title: str | None¶
- embeddingConfig: EmbeddingConfig¶
- metadata: List[VectorKeyValueListPair] | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.Collection(*, id: str, title: str | None = None, embeddingConfig: EmbeddingConfig, metadata: List[VectorKeyValueListPair] | None = [])¶
Bases:
BaseModel- id: str¶
- title: str | None¶
- embeddingConfig: EmbeddingConfig¶
- metadata: List[VectorKeyValueListPair] | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.CollectionsListResponse(*, count: int | None = None, resources: List[Collection])¶
Bases:
BaseModel- count: int | None¶
- resources: List[Collection]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.TextOnlyBaseChunk(*, content: str, metadata: List[VectorKeyValueListPair] | None = [])¶
Bases:
BaseModel- content: str¶
- metadata: List[VectorKeyValueListPair] | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.BaseDocument(*, chunks: List[TextOnlyBaseChunk], metadata: List[VectorKeyValueListPair])¶
Bases:
BaseModel- chunks: List[TextOnlyBaseChunk]¶
- metadata: List[VectorKeyValueListPair]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.DocumentWithoutChunks(*, id: str, metadata: List[VectorKeyValueListPair])¶
Bases:
BaseModel- id: str¶
- metadata: List[VectorKeyValueListPair]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.Document(*, chunks: List[TextOnlyBaseChunk], metadata: List[VectorKeyValueListPair], id: str)¶
Bases:
BaseDocument- id: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.DocumentsCreateRequest(*, documents: List[BaseDocument])¶
Bases:
BaseModel- documents: List[BaseDocument]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.DocumentsUpdateRequest(*, documents: List[Document])¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.DocumentsListResponse(*, documents: List[DocumentWithoutChunks])¶
Bases:
BaseModel- documents: List[DocumentWithoutChunks]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.DocumentsResponse(*, count: int | None = None, resources: List[DocumentWithoutChunks])¶
Bases:
BaseModel- count: int | None¶
- resources: List[DocumentWithoutChunks]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.CollectionCreatedResponse(*, collectionUrl: str, status: Literal['CREATED'] = 'CREATED')¶
Bases:
BaseModel- collectionURL: str¶
- status: Literal['CREATED']¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.CollectionDeletedResponse(*, collectionUrl: str, status: Literal['DELETED'] = 'DELETED')¶
Bases:
BaseModel- collectionURL: str¶
- status: Literal['DELETED']¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.CollectionPendingResponse(*, location: str, status: Literal['PENDING'] = 'PENDING')¶
Bases:
BaseModel- Location: str¶
- status: Literal['PENDING']¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.VectorSearchConfiguration(*, maxChunkCount: int | None = None, maxDocumentCount: int | None = None)¶
Bases:
BaseModel- maxChunkCount: int | None¶
- maxDocumentCount: int | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.VectorSearchDocumentKeyValueListPair(*, key: str, value: List[str], selectMode: List[str] | None = None)¶
Bases:
BaseModel- key: str¶
- value: List[str]¶
- selectMode: List[str] | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.VectorSearchFilter(*, id: str, collectionIds: List[str], configuration: VectorSearchConfiguration, collectionMetadata: List[VectorKeyValueListPair] | None = [], documentMetadata: List[VectorSearchDocumentKeyValueListPair] | None = [], chunkMetadata: List[VectorKeyValueListPair] | None = [])¶
Bases:
BaseModel- id: str¶
- collectionIds: List[str]¶
- configuration: VectorSearchConfiguration¶
- collectionMetadata: List[VectorKeyValueListPair] | None¶
- documentMetadata: List[VectorSearchDocumentKeyValueListPair] | None¶
- chunkMetadata: List[VectorKeyValueListPair] | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.TextSearchRequest(*, query: str, filters: List[VectorSearchFilter])¶
Bases:
BaseModel- query: str¶
- filters: List[VectorSearchFilter]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.VectorChunk(*, id: str, content: str, metadata: List[VectorKeyValueListPair] | None = [])¶
Bases:
BaseModel- id: str¶
- content: str¶
- metadata: List[VectorKeyValueListPair] | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.DocumentOutput(*, id: str, metadata: List[VectorKeyValueListPair] | None = [], chunks: List[VectorChunk])¶
Bases:
BaseModel- id: str¶
- metadata: List[VectorKeyValueListPair] | None¶
- chunks: List[VectorChunk]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.DocumentsChunk(*, id: str, title: str, metadata: List[VectorKeyValueListPair] | None = [], documents: List[DocumentOutput])¶
Bases:
BaseModel- id: str¶
- title: str¶
- metadata: List[VectorKeyValueListPair] | None¶
- documents: List[DocumentOutput]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.VectorPerFilterSearchResult(*, filterId: str, results: List[DocumentsChunk])¶
Bases:
BaseModel- filterId: str¶
- results: List[DocumentsChunk]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gen_ai_hub.document_grounding.models.vector.VectorSearchResults(*, results: List[VectorPerFilterSearchResult])¶
Bases:
BaseModel- results: List[VectorPerFilterSearchResult]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].