How to stream LangChain, LangGraph's final generation #6977
Mohan-Sharma
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How do we stream LangGraph's final generation using vercel's AI sdk? It works pretty well with LangChain LCEL as explain in this blog. But how do we do this using LangGraph and vercel ai?
I am getting error TypeError: stream.pipeThrough is not a function while doing LangChainAdapter.toDataStreamResponse(final_generation) in handling the graph's stream
When user clicks submit the below POST is invoked, which in turn invokes the graph flow. This is where the error occurs.
A simple CompiledStateGraph
generate node
State
The input binding, handling the user message is done by useChat() of vercel ai
Rendering part, here the HumanInput component binds to the input and submits the user query to handleSubmit which in turn invokes our previous POST server function.
Beta Was this translation helpful? Give feedback.
All reactions