sdk-js: Accept command when creating run

This commit is contained in:
Nuno Campos
2024-11-14 18:17:04 -08:00
parent 970e68edcc
commit bdc22ea127
2 changed files with 21 additions and 0 deletions
+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 {