@langchain/langgraph-sdk 0.0.72 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.cjs +7 -0
- package/dist/client.d.ts +5 -3
- package/dist/client.js +7 -0
- package/dist/schema.d.ts +3 -0
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -152,6 +152,7 @@ class CronsClient extends BaseClient {
|
|
|
152
152
|
webhook: payload?.webhook,
|
|
153
153
|
multitask_strategy: payload?.multitaskStrategy,
|
|
154
154
|
if_not_exists: payload?.ifNotExists,
|
|
155
|
+
checkpoint_during: payload?.checkpointDuring,
|
|
155
156
|
};
|
|
156
157
|
return this.fetch(`/threads/${threadId}/runs/crons`, {
|
|
157
158
|
method: "POST",
|
|
@@ -176,6 +177,7 @@ class CronsClient extends BaseClient {
|
|
|
176
177
|
webhook: payload?.webhook,
|
|
177
178
|
multitask_strategy: payload?.multitaskStrategy,
|
|
178
179
|
if_not_exists: payload?.ifNotExists,
|
|
180
|
+
checkpoint_during: payload?.checkpointDuring,
|
|
179
181
|
};
|
|
180
182
|
return this.fetch(`/runs/crons`, {
|
|
181
183
|
method: "POST",
|
|
@@ -313,6 +315,8 @@ class AssistantsClient extends BaseClient {
|
|
|
313
315
|
metadata: query?.metadata ?? undefined,
|
|
314
316
|
limit: query?.limit ?? 10,
|
|
315
317
|
offset: query?.offset ?? 0,
|
|
318
|
+
sort_by: query?.sortBy ?? undefined,
|
|
319
|
+
sort_order: query?.sortOrder ?? undefined,
|
|
316
320
|
},
|
|
317
321
|
});
|
|
318
322
|
}
|
|
@@ -543,6 +547,7 @@ class RunsClient extends BaseClient {
|
|
|
543
547
|
on_disconnect: payload?.onDisconnect,
|
|
544
548
|
after_seconds: payload?.afterSeconds,
|
|
545
549
|
if_not_exists: payload?.ifNotExists,
|
|
550
|
+
checkpoint_during: payload?.checkpointDuring,
|
|
546
551
|
};
|
|
547
552
|
const endpoint = threadId == null ? `/runs/stream` : `/threads/${threadId}/runs/stream`;
|
|
548
553
|
const response = await this.asyncCaller.fetch(...this.prepareFetchOptions(endpoint, {
|
|
@@ -581,6 +586,7 @@ class RunsClient extends BaseClient {
|
|
|
581
586
|
multitask_strategy: payload?.multitaskStrategy,
|
|
582
587
|
after_seconds: payload?.afterSeconds,
|
|
583
588
|
if_not_exists: payload?.ifNotExists,
|
|
589
|
+
checkpoint_during: payload?.checkpointDuring,
|
|
584
590
|
};
|
|
585
591
|
return this.fetch(`/threads/${threadId}/runs`, {
|
|
586
592
|
method: "POST",
|
|
@@ -630,6 +636,7 @@ class RunsClient extends BaseClient {
|
|
|
630
636
|
on_disconnect: payload?.onDisconnect,
|
|
631
637
|
after_seconds: payload?.afterSeconds,
|
|
632
638
|
if_not_exists: payload?.ifNotExists,
|
|
639
|
+
checkpoint_during: payload?.checkpointDuring,
|
|
633
640
|
};
|
|
634
641
|
const endpoint = threadId == null ? `/runs/wait` : `/threads/${threadId}/runs/wait`;
|
|
635
642
|
const response = await this.fetch(endpoint, {
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Assistant, AssistantGraph, AssistantVersion, CancelAction, Checkpoint, Config, Cron, CronCreateForThreadResponse, CronCreateResponse, DefaultValues, GraphSchema, Item, ListNamespaceResponse, Metadata, Run, RunStatus, SearchItemsResponse, Subgraphs, Thread, ThreadState, ThreadStatus } from "./schema.js";
|
|
1
|
+
import { Assistant, AssistantGraph, AssistantSortBy, AssistantVersion, CancelAction, Checkpoint, Config, Cron, CronCreateForThreadResponse, CronCreateResponse, DefaultValues, GraphSchema, Item, ListNamespaceResponse, Metadata, Run, RunStatus, SearchItemsResponse, SortOrder, Subgraphs, Thread, ThreadSortBy, ThreadState, ThreadStatus } from "./schema.js";
|
|
2
2
|
import type { Command, CronsCreatePayload, OnConflictBehavior, RunsCreatePayload, RunsStreamPayload, RunsWaitPayload, StreamEvent } from "./types.js";
|
|
3
3
|
import type { StreamMode, TypedAsyncGenerator } from "./types.stream.js";
|
|
4
4
|
import { AsyncCaller, AsyncCallerParams } from "./utils/async_caller.js";
|
|
@@ -149,6 +149,8 @@ export declare class AssistantsClient extends BaseClient {
|
|
|
149
149
|
metadata?: Metadata;
|
|
150
150
|
limit?: number;
|
|
151
151
|
offset?: number;
|
|
152
|
+
sortBy?: AssistantSortBy;
|
|
153
|
+
sortOrder?: SortOrder;
|
|
152
154
|
}): Promise<Assistant[]>;
|
|
153
155
|
/**
|
|
154
156
|
* List all versions of an assistant.
|
|
@@ -271,12 +273,12 @@ export declare class ThreadsClient<TStateType = DefaultValues, TUpdateType = TSt
|
|
|
271
273
|
/**
|
|
272
274
|
* Sort by.
|
|
273
275
|
*/
|
|
274
|
-
sortBy?:
|
|
276
|
+
sortBy?: ThreadSortBy;
|
|
275
277
|
/**
|
|
276
278
|
* Sort order.
|
|
277
279
|
* Must be one of 'asc' or 'desc'.
|
|
278
280
|
*/
|
|
279
|
-
sortOrder?:
|
|
281
|
+
sortOrder?: SortOrder;
|
|
280
282
|
}): Promise<Thread<ValuesType>[]>;
|
|
281
283
|
/**
|
|
282
284
|
* Get state for a thread.
|
package/dist/client.js
CHANGED
|
@@ -148,6 +148,7 @@ export class CronsClient extends BaseClient {
|
|
|
148
148
|
webhook: payload?.webhook,
|
|
149
149
|
multitask_strategy: payload?.multitaskStrategy,
|
|
150
150
|
if_not_exists: payload?.ifNotExists,
|
|
151
|
+
checkpoint_during: payload?.checkpointDuring,
|
|
151
152
|
};
|
|
152
153
|
return this.fetch(`/threads/${threadId}/runs/crons`, {
|
|
153
154
|
method: "POST",
|
|
@@ -172,6 +173,7 @@ export class CronsClient extends BaseClient {
|
|
|
172
173
|
webhook: payload?.webhook,
|
|
173
174
|
multitask_strategy: payload?.multitaskStrategy,
|
|
174
175
|
if_not_exists: payload?.ifNotExists,
|
|
176
|
+
checkpoint_during: payload?.checkpointDuring,
|
|
175
177
|
};
|
|
176
178
|
return this.fetch(`/runs/crons`, {
|
|
177
179
|
method: "POST",
|
|
@@ -308,6 +310,8 @@ export class AssistantsClient extends BaseClient {
|
|
|
308
310
|
metadata: query?.metadata ?? undefined,
|
|
309
311
|
limit: query?.limit ?? 10,
|
|
310
312
|
offset: query?.offset ?? 0,
|
|
313
|
+
sort_by: query?.sortBy ?? undefined,
|
|
314
|
+
sort_order: query?.sortOrder ?? undefined,
|
|
311
315
|
},
|
|
312
316
|
});
|
|
313
317
|
}
|
|
@@ -536,6 +540,7 @@ export class RunsClient extends BaseClient {
|
|
|
536
540
|
on_disconnect: payload?.onDisconnect,
|
|
537
541
|
after_seconds: payload?.afterSeconds,
|
|
538
542
|
if_not_exists: payload?.ifNotExists,
|
|
543
|
+
checkpoint_during: payload?.checkpointDuring,
|
|
539
544
|
};
|
|
540
545
|
const endpoint = threadId == null ? `/runs/stream` : `/threads/${threadId}/runs/stream`;
|
|
541
546
|
const response = await this.asyncCaller.fetch(...this.prepareFetchOptions(endpoint, {
|
|
@@ -574,6 +579,7 @@ export class RunsClient extends BaseClient {
|
|
|
574
579
|
multitask_strategy: payload?.multitaskStrategy,
|
|
575
580
|
after_seconds: payload?.afterSeconds,
|
|
576
581
|
if_not_exists: payload?.ifNotExists,
|
|
582
|
+
checkpoint_during: payload?.checkpointDuring,
|
|
577
583
|
};
|
|
578
584
|
return this.fetch(`/threads/${threadId}/runs`, {
|
|
579
585
|
method: "POST",
|
|
@@ -623,6 +629,7 @@ export class RunsClient extends BaseClient {
|
|
|
623
629
|
on_disconnect: payload?.onDisconnect,
|
|
624
630
|
after_seconds: payload?.afterSeconds,
|
|
625
631
|
if_not_exists: payload?.ifNotExists,
|
|
632
|
+
checkpoint_during: payload?.checkpointDuring,
|
|
626
633
|
};
|
|
627
634
|
const endpoint = threadId == null ? `/runs/wait` : `/threads/${threadId}/runs/wait`;
|
|
628
635
|
const response = await this.fetch(endpoint, {
|
package/dist/schema.d.ts
CHANGED
|
@@ -225,4 +225,7 @@ export interface CronCreateResponse {
|
|
|
225
225
|
export interface CronCreateForThreadResponse extends Omit<CronCreateResponse, "thread_id"> {
|
|
226
226
|
thread_id: string;
|
|
227
227
|
}
|
|
228
|
+
export type AssistantSortBy = "assistant_id" | "graph_id" | "name" | "created_at" | "updated_at";
|
|
229
|
+
export type ThreadSortBy = "thread_id" | "status" | "created_at" | "updated_at";
|
|
230
|
+
export type SortOrder = "asc" | "desc";
|
|
228
231
|
export {};
|
package/dist/types.d.ts
CHANGED
|
@@ -46,6 +46,10 @@ interface RunsInvokePayload {
|
|
|
46
46
|
* Checkpoint for when creating a new run.
|
|
47
47
|
*/
|
|
48
48
|
checkpoint?: Omit<Checkpoint, "thread_id">;
|
|
49
|
+
/**
|
|
50
|
+
* Whether to checkpoint during the run (or only at the end/interruption).
|
|
51
|
+
*/
|
|
52
|
+
checkpointDuring?: boolean;
|
|
49
53
|
/**
|
|
50
54
|
* Interrupt execution before entering these nodes.
|
|
51
55
|
*/
|