Debian Codegraph @

tests/lib/_parse/__inline_snapshot__/test_messages/TestAsyncStream/a8b7dbb8-2321-4624-abdb-7ba2136b5c38.json

raw
1 [
2 {
3 "request": {
4 "method": "POST",
5 "url": "https://api.anthropic.com/v1/messages",
6 "headers": {
7 "host": "api.anthropic.com",
8 "accept-encoding": "gzip, deflate",
9 "connection": "keep-alive",
10 "x-stainless-timeout": "NOT_GIVEN",
11 "accept": "application/json",
12 "content-type": "application/json",
13 "user-agent": "AsyncAnthropic/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": "async:asyncio",
21 "anthropic-version": "2023-06-01",
22 "x-stainless-helper-method": "stream",
23 "x-stainless-stream-helper": "messages",
24 "x-stainless-retry-count": "0",
25 "x-stainless-read-timeout": "600",
26 "content-length": "276"
27 },
28 "body": {
29 "max_tokens": 1024,
30 "messages": [
31 {
32 "role": "user",
33 "content": "Extract order IDs from the following text:\n\nOrder 12345\nOrder 67890"
34 }
35 ],
36 "model": "claude-sonnet-4-5",
37 "output_config": {
38 "format": {
39 "type": "json_schema",
40 "schema": {
41 "type": "array",
42 "items": {
43 "type": "integer"
44 }
45 }
46 }
47 },
48 "stream": true
49 }
50 },
51 "response": {
52 "status_code": 429,
53 "headers": {
54 "content-type": "application/json",
55 "content-length": "606",
56 "connection": "keep-alive",
57 "x-should-retry": "true",
58 "strict-transport-security": "max-age=31536000; includeSubDomains; preload",
59 "server": "cloudflare",
60 "cf-cache-status": "DYNAMIC",
61 "x-robots-tag": "none",
62 "content-security-policy": "default-src 'none'; frame-ancestors 'none'"
63 },
64 "body": {
65 "type": "error",
66 "error": {
67 "type": "rate_limit_error",
68 "message": "This request would exceed your organization's rate limit of 20,000,000 prompt bytes per hour (org: 5576611f-a1ee-427c-9800-298d9579899c, model: claude-sonnet-4-5-20250929). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://www.anthropic.com/contact-sales to discuss your options for a rate limit increase."
69 },
70 "request_id": "req_011CYK5n67SytMUxm8WMZUWY"
71 }
72 }
73 },
74 {
75 "request": {
76 "method": "POST",
77 "url": "https://api.anthropic.com/v1/messages",
78 "headers": {
79 "host": "api.anthropic.com",
80 "accept-encoding": "gzip, deflate",
81 "connection": "keep-alive",
82 "x-stainless-timeout": "NOT_GIVEN",
83 "accept": "application/json",
84 "content-type": "application/json",
85 "user-agent": "AsyncAnthropic/Python 0.82.0",
86 "x-stainless-lang": "python",
87 "x-stainless-package-version": "0.82.0",
88 "x-stainless-os": "MacOS",
89 "x-stainless-arch": "arm64",
90 "x-stainless-runtime": "CPython",
91 "x-stainless-runtime-version": "3.9.18",
92 "x-stainless-async": "async:asyncio",
93 "anthropic-version": "2023-06-01",
94 "x-stainless-helper-method": "stream",
95 "x-stainless-stream-helper": "messages",
96 "x-stainless-retry-count": "1",
97 "x-stainless-read-timeout": "600",
98 "content-length": "276"
99 },
100 "body": {
101 "max_tokens": 1024,
102 "messages": [
103 {
104 "role": "user",
105 "content": "Extract order IDs from the following text:\n\nOrder 12345\nOrder 67890"
106 }
107 ],
108 "model": "claude-sonnet-4-5",
109 "output_config": {
110 "format": {
111 "type": "json_schema",
112 "schema": {
113 "type": "array",
114 "items": {
115 "type": "integer"
116 }
117 }
118 }
119 },
120 "stream": true
121 }
122 },
123 "response": {
124 "status_code": 429,
125 "headers": {
126 "content-type": "application/json",
127 "content-length": "606",
128 "connection": "keep-alive",
129 "x-should-retry": "true",
130 "strict-transport-security": "max-age=31536000; includeSubDomains; preload",
131 "server": "cloudflare",
132 "cf-cache-status": "DYNAMIC",
133 "x-robots-tag": "none",
134 "content-security-policy": "default-src 'none'; frame-ancestors 'none'"
135 },
136 "body": {
137 "type": "error",
138 "error": {
139 "type": "rate_limit_error",
140 "message": "This request would exceed your organization's rate limit of 20,000,000 prompt bytes per hour (org: 5576611f-a1ee-427c-9800-298d9579899c, model: claude-sonnet-4-5-20250929). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://www.anthropic.com/contact-sales to discuss your options for a rate limit increase."
141 },
142 "request_id": "req_011CYK5n94JW2KDxvEjTDLeR"
143 }
144 }
145 },
146 {
147 "request": {
148 "method": "POST",
149 "url": "https://api.anthropic.com/v1/messages",
150 "headers": {
151 "host": "api.anthropic.com",
152 "accept-encoding": "gzip, deflate",
153 "connection": "keep-alive",
154 "x-stainless-timeout": "NOT_GIVEN",
155 "accept": "application/json",
156 "content-type": "application/json",
157 "user-agent": "AsyncAnthropic/Python 0.82.0",
158 "x-stainless-lang": "python",
159 "x-stainless-package-version": "0.82.0",
160 "x-stainless-os": "MacOS",
161 "x-stainless-arch": "arm64",
162 "x-stainless-runtime": "CPython",
163 "x-stainless-runtime-version": "3.9.18",
164 "x-stainless-async": "async:asyncio",
165 "anthropic-version": "2023-06-01",
166 "x-stainless-helper-method": "stream",
167 "x-stainless-stream-helper": "messages",
168 "x-stainless-retry-count": "2",
169 "x-stainless-read-timeout": "600",
170 "content-length": "276"
171 },
172 "body": {
173 "max_tokens": 1024,
174 "messages": [
175 {
176 "role": "user",
177 "content": "Extract order IDs from the following text:\n\nOrder 12345\nOrder 67890"
178 }
179 ],
180 "model": "claude-sonnet-4-5",
181 "output_config": {
182 "format": {
183 "type": "json_schema",
184 "schema": {
185 "type": "array",
186 "items": {
187 "type": "integer"
188 }
189 }
190 }
191 },
192 "stream": true
193 }
194 },
195 "response": {
196 "status_code": 200,
197 "headers": {
198 "content-type": "text/event-stream; charset=utf-8",
199 "connection": "keep-alive",
200 "cache-control": "no-cache",
201 "strict-transport-security": "max-age=31536000; includeSubDomains; preload",
202 "server": "cloudflare",
203 "cf-cache-status": "DYNAMIC",
204 "x-robots-tag": "none",
205 "content-security-policy": "default-src 'none'; frame-ancestors 'none'"
206 },
207 "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"model\":\"claude-sonnet-4-5-20250929\",\"id\":\"msg_013nnniYDrJDocdy5nrMU7cH\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":135,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":1,\"service_tier\":\"standard\",\"inference_geo\":\"not_available\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"[\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"12\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"345,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"67890]\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":135,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":10} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n"
208 }
209 }
210 ]