Open objectiveSee opened 1 week ago
Follow-up: Looks like the issue is what the way nodes are defined. This works fine in LangGraph Studio, but fails at run-time when I hook it up to a Firebase Function. It seems like the graph doesn't like the way the node is defined, which is odd because I am following the docs. Is there something I am missing?
Node:
export const wikipediaNode = async (state: typeof AgentState.State) => {
const x = state.articleId;
const articleContent = await fetchArticleContent(Number(x));
return { article: articleContent };
};
Simplified Example:
❌ FAILS
workflow = new StateGraph(AgentState)
.addNode("wiki", wikipediaNode)
.addEdge(START, "wiki")
.addEdge("wiki", END);
✅ SUCEEDS
workflow = new StateGraph(AgentState).addEdge(START, END);
I am getting run-time error when trying to run LangGraph inside a Firebase function.
Firebase Function:
Workflow:
Error:
Any thoughts on why this might happen? My code worked with LangGraph studio. I've tried two ways of doing this: 1) the workflow is compiled at script start time, and 2) on demand via getWorkflow(). Both fail with same error.
Thanks
Packages: