Merge pull request #2420 from langchain-ai/nc/14nov/js-sdk-command

Nc/14nov/js sdk command
This commit is contained in:
Nuno Campos
2024-11-14 18:21:38 -08:00
committed by GitHub
3 changed files with 22 additions and 1 deletions
+1 -1
View File
@@ -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",
+3
View File
@@ -693,6 +693,7 @@ export class RunsClient extends BaseClient {
}> {
const json: Record<string, any> = {
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<Run> {
const json: Record<string, any> = {
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<ThreadState["values"]> {
const json: Record<string, any> = {
input: payload?.input,
command: payload?.command,
config: payload?.config,
metadata: payload?.metadata,
assistant_id: assistantId,
+18
View File
@@ -23,6 +23,19 @@ export type StreamEvent =
| "messages/complete"
| (string & {});
export interface Send {
node: string;
input: Record<string, unknown> | null;
}
export interface Command {
update?: Record<string, unknown>;
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 {