Views

LLMClient api/v1/llm_clients CRUD views.

class smarter.apps.llm_client.api.v1.views.views.LLMClientAPIKeyListView(*args, **kwargs)[source]

Bases: ListViewBase

LLMClientAPIKey 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 LLMClientAPIKeySerializer

class smarter.apps.llm_client.api.v1.views.views.LLMClientAPIKeyView(*args, **kwargs)[source]

Bases: ViewBase

LLMClientAPIKey view for smarter api.

delete(request, llm_client_id, api_key_id)[source]
get(request, llm_client_id, api_key_id)[source]
post(request, llm_client_id, api_key_id=None)[source]
serializer_class

alias of LLMClientAPIKeySerializer

class smarter.apps.llm_client.api.v1.views.views.LLMClientCustomDomainListView(*args, **kwargs)[source]

Bases: ListViewBase

LLMClientCustomDomain 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 LLMClientCustomDomainSerializer

class smarter.apps.llm_client.api.v1.views.views.LLMClientCustomDomainView(*args, **kwargs)[source]

Bases: ViewBase

LLMClientCustomDomain view for smarter api.

delete(request, llm_client_id, custom_domain_id)[source]
get(request, llm_client_id, custom_domain_id)[source]
post(request, llm_client_id, custom_domain_id=None)[source]
serializer_class

alias of LLMClientCustomDomainSerializer

class smarter.apps.llm_client.api.v1.views.views.LLMClientDeployView(*args, **kwargs)[source]

Bases: ViewBase

LLMClient deployment view for smarter api.

post(request, llm_client_id)[source]
serializer_class

alias of LLMClientSerializer

class smarter.apps.llm_client.api.v1.views.views.LLMClientFunctionsListView(*args, **kwargs)[source]

Bases: ListViewBase

LLMClientFunctions 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 LLMClientFunctionsSerializer

class smarter.apps.llm_client.api.v1.views.views.LLMClientFunctionsView(*args, **kwargs)[source]

Bases: ViewBase

LLMClientFunctions view for smarter api.

delete(request, llm_client_id, function_id)[source]
get(request, llm_client_id, function_id)[source]
patch(request, llm_client_id, function_id)[source]
post(request, llm_client_id)[source]
serializer_class

alias of LLMClientFunctionsSerializer

class smarter.apps.llm_client.api.v1.views.views.LLMClientListView(*args, **kwargs)[source]

Bases: ListViewBase

LLMClient 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)

llm_clients: QuerySet | None
serializer_class

alias of LLMClientSerializer

class smarter.apps.llm_client.api.v1.views.views.LLMClientPluginListView(*args, **kwargs)[source]

Bases: ListViewBase

LLMClientPlugin 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.llm_client.api.v1.views.views.LLMClientPluginView(*args, **kwargs)[source]

Bases: ViewBase

LLMClientPlugin view for smarter api.

delete(request, llm_client_id, plugin_id)[source]
get(request, llm_client_id, plugin_meta_id)[source]
patch(request, llm_client_id, plugin_id)[source]
post(request, llm_client_id)[source]
serializer_class

alias of LLMClientPluginSerializer

class smarter.apps.llm_client.api.v1.views.views.LLMClientView(*args, **kwargs)[source]

Bases: ViewBase

LLMClient view for smarter api.

delete(request, *args, llm_client_id=None, **kwargs)[source]
dispatch(request, *args, **kwargs)[source]

Extend DRF dispatch() to add authentication check.

Parameters:

request (Request) – The incoming HTTP request.

Raises:
  • AuthenticationFailed – Raised when authentication fails.

  • SmarterTokenAuthenticationError – Raised for errors specific to SmarterTokenAuthentication.

get(request, llm_client_id=None)[source]
get_queryset(*args, **kwargs)[source]
hashed_id: str | None = None
llm_client: LLMClient | None = None
llm_client_id: int | None = None
patch(request, *args, llm_client_id=None, **kwargs)[source]
post(request, *args, **kwargs)[source]
serializer_class

alias of LLMClientSerializer

class smarter.apps.llm_client.api.v1.views.views.ListViewBase(*args, **kwargs)[source]

Bases: SmarterAdminListAPIView

Base class for all llm_client list views.

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.

class smarter.apps.llm_client.api.v1.views.views.ViewBase(*args, **kwargs)[source]

Bases: SmarterAdminAPIView

Base class for all llm_client detail views.

dispatch(request, *args, **kwargs)[source]

Extend DRF dispatch() to add authentication check.

Parameters:

request (Request) – The incoming HTTP request.

Raises:
  • AuthenticationFailed – Raised when authentication fails.

  • SmarterTokenAuthenticationError – Raised for errors specific to SmarterTokenAuthentication.