You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building a chatbot that responds in JSON format, but I am not able to stream it because the JSON Output Function parser from langchain uses chunks, and in the Vercel ai SDK StreamingTextResponse needs a byte function parser.
then How to use both together?
const jsonOutputParser = new JsonOutputFunctionsParser({ diff: true });
const bytesOutputParser = new BytesOutputParser();
// I tried this but it doesn't work...
const chain = RunnableSequence.from([
prompt,
model,
jsonOutputParser,
bytesOutputParser,
]);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am building a chatbot that responds in JSON format, but I am not able to stream it because the JSON Output Function parser from langchain uses chunks, and in the Vercel ai SDK StreamingTextResponse needs a byte function parser.
then How to use both together?
Beta Was this translation helpful? Give feedback.
All reactions