Skip to content

Commit

Permalink
Merge pull request #2066 from langchain-ai/dqbd/checkpoint-sdk-js
Browse files Browse the repository at this point in the history
fix(sdk-js): pass checkpoint when creating run
  • Loading branch information
dqbd authored Oct 9, 2024
2 parents f9df0f4 + 9360545 commit fc276c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions libs/sdk-js/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ export class RunsClient extends BaseClient {
assistant_id: assistantId,
interrupt_before: payload?.interruptBefore,
interrupt_after: payload?.interruptAfter,
checkpoint: payload?.checkpoint,
checkpoint_id: payload?.checkpointId,
webhook: payload?.webhook,
multitask_strategy: payload?.multitaskStrategy,
Expand Down Expand Up @@ -756,6 +757,7 @@ export class RunsClient extends BaseClient {
interrupt_before: payload?.interruptBefore,
interrupt_after: payload?.interruptAfter,
webhook: payload?.webhook,
checkpoint: payload?.checkpoint,
checkpoint_id: payload?.checkpointId,
multitask_strategy: payload?.multitaskStrategy,
after_seconds: payload?.afterSeconds,
Expand Down Expand Up @@ -822,6 +824,7 @@ export class RunsClient extends BaseClient {
assistant_id: assistantId,
interrupt_before: payload?.interruptBefore,
interrupt_after: payload?.interruptAfter,
checkpoint: payload?.checkpoint,
checkpoint_id: payload?.checkpointId,
webhook: payload?.webhook,
multitask_strategy: payload?.multitaskStrategy,
Expand Down
7 changes: 6 additions & 1 deletion libs/sdk-js/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Config, Metadata } from "./schema.js";
import { Checkpoint, Config, Metadata } from "./schema.js";

export type StreamMode = "values" | "messages" | "updates" | "events" | "debug";
export type MultitaskStrategy = "reject" | "interrupt" | "rollback" | "enqueue";
Expand Down Expand Up @@ -37,6 +37,11 @@ interface RunsInvokePayload {
*/
checkpointId?: string;

/**
* Checkpoint for when creating a new run.
*/
checkpoint?: Omit<Checkpoint, "thread_id">;

/**
* Interrupt execution before entering these nodes.
*/
Expand Down

0 comments on commit fc276c5

Please sign in to comment.