github.com/anthropics/anthropic-sdk-go@v1.70.1/toolrunner/testdata/cassettes/tool_runner_tool_call_error.yaml (about)

     1  ---
     2  version: 1
     3  interactions:
     4  - request:
     5      body: '{"max_tokens":512,"messages":[{"content":[{"text":"Weather in San Francisco?","type":"text"}],"role":"user"}],"model":"claude-3-7-sonnet-latest","tools":[{"input_schema":{"properties":{"city":{"type":"string"},"units":{"enum":["celsius","fahrenheit"],"type":"string"}},"required":["city"],"type":"object"},"name":"get_weather","description":"Get
     6        weather"}]}'
     7      form: {}
     8      headers:
     9        Accept:
    10        - application/json
    11        Anthropic-Version:
    12        - "2023-06-01"
    13        Content-Type:
    14        - application/json
    15        User-Agent:
    16        - Anthropic/Go 1.16.0
    17        X-Api-Key:
    18        - fake-api-key-for-testing-only
    19        X-Stainless-Arch:
    20        - arm64
    21        X-Stainless-Lang:
    22        - go
    23        X-Stainless-Os:
    24        - MacOS
    25        X-Stainless-Package-Version:
    26        - 1.16.0
    27        X-Stainless-Retry-Count:
    28        - "0"
    29        X-Stainless-Runtime:
    30        - go
    31        X-Stainless-Runtime-Version:
    32        - go1.24.5
    33        X-Stainless-Timeout:
    34        - "600"
    35      url: https://api.anthropic.com/v1/messages?beta=true
    36      method: POST
    37    response:
    38      body: '{"model":"claude-3-7-sonnet-20250219","id":"msg_014tfMBTf8yzH6aC9ohZ94k3","type":"message","role":"assistant","content":[{"type":"text","text":"I''ll
    39        check the current weather in San Francisco for you."},{"type":"tool_use","id":"toolu_01XKSJ1fM9PHM9vpwH1p7PDT","name":"get_weather","input":{"city":"San
    40        Francisco"}}],"stop_reason":"tool_use","stop_sequence":null,"usage":{"input_tokens":395,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":67,"service_tier":"standard"}}'
    41      headers:
    42        Anthropic-Organization-Id:
    43        - 1577a8a6-174a-4705-916c-6b22ae7a49e6
    44        Anthropic-Ratelimit-Input-Tokens-Limit:
    45        - "200000"
    46        Anthropic-Ratelimit-Input-Tokens-Remaining:
    47        - "199000"
    48        Anthropic-Ratelimit-Input-Tokens-Reset:
    49        - "2025-10-30T16:17:36Z"
    50        Anthropic-Ratelimit-Output-Tokens-Limit:
    51        - "80000"
    52        Anthropic-Ratelimit-Output-Tokens-Remaining:
    53        - "80000"
    54        Anthropic-Ratelimit-Output-Tokens-Reset:
    55        - "2025-10-30T16:17:37Z"
    56        Anthropic-Ratelimit-Requests-Limit:
    57        - "4000"
    58        Anthropic-Ratelimit-Requests-Remaining:
    59        - "3999"
    60        Anthropic-Ratelimit-Requests-Reset:
    61        - "2025-10-30T16:17:35Z"
    62        Anthropic-Ratelimit-Tokens-Limit:
    63        - "280000"
    64        Anthropic-Ratelimit-Tokens-Remaining:
    65        - "279000"
    66        Anthropic-Ratelimit-Tokens-Reset:
    67        - "2025-10-30T16:17:36Z"
    68        Cf-Cache-Status:
    69        - DYNAMIC
    70        Cf-Ray:
    71        - 996c3946fe615e6a-EWR
    72        Content-Type:
    73        - application/json
    74        Date:
    75        - Thu, 30 Oct 2025 16:17:37 GMT
    76        Request-Id:
    77        - req_011CUdgeEYzbWH4BW7aH5Dbx
    78        Server:
    79        - cloudflare
    80        Strict-Transport-Security:
    81        - max-age=31536000; includeSubDomains; preload
    82        X-Envoy-Upstream-Service-Time:
    83        - "1378"
    84        X-Robots-Tag:
    85        - none
    86      status: 200 OK
    87      code: 200
    88      duration: ""
    89  - request:
    90      body: '{"max_tokens":512,"messages":[{"content":[{"text":"Weather in San Francisco?","type":"text"}],"role":"user"},{"content":[{"text":"I''ll
    91        check the current weather in San Francisco for you.","type":"text"},{"id":"toolu_01XKSJ1fM9PHM9vpwH1p7PDT","input":{"city":"San
    92        Francisco"},"name":"get_weather","type":"tool_use"}],"role":"assistant"},{"content":[{"tool_use_id":"toolu_01XKSJ1fM9PHM9vpwH1p7PDT","is_error":true,"content":[{"text":"Error:
    93        Unexpected error, try again","type":"text"}],"type":"tool_result"}],"role":"user"}],"model":"claude-3-7-sonnet-latest","tools":[{"input_schema":{"properties":{"city":{"type":"string"},"units":{"enum":["celsius","fahrenheit"],"type":"string"}},"required":["city"],"type":"object"},"name":"get_weather","description":"Get
    94        weather"}]}'
    95      form: {}
    96      headers:
    97        Accept:
    98        - application/json
    99        Anthropic-Version:
   100        - "2023-06-01"
   101        Content-Type:
   102        - application/json
   103        User-Agent:
   104        - Anthropic/Go 1.16.0
   105        X-Api-Key:
   106        - fake-api-key-for-testing-only
   107        X-Stainless-Arch:
   108        - arm64
   109        X-Stainless-Lang:
   110        - go
   111        X-Stainless-Os:
   112        - MacOS
   113        X-Stainless-Package-Version:
   114        - 1.16.0
   115        X-Stainless-Retry-Count:
   116        - "0"
   117        X-Stainless-Runtime:
   118        - go
   119        X-Stainless-Runtime-Version:
   120        - go1.24.5
   121        X-Stainless-Timeout:
   122        - "600"
   123      url: https://api.anthropic.com/v1/messages?beta=true
   124      method: POST
   125    response:
   126      body: '{"model":"claude-3-7-sonnet-20250219","id":"msg_01WkcabYzR3oCnHMEPgBcSAa","type":"message","role":"assistant","content":[{"type":"text","text":"I
   127        apologize for the error. Let me try checking the weather in San Francisco again."},{"type":"tool_use","id":"toolu_01LELQc5n8mDyvS1bApN4qPi","name":"get_weather","input":{"city":"San
   128        Francisco"}}],"stop_reason":"tool_use","stop_sequence":null,"usage":{"input_tokens":489,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":74,"service_tier":"standard"}}'
   129      headers:
   130        Anthropic-Organization-Id:
   131        - 1577a8a6-174a-4705-916c-6b22ae7a49e6
   132        Anthropic-Ratelimit-Input-Tokens-Limit:
   133        - "200000"
   134        Anthropic-Ratelimit-Input-Tokens-Remaining:
   135        - "199000"
   136        Anthropic-Ratelimit-Input-Tokens-Reset:
   137        - "2025-10-30T16:17:37Z"
   138        Anthropic-Ratelimit-Output-Tokens-Limit:
   139        - "80000"
   140        Anthropic-Ratelimit-Output-Tokens-Remaining:
   141        - "80000"
   142        Anthropic-Ratelimit-Output-Tokens-Reset:
   143        - "2025-10-30T16:17:38Z"
   144        Anthropic-Ratelimit-Requests-Limit:
   145        - "4000"
   146        Anthropic-Ratelimit-Requests-Remaining:
   147        - "3998"
   148        Anthropic-Ratelimit-Requests-Reset:
   149        - "2025-10-30T16:17:37Z"
   150        Anthropic-Ratelimit-Tokens-Limit:
   151        - "280000"
   152        Anthropic-Ratelimit-Tokens-Remaining:
   153        - "279000"
   154        Anthropic-Ratelimit-Tokens-Reset:
   155        - "2025-10-30T16:17:37Z"
   156        Cf-Cache-Status:
   157        - DYNAMIC
   158        Cf-Ray:
   159        - 996c394fd8575e6a-EWR
   160        Content-Type:
   161        - application/json
   162        Date:
   163        - Thu, 30 Oct 2025 16:17:38 GMT
   164        Request-Id:
   165        - req_011CUdgeLfMAoXNWKXy99k2B
   166        Server:
   167        - cloudflare
   168        Strict-Transport-Security:
   169        - max-age=31536000; includeSubDomains; preload
   170        X-Envoy-Upstream-Service-Time:
   171        - "1260"
   172        X-Robots-Tag:
   173        - none
   174      status: 200 OK
   175      code: 200
   176      duration: ""
   177  - request:
   178      body: '{"max_tokens":512,"messages":[{"content":[{"text":"Weather in San Francisco?","type":"text"}],"role":"user"},{"content":[{"text":"I''ll
   179        check the current weather in San Francisco for you.","type":"text"},{"id":"toolu_01XKSJ1fM9PHM9vpwH1p7PDT","input":{"city":"San
   180        Francisco"},"name":"get_weather","type":"tool_use"}],"role":"assistant"},{"content":[{"tool_use_id":"toolu_01XKSJ1fM9PHM9vpwH1p7PDT","is_error":true,"content":[{"text":"Error:
   181        Unexpected error, try again","type":"text"}],"type":"tool_result"}],"role":"user"},{"content":[{"text":"I
   182        apologize for the error. Let me try checking the weather in San Francisco again.","type":"text"},{"id":"toolu_01LELQc5n8mDyvS1bApN4qPi","input":{"city":"San
   183        Francisco"},"name":"get_weather","type":"tool_use"}],"role":"assistant"},{"content":[{"tool_use_id":"toolu_01LELQc5n8mDyvS1bApN4qPi","content":[{"text":"Sunny
   184        68°F","type":"text"}],"type":"tool_result"}],"role":"user"}],"model":"claude-3-7-sonnet-latest","tools":[{"input_schema":{"properties":{"city":{"type":"string"},"units":{"enum":["celsius","fahrenheit"],"type":"string"}},"required":["city"],"type":"object"},"name":"get_weather","description":"Get
   185        weather"}]}'
   186      form: {}
   187      headers:
   188        Accept:
   189        - application/json
   190        Anthropic-Version:
   191        - "2023-06-01"
   192        Content-Type:
   193        - application/json
   194        User-Agent:
   195        - Anthropic/Go 1.16.0
   196        X-Api-Key:
   197        - fake-api-key-for-testing-only
   198        X-Stainless-Arch:
   199        - arm64
   200        X-Stainless-Lang:
   201        - go
   202        X-Stainless-Os:
   203        - MacOS
   204        X-Stainless-Package-Version:
   205        - 1.16.0
   206        X-Stainless-Retry-Count:
   207        - "0"
   208        X-Stainless-Runtime:
   209        - go
   210        X-Stainless-Runtime-Version:
   211        - go1.24.5
   212        X-Stainless-Timeout:
   213        - "600"
   214      url: https://api.anthropic.com/v1/messages?beta=true
   215      method: POST
   216    response:
   217      body: '{"model":"claude-3-7-sonnet-20250219","id":"msg_01BT54to51fGtyrvodmSUuUw","type":"message","role":"assistant","content":[{"type":"text","text":"The
   218        current weather in San Francisco is sunny with a temperature of 68°F."}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":580,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":21,"service_tier":"standard"}}'
   219      headers:
   220        Anthropic-Organization-Id:
   221        - 1577a8a6-174a-4705-916c-6b22ae7a49e6
   222        Anthropic-Ratelimit-Input-Tokens-Limit:
   223        - "200000"
   224        Anthropic-Ratelimit-Input-Tokens-Remaining:
   225        - "200000"
   226        Anthropic-Ratelimit-Input-Tokens-Reset:
   227        - "2025-10-30T16:17:38Z"
   228        Anthropic-Ratelimit-Output-Tokens-Limit:
   229        - "80000"
   230        Anthropic-Ratelimit-Output-Tokens-Remaining:
   231        - "80000"
   232        Anthropic-Ratelimit-Output-Tokens-Reset:
   233        - "2025-10-30T16:17:39Z"
   234        Anthropic-Ratelimit-Requests-Limit:
   235        - "4000"
   236        Anthropic-Ratelimit-Requests-Remaining:
   237        - "3999"
   238        Anthropic-Ratelimit-Requests-Reset:
   239        - "2025-10-30T16:17:38Z"
   240        Anthropic-Ratelimit-Tokens-Limit:
   241        - "280000"
   242        Anthropic-Ratelimit-Tokens-Remaining:
   243        - "280000"
   244        Anthropic-Ratelimit-Tokens-Reset:
   245        - "2025-10-30T16:17:38Z"
   246        Cf-Cache-Status:
   247        - DYNAMIC
   248        Cf-Ray:
   249        - 996c39580aab5e6a-EWR
   250        Content-Type:
   251        - application/json
   252        Date:
   253        - Thu, 30 Oct 2025 16:17:39 GMT
   254        Request-Id:
   255        - req_011CUdgeSDTmEigNbh79UCJo
   256        Server:
   257        - cloudflare
   258        Strict-Transport-Security:
   259        - max-age=31536000; includeSubDomains; preload
   260        X-Envoy-Upstream-Service-Time:
   261        - "605"
   262        X-Robots-Tag:
   263        - none
   264      status: 200 OK
   265      code: 200
   266      duration: ""