Web Console Views
The JSON API of the React Vectorstore list in the web console: list, clone, rename and delete.
- class smarter.apps.vectorstore.views.listview.api.VectorstoreListApiCloneView(**kwargs)[source]
Bases:
SmarterAuthenticatedNeverCachedWebViewClone a vectorstore: a new, undeployed vectorstore with the same spec, owned by the user.
Its documents and database are not copied. Deploy it, and add documents, to use it.
- class smarter.apps.vectorstore.views.listview.api.VectorstoreListApiDeleteView(**kwargs)[source]
Bases:
SmarterAuthenticatedNeverCachedWebViewDestroy a vectorstore’s database and data, unless deletionProtection is enabled, then delete it.
- class smarter.apps.vectorstore.views.listview.api.VectorstoreListApiRenameView(**kwargs)[source]
Bases:
SmarterAuthenticatedNeverCachedWebViewRename a vectorstore.
Its database keeps its index name, and its server its Kubernetes name.
- class smarter.apps.vectorstore.views.listview.api.VectorstoreListApiView(**kwargs)[source]
Bases:
SmarterAuthenticatedNeverCachedWebViewThe vectorstores that the user owns, those shared with them, or both.
This module contains views to implement the React.
Vectorstore list view in the Smarter Dashboard.
- class smarter.apps.vectorstore.views.listview.view.VectorstoreListView(**kwargs)[source]
Bases:
SmarterAuthenticatedNeverCachedWebViewRender the vectorstore list view for the Smarter Workbench web console.
This view displays all vectorstores available to the authenticated user as cards, providing a quick overview and access to vectorstore details.
- Parameters:
- Returns:
Rendered HTML page with a card for each vectorstore, or a 404 error page if the user is not authenticated.
- Return type:
HttpResponse
- property formatted_class_name: str
Returns a formatted string of the class name for logging purposes.
- get(request, *args, **kwargs)[source]
Handle GET requests and return a cleaned HttpResponse.
- Parameters:
request (
ASGIRequest) – The HTTP request object.- Returns:
An HttpResponse with the cleaned HTML content.
- Return type:
HttpResponse
- vectorstores: list[VectorstoreMeta]
This module contains views to implement the Vectorstore.
card-style detail view in the Smarter Dashboard.
- class smarter.apps.vectorstore.views.detailview.VectorstoreDetailView(**kwargs)[source]
Bases:
DocsBaseViewRenders the detail view for a Smarter dashboard vectorstore.
This view renders a detailed manifest for a specific vectorstore, including its configuration and metadata, in YAML format. It is intended for authenticated users and provides error handling for missing or unsupported vectorstore kinds and names.
- Parameters:
- Returns:
Rendered HTML page with vectorstore manifest details, or a 404 error page if the vectorstore is not found or parameters are invalid.
- Return type:
HttpResponse
Note
The vectorstore name and kind must be provided and valid. Otherwise, a “not found” response is returned.
See also
Vectorstorefor vectorstore metadata retrieval.ApiV1CliDescribeApiViewfor API details.Example usage:
GET /vectorstore/detail/?name=my_vectorstore&kind=custom
- get(request, *args, **kwargs)[source]
Handle GET requests to render the vectorstore manifest detail view.
This method processes the incoming request to retrieve the specified vectorstore’s manifest details and renders them in a user-friendly format. It performs validation on the provided vectorstore name and kind, retrieves the vectorstore metadata, and handles any errors that may arise during this process.
Process: 1. Extract and validate ‘name’ and ‘kind’ from kwargs. 2. Retrieve the vectorstore metadata using the provided name and user context. 3. If the vectorstore is found, call the API view to get the vectorstore details 4. Convert the JSON response to YAML format for better readability. 5. Render the vectorstore manifest detail template with the retrieved data. 6. Handle any errors that occur during the process and return appropriate error responses.
- Parameters:
- Returns:
Rendered HTML page with vectorstore manifest details, or an error response if the vectorstore is not found or parameters are invalid.
- Return type:
- vectorstore: VectorstoreMeta | None = None