feat(sdk): add bulk_update_state in SDK

This commit is contained in:
Tat Dat Duong
2025-03-19 20:05:08 +01:00
parent d4c569cb7c
commit 1e767c0653
4 changed files with 113 additions and 31 deletions
+5 -1
View File
@@ -641,6 +641,10 @@ export class ThreadsClient<
/**
* Create a new thread from a batch states.
*
* @param supersteps An array of supersteps.
* @param options Additional options.
* @returns The created thread.
*/
async bulkUpdateState(
supersteps: Array<{
@@ -653,7 +657,7 @@ export class ThreadsClient<
ifExists?: OnConflictBehavior;
},
): Promise<Thread<TStateType>> {
return this.fetch<Thread<TStateType>>("/threads/state/batch", {
return this.fetch<Thread<TStateType>>("/threads/state/bulk", {
method: "POST",
json: {
supersteps: supersteps.map((s) => ({