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
The @google/generative-ai package exposes a somewhat different API than the openai and @anthropic-ai/sdk packages do. This is clearest in the implementation of streaming responses.
The others expose a .toReadableStream() method on the return value of their streaming methods. Google does not do this, instead returning an AsyncGenerator.
I've tried to find a way to convert the output into a ReadableStream, but nothing I've tried has worked. I suspect that there is a fairly simple solution, I just don't have the experience with streams required to find it.
For now, using the GoogleAI API will just force streaming to be disabled.
The text was updated successfully, but these errors were encountered:
The @google/generative-ai package exposes a somewhat different API than the openai and @anthropic-ai/sdk packages do. This is clearest in the implementation of streaming responses.
The others expose a
.toReadableStream()
method on the return value of their streaming methods. Google does not do this, instead returning anAsyncGenerator
.I've tried to find a way to convert the output into a ReadableStream, but nothing I've tried has worked. I suspect that there is a fairly simple solution, I just don't have the experience with streams required to find it.
For now, using the GoogleAI API will just force streaming to be disabled.
The text was updated successfully, but these errors were encountered: