Optional
config: ClientConfigProtected
apiProtected
asyncProtected
defaultProtected
Optional
onProtected
timeoutID of the thread to be copied
Newly copied thread
Count threads matching filters.
Optional
query: { metadata?: Metadata; status?: ThreadStatus; values?: ValuesType }Optional
metadata?: MetadataThread metadata to filter on.
Optional
status?: ThreadStatusThread status to filter on.
Optional
values?: ValuesTypeState values to filter on.
Number of threads matching the criteria.
Create a new thread.
Optional
payload: {Payload for creating a thread.
Optional
graphId?: stringGraph ID to associate with the thread.
Optional
ifExists?: OnConflictBehaviorHow to handle duplicate creation.
Optional
metadata?: MetadataMetadata for the thread.
Optional
supersteps?: { updates: { asNode: string; command?: Command; values: unknown }[] }[]Apply a list of supersteps when creating a thread, each containing a sequence of updates.
Used for copying a thread between deployments.
Optional
threadId?: stringID of the thread to create.
If not provided, a random UUID will be generated.
Optional
ttl?: number | { strategy?: "delete"; ttl: number }Optional time-to-live in minutes for the thread. If a number is provided, it is treated as minutes and defaults to strategy "delete". You may also provide an object { ttl: number, strategy?: "delete" }.
The created thread.
Delete a thread.
ID of the thread.
Protected
fetchOptional
options: RequestInit & {Get a thread by ID.
ID of the thread.
The thread.
Get all past states for a thread.
ID of the thread.
Optional
options: {Additional options.
List of thread states.
Get state for a thread.
ID of the thread.
Optional
checkpoint: string | CheckpointOptional
options: { subgraphs?: boolean }Thread state.
Optional
options: { lastEventId?: string; streamMode?: ThreadStreamMode | ThreadStreamMode[] }Protected
prepareOptional
options: RequestInit & {List threads
Optional
query: {Query options
Optional
ids?: string[]Filter by specific thread IDs.
Optional
limit?: numberMaximum number of threads to return. Defaults to 10
Optional
metadata?: MetadataMetadata to filter threads by.
Optional
offset?: numberOffset to start from.
Optional
select?: ThreadSelectField[]Optional
sortBy?: ThreadSortBySort by.
Optional
sortOrder?: SortOrderSort order. Must be one of 'asc' or 'desc'.
Optional
status?: ThreadStatusThread status to filter on.
List of threads
Update a thread.
ID of the thread.
Optional
payload: { metadata?: Metadata; ttl?: number | { strategy?: "delete"; ttl: number } }Payload for updating the thread.
Optional
metadata?: MetadataMetadata for the thread.
Optional
ttl?: number | { strategy?: "delete"; ttl: number }Optional time-to-live in minutes for the thread. If a number is provided, it is treated as minutes and defaults to strategy "delete". You may also provide an object { ttl: number, strategy?: "delete" }.
The updated thread.
Add state to a thread.
The ID of the thread.
Copy an existing thread