Next.js Discord

Discord Forum

Question about experimental_toolCalls.

Unanswered
Ragdoll posted this in #help-forum
Open in Discord
RagdollOP
I'm using the AI SDK in the AI Chat template starter. I am using experimental_toolCalls to capture tool calls. From what I can tell there isn't a super obvious to me how I would use this callback and add the tool calls permanently to the chat history. Basically the problem seems to be that the OpenAI stream can only return the completion content for the next assistant utterance and I can't signal to the client that there are multiple messages to append to the history in the UI.

Does anyone have any guidance on how this callback is meant to be used?

0 Replies