Django View
PromptListView is a Django class-based view that serves the list of LLMClients.
for the Smarter workbench web console. It is responsible for fetching the LLMClients associated with the authenticated user, as well as any shared LLMClients, and rendering them in a template. The view is protected and requires the user to be authenticated. It also includes caching to keep the workbench snappy while avoiding appearing stale.
- class smarter.apps.prompt.views.listview.view.PromptListView(**kwargs)[source]
Bases:
SmarterAuthenticatedWebViewList view for smarter workbench web console.
This sets up the React component that will render the list of LLMClients. The React component uses the views located in ./api for its data.
id=”smarter-prompt-list-root” django-csrf-cookie-name=”csrftoken” django-session-cookie-name=”sessionid” smarter-prompt-list-api-url=”/prompt/api/llm-clients/”
- 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 (
HttpRequest) – The HTTP request object.- Returns:
An HttpResponse with the cleaned HTML content.
- Return type:
- template_path: str = 'react/prompt-list.html'