Pydantic Models
Smarter API Vectorsearch Manifest Constants.
Smarter API Manifest - Vectorsearch.metadata.
- class smarter.apps.vectorsearch.manifest.models.vectorsearch.metadata.SAMVectorsearchMetadata(*, name: str, description: str | None, version: str | None, tags: List[str] | None = <factory>, annotations: dict[str, str] | None=<factory>)[source]
Bases:
AbstractSAMMetadataBaseSmarter API Vectorsearch Manifest - Metadata class.
- model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
Smarter API Manifest - Vectorsearch.spec.
- class smarter.apps.vectorsearch.manifest.models.vectorsearch.spec.SAMVectorsearchSpec(*, config: SAMVectorsearchSpecConfig)[source]
Bases:
AbstractSAMSpecBaseSmarter API Vectorsearch Manifest Vectorsearch.spec.
- config: SAMVectorsearchSpecConfig
- model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- class smarter.apps.vectorsearch.manifest.models.vectorsearch.spec.SAMVectorsearchSpecConfig(*, vectorstore_name: str, auth_secret_name: str | None = None, search_type: VectorsearchSearchType = VectorsearchSearchType.SIMILARITY, k: Annotated[int, Gt(gt=0)] = 4, score_threshold: Annotated[float | None, Ge(ge=0.0), Le(le=1.0)] = None, fetch_k: Annotated[int | None, Gt(gt=0)] = None, lambda_mult: Annotated[float | None, Ge(ge=0.0), Le(le=1.0)] = None, metadata_filter: dict | None = None, is_enabled: bool = True)[source]
Bases:
AbstractSAMSpecBaseSmarter API Vectorsearch Manifest Vectorsearch.spec.config.
- model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- search_type: VectorsearchSearchType
- classmethod strip_and_validate_name(value)[source]
Strip whitespace from
vectorstore_nameandauth_secret_name, and reject blank names.- Parameters:
- Return type:
- Returns:
The stripped name, or None if it was None.
- Raises:
ValueError – when the name is blank.
- validate_search_type_constraints()[source]
Check that the search parameters suit
search_type.score_thresholdis required for, and only valid with,similarity_score_threshold.fetch_kandlambda_multare only valid withmmr, wherefetch_kmust be at leastk.- Return type:
- Returns:
The config, unchanged.
- Raises:
ValueError – when a parameter does not suit the search type.
Smarter API Manifest - Vectorsearch.status.
- class smarter.apps.vectorsearch.manifest.models.vectorsearch.status.SAMVectorsearchStatus(*, recordLocator: str, created: datetime, modified: datetime, dependencies: List[SAMDependency] | None = None, accountNumber: str, username: str)[source]
Bases:
AbstractSAMStatusBaseSmarter API Vectorsearch Manifest - Status class.
- model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
Smarter API Vectorsearch Manifest.
- class smarter.apps.vectorsearch.manifest.models.vectorsearch.model.SAMVectorsearch(*, apiVersion: str, kind: str, metadata: SAMVectorsearchMetadata, spec: SAMVectorsearchSpec, status: SAMVectorsearchStatus | None = None)[source]
Bases:
AbstractSAMBaseSmarter API Manifest - Vectorsearch.
- metadata: SAMVectorsearchMetadata
- model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- spec: SAMVectorsearchSpec
- status: SAMVectorsearchStatus | None