AgentOptions
Options for creating a LangGraph-backed agent via agent.
import type { AgentOptions } from '@threadplane/langgraph';Declaration
export interface AgentOptions<T, _ResolvedBag extends BagTemplate> {
a2uiClientCapabilities?: {
supportedCatalogIds: string[];
inlineCatalogs?: unknown[];
};
apiUrl?: string;
assistantId: string;
clientOptions?: LangGraphClientOptions;
initialValues?: Partial<T>;
onThreadId?: (id: string) => void;
subagentToolNames?: string[];
telemetry?: AgentRuntimeTelemetrySink | false;
threadId?: Signal<string | null> | string | null;
throttle?: number | false;
toMessage?: (msg: unknown) => BaseMessage;
transcriptNodeNames?: string[];
transport?: AgentTransport;
}Type parameters
T_ResolvedBagBagTemplate
Members
a2uiClientCapabilities
A2UI client capabilities (catalog negotiation) to advertise to the graph.
When set, every plain-object run payload carries them under the
a2ui_client_capabilities state key — mirroring how client_tools
rides the payload. Read server-side via threadplane-middleware's
a2ui_client_capabilities(state). Use @threadplane/chat's
a2uiClientCapabilities() for the renderer's standard value.
a2uiClientCapabilities?: {
supportedCatalogIds: string[];
inlineCatalogs?: unknown[];
};apiUrl
Base URL of the LangGraph Platform API. Defaults to provideAgent({ apiUrl }) when omitted.
apiUrl?: string;assistantId
Agent or graph identifier on the LangGraph platform.
assistantId: string;clientOptions
Tuning options for the default transport's LangGraph SDK client (e.g. retry budget).
clientOptions?: LangGraphClientOptions;initialValues
Initial state values before the first stream response arrives.
initialValues?: Partial<T>;onThreadId
Called when a new thread is auto-created by the transport.
onThreadId?: (id: string) => void;subagentToolNames
Tool names that indicate a subagent invocation.
subagentToolNames?: string[];telemetry
Omit to enable automatic development-only collection. Set false to disable.
An app-owned sink replaces the automatic destination and receives the
existing runtime lifecycle callbacks.
telemetry?: AgentRuntimeTelemetrySink | false;threadId
Thread ID to connect to. Pass a Signal for reactive thread switching.
threadId?: Signal<string | null> | string | null;throttle
Throttle signal updates in milliseconds. false to disable.
throttle?: number | false;toMessage
Custom message deserializer for non-standard message formats.
toMessage?: (msg: unknown) => BaseMessage;transcriptNodeNames
LangGraph node names whose messages-tuple LLM chunks should be projected
into the main chat transcript. Omit to accept all top-level message chunks.
Child-graph (namespaced) chunks never reach the transcript regardless of
this option — they belong to their child stream in subagents().
Use this when a graph has side-effect LLM nodes, such as title generation, whose streamed model output should not render as assistant chat content.
transcriptNodeNames?: string[];transport
Custom transport. Defaults to FetchStreamTransport.
A custom transport owns its own thread creation, so the runtime cannot
observe it directly: report every thread id the transport creates through
this config's AgentOptions.onThreadId or through the threadId
signal, otherwise the runtime keeps sending null and a new thread is
created on each submit.
transport?: AgentTransport;