diff --git a/libs/sdk-js/src/client.mts b/libs/sdk-js/src/client.mts index 96654f0f4..03024299d 100644 --- a/libs/sdk-js/src/client.mts +++ b/libs/sdk-js/src/client.mts @@ -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; diff --git a/libs/sdk-js/src/types.mts b/libs/sdk-js/src/types.mts index e7d1bdc09..872cc5723 100644 --- a/libs/sdk-js/src/types.mts +++ b/libs/sdk-js/src/types.mts @@ -30,6 +30,11 @@ interface RunsInvokePayload { */ config?: Config; + /** + * Checkpoint ID for when creating a new run. + */ + checkpointId?: string; + /** * Interrupt execution before entering these nodes. */ diff --git a/libs/sdk-py/langgraph_sdk/client.py b/libs/sdk-py/langgraph_sdk/client.py index 8578680d7..84b6e1876 100644 --- a/libs/sdk-py/langgraph_sdk/client.py +++ b/libs/sdk-py/langgraph_sdk/client.py @@ -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",