useThreadManager
and useThreadListManager
hooks with your app’s persistence logic.
useThreadManager
and useThreadListManager
hooks are exported from both the @crayonai/react-core
and @thesysai/genui-sdk
packages. It is recommended to
use the @thesysai/genui-sdk
package since it provides more features and eliminates the need to write a significant amount of boilerplate code.useThreadManager
ThreadManager
, obtained via the useThreadManager
hook, controls its state and actions.
Key configurations:
ThreadListManager
object. For more information on how to get this object, see useThreadListManager."/api/chat"
). Thesys GenUI SDK does a POST request to this endpoint with the following three arguments in the request body. If you need to pass additional arguments, use the processMessage
function.
Provide either processMessage
or apiUrl
.processMessage
or apiUrl
.The useThreadManager
hook uses the Response
object from this function to handle streaming updates to the UI.
responseId
to set the final assistant’s response message ID, as it’s used for future updates to that message. useThreadListManager
ThreadListManager
, from the useThreadListManager
hook, manages this list.
Key configurations: