From bdc22ea127db8ee34d7bb29ce6b6e1a7c6ef784f Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Thu, 14 Nov 2024 18:17:04 -0800 Subject: [PATCH 1/2] sdk-js: Accept command when creating run --- libs/sdk-js/src/client.ts | 3 +++ libs/sdk-js/src/types.ts | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/libs/sdk-js/src/client.ts b/libs/sdk-js/src/client.ts index e8ce15f44..e154c87cf 100644 --- a/libs/sdk-js/src/client.ts +++ b/libs/sdk-js/src/client.ts @@ -693,6 +693,7 @@ export class RunsClient extends BaseClient { }> { const json: Record = { input: payload?.input, + command: payload?.command, config: payload?.config, metadata: payload?.metadata, stream_mode: payload?.streamMode, @@ -780,6 +781,7 @@ export class RunsClient extends BaseClient { ): Promise { const json: Record = { input: payload?.input, + command: payload?.command, config: payload?.config, metadata: payload?.metadata, assistant_id: assistantId, @@ -849,6 +851,7 @@ export class RunsClient extends BaseClient { ): Promise { const json: Record = { input: payload?.input, + command: payload?.command, config: payload?.config, metadata: payload?.metadata, assistant_id: assistantId, diff --git a/libs/sdk-js/src/types.ts b/libs/sdk-js/src/types.ts index 971d5d836..24f44d1f7 100644 --- a/libs/sdk-js/src/types.ts +++ b/libs/sdk-js/src/types.ts @@ -23,6 +23,19 @@ export type StreamEvent = | "messages/complete" | (string & {}); +export interface Send { + node: string; + input: Record | null; +} + +export interface Command { + update?: Record; + + resume?: unknown; + + send?: Send | Send[]; +} + interface RunsInvokePayload { /** * Input to the run. Pass `null` to resume from the current state of the thread. @@ -107,6 +120,11 @@ interface RunsInvokePayload { * Behavior if the specified run doesn't exist. Defaults to "reject". */ ifNotExists?: "create" | "reject"; + + /** + * One or more commands to invoke the graph with. + */ + command?: Command; } export interface RunsStreamPayload extends RunsInvokePayload { From 84ef939bf4c0091f769f8b6b00e5688a9d494459 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Thu, 14 Nov 2024 18:17:22 -0800 Subject: [PATCH 2/2] sdk-js 0.0.24 --- libs/sdk-js/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/sdk-js/package.json b/libs/sdk-js/package.json index 2786ebf8b..49cdce4df 100644 --- a/libs/sdk-js/package.json +++ b/libs/sdk-js/package.json @@ -1,6 +1,6 @@ { "name": "@langchain/langgraph-sdk", - "version": "0.0.23", + "version": "0.0.24", "description": "Client library for interacting with the LangGraph API", "type": "module", "packageManager": "yarn@1.22.19",