Management Commands
Apply the built-in Vectorstore manifests: example vector databases, which every account may use.
- class smarter.apps.vectorstore.management.commands.add_builtin_vectorstores.Command(*args, **kwargs)[source]
Bases:
SmarterCommandDjango manage.py add_builtin_vectorstores command.
Applies the Vectorstore manifests in smarter/apps/vectorstore/data/vectorstores. They are not deployed. Run it after
manage.py initialize_vectorstore_providers, which creates the ApiConnections of the managed services: a manifest whose Provider or ApiConnection does not exist is skipped.- help = 'Apply the built-in Vectorstore manifests, in smarter/apps/vectorstore/data/vectorstores. They are not deployed. Those whose Provider or ApiConnection does not exist are skipped.'
Create the ApiConnections of the managed vector database services: Pinecone, and Qdrant Cloud.
- class smarter.apps.vectorstore.management.commands.initialize_vectorstore_providers.Command(*args, **kwargs)[source]
Bases:
SmarterCommandDjango manage.py initialize_vectorstore_providers command.
For each managed vector database service whose environment variables are set, it creates, or updates, a Secret with its API key, and an ApiConnection, owned by the Smarter admin, which the built-in Vectorstore manifests use:
Pinecone:
PINECONE_API_KEY. The ApiConnectionpinecone.Qdrant Cloud:
QDRANT_CLOUD_URLandQDRANT_CLOUD_API_KEY. The ApiConnectionqdrant_cloud.
A self-hosted Qdrant database needs neither: Smarter runs it, and generates its API key.
- connection(user_profile, name, base_url, secret_name, api_key, description)[source]
Create or update a Secret with an API key, and an ApiConnection that uses it.
- Return type:
ApiConnection
- help = 'Create the ApiConnections of Pinecone and Qdrant Cloud, from PINECONE_API_KEY, QDRANT_CLOUD_URL and QDRANT_CLOUD_API_KEY.'
Add local files, e.g. a folder of PDFs, to a vectorstore, and load them.
- class smarter.apps.vectorstore.management.commands.load_vectorstore_documents.Command(*args, **kwargs)[source]
Bases:
SmarterCommandDjango manage.py load_vectorstore_documents command.
Adds a file, or every supported file in a folder and its subfolders, to a vectorstore: PDF, text, Markdown, CSV, JSON, YAML and HTML. Files whose text is already in the vectorstore are skipped. They are loaded by Celery, or now, with
--now.python manage.py load_vectorstore_documents --name example_knowledge_base --path /data/manuals- help = 'Add a file, or a folder of files, e.g. PDFs, to a vectorstore, and load them.'