OptionalonChunk?: StreamTextOnChunkCallback<Tools>Callback for every AI SDK 7 stream part, including lifecycle, boundary, terminal, text, reasoning, and tool parts.
OptionalonEnd?: WrappedStreamTextOnEndCallback<Tools>Callback when the stream completes. Receives the wrapped AI SDK onEnd event with result, cost, and sources.
OptionalonError?: StreamTextOnErrorCallbackCallback when a stream error occurs
Parameters accepted by streamText.