Example Prompt Configuration =============================== This is an example configuration object generated by :py:class:`smarter.apps.prompt.views.ChatConfigView`. This is generated on every user prompt, hence, performance is important. The Smarter Platform generates historical artifacts on a variety of events, including for example: - history of the chat invocation - which Smarter Plugins (eg an extensible LLM tool) where selected to include in the LLM request, and the selection criteria used. - which tools were actually invoked by the LLM - the responses from each tool invocation These artifacts are generated asynchronously, and ChatConfigView is optimized to return this data lazily and with extensive use of caching. Usage ---------------- .. code-block:: bash # Smarter Prompt Engineer Workbench curl -X GET http://localhost:9357/api/v1/chatbots/9/chat/config/?session_key=e5c0368d6d7201b60f4f20c470f4b5ba36faf45e80ddbe8b04b6cf20f33167a7 # Deployed Smarter Chatbot - Alpha curl -X GET https://stackademy.3141-5926-5359.alpha.api.example.com/config/ # Deployed Smarter Chatbot - Production curl -X GET https://stackademy.3141-5926-5359.api.example.com/config/ .. note:: There are multiple possible hosts and paths that lead to this endpoint, depending on your use case. Json Object Keys --------------------- - **session_key**: generated by :py:class:`smarter.apps.prompt.views.SmarterChatSession` and used as the primary identifier for :py:class:`smarter.apps.prompt.models.Chat`. - **sandbox_model**: true if the chat session is operating inside of the Smarter Prompt Engineer Workbench environment. - **debug_mode**: true if the :doc:`Smarter Waffle switch <../../smarter-framework/smarter-waffle>` ``enable_reactapp_debug_mode`` is enabled (see :py:class:`smarter.lib.django.waffle.SmarterWaffleSwitches`). - **chatbot** : Exactly one :doc:`chatbot <../smarter-chatbot>` is associated with a chat session. This serialization is generated by :py:class:`smarter.apps.chatbot.serializers.ChatBotConfigSerializer`. - **history**: a compound object containing serializations generated by the following - :py:class:`smarter.apps.prompt.models.ChatSerializer` - :py:class:`smarter.apps.prompt.models.ChatHelper` - **meta_data**: generated by :py:class:`smarter.apps.chatbot.models.ChatBotHelper`. - **plugins**: a compound object containing the following keys: - :py:class:`smarter.apps.chatbot.serializers.ChatBotPluginSerializer`. - :py:class:`smarter.apps.chatbot.models.ChatBotPlugin`. .. seealso:: - :doc:`Example Prompt Request <./example-request>` - :doc:`Django Hosts <../../smarter-framework/django/hosts>` - :doc:`Smarter React UI <../../smarter-framework/smarter-react-ui>` - class reference :py:class:`smarter.apps.prompt.views.ChatConfigView` Example JSON Object -------------------- .. literalinclude:: ../../../../smarter/smarter/apps/prompt/data/chat_config.json :language: json :caption: Example Chat Configuration JSON Object