-
-
Notifications
You must be signed in to change notification settings - Fork 116
Description
TanStack AI version
v0.2.2
Framework/Library version
v0.2.2
Describe the bug and the steps to reproduce it
The documentation shows an example websocket adapter here: https://tanstack.com/ai/latest/docs/guides/connection-adapters#websocket-adapter-example
However, when i attempt that it produces a type error since the stream utility expects the factory function to return an AsyncIterable<StreamChunk>, not a readable stream.
I'm using this in a react router app where the typescript compilerOptions target is ES2022 which i think has something to do with the problem. I get no error in the typescript playground if i leave it on the default value of ES2017
Also, I'm not sure i understand how it's supposed to work. I believe it will create a new websocket connection on every user message send but i can't determine when/how that connection gets closed between user message sends.
I was hoping a single websocket connection could be opened and used for the life of the conversation.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
Screenshots or Videos (Optional)
Do you intend to try to help solve this bug with your own PR?
None
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.