import { BaseChannel } from "../channels/base.js"; import { LangGraphRunnableConfig } from "./runnable_types.js"; import { PregelNode } from "./read.js"; import { PregelInputType, PregelInterface, PregelOptions, PregelOutputType, PregelParams, StateSnapshot } from "./types.js"; import { StrRecord } from "./algo.js"; import { All, CheckpointListOptions } from "@langchain/langgraph-checkpoint"; import { Runnable, RunnableConfig } from "@langchain/core/runnables"; import { Graph, Node } from "@langchain/core/runnables/graph"; import { IterableReadableStream } from "@langchain/core/utils/stream"; import { Checkpoint as Checkpoint$1, Client, ThreadState } from "@langchain/langgraph-sdk"; import { StreamEvent } from "@langchain/core/tracers/log_stream"; //#region src/pregel/remote.d.ts type RemoteGraphParams = Omit, StrRecord>, "channels" | "nodes" | "inputChannels" | "outputChannels"> & { graphId: string; client?: Client; url?: string; apiKey?: string; headers?: Record; streamResumable?: boolean; }; /** * The `RemoteGraph` class is a client implementation for calling remote * APIs that implement the LangGraph Server API specification. * * For example, the `RemoteGraph` class can be used to call APIs from deployments * on LangSmith Deployment. * * `RemoteGraph` behaves the same way as a `StateGraph` and can be used directly as * a node in another `StateGraph`. * * @example * ```ts * import { RemoteGraph } from "@langchain/langgraph/remote"; * * // Can also pass a LangGraph SDK client instance directly * const remoteGraph = new RemoteGraph({ * graphId: process.env.LANGGRAPH_REMOTE_GRAPH_ID!, * apiKey: process.env.LANGGRAPH_REMOTE_GRAPH_API_KEY, * url: process.env.LANGGRAPH_REMOTE_GRAPH_API_URL, * }); * * const input = { * messages: [ * { * role: "human", * content: "Hello world!", * }, * ], * }; * * const config = { * configurable: { thread_id: "threadId1" }, * }; * * await remoteGraph.invoke(input, config); * ``` */ declare class RemoteGraph = StrRecord, Cc extends StrRecord = StrRecord, ContextType extends Record = StrRecord> extends Runnable> implements PregelInterface { static lc_name(): string; lc_namespace: string[]; lg_is_pregel: boolean; config?: RunnableConfig; graphId: string; protected client: Client; protected interruptBefore?: Array | All; protected interruptAfter?: Array | All; protected streamResumable?: boolean; constructor(params: RemoteGraphParams); withConfig(config: RunnableConfig): typeof this; protected _sanitizeConfig(config: RunnableConfig): { tags: string[]; metadata: Record; configurable: { [k: string]: any; }; recursion_limit: number | undefined; }; protected _getConfig(checkpoint: Record): RunnableConfig; protected _getCheckpoint(config?: RunnableConfig): Checkpoint$1 | undefined; protected _createStateSnapshot(state: ThreadState): StateSnapshot; invoke(input: PregelInputType, options?: Partial>): Promise; streamEvents(input: PregelInputType, options: Partial> & { version: "v1" | "v2"; }): IterableReadableStream; streamEvents(input: PregelInputType, options: Partial> & { version: "v1" | "v2"; encoding: never; }): IterableReadableStream; _streamIterator(input: PregelInputType, options?: Partial>): AsyncGenerator; updateState(inputConfig: LangGraphRunnableConfig, values: Record, asNode?: string): Promise; getStateHistory(config: RunnableConfig, options?: CheckpointListOptions): AsyncIterableIterator; protected _getDrawableNodes(nodes: Array<{ id: string | number; name?: string; data?: Record | string; metadata?: unknown; }>): Record; getState(config: RunnableConfig, options?: { subgraphs?: boolean; }): Promise; /** @deprecated Use getGraphAsync instead. The async method will become the default in the next minor release. */ getGraph(_?: RunnableConfig & { xray?: boolean | number; }): Graph; /** * Returns a drawable representation of the computation graph. */ getGraphAsync(config?: RunnableConfig & { xray?: boolean | number; }): Promise; /** @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release. */ getSubgraphs(): Generator<[string, PregelInterface]>; getSubgraphsAsync(namespace?: string, recurse?: boolean): AsyncGenerator<[string, PregelInterface]>; } //#endregion export { RemoteGraph, RemoteGraphParams }; //# sourceMappingURL=remote.d.ts.map