SAMVectorstore

SAM model of the Vectorstore kind, generated from the Smarter platform’s JSON Schema.

Do not edit: run scripts/generate_sam_models.py. See smarter.models.sam.

class smarter.models.sam.vectorstore.SAMDependency(*, kind: str, name: str, **extra_data: Any)[source]

Bases: SAMModel

A resource that depends on the resource that a manifest describes.

kind: str

Kind[String]: The SAM kind of the resource that depends on this resource, e.g. LLMClient.

Read only.

name: str

Name[String]: The name of the resource that depends on this resource.

Read only.

model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}

Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].

class smarter.models.sam.vectorstore.SAMVectorstoreEmbeddings(*, batchSize: Annotated[int, None, Interval(gt=None, ge=1, lt=None, le=1000), None] | None = 64, chunkOverlap: Annotated[int, None, Interval(gt=None, ge=0, lt=None, le=2000), None] | None = 200, chunkSize: Annotated[int, None, Interval(gt=None, ge=100, lt=None, le=8000), None] | None = 1000, dimensions: Annotated[int, None, Interval(gt=None, ge=1, lt=None, le=20000), None] | None = None, model: Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)], provider: Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)], **extra_data: Any)[source]

Bases: SAMModel

Vectorstore.spec.embeddings: how documents and queries are turned into vectors.

batchSize: conint(ge=1, le=1000) | None

Vectorstore.__init__.embeddings.batchSize: chunks per embeddings request and upsert.

chunkOverlap: conint(ge=0, le=2000) | None

Vectorstore.__init__.embeddings.chunkOverlap: characters shared by consecutive chunks.

chunkSize: conint(ge=100, le=8000) | None

Vectorstore.__init__.embeddings.chunkSize: characters per chunk.

dimensions: conint(ge=1, le=20000) | None

Vectorstore.__init__.embeddings.dimensions: ask the model for vectors of this size, if it supports it, e.g. text-embedding-3.

It must equal index.dimension.

model: constr(min_length=1)

Vectorstore.__init__.embeddings.model: the embeddings model, e.g. text-embedding-3-small.

provider: constr(min_length=1)

Vectorstore.__init__.embeddings.provider: a Provider with an OpenAI-compatible embeddings API, e.g. openai.

model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}

Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].

class smarter.models.sam.vectorstore.Metric(*values)[source]

Bases: Enum

Vectorstore.__init__.index.metric: the distance metric.

class smarter.models.sam.vectorstore.SAMVectorstoreIndex(*, deletionProtection: bool | None = False, dimension: Annotated[int, None, Interval(gt=None, ge=1, lt=None, le=20000), None], metric: Metric | None = 'cosine', name: Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=45, pattern=None, ascii_only=None)] | None = None, **extra_data: Any)[source]

Bases: SAMModel

Vectorstore.spec.index: the index (Pinecone), or collection (Qdrant), of the database.

deletionProtection: bool | None

Vectorstore.__init__.index.deletionProtection: refuse to destroy the database.

dimension: conint(ge=1, le=20000)

Vectorstore.__init__.index.dimension: of the embeddings model’s vectors.

metric: Metric | None

Vectorstore.__init__.index.metric: the distance metric.

name: constr(max_length=45) | None

Vectorstore.__init__.index.name: the index or collection’s name, in lowercase letters, digits and hyphens.

Defaults to the manifest’s name, with the account number for a managed service.

model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}

Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].

class smarter.models.sam.vectorstore.SAMVectorstoreMaintenance(*, snapshotIntervalHours: Annotated[int, None, Interval(gt=None, ge=1, lt=None, le=720), None] | None = 24, snapshotRetention: Annotated[int, None, Interval(gt=None, ge=1, lt=None, le=100), None] | None = 7, snapshots: bool | None = True, **extra_data: Any)[source]

Bases: SAMModel

Vectorstore.spec.maintenance: what Celery Beat does, besides checking its status.

snapshotIntervalHours: conint(ge=1, le=720) | None

Vectorstore.__init__.maintenance.snapshotIntervalHours: how often.

snapshotRetention: conint(ge=1, le=100) | None

Vectorstore.__init__.maintenance.snapshotRetention: how many are kept.

Older ones are deleted.

snapshots: bool | None

Vectorstore.__init__.maintenance.snapshots: take Qdrant snapshots, or Pinecone backups.

model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}

Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].

class smarter.models.sam.vectorstore.SAMVectorstoreMetadata(*, annotations: None | list[dict[str, str | int | float | bool | date | datetime | UUID | bytes | list | dict[str, Any]]] = None, description: str | None, name: str, tags: list[str] | None = None, version: str | None, **extra_data: Any)[source]

Bases: SAMModel

Smarter API Vectorstore Manifest - Metadata class.

annotations: None | list[dict[str, str | int | float | bool | date | datetime | UUID | bytes | list | dict[str, Any]]]

The manifest annotations.

Used for storing arbitrary metadata as

key-value pairs. Example: [{‘smarter.sh/test-manifest/project-name’: ‘Scooby dooby do’}]. The key should be a valid url-friendly string. The value accepts multi-line string values (YAML block scalars) and various scalar types including str, int, float, bool, datetime.date, datetime.datetime, decimal.Decimal, uuid.UUID, bytes, list, dict.

description: str | None

The description for this resource.

Be brief. Keep it under 255 characters.

name: str

The camelCase name of the manifest resource.

tags: list[str] | None

The tags of the manifest.

Used for generic resource categorization and search. Example: [‘tag1’, ‘tag2’]

version: str | None

The semantic version of the manifest.

Example: 0.1.0

model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}

Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].

class smarter.models.sam.vectorstore.Cloud(*values)[source]

Bases: Enum

Vectorstore.__init__.pinecone.cloud.

class smarter.models.sam.vectorstore.SAMVectorstorePinecone(*, cloud: Cloud | None = 'aws', region: Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)] | None = 'us-east-1', **extra_data: Any)[source]

Bases: SAMModel

Vectorstore.spec.pinecone: where Pinecone runs a serverless index.

cloud: Cloud | None

Vectorstore.__init__.pinecone.cloud.

region: constr(min_length=1) | None

Vectorstore.__init__.pinecone.region.

model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}

Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].

class smarter.models.sam.vectorstore.SAMVectorstoreSelfHosted(*, cpu: str | None = '500m', image: str | None = 'qdrant/qdrant:v1.19.1', memory: str | None = '1Gi', storage: str | None = '10Gi', storageClass: str | None = None, **extra_data: Any)[source]

Bases: SAMModel

Vectorstore.spec.selfHosted: the Qdrant server that Smarter runs on Kubernetes.

cpu: str | None

Vectorstore.__init__.selfHosted.cpu: requested, e.g. 500m.

image: str | None

Vectorstore.__init__.selfHosted.image: the Qdrant image.

memory: str | None

Vectorstore.__init__.selfHosted.memory: requested, e.g. 1Gi.

storage: str | None

Vectorstore.__init__.selfHosted.storage: the size of its volume, e.g. 10Gi.

storageClass: str | None

Vectorstore.__init__.selfHosted.storageClass: of its volume.

Defaults to the cluster’s.

model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}

Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].

class smarter.models.sam.vectorstore.Backend(*values)[source]

Bases: Enum

Vectorstore.__init__.backend: qdrant or pinecone.

class smarter.models.sam.vectorstore.Hosting(*values)[source]

Bases: Enum

Vectorstore.__init__.hosting: self_hosted, run by Smarter on Kubernetes (qdrant only), or managed, a service reached through the ApiConnection in connection.

class smarter.models.sam.vectorstore.SAMVectorstoreSpec(*, backend: Backend, connection: str | None = None, embeddings: SAMVectorstoreEmbeddings, hosting: Hosting | None = 'managed', index: SAMVectorstoreIndex, isActive: bool | None = True, maintenance: SAMVectorstoreMaintenance | None = None, pinecone: SAMVectorstorePinecone | None = None, selfHosted: SAMVectorstoreSelfHosted | None = None, **extra_data: Any)[source]

Bases: SAMModel

Smarter API Vectorstore Manifest Vectorstore.spec.

backend: Backend

Vectorstore.__init__.backend: qdrant or pinecone.

connection: str | None

Vectorstore.__init__.connection: managed only.

The name of an ApiConnection with the service’s URL and API key Secret, e.g. https://api.pinecone.io, or a Qdrant Cloud cluster’s URL.

embeddings: SAMVectorstoreEmbeddings

Vectorstore.__init__.embeddings.

model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}

Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].

hosting: Hosting | None

Vectorstore.__init__.hosting: self_hosted, run by Smarter on Kubernetes (qdrant only), or managed, a service reached through the ApiConnection in connection.

index: SAMVectorstoreIndex

Vectorstore.__init__.index.

isActive: bool | None

Vectorstore.__init__.isActive: whether it may be used.

maintenance: SAMVectorstoreMaintenance | None

Vectorstore.__init__.maintenance.

pinecone: SAMVectorstorePinecone | None

Vectorstore.__init__.pinecone: pinecone only.

selfHosted: SAMVectorstoreSelfHosted | None

Vectorstore.__init__.selfHosted: self_hosted only.

class smarter.models.sam.vectorstore.SAMVectorstoreStatus(*, accountNumber: str, apiKeySecret: str | None = None, created: datetime, dependencies: list[SAMDependency] | None = None, deployedAt: datetime | None = None, documentCount: int | None = 0, endpoint: str | None = None, indexName: str | None = None, lastCheckedAt: datetime | None = None, lastMaintenanceAt: datetime | None = None, lastSnapshotAt: datetime | None = None, message: str | None = None, modified: datetime, recordLocator: str, snapshotCount: int | None = 0, username: str, vectorCount: int | None = 0, vectorstoreStatus: str, **extra_data: Any)[source]

Bases: SAMModel

Smarter API Vectorstore Manifest - Status class.

Read only.

model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}

Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].

accountNumber: str

Vectorstore.status.accountNumber: the owner’s account.

Read only.

apiKeySecret: str | None

Vectorstore.status.apiKeySecret: the Secret with a self-hosted database’s API key.

created: datetime

The date in which this resource was created.

Read only.

dependencies: list[SAMDependency] | None

Dependencies[List]: The resources that depend on this resource, and that must be deleted, or stop referring to it, before it can be deleted.

Lists only the resources that you can read. Read only.

documentCount: int | None

Vectorstore.status.documentCount: its documents.

endpoint: str | None

Vectorstore.status.endpoint: where it is reached.

indexName: str | None

Vectorstore.status.indexName: the Pinecone index, or Qdrant collection.

message: str | None

Vectorstore.status.message: why, if it failed.

modified: datetime

The date in which this resource was most recently changed.

Read only.

recordLocator: str

RecordLocator[String]: An optional identifier used to locate the resource record associated with this manifest.

Read only.

snapshotCount: int | None

Vectorstore.status.snapshotCount: its snapshots, or backups.

username: str

Vectorstore.status.username: the owner.

Read only.

vectorCount: int | None

Vectorstore.status.vectorCount: as of lastCheckedAt.

vectorstoreStatus: str

Vectorstore.status.vectorstoreStatus: pending, provisioning, ready, stopped, failed or deleting.

class smarter.models.sam.vectorstore.SAMVectorstore(*, apiVersion: str, kind: str, metadata: SAMVectorstoreMetadata, spec: SAMVectorstoreSpec, status: SAMVectorstoreStatus | None = None, **extra_data: Any)[source]

Bases: SAMModel

Smarter API Manifest - Vectorstore.

model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}

Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].

apiVersion: str

ApiVersion[String]: Required.

The API version of the AbstractSAMBase.

kind: str

Kind[String]: Required.

The kind of resource described by the manifest.

metadata: SAMVectorstoreMetadata

Vectorstore.metadata[obj]: Required, the Vectorstore metadata.

spec: SAMVectorstoreSpec

Vectorstore.spec[obj]: Required, the Vectorstore specification.

status: SAMVectorstoreStatus | None

Vectorstore.status[obj]: Optional, Read-only.

Stateful status information about the Vectorstore.