onFinishStream
Registers a handler that is triggered when the stream processing is finished.
Parameters
handler
The function to handle the final output, receiving the remaining text as a parameter.
Registers a handler that is triggered when the stream processing is finished.
The function to handle the final output, receiving the remaining text as a parameter.