Prompt Landing View

PromptSandboxView is a Django class-based view that serves as the base URL.

class smarter.apps.prompt.views.detailviews.prompt_sandbox_view.PromptSandboxView(**kwargs)[source]

Bases: SmarterAuthenticatedNeverCachedWebView

Base url for LLMClient.sandbox_url.

This a a noop view that is used for generating the base URL for the workbench prompt /prompt/ and /prompt/config/ endpoints, both of which are constructed inside of the React app and are not actual Django views.

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

Dispatch the request, redirecting to login if the user is anonymous.

Parameters:

request (HttpRequest) – The HTTP request object.

Returns:

An HttpResponse object.

Return type:

HttpResponse

property formatted_class_name: str

Returns a formatted string of the class name for logging purposes.

smarter.apps.prompt.views.detailviews.prompt_sandbox_view.should_log(level)[source]

Check if logging should be done based on the waffle switch.

smarter.apps.prompt.views.detailviews.prompt_sandbox_view.should_log_verbose(level)[source]

Check if logging should be done based on the waffle switch.