-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Open
Description
In the chat route you guys save the chat with a pretty complicated section in the onFinish callback:
https://github.com/vercel/ai-chatbot/blob/22de9232982d4f8bc06e54d5fe637fe9e35647ac/app/(chat)/api/chat/route.ts#L221C8-L266C1
could this not be simplified by using responseMessage (which only gives the final message) in the onFinish function? is there a reason/flows where responseMessage is not enough?
the only scenario i could think of was: when waiting for a tool approval (input-available) but then the user sends another message (essentially skipping the request), in this case the assistant message part needs to be updated.
would love to understand your reasoning for this,
thanks for all the great work.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels