Urls
Django URL patterns for the prompt app.
These are the endpoints for for the Workbench React app and prompt configuration.
- how we got here:
/
/workbench/<str:name>/config/
- class smarter.apps.prompt.urls.PromptReverseNames[source]
Bases:
objectReverse views for the Prompt app.
Provides named references for reversing Prompt-related API endpoints.
This class is used for reverse URL resolution in Django, where each attribute corresponds to a Prompt command endpoint. The names are derived from the actual API view class names, ensuring consistency and reducing the risk of typos when using Django’s URL reversing features.
All Prompt endpoints in the Smarter platform are included as attributes of this class. This centralizes the reverse URL names for all Prompt endpoints, making it easier to maintain and reference them throughout the codebase.
Usage
Use these attributes with Django’s
reverse()function or in templates to generate URLs for Prompt API endpoints based on the view class names.Example
from smarter.lib.django.shortcuts import reverse url = reverse(PromptReverseNames.describe, kwargs={'hashed_id': 'rMTAwMDAzOQx'}) # returns manifest of the llm_client with the given hashed_id retval = PromptReverseNames.describe print(retval)
- chat_by_hashed_id = 'prompt_workbench_view'
- config_by_hashed_id = 'prompt_config_view'
- listview = 'prompt_list_view'
- listview_api = 'prompt_list_api_view'
- listview_api_all = 'prompt_list_api_view_all'
- listview_api_clone = 'prompt_list_api_clone_view'
- listview_api_delete = 'prompt_list_api_delete_view'
- listview_api_rename = 'prompt_list_api_rename_view'
- manifest_by_hashed_id = 'llm_client_detail_view'
- namespace = 'prompt'
- sandbox_by_hashed_id = 'prompt_sandbox_view'