Smarter Prompt =============== Overview -------- Smarter Prompt manages :py:class:`prompt sessions ` and integrations between the Smarter backend and the :doc:`ReactJS chat component <../smarter-framework/developer-reference/react-integration/smarter-chat>` used for managing sessions in the Smarter Chat in html integrations, as well as in the :doc:`command-line interface (CLI) <../smarter-framework/smarter-cli>`. Smarter Prompt is chiefly responsible for: - Storing and retrieving :py:class:`prompt sessions ` and messages in the database. - Serving the :doc:`configuration object ` to the :doc:`ReactJS chat component <../smarter-framework/developer-reference/react-integration/smarter-chat>`. - Handling REST API :doc:`prompt requests `. - Serving :doc:`prompt responses `. - Orchestrating the Smarter resources for the session ( :doc:`Account `, :doc:`LLMClient `, :doc:`Plugin `) Smarter sessions do not expire unless deleted by an administrator as part of MySQL database disk space maintenance operations. .. note:: Smarter sessions are distinct from Smarter LLMClients. A Smarter LLMClient is a resource that defines the configuration of an llm_client, including its system prompt, plugins, and other settings. A Smarter session, on the other hand, is an instance of a conversation with an llm_client, which includes the complete history of messages exchanged during that conversation. Smarter sessions originate in Smarter Prompt, are passed to the ReactJS component as part of the configuration object, and are stored as browser cookies. Smarter session identifiers are a GUID-like string that, with a high level of certainty, uniquely identify a session. Smarter sessions are distinct to the device/browser in which they are created. If you start a session on one device/browser, you cannot continue that session on another device/browser. Usage ----- .. code-block:: bash # Smarter Prompt Engineer Workbench curl -X POST http://localhost:9357/api/v1/llm-clients/9/chat/?session_key=e5c0368d6d7201b60f4f20c470f4b5ba36faf45e80ddbe8b04b6cf20f33167a7 # Deployed Smarter LLMClient - Alpha curl -X GET https://stackademy.3141-5926-5359.alpha.api.example.com/chat/?session_key= # Deployed Smarter LLMClient - Production curl -X GET https://stackademy.3141-5926-5359.api.example.com/chat/?session_key= .. seealso:: - :doc:`Smarter Chat <../smarter-framework/developer-reference/react-integration/smarter-chat>` - :doc:`Smarter CLI <../smarter-framework/smarter-cli>` - :doc:`Smarter API <../smarter-framework/smarter-api>` - :doc:`Smarter Journal <../smarter-framework/developer-reference/smarter-journal>` - :doc:`Smarter Account <../smarter-resources/smarter-account>` - :doc:`Smarter LLMClients <../smarter-resources/smarter-llm_client>` - :doc:`Smarter Plugins <../smarter-resources/smarter-plugin>` Technical Reference ------------------- .. toctree:: :maxdepth: 1 prompt/example-config prompt/example-request prompt/example-response prompt/api prompt/const prompt/manifest prompt/models prompt/functions prompt/management prompt/signals prompt/tasks prompt/templatetags prompt/urls prompt/views