Example Prompt Configuration =============================== This is an example configuration object generated by :py:class:`smarter.apps.prompt.views.PromptConfigView`. 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 PromptConfigView 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/llm-clients/9/chat/config/?session_key=e5c0368d6d7201b60f4f20c470f4b5ba36faf45e80ddbe8b04b6cf20f33167a7 # Deployed Smarter LLMClient - Alpha curl -X GET https://stackademy.3141-5926-5359.alpha.api.example.com/config/ # Deployed Smarter LLMClient - 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.views.SmarterPromptSession` 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/developer-reference/lib/django/waffle>` ``enable_reactapp_debug_mode`` is enabled (see :py:class:`smarter.lib.django.waffle.SmarterWaffleSwitches`). - **llm_client** : Exactly one :doc:`llm_client <../smarter-llm_client>` is associated with a chat session. This serialization is generated by :py:class:`smarter.apps.llm_client.serializers.LLMClientConfigSerializer`. - **history**: a compound object containing serializations generated by the following - :py:class:`smarter.apps.prompt.models.PromptSerializer` - :py:class:`smarter.apps.prompt.models.PromptHelper` - **meta_data**: generated by :py:class:`smarter.apps.llm_client.models.LLMClientHelper`. - **plugins**: a compound object containing the following keys: - :py:class:`smarter.apps.llm_client.serializers.LLMClientPluginSerializer`. - :py:class:`smarter.apps.llm_client.models.LLMClientPlugin`. .. seealso:: - :doc:`Example Prompt Request <./example-request>` - :doc:`Django Hosts <../../../smarter-framework/developer-reference/lib/django/hosts>` - :doc:`Smarter Chat <../../../smarter-framework/developer-reference/react-integration/smarter-chat>` - class reference :py:class:`smarter.apps.prompt.views.views.PromptConfigView` Example JSON Object -------------------- .. literalinclude:: ../../../../../smarter/smarter/smarter/apps/prompt/data/chat_config.json :language: json :caption: Example Chat Configuration JSON Object