Set isLoading
to true when operation is triggered, not when stream starts?
#3877
Closed
s-h-a-d-o-w
started this conversation in
Ideas & Feedback
Replies: 1 comment 2 replies
-
Hey! What version of the AI SDK are you using? With the latest 4.0, streamText is no longer blocking (no more await). As a result, the initial response should come back almost immediately. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sometimes, it can take a few seconds until an API starts to stream the response. Sure, we could work around this by keeping track of
isLoading
ourselves instead of relying on what the SDK provides. But I think that kind of goes against the purpose of the SDK of having a solution that's as complete as reasonably possible?And so I would propose to set this to true as soon as something like e.g.
reload()
gets triggered.If after a few seconds an error occurs instead of the stream starting, I think the user should still see some indication in the UI that their input was triggered successfully in the meantime.
Beta Was this translation helpful? Give feedback.
All reactions