Debian Codegraph @

tests/lib/tools/__inline_snapshot__/test_runners/TestSyncRunTools/10e53c1d-51be-4c64-b5bf-99adb3fa4719.json

raw
1 [
2 {
3 "request": {
4 "method": "POST",
5 "url": "https://api.anthropic.com/v1/messages?beta=true",
6 "headers": {
7 "host": "api.anthropic.com",
8 "accept-encoding": "gzip, deflate",
9 "connection": "keep-alive",
10 "x-stainless-timeout": "600",
11 "accept": "application/json",
12 "content-type": "application/json",
13 "user-agent": "Anthropic/Python 0.82.0",
14 "x-stainless-lang": "python",
15 "x-stainless-package-version": "0.82.0",
16 "x-stainless-os": "MacOS",
17 "x-stainless-arch": "arm64",
18 "x-stainless-runtime": "CPython",
19 "x-stainless-runtime-version": "3.9.18",
20 "x-stainless-async": "false",
21 "anthropic-version": "2023-06-01",
22 "x-stainless-helper": "BetaToolRunner",
23 "anthropic-beta": "structured-outputs-2025-12-15",
24 "x-stainless-retry-count": "0",
25 "x-stainless-read-timeout": "600",
26 "content-length": "588"
27 },
28 "body": {
29 "max_tokens": 1024,
30 "messages": [
31 {
32 "role": "user",
33 "content": "What is the weather in SF?"
34 }
35 ],
36 "model": "claude-haiku-4-5",
37 "tools": [
38 {
39 "name": "get_weather",
40 "description": "Lookup the weather for a given city in either celsius or fahrenheit",
41 "input_schema": {
42 "additionalProperties": false,
43 "properties": {
44 "location": {
45 "description": "The city and state, e.g. San Francisco, CA",
46 "title": "Location",
47 "type": "string"
48 },
49 "units": {
50 "description": "Unit for the output, either 'c' for celsius or 'f' for fahrenheit",
51 "enum": [
52 "c",
53 "f"
54 ],
55 "title": "Units",
56 "type": "string"
57 }
58 },
59 "required": [
60 "location",
61 "units"
62 ],
63 "type": "object"
64 }
65 }
66 ]
67 }
68 },
69 "response": {
70 "status_code": 200,
71 "headers": {
72 "content-type": "application/json",
73 "connection": "keep-alive",
74 "x-robots-tag": "none",
75 "strict-transport-security": "max-age=31536000; includeSubDomains; preload",
76 "server": "cloudflare",
77 "content-security-policy": "default-src 'none'; frame-ancestors 'none'",
78 "cf-cache-status": "DYNAMIC"
79 },
80 "body": {
81 "model": "claude-haiku-4-5-20251001",
82 "id": "msg_01RMQBcKf2dxTq6qfi31BBTz",
83 "type": "message",
84 "role": "assistant",
85 "content": [
86 {
87 "type": "tool_use",
88 "id": "toolu_01A9HHF5Ezy3oBrKmSgfASm9",
89 "name": "get_weather",
90 "input": {
91 "location": "San Francisco, CA",
92 "units": "f"
93 },
94 "caller": {
95 "type": "direct"
96 }
97 }
98 ],
99 "stop_reason": "tool_use",
100 "stop_sequence": null,
101 "usage": {
102 "input_tokens": 656,
103 "cache_creation_input_tokens": 0,
104 "cache_read_input_tokens": 0,
105 "cache_creation": {
106 "ephemeral_5m_input_tokens": 0,
107 "ephemeral_1h_input_tokens": 0
108 },
109 "output_tokens": 74,
110 "service_tier": "standard",
111 "inference_geo": "not_available"
112 }
113 }
114 }
115 },
116 {
117 "request": {
118 "method": "POST",
119 "url": "https://api.anthropic.com/v1/messages?beta=true",
120 "headers": {
121 "host": "api.anthropic.com",
122 "accept-encoding": "gzip, deflate",
123 "connection": "keep-alive",
124 "x-stainless-timeout": "600",
125 "accept": "application/json",
126 "content-type": "application/json",
127 "user-agent": "Anthropic/Python 0.82.0",
128 "x-stainless-lang": "python",
129 "x-stainless-package-version": "0.82.0",
130 "x-stainless-os": "MacOS",
131 "x-stainless-arch": "arm64",
132 "x-stainless-runtime": "CPython",
133 "x-stainless-runtime-version": "3.9.18",
134 "x-stainless-async": "false",
135 "anthropic-version": "2023-06-01",
136 "x-stainless-helper": "BetaToolRunner",
137 "anthropic-beta": "structured-outputs-2025-12-15",
138 "x-stainless-retry-count": "0",
139 "x-stainless-read-timeout": "600",
140 "content-length": "950"
141 },
142 "body": {
143 "max_tokens": 1024,
144 "messages": [
145 {
146 "role": "user",
147 "content": "What is the weather in SF?"
148 },
149 {
150 "role": "assistant",
151 "content": [
152 {
153 "id": "toolu_01A9HHF5Ezy3oBrKmSgfASm9",
154 "input": {
155 "location": "San Francisco, CA",
156 "units": "f"
157 },
158 "name": "get_weather",
159 "type": "tool_use",
160 "caller": {
161 "type": "direct"
162 }
163 }
164 ]
165 },
166 {
167 "role": "user",
168 "content": [
169 {
170 "type": "tool_result",
171 "tool_use_id": "toolu_01A9HHF5Ezy3oBrKmSgfASm9",
172 "content": "RuntimeError('Unexpected error, try again')",
173 "is_error": true
174 }
175 ]
176 }
177 ],
178 "model": "claude-haiku-4-5",
179 "tools": [
180 {
181 "name": "get_weather",
182 "description": "Lookup the weather for a given city in either celsius or fahrenheit",
183 "input_schema": {
184 "additionalProperties": false,
185 "properties": {
186 "location": {
187 "description": "The city and state, e.g. San Francisco, CA",
188 "title": "Location",
189 "type": "string"
190 },
191 "units": {
192 "description": "Unit for the output, either 'c' for celsius or 'f' for fahrenheit",
193 "enum": [
194 "c",
195 "f"
196 ],
197 "title": "Units",
198 "type": "string"
199 }
200 },
201 "required": [
202 "location",
203 "units"
204 ],
205 "type": "object"
206 }
207 }
208 ]
209 }
210 },
211 "response": {
212 "status_code": 200,
213 "headers": {
214 "content-type": "application/json",
215 "connection": "keep-alive",
216 "x-robots-tag": "none",
217 "strict-transport-security": "max-age=31536000; includeSubDomains; preload",
218 "server": "cloudflare",
219 "content-security-policy": "default-src 'none'; frame-ancestors 'none'",
220 "cf-cache-status": "DYNAMIC"
221 },
222 "body": {
223 "model": "claude-haiku-4-5-20251001",
224 "id": "msg_01GJyhkguJrrqMbZNzEybYFL",
225 "type": "message",
226 "role": "assistant",
227 "content": [
228 {
229 "type": "text",
230 "text": "I apologize, but I'm getting an error when trying to fetch the weather for San Francisco. This appears to be a temporary issue with the weather service. Could you try again in a moment, or let me know if you'd like me to attempt to retrieve the weather for a different location?"
231 }
232 ],
233 "stop_reason": "end_turn",
234 "stop_sequence": null,
235 "usage": {
236 "input_tokens": 760,
237 "cache_creation_input_tokens": 0,
238 "cache_read_input_tokens": 0,
239 "cache_creation": {
240 "ephemeral_5m_input_tokens": 0,
241 "ephemeral_1h_input_tokens": 0
242 },
243 "output_tokens": 63,
244 "service_tier": "standard",
245 "inference_geo": "not_available"
246 }
247 }
248 }
249 }
250 ]