Vectorstore Serializers

Serializers of the vectorstore app.

Field names are camelCase in JSON. Related objects are given by name, and a Secret’s value is never serialized.

class smarter.apps.vectorstore.serializers.VectorstoreDocumentSerializer(*args, **kwargs)[source]

Bases: SmarterCamelCaseSerializer

A document of a vectorstore, without its content.

class smarter.apps.vectorstore.serializers.VectorstoreSerializer(*args, **kwargs)[source]

Bases: MetaDataWithOwnershipModelSerializer

A vectorstore, as the web console and the REST API show it.

Read only.

get_document_count(obj)[source]

Return the number of the vectorstore’s documents.

Parameters:

obj (VectorstoreMeta) – The vectorstore.

Return type:

int

get_fields()[source]

Return the serializer’s fields, all read-only.

get_manifest_url(obj)[source]

The URL of the vectorstore’s detail view, which renders its manifest.

Return type:

str

get_snapshot_count(obj)[source]

Return the number of the vectorstore’s snapshots.

Parameters:

obj (VectorstoreMeta) – The vectorstore.

Return type:

int

class smarter.apps.vectorstore.serializers.VectorstoreSnapshotSerializer(*args, **kwargs)[source]

Bases: SmarterCamelCaseSerializer

A Qdrant snapshot, or Pinecone backup, of a vectorstore.