You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expose setThreadId as a UseAssistantHelper so that a new conversation thread can be started by executing setThreadId(undefined).
Use Case
Use case: an assistant providing feedback on a specific tuple of "question" and "student_answer". The UI provides user the ability to select the specific course, exam and question they want to get the assistant's feedback on. When selection is complete the UI should initiate a new chat with an initial prompt dynamically generated from the user's selections. Each new request for feedback should be a new chat where the bot has no memory of any previous conversations.
Without the ability to set the threadId to undefined the same chat thread will be used for the entire lifetime of the React component containing the useAssistant hook and even if messages are cleared the assistant still has memory of the previous conversation. A full page refresh is not ideal as memory of current UI state will be lost without some workarounds.
Additional context
As an alternative to exposing setThreadId add a more explicit helper. e.g.
/**
* Resets the chat thread.
* Stops any existing chat threads, clears the chat `Messages` and `Input`.
* Resets `threadId` so that new messages will run on a new thread.
*/
resetThread: () => {
stop()
setMessages([])
setInput('')
setThreadId(undefined)
}
The text was updated successfully, but these errors were encountered:
Feature Description
Expose
setThreadId
as aUseAssistantHelper
so that a new conversation thread can be started by executingsetThreadId(undefined)
.Use Case
Use case: an assistant providing feedback on a specific tuple of "question" and "student_answer". The UI provides user the ability to select the specific course, exam and question they want to get the assistant's feedback on. When selection is complete the UI should initiate a new chat with an initial prompt dynamically generated from the user's selections. Each new request for feedback should be a new chat where the bot has no memory of any previous conversations.
Without the ability to set the threadId to undefined the same chat thread will be used for the entire lifetime of the React component containing the
useAssistant
hook and even if messages are cleared the assistant still has memory of the previous conversation. A full page refresh is not ideal as memory of current UI state will be lost without some workarounds.Additional context
As an alternative to exposing
setThreadId
add a more explicit helper. e.g.The text was updated successfully, but these errors were encountered: