Replies: 1 comment
-
We have removed the old approach of converting the output stream from 3rd party provider libraries (such as OpenAI) in 4.0 in favor to our standardized provider approach: https://sdk.vercel.ai/docs/ai-sdk-core/overview You need to use AI SDK core and the related functions in 4.0 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am running express server, and below code works well.
The
ai
library version is"^2.2.31"
Using latest
ai
library, How do I changestreamToResponse
function?As you know,
streamToResponse
function is gone after version 4.streamToResponse has been removed in AI SDK 4.0. Use pipeDataStreamToResponse from streamText instead.
If I change the function to
pipeDataStreamToResponse
,The below error occured.
server error TypeError: response.writeHead is not a function
Can anyone help me?
Beta Was this translation helpful? Give feedback.
All reactions