Streaming with Tools
When using function calling with streaming, tool parameters are streamed as partial JSON:text_chunks
. To get the full message, you need to combine these chunks together in the order they arrive. Each chunk is part of the overall text, so only after concatenation do you get the complete response.
User Experience
- Progressive rendering: Display content as it streams in for better perceived performance
- Loading indicators: Show appropriate loading states during streaming