API V1 Default Views

Smarter Customer API view.

class smarter.apps.chatbot.api.v1.views.default.DefaultChatbotApiView(*args, **kwargs)[source]

Bases: ChatBotApiBaseViewSet

Main view for Smarter ChatBot API chat prompts. top-level viewset for customer-deployed Plugin-based Chat APIs.

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

Smarter API ChatBot dispatch method.

Parameters:
  • request – Django HttpRequest object

  • args – Additional positional arguments

  • name – Chatbot name (str, optional)

  • kwargs – Additional keyword arguments

Example request payload:

{
    "session_key": "dde3dde5e3b97134f5bce5edf26ec05134da71d8485a86dfc9231149aaf0b0af",
    "messages": [
        {
            "role": "assistant",
            "content": "Welcome to Smarter!.  how can I assist you today?"
        },
        {
            "role": "user",
            "content": "Hello, World!"
        }
    ]
}
smarter.apps.chatbot.api.v1.views.default.should_log(level)[source]

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