New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generateContentStream ERROR: TypeError: response.body.pipeThrough is not a function #43
Comments
Per this answer, this is the correct place for this issue. |
I've encountering the same problem for I'm not having the problem on Debian (Node v20.10.0, @google/generative-ai 0.1.3). https://github.com/google/generative-ai-js/blob/main/packages/main/src/requests/stream-reader.ts#L38 https://github.com/google/generative-ai-js/blob/main/packages/main/src/requests/request.ts#L68 |
I found the source of error. It's not a bug from this repo. Another library I was using ( After I fixed it, the streaming seems to work well. |
Can I confirm that you can use sendMessageStream without error, right? I don't have mistralai but I still have the error 😢 |
Yes, I can use
Same for
There are a few ways you can check whether you are having the same problem with me:
|
Yes, I have node-fetch in the source code, I use it in another file like this
So the problem we have is that the streaming gets node-fetch instead of the original fetch of nodejs, right? Good clue for me to debug the issue, I will try this way tomorrow, thanks for the support @123jimin 🙏 |
Yes, you're correct @123jimin the issue caused by this cohere-ai/cohere-typescript#113 I will follow up there, thank you! 🙏 |
So once this repo updates the cohere-typescript fix to 7.7.4 and @google/generative-ai updates its related packages to reflect this, the issue will be fixed? |
@stackifyit Yes, correct, you can try to debug in the code to see if anything modifies the original fetch, in my case, the Async is the original one |
Same for me, I modified the content of @mistralai/mistralai and it's work now |
This works:
But when I stream, I get the error TypeError: response.body.pipeThrough is not a function:
I am using node v21.3.0
npm version @google/generative-ai : "^0.1.3"
Thanks in advance!
The text was updated successfully, but these errors were encountered: