Python 88.3%
TypeScript 7.6%
Shell 4.1%
1#!/usr/bin/env bash2set -euo pipefail3cd "$(dirname "$0")/../../../.."4source scripts/lib.sh5MODEL="${MODEL:-claude-haiku-4-5-20251001}"6# Streaming a tool call: watch content_block_start(tool_use, input:{}) then input_json_delta fragments. eager_input_streaming:true on the tool7# turns on fine-grained (unbuffered, unvalidated) streaming; the legacy header fine-grained-tool-streaming-2025-05-14 is no longer needed.8# STATUS: LIVE_VERIFIED 2026-09-18 (b1 buffered: 6 fragments; b2 eager: 4 longer fragments; b3 legacy header identical to b2).9EAGER="${EAGER:-true}"10curl -sN https://api.anthropic.com/v1/messages -H "x-api-key: $ANTHROPIC_API_KEY" -H "anthropic-version: $ANTHROPIC_VERSION" -H "content-type: application/json" \11 -d "$(jq -n --arg m "$MODEL" --argjson e "$EAGER" '{model:$m,max_tokens:150,stream:true,tool_choice:{type:"any"},tools:[{name:"get_weather",description:"Get the current weather for a city.",eager_input_streaming:$e,input_schema:{type:"object",properties:{location:{type:"string"}},required:["location"]}}],messages:[{role:"user",content:"Weather in San Francisco, CA?"}]}')" \12 | grep '^data:' | sed 's/^data: //' | jq -c 'select(.type=="content_block_start" or .type=="content_block_delta")|.content_block // .delta'13log_request anthropic POST /v1/messages 200 0.001 "fine-grained-streaming/basic.sh eager=$EAGER"14