-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat (rsc): add streamUI onFinish callback #1920
Conversation
babf2a2
to
16e000d
Compare
For the "test", "example", and "docs:example" tasks, I couldn't find the right places to extend for the |
@lgrammel If you get a chance, can you review these changes? |
@gclark-eightfold general direction looks good. tests would be important, since i'm thinking about refactoring the inner loop of |
@lgrammel I'll see about adding some tests then soon. I did see there were some already made for the precursor Edit: I actually see now the E2E tests already made for streamUI. Let me know if these are sufficient. |
…-finish-stream-ui
@gclark-eightfold I have concerns going all in on e2e, bc of the nature of e2e tests. I'd love to have tests similar to streamText, but that requires a refactoring on my end |
Thanks for working on this! I'm looking forward to this one since it's preventing me from using streamUI! |
@lgrammel I re-added some of the tests I found for the I can remove the snapshot tests that aren't related to the |
The example could go under |
It's fine as is for now. |
@lgrammel Should be all added now. Let me know if this should be changed in any way. Also wasn't able to figure out how to run a server for the MDX content to verify it all works, but I tried to keep it as close to what exists already. |
@gclark-eightfold looks very good. I'll do some testing, also one the docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Awesome work!
I've been playing with this, but I was curious, since onFinish cannot have a return like the text callback, how can I display that a finish reason violated the safety settings? |
if you use streamable value or streamable ui, you can update them from within the onFinish callback |
Summary
Adds an
onFinish
callback tostreamUI
.Resolves #1845
Tasks