Optionalconfig: ClientConfigProtectedapiProtectedasyncProtecteddefaultProtected OptionalonProtectedtimeoutID of the thread to be copied
Newly copied thread
Count threads matching filters.
Optionalquery: { metadata?: Metadata; status?: ThreadStatus; values?: ValuesType }Optionalmetadata?: MetadataThread metadata to filter on.
Optionalstatus?: ThreadStatusThread status to filter on.
Optionalvalues?: ValuesTypeState values to filter on.
Number of threads matching the criteria.
Create a new thread.
Optionalpayload: {Payload for creating a thread.
OptionalgraphId?: stringGraph ID to associate with the thread.
OptionalifExists?: OnConflictBehaviorHow to handle duplicate creation.
Optionalmetadata?: MetadataMetadata for the thread.
Optionalsupersteps?: { 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.
OptionalthreadId?: stringID of the thread to create.
If not provided, a random UUID will be generated.
Optionalttl?: 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.
ProtectedfetchOptionaloptions: RequestInit & {Get a thread by ID.
ID of the thread.
The thread.
Get all past states for a thread.
ID of the thread.
Optionaloptions: {Additional options.
List of thread states.
Get state for a thread.
ID of the thread.
Optionalcheckpoint: string | CheckpointOptionaloptions: { subgraphs?: boolean }Thread state.
Optionaloptions: { lastEventId?: string; streamMode?: ThreadStreamMode | ThreadStreamMode[] }ProtectedprepareOptionaloptions: RequestInit & {List threads
Optionalquery: {Query options
Optionalids?: string[]Filter by specific thread IDs.
Optionallimit?: numberMaximum number of threads to return. Defaults to 10
Optionalmetadata?: MetadataMetadata to filter threads by.
Optionaloffset?: numberOffset to start from.
Optionalselect?: ThreadSelectField[]OptionalsortBy?: ThreadSortBySort by.
OptionalsortOrder?: SortOrderSort order. Must be one of 'asc' or 'desc'.
Optionalstatus?: ThreadStatusThread status to filter on.
List of threads
Update a thread.
ID of the thread.
Optionalpayload: { metadata?: Metadata; ttl?: number | { strategy?: "delete"; ttl: number } }Payload for updating the thread.
Optionalmetadata?: MetadataMetadata for the thread.
Optionalttl?: 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