fine-grained-tool-streaming-2025-05-14
to a tool use request and turn on streaming.
Here’s an example of how to use fine-grained tool streaming with the API:
make_file
without buffering to validate if the lines_of_text
parameter is valid JSON. This means you can see the parameter stream as it arrives, without having to wait for the entire parameter to buffer and validate.
max_tokens
is reached, the stream may end midway through a parameter and may be incomplete. You will generally have to write specific support to handle when max_tokens
is reached.