mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-05 09:17:47 +02:00
Merge pull request #1484 from langchain-ai/vb/add-checkpoint-id-js-sdk
sdk-js: add checkpoint_id arg to runs create/stream/wait payload
This commit is contained in:
@@ -559,6 +559,7 @@ export class RunsClient extends BaseClient {
|
||||
assistant_id: assistantId,
|
||||
interrupt_before: payload?.interruptBefore,
|
||||
interrupt_after: payload?.interruptAfter,
|
||||
checkpoint_id: payload?.checkpointId,
|
||||
};
|
||||
if (payload?.multitaskStrategy != null) {
|
||||
json["multitask_strategy"] = payload?.multitaskStrategy;
|
||||
@@ -638,6 +639,7 @@ export class RunsClient extends BaseClient {
|
||||
interrupt_before: payload?.interruptBefore,
|
||||
interrupt_after: payload?.interruptAfter,
|
||||
webhook: payload?.webhook,
|
||||
checkpoint_id: payload?.checkpointId,
|
||||
};
|
||||
if (payload?.multitaskStrategy != null) {
|
||||
json["multitask_strategy"] = payload?.multitaskStrategy;
|
||||
@@ -681,6 +683,7 @@ export class RunsClient extends BaseClient {
|
||||
assistant_id: assistantId,
|
||||
interrupt_before: payload?.interruptBefore,
|
||||
interrupt_after: payload?.interruptAfter,
|
||||
checkpoint_id: payload?.checkpointId,
|
||||
};
|
||||
if (payload?.multitaskStrategy != null) {
|
||||
json["multitask_strategy"] = payload?.multitaskStrategy;
|
||||
|
||||
@@ -30,6 +30,11 @@ interface RunsInvokePayload {
|
||||
*/
|
||||
config?: Config;
|
||||
|
||||
/**
|
||||
* Checkpoint ID for when creating a new run.
|
||||
*/
|
||||
checkpointId?: string;
|
||||
|
||||
/**
|
||||
* Interrupt execution before entering these nodes.
|
||||
*/
|
||||
|
||||
@@ -853,15 +853,14 @@ class ThreadsClient:
|
||||
thread_id: The ID of the thread to update.
|
||||
values: The values to update to the state.
|
||||
as_node: Update the state as if this node had just executed.
|
||||
|
||||
checkpoint_id: The ID of the checkpoint to get the state of.
|
||||
checkpoint_id: The ID of the checkpoint to update the state of.
|
||||
|
||||
Returns:
|
||||
None
|
||||
|
||||
Example Usage:
|
||||
|
||||
await client.threads.get_state(
|
||||
await client.threads.update_state(
|
||||
thread_id="my_thread_id",
|
||||
values={"messages":[{"role": "user", "content": "hello!"}]},
|
||||
as_node="my_node",
|
||||
|
||||
Reference in New Issue
Block a user