API ReferenceRuntime Hooks
ThreadListRuntime
Access via useAssistantRuntime
You can access the thread list runtime via the assistant runtime:
ThreadListRuntime
getState:
() => ThreadListState
subscribe:
(callback: () => void) => Unsubscribe
main:
ThreadRuntime
getById:
(threadId: string) => ThreadRuntime
mainItem:
ThreadListItemRuntime
getItemById:
(threadId: string) => ThreadListItemRuntime
getItemByIndex:
(idx: number) => ThreadListItemRuntime
getArchivedItemByIndex:
(idx: number) => ThreadListItemRuntime
switchToThread:
(threadId: string) => Promise<void>
switchToNewThread:
() => Promise<void>
useThreadList
This hook provides access to the thread list state:
ThreadListState
mainThreadId:
string
newThread:
string | undefined
threads:
readonly string[]
archivedThreads:
readonly string[]