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", 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 {