class RemoteGraphRunnable<PregelInputType, PregelOutputType, PregelOptions<Nn, Cc, ContextType>>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);The default configuration for graph execution, can be overridden on a per-invocation basis
Optional array of node names or "all" to interrupt after executing these nodes. Used for implementing human-in-the-loop workflows.
Optional array of node names or "all" to interrupt before executing these nodes. Used for implementing human-in-the-loop workflows.
A path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.
The name of the task, analogous to the node name in StateGraph.
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.