UNPKG

@langchain/langgraph-sdk

Version:

Client library for interacting with the LangGraph API

45 lines (44 loc) • 2.24 kB
import { ClientAssembledToolCall } from "./tools.js"; import { StreamingMessageHandle } from "../messages.js"; import { AudioMedia, FileMedia, ImageMedia, VideoMedia } from "../media.js"; import { EventForChannel, EventForChannels, SubscribeOptions, YieldForChannel, YieldForChannels } from "../types.js"; import { SubgraphHandle, Subscribable } from "./subgraphs.js"; import { SubscriptionHandle } from "../index.js"; import { Channel, Event, SubscribeParams } from "@langchain/protocol"; //#region src/client/stream/handles/subagents.d.ts /** * Discovered subagent within a streaming session. Mirrors the * in-process `SubagentRunStream` from DeepAgent. * * Each subagent is discovered when a `tool-started` event with * `tool_name === "task"` is observed. The `taskInput` and `output` * promises resolve from the task tool's lifecycle events. * * Use lazy getters (`sub.messages`, `sub.toolCalls`, etc.) for * namespace-scoped projections. */ declare class SubagentHandle { #private; readonly name: string; readonly callId: string; readonly taskInput: Promise<string>; readonly output: Promise<unknown>; readonly namespace: string[]; constructor(name: string, callId: string, namespace: string[], taskInput: Promise<string>, output: Promise<unknown>, session: Subscribable); get messages(): AsyncIterable<StreamingMessageHandle>; get toolCalls(): AsyncIterable<ClientAssembledToolCall>; get audio(): AsyncIterable<AudioMedia>; get images(): AsyncIterable<ImageMedia>; get video(): AsyncIterable<VideoMedia>; get files(): AsyncIterable<FileMedia>; get subgraphs(): AsyncIterable<SubgraphHandle>; /** * Create a raw channel subscription scoped to this subagent's namespace. */ subscribe<TChannel extends Channel>(channel: TChannel, options?: SubscribeOptions): Promise<SubscriptionHandle<EventForChannel<TChannel>, YieldForChannel<TChannel>>>; subscribe<const TChannels extends readonly Channel[]>(channels: TChannels, options?: SubscribeOptions): Promise<SubscriptionHandle<EventForChannels<TChannels>, YieldForChannels<TChannels>>>; subscribe(params: SubscribeParams): Promise<SubscriptionHandle<Event>>; } //#endregion export { SubagentHandle }; //# sourceMappingURL=subagents.d.ts.map