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:
Nuno Campos
2024-08-26 15:36:03 -07:00
committed by GitHub
3 changed files with 10 additions and 3 deletions
+3
View File
@@ -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;
+5
View File
@@ -30,6 +30,11 @@ interface RunsInvokePayload {
*/
config?: Config;
/**
* Checkpoint ID for when creating a new run.
*/
checkpointId?: string;
/**
* Interrupt execution before entering these nodes.
*/
+2 -3
View File
@@ -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",