@threadplane/langgraphInterfacev0.3.7

LangGraphRunSettings

LangGraph settings for the run a command creates, passed to the run-creation request. They are grouped under run so that a caller states them on purpose: nothing at the root of the options is ever read as one.

import type { LangGraphRunSettings } from '@threadplane/langgraph';

Declaration

export interface LangGraphRunSettings  {
  readonly afterSeconds?: number;
  readonly checkpoint?: {
        readonly checkpoint_id: string;
        readonly checkpoint_ns?: string;
        readonly checkpoint_map?: Readonly<Record<string, PlainValue>> | null;
    };
  readonly checkpointDuring?: boolean;
  readonly checkpointId?: string;
  readonly command?: {
        readonly update?: PlainValue;
        readonly goto?: PlainValue;
        readonly resume?: never;
    };
  readonly durability?: LangGraphSubmitOptions['durability'];
  readonly feedbackKeys?: readonly string[];
  readonly ifNotExists?: LangGraphSubmitOptions['ifNotExists'];
  readonly interruptAfter?: '*' | readonly string[];
  readonly interruptBefore?: '*' | readonly string[];
  readonly multitaskStrategy?: LangGraphSubmitOptions['multitaskStrategy'];
  readonly onCompletion?: LangGraphSubmitOptions['onCompletion'];
  readonly onDisconnect?: LangGraphSubmitOptions['onDisconnect'];
  readonly onRunCreated?: (run: {
        readonly run_id: string;
        readonly thread_id?: string;
    }) => void;
  readonly streamMode?: readonly StreamMode[];
  readonly streamSubgraphs?: boolean;
  readonly webhook?: string;
}

Members

afterSeconds

readonly afterSeconds?: number;

checkpoint

Start the run from a saved checkpoint instead of the thread's newest one. checkpointId is the short form for a root checkpoint. The thread gains a branch there; see the runtime README for what the session does with its transcript. fork is the guarded alternative for a completed checkpoint.

readonly checkpoint?: {
        readonly checkpoint_id: string;
        readonly checkpoint_ns?: string;
        readonly checkpoint_map?: Readonly<Record<string, PlainValue>> | null;
    };

checkpointDuring

readonly checkpointDuring?: boolean;

checkpointId

readonly checkpointId?: string;

command

A graph command sent with the run: a state update and a goto. With resume, the session adds the answer, so one command both answers a pause and updates the state. The answer itself is never given here.

readonly command?: {
        readonly update?: PlainValue;
        readonly goto?: PlainValue;
        readonly resume?: never;
    };

durability

readonly durability?: LangGraphSubmitOptions['durability'];

feedbackKeys

readonly feedbackKeys?: readonly string[];

ifNotExists

readonly ifNotExists?: LangGraphSubmitOptions['ifNotExists'];

interruptAfter

readonly interruptAfter?: '*' | readonly string[];

interruptBefore

readonly interruptBefore?: '*' | readonly string[];

multitaskStrategy

What the backend does when the thread already has a run going. With 'enqueue' during a run, the session queues the run instead: see queue.

readonly multitaskStrategy?: LangGraphSubmitOptions['multitaskStrategy'];

onCompletion

readonly onCompletion?: LangGraphSubmitOptions['onCompletion'];

onDisconnect

readonly onDisconnect?: LangGraphSubmitOptions['onDisconnect'];

onRunCreated

Called with each run the command creates. A throwing callback is ignored.

readonly onRunCreated?: (run: {
        readonly run_id: string;
        readonly thread_id?: string;
    }) => void;

streamMode

Extra stream modes. The modes the session itself needs are always kept.

readonly streamMode?: readonly StreamMode[];

streamSubgraphs

readonly streamSubgraphs?: boolean;

webhook

readonly webhook?: string;