SPB Git forge

spb/doc-api

Public
2commits 1branches 0releases
15.7 MBsize
maindefault branch
14 days agolast push
Python 88.3% TypeScript 7.6% Shell 4.1%
1.4 KB · 15 lines shellscript
Raw Blame History
1#!/usr/bin/env bash2set -euo pipefail3cd "$(dirname "$0")/../../../.."4source scripts/lib.sh5MODEL="${MODEL:-claude-haiku-4-5-20251001}"6# tool_choice auto | any | none and disable_parallel_tool_use with two tools.7# STATUS: LIVE_VERIFIED 2026-09-18 (a3 parallel: 2 tool_use blocks; a4 disable_parallel: 1 block; a5 any; a6 none) on claude-haiku-4-5-20251001.8T='[{"name":"get_weather","description":"Get the current weather for a city. Returns a short text description.","input_schema":{"type":"object","properties":{"location":{"type":"string","description":"City name, e.g. Paris"}},"required":["location"]}},{"name":"get_time","description":"Get the current local time in a city.","input_schema":{"type":"object","properties":{"location":{"type":"string"}},"required":["location"]}}]'9Q="Give me the weather AND the local time in Tokyo. Call both tools at once."10for TC in '{"type":"auto"}' '{"type":"auto","disable_parallel_tool_use":true}' '{"type":"any"}' '{"type":"none"}'; do11  R=$(ant POST /v1/messages -d "$(jq -n --argjson t "$T" --argjson tc "$TC" --arg m "$MODEL" --arg q "$Q" '{model:$m,max_tokens:300,tools:$t,tool_choice:$tc,messages:[{role:"user",content:$q}]}')")12  log_request anthropic POST /v1/messages "$ANT_STATUS" 0.001 "custom-tools/tool_choice_variants.sh $TC"13  echo "tool_choice=$TC -> stop_reason=$(echo "$R"|jq -r .stop_reason) tool_use blocks=$(echo "$R"|jq '[.content[]|select(.type=="tool_use")]|length')"14done15