@langchain/langgraph-sdk 0.0.2 → 0.0.4-rc.0
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.d.mts +11 -5
- package/dist/client.mjs +14 -4
- package/dist/schema.d.ts +16 -4
- package/package.json +1 -1
package/dist/client.d.mts
CHANGED
|
@@ -22,7 +22,7 @@ declare class BaseClient {
|
|
|
22
22
|
params?: Record<string, unknown>;
|
|
23
23
|
}): Promise<T>;
|
|
24
24
|
}
|
|
25
|
-
declare class CronsClient extends BaseClient {
|
|
25
|
+
export declare class CronsClient extends BaseClient {
|
|
26
26
|
/**
|
|
27
27
|
*
|
|
28
28
|
* @param threadId The ID of the thread.
|
|
@@ -55,7 +55,7 @@ declare class CronsClient extends BaseClient {
|
|
|
55
55
|
offset?: number;
|
|
56
56
|
}): Promise<Cron[]>;
|
|
57
57
|
}
|
|
58
|
-
declare class AssistantsClient extends BaseClient {
|
|
58
|
+
export declare class AssistantsClient extends BaseClient {
|
|
59
59
|
/**
|
|
60
60
|
* Get an assistant by ID.
|
|
61
61
|
*
|
|
@@ -114,7 +114,7 @@ declare class AssistantsClient extends BaseClient {
|
|
|
114
114
|
offset?: number;
|
|
115
115
|
}): Promise<Assistant[]>;
|
|
116
116
|
}
|
|
117
|
-
declare class ThreadsClient extends BaseClient {
|
|
117
|
+
export declare class ThreadsClient extends BaseClient {
|
|
118
118
|
/**
|
|
119
119
|
* Get a thread by ID.
|
|
120
120
|
*
|
|
@@ -136,6 +136,12 @@ declare class ThreadsClient extends BaseClient {
|
|
|
136
136
|
threadId?: string;
|
|
137
137
|
ifExists?: OnConflictBehavior;
|
|
138
138
|
}): Promise<Thread>;
|
|
139
|
+
/**
|
|
140
|
+
* Copy an existing thread
|
|
141
|
+
* @param threadId ID of the thread to be copied
|
|
142
|
+
* @returns Newly copied thread
|
|
143
|
+
*/
|
|
144
|
+
copy(threadId: string): Promise<Thread>;
|
|
139
145
|
/**
|
|
140
146
|
* Update a thread.
|
|
141
147
|
*
|
|
@@ -193,7 +199,7 @@ declare class ThreadsClient extends BaseClient {
|
|
|
193
199
|
values: ValuesType;
|
|
194
200
|
checkpointId?: string;
|
|
195
201
|
asNode?: string;
|
|
196
|
-
}): Promise<
|
|
202
|
+
}): Promise<Pick<Config, "configurable">>;
|
|
197
203
|
/**
|
|
198
204
|
* Patch the metadata of a thread.
|
|
199
205
|
*
|
|
@@ -214,7 +220,7 @@ declare class ThreadsClient extends BaseClient {
|
|
|
214
220
|
metadata?: Metadata;
|
|
215
221
|
}): Promise<ThreadState<ValuesType>[]>;
|
|
216
222
|
}
|
|
217
|
-
declare class RunsClient extends BaseClient {
|
|
223
|
+
export declare class RunsClient extends BaseClient {
|
|
218
224
|
stream(threadId: null, assistantId: string, payload?: Omit<RunsStreamPayload, "multitaskStrategy">): AsyncGenerator<{
|
|
219
225
|
event: StreamEvent;
|
|
220
226
|
data: any;
|
package/dist/client.mjs
CHANGED
|
@@ -71,7 +71,7 @@ class BaseClient {
|
|
|
71
71
|
return response.json();
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
class CronsClient extends BaseClient {
|
|
74
|
+
export class CronsClient extends BaseClient {
|
|
75
75
|
/**
|
|
76
76
|
*
|
|
77
77
|
* @param threadId The ID of the thread.
|
|
@@ -143,7 +143,7 @@ class CronsClient extends BaseClient {
|
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
class AssistantsClient extends BaseClient {
|
|
146
|
+
export class AssistantsClient extends BaseClient {
|
|
147
147
|
/**
|
|
148
148
|
* Get an assistant by ID.
|
|
149
149
|
*
|
|
@@ -227,7 +227,7 @@ class AssistantsClient extends BaseClient {
|
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
class ThreadsClient extends BaseClient {
|
|
230
|
+
export class ThreadsClient extends BaseClient {
|
|
231
231
|
/**
|
|
232
232
|
* Get a thread by ID.
|
|
233
233
|
*
|
|
@@ -253,6 +253,16 @@ class ThreadsClient extends BaseClient {
|
|
|
253
253
|
},
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
+
/**
|
|
257
|
+
* Copy an existing thread
|
|
258
|
+
* @param threadId ID of the thread to be copied
|
|
259
|
+
* @returns Newly copied thread
|
|
260
|
+
*/
|
|
261
|
+
async copy(threadId) {
|
|
262
|
+
return this.fetch(`/threads/${threadId}/copy`, {
|
|
263
|
+
method: "POST",
|
|
264
|
+
});
|
|
265
|
+
}
|
|
256
266
|
/**
|
|
257
267
|
* Update a thread.
|
|
258
268
|
*
|
|
@@ -359,7 +369,7 @@ class ThreadsClient extends BaseClient {
|
|
|
359
369
|
});
|
|
360
370
|
}
|
|
361
371
|
}
|
|
362
|
-
class RunsClient extends BaseClient {
|
|
372
|
+
export class RunsClient extends BaseClient {
|
|
363
373
|
/**
|
|
364
374
|
* Create a run and stream the results.
|
|
365
375
|
*
|
package/dist/schema.d.ts
CHANGED
|
@@ -32,13 +32,25 @@ export interface GraphSchema {
|
|
|
32
32
|
*/
|
|
33
33
|
graph_id: string;
|
|
34
34
|
/**
|
|
35
|
-
* The schema for the
|
|
35
|
+
* The schema for the input state.
|
|
36
|
+
* Missing if unable to generate JSON schema from graph.
|
|
36
37
|
*/
|
|
37
|
-
|
|
38
|
+
input_schema?: JSONSchema7;
|
|
38
39
|
/**
|
|
39
|
-
* The schema for the
|
|
40
|
+
* The schema for the output state.
|
|
41
|
+
* Missing if unable to generate JSON schema from graph.
|
|
40
42
|
*/
|
|
41
|
-
|
|
43
|
+
output_schema?: JSONSchema7;
|
|
44
|
+
/**
|
|
45
|
+
* The schema for the graph state.
|
|
46
|
+
* Missing if unable to generate JSON schema from graph.
|
|
47
|
+
*/
|
|
48
|
+
state_schema?: JSONSchema7;
|
|
49
|
+
/**
|
|
50
|
+
* The schema for the graph config.
|
|
51
|
+
* Missing if unable to generate JSON schema from graph.
|
|
52
|
+
*/
|
|
53
|
+
config_schema?: JSONSchema7;
|
|
42
54
|
}
|
|
43
55
|
export type Metadata = Optional<Record<string, unknown>>;
|
|
44
56
|
export interface Assistant {
|