unibaraU
Convex Community10mo ago
4 replies
unibara

Streaming more than text

Working with the get-convex persistent-text-streaming has been great, would appreciate some advice on handling non-text chunk appending. https://github.com/get-convex/persistent-text-streaming/blob/6c14033c16871f71fb27457c59ab1c227444999b/src/react/index.ts#L10C1-L12C2

Currently it's very straightforward to add basic chat via this component, however, when considering streaming the current state of generation for things like tool calls (eg. web browsing) it's not as clear how to handle.

Are there plans to include more robust support different types of objects that could be streamed to the client, rather than just text? Or is there recommended way to handle this with the current component?

On another note, wonder if this window check should be included in a useEffect instead to prevent having to dynamically import in NextJS. https://github.dev/get-convex/persistent-text-streaming/blob/6c14033c16871f71fb27457c59ab1c227444999b/src/react/index.ts#L10-L12
GitHub
Stream text back to a client over HTTP while persisting it on the server for reloading/sharing - get-convex/persistent-text-streaming
persistent-text-streaming/src/react/index.ts at 6c14033c16871f71fb2...
Was this page helpful?