Skip to content

How to store streaming results in a database #164

Discussion options

You must be logged in to vote

On the client, you can use the onFinish callback available in use-completion and use-chat.

On the server, you can use the onCompletion callback that's part of AIStream: https://sdk.vercel.ai/docs/api-reference/ai-stream#aistreamcallbacks, like in this example

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Macky151203
Comment options

Answer selected by MaxLeiter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants