Django View
PromptListView is a Django class-based view that serves the list of ChatBots for the Smarter workbench web console. It is responsible for fetching the ChatBots associated with the authenticated user, as well as any shared ChatBots, 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(*args, **kwargs)[source]
Bases:
SmarterAuthenticatedWebViewlist view for smarter workbench web console. This sets up the React component that will render the list of ChatBots. 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/chatbots/”
- 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'