/** * LangChainStreamingAdapter — LangChainAdapter with real incremental streaming. * * Extends {@link LangChainAdapter} with genuine streaming via the LangChain * Runnable `.stream()` interface. Falls back gracefully to `.invoke()` for * agents whose Runnable does not expose `.stream()`. * * Usage (drop-in replacement for LangChainAdapter): * * const adapter = new LangChainStreamingAdapter(); * adapter.registerAgent('analyst', myChain); // same API * await registry.addAdapter(adapter); * * // Stream the response * for await (const chunk of adapter.executeAgentStream('analyst', payload, ctx)) { * process.stdout.write(chunk.text); * if (chunk.done) break; * } * * @module LangChainStreamingAdapter * @version 1.0.0 */ import type { AgentPayload, AgentContext, AdapterCapabilities } from '../types/agent-adapter'; import type { StreamingChunk } from '../types/streaming-adapter'; import type { IStreamingAdapter } from '../types/streaming-adapter'; import { LangChainAdapter, LangChainRunnable } from './langchain-adapter'; export declare class LangChainStreamingAdapter extends LangChainAdapter implements IStreamingAdapter { private streamableAgentIds; get capabilities(): AdapterCapabilities; /** * Register a LangChain agent. Automatically detects `.stream()` support. */ registerAgent(agentId: string, runnable: LangChainRunnable, metadata?: { description?: string; capabilities?: string[]; }): void; /** Returns `true` when the agent exposes LangChain's `.stream()` method. */ supportsStreaming(agentId: string): boolean; /** * Stream agent execution as incremental `StreamingChunk` values. * * - If the registered Runnable exposes `.stream()`, emits tokens incrementally. * - Otherwise falls back to `.invoke()` and emits a single chunk. */ executeAgentStream(agentId: string, payload: AgentPayload, context: AgentContext): AsyncIterable; private _fallbackStream; } //# sourceMappingURL=langchain-streaming-adapter.d.ts.map