Performing controlled actions while streaming #4438
Unanswered
cacosandon
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I read the documentation, but I can't find anything related to executing actions while streaming, at least in React (NextJS).
For example, let's say I want to call my
/api/completion
endpoint from a component to update a specific state in a controlled way. What is the best approach for this?It seems the best option is to call fetch to the API and handle SSE manually without the SDK, so I can perform actions per chunk received.
I noticed that
onChunk
is a property forstreamText
on the server but not available on the client. Why is that?There are some workarounds, like the one in this pull request: #3252, but it's like something is off.
Any help would be much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions