Views
LLMClient api/v1/llmclients CRUD views.
- class smarter.apps.llmclient.api.v1.views.views.LLMClientAPIKeyListView(*args, **kwargs)[source]
Bases:
ListViewBaseLLMClientAPIKey list view for smarter api.
- contract_model
alias of
LLMClientApiKey
- get_queryset(*args, **kwargs)[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- serializer_class
alias of
LLMClientAPIKeySerializer
- class smarter.apps.llmclient.api.v1.views.views.LLMClientAPIKeyView(*args, **kwargs)[source]
Bases:
ViewBaseLLMClientAPIKey view for smarter api.
- serializer_class
alias of
LLMClientAPIKeySerializer
- class smarter.apps.llmclient.api.v1.views.views.LLMClientCustomDomainListView(*args, **kwargs)[source]
Bases:
ListViewBaseLLMClientCustomDomain list view for smarter api.
- contract_model
alias of
LLMClientApiCustomDomain
- get_queryset(*args, **kwargs)[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- serializer_class
alias of
LLMClientCustomDomainSerializer
- class smarter.apps.llmclient.api.v1.views.views.LLMClientCustomDomainView(*args, **kwargs)[source]
Bases:
ViewBaseLLMClientCustomDomain view for smarter api.
- delete(request, llmclient_id, customdomain_id)[source]
Detach the custom domain from the LLMClient.
The domain itself is kept: LLMClient.custom_domain is on_delete=CASCADE, so deleting the domain would delete the LLMClient too.
- post(request, llmclient_id, customdomain_id)[source]
Attach the custom domain to the LLMClient, through LLMClient.custom_domain.
- serializer_class
alias of
LLMClientCustomDomainSerializer
- class smarter.apps.llmclient.api.v1.views.views.LLMClientDeployView(*args, **kwargs)[source]
Bases:
ViewBaseLLMClient deployment view for smarter api.
- serializer_class
alias of
LLMClientSerializer
- class smarter.apps.llmclient.api.v1.views.views.LLMClientFunctionsListView(*args, **kwargs)[source]
Bases:
ListViewBaseLLMClientFunctions list view for smarter api.
- contract_model
alias of
LLMClientApiFunction
- get_queryset(*args, **kwargs)[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- serializer_class
alias of
LLMClientFunctionsSerializer
- class smarter.apps.llmclient.api.v1.views.views.LLMClientFunctionsView(*args, **kwargs)[source]
Bases:
ViewBaseLLMClientFunctions view for smarter api.
- serializer_class
alias of
LLMClientFunctionsSerializer
- class smarter.apps.llmclient.api.v1.views.views.LLMClientListView(*args, **kwargs)[source]
Bases:
ListViewBaseLLMClient list view for smarter api.
- dispatch(request, *args, **kwargs)[source]
Extend DRF dispatch() to add authentication checks and logging.
- Parameters:
request (
Request) – The incoming HTTP request.- Returns:
The HTTP response generated by the view.
- Return type:
HttpResponse
- Raises:
AuthenticationFailed – Raised when authentication fails.
SmarterTokenAuthenticationError – Raised for errors specific to SmarterTokenAuthentication.
- get_queryset(*args, **kwargs)[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- serializer_class
alias of
LLMClientSerializer
- class smarter.apps.llmclient.api.v1.views.views.LLMClientPluginListView(*args, **kwargs)[source]
Bases:
ListViewBaseLLMClientPlugin list view for smarter api.
- get_queryset(*args, **kwargs)[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- serializer_class
alias of
LLMClientPluginSerializer
- class smarter.apps.llmclient.api.v1.views.views.LLMClientPluginView(*args, **kwargs)[source]
Bases:
ViewBaseLLMClientPlugin view for smarter api.
- serializer_class
alias of
LLMClientPluginSerializer
- class smarter.apps.llmclient.api.v1.views.views.LLMClientView(*args, **kwargs)[source]
Bases:
ViewBaseLLMClient view for smarter api.
- dispatch(request, *args, **kwargs)[source]
Extend DRF dispatch() to add logging and signals.
- Parameters:
request (
Request) – The incoming HTTP request.- Raises:
AuthenticationFailed – Raised when authentication fails.
SmarterTokenAuthenticationError – Raised for errors specific to SmarterTokenAuthentication.
- initial(request, *args, **kwargs)[source]
Find the LLMClient, after DRF has authenticated the request and before the handler runs.
- serializer_class
alias of
LLMClientSerializer
- class smarter.apps.llmclient.api.v1.views.views.ListViewBase(*args, **kwargs)[source]
Bases:
ContractListMixin,SmarterAdminListAPIViewBase class for all llmclient list views.
A subclass sets
contract_model, the model ofsmarter.apps.llmclient.contract.modelsthat each row of its response is built with.
- class smarter.apps.llmclient.api.v1.views.views.ViewBase(*args, **kwargs)[source]
Bases:
SmarterAdminAPIViewBase class for all llmclient detail views.
Their GET responses are built from the models of
smarter.apps.llmclient.contract.models, which the Smarter api’s OpenAPI document publishes.