Skip to content

Commit ed0fe8c

Browse files
committed
Merge branch 'main' into abhi-refactor-adk-to-integrations-api
2 parents d735951 + 92165c3 commit ed0fe8c

10 files changed

Lines changed: 785 additions & 285 deletions

py/src/braintrust/integrations/anthropic/cassettes/TestAnthropicIntegrationSetupAsyncSpans.test_setup_creates_async_spans.yaml renamed to py/src/braintrust/integrations/anthropic/cassettes/TestBatchesCreateSpans.test_async_batches_create_produces_span.yaml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
interactions:
22
- request:
3-
body: '{"max_tokens":100,"messages":[{"role":"user","content":"Say hi async"}],"model":"claude-3-5-haiku-latest"}'
3+
body: '{"requests":[{"custom_id":"req-1","params":{"model":"claude-3-haiku-20240307","max_tokens":100,"messages":[{"role":"user","content":"What
4+
is 2+2?"}]}},{"custom_id":"req-2","params":{"model":"claude-3-haiku-20240307","max_tokens":100,"messages":[{"role":"user","content":"What
5+
is 3+3?"}]}}]}'
46
headers:
57
Accept:
68
- application/json
@@ -9,7 +11,7 @@ interactions:
911
Connection:
1012
- keep-alive
1113
Content-Length:
12-
- '106'
14+
- '290'
1315
Content-Type:
1416
- application/json
1517
Host:
@@ -37,24 +39,23 @@ interactions:
3739
x-stainless-retry-count:
3840
- '0'
3941
x-stainless-timeout:
40-
- '600'
42+
- NOT_GIVEN
4143
method: POST
42-
uri: https://api.anthropic.com/v1/messages
44+
uri: https://api.anthropic.com/v1/messages/batches
4345
response:
4446
body:
45-
string: '{"type":"error","error":{"type":"not_found_error","message":"model:
46-
claude-3-5-haiku-latest"},"request_id":"req_011CZLdMZnqva1tBGWuemWN9"}'
47+
string: '{"id":"msgbatch_019LiP2CEHA2yQZT9HiJ7rQ3","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-03-24T16:48:33.250265+00:00","expires_at":"2026-03-25T16:48:33.250265+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}'
4748
headers:
4849
CF-RAY:
49-
- 9e101d82cf341fdb-SJC
50+
- 9e1729fe4c6b042c-SJC
5051
Connection:
5152
- keep-alive
5253
Content-Security-Policy:
5354
- default-src 'none'; frame-ancestors 'none'
5455
Content-Type:
5556
- application/json
5657
Date:
57-
- Mon, 23 Mar 2026 20:16:41 GMT
58+
- Tue, 24 Mar 2026 16:48:33 GMT
5859
Server:
5960
- cloudflare
6061
Transfer-Encoding:
@@ -66,23 +67,21 @@ interactions:
6667
cf-cache-status:
6768
- DYNAMIC
6869
content-length:
69-
- '138'
70+
- '361'
7071
request-id:
71-
- req_011CZLdMZnqva1tBGWuemWN9
72+
- req_011CZNFHubo6iV5DHippSpJq
7273
server-timing:
73-
- x-originResponse;dur=25
74+
- x-originResponse;dur=302
7475
set-cookie:
75-
- _cfuvid=O35oR1Sx8_qfQk2ct3bUq6P_LfxnelQS3AuhGTtAo3Q-1774297001.4099903-1.0.1.1-l__Wn1ND363h2RHwrTFmIqpFtWzPoIUNjQXrH1hjWyY;
76+
- _cfuvid=tCl0dHjx7QmH_ZAZsV5JZXo6iXr.5DKYZ6eTwVr3O9U-1774370913.0033047-1.0.1.1-98E2NulvgerP_hm8fJJmpfNnCka.CTGTjUyU0ueSaHY;
7677
HttpOnly; SameSite=None; Secure; Path=/; Domain=api.anthropic.com
7778
strict-transport-security:
7879
- max-age=31536000; includeSubDomains; preload
7980
vary:
8081
- Accept-Encoding
8182
x-envoy-upstream-service-time:
82-
- '23'
83-
x-should-retry:
84-
- 'false'
83+
- '300'
8584
status:
86-
code: 404
87-
message: Not Found
85+
code: 200
86+
message: OK
8887
version: 1

py/src/braintrust/integrations/anthropic/cassettes/TestAnthropicIntegrationSetupSpans.test_setup_creates_spans.yaml renamed to py/src/braintrust/integrations/anthropic/cassettes/TestBatchesCreateSpans.test_sync_batches_create_logs_error_on_failure.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"max_tokens":100,"messages":[{"role":"user","content":"Say hi"}],"model":"claude-3-5-haiku-latest"}'
3+
body: '{"requests":[]}'
44
headers:
55
Accept:
66
- application/json
@@ -9,7 +9,7 @@ interactions:
99
Connection:
1010
- keep-alive
1111
Content-Length:
12-
- '100'
12+
- '15'
1313
Content-Type:
1414
- application/json
1515
Host:
@@ -37,24 +37,24 @@ interactions:
3737
x-stainless-retry-count:
3838
- '0'
3939
x-stainless-timeout:
40-
- '600'
40+
- NOT_GIVEN
4141
method: POST
42-
uri: https://api.anthropic.com/v1/messages
42+
uri: https://api.anthropic.com/v1/messages/batches
4343
response:
4444
body:
45-
string: '{"type":"error","error":{"type":"not_found_error","message":"model:
46-
claude-3-5-haiku-latest"},"request_id":"req_011CZLdMYnZkfSiZUydAPCJh"}'
45+
string: '{"type":"error","error":{"type":"invalid_request_error","message":"requests:
46+
List should have at least 1 item after validation, not 0"},"request_id":"req_011CZNFHwZ7YMN9zyDPHXbmQ"}'
4747
headers:
4848
CF-RAY:
49-
- 9e101d81485f9e5c-SJC
49+
- 9e172a012bf5963f-SJC
5050
Connection:
5151
- keep-alive
5252
Content-Security-Policy:
5353
- default-src 'none'; frame-ancestors 'none'
5454
Content-Type:
5555
- application/json
5656
Date:
57-
- Mon, 23 Mar 2026 20:16:41 GMT
57+
- Tue, 24 Mar 2026 16:48:33 GMT
5858
Server:
5959
- cloudflare
6060
Transfer-Encoding:
@@ -66,23 +66,23 @@ interactions:
6666
cf-cache-status:
6767
- DYNAMIC
6868
content-length:
69-
- '138'
69+
- '180'
7070
request-id:
71-
- req_011CZLdMYnZkfSiZUydAPCJh
71+
- req_011CZNFHwZ7YMN9zyDPHXbmQ
7272
server-timing:
73-
- x-originResponse;dur=33
73+
- x-originResponse;dur=67
7474
set-cookie:
75-
- _cfuvid=qjfwtdMQuaH4s2MvMr53WG49MOjmHdRt83XWnDUSnZs-1774297001.1711438-1.0.1.1-6h3vTb4keZZALUiWWbTnUXgtrTuyB4XqC2sFuQc9fQk;
75+
- _cfuvid=wf8HdCMhs1UcbQutpPzsJc1I_lzHbLbPsQj6EA0sl4s-1774370913.461001-1.0.1.1-wD9j9Vl_k5M7qG3MI7A3pbi6Q52GLfngLxFm_kctpPo;
7676
HttpOnly; SameSite=None; Secure; Path=/; Domain=api.anthropic.com
7777
strict-transport-security:
7878
- max-age=31536000; includeSubDomains; preload
7979
vary:
8080
- Accept-Encoding
8181
x-envoy-upstream-service-time:
82-
- '31'
82+
- '65'
8383
x-should-retry:
8484
- 'false'
8585
status:
86-
code: 404
87-
message: Not Found
86+
code: 400
87+
message: Bad Request
8888
version: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
interactions:
2+
- request:
3+
body: '{"requests":[{"custom_id":"req-1","params":{"model":"claude-3-haiku-20240307","max_tokens":100,"messages":[{"role":"user","content":"Hi"}]}},{"custom_id":"req-2","params":{"model":"claude-3-5-haiku-latest","max_tokens":100,"messages":[{"role":"user","content":"Hello"}]}}]}'
4+
headers:
5+
Accept:
6+
- application/json
7+
Accept-Encoding:
8+
- gzip, deflate, zstd
9+
Connection:
10+
- keep-alive
11+
Content-Length:
12+
- '273'
13+
Content-Type:
14+
- application/json
15+
Host:
16+
- api.anthropic.com
17+
User-Agent:
18+
- Anthropic/Python 0.84.0
19+
X-Stainless-Arch:
20+
- arm64
21+
X-Stainless-Async:
22+
- 'false'
23+
X-Stainless-Lang:
24+
- python
25+
X-Stainless-OS:
26+
- MacOS
27+
X-Stainless-Package-Version:
28+
- 0.84.0
29+
X-Stainless-Runtime:
30+
- CPython
31+
X-Stainless-Runtime-Version:
32+
- 3.13.3
33+
anthropic-version:
34+
- '2023-06-01'
35+
x-stainless-read-timeout:
36+
- '600'
37+
x-stainless-retry-count:
38+
- '0'
39+
x-stainless-timeout:
40+
- NOT_GIVEN
41+
method: POST
42+
uri: https://api.anthropic.com/v1/messages/batches
43+
response:
44+
body:
45+
string: '{"id":"msgbatch_01Cq1688wP7FtQMAnsHr5G4Y","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-03-24T16:48:33.926161+00:00","expires_at":"2026-03-25T16:48:33.926161+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}'
46+
headers:
47+
CF-RAY:
48+
- 9e172a025ecd1fdb-SJC
49+
Connection:
50+
- keep-alive
51+
Content-Security-Policy:
52+
- default-src 'none'; frame-ancestors 'none'
53+
Content-Type:
54+
- application/json
55+
Date:
56+
- Tue, 24 Mar 2026 16:48:34 GMT
57+
Server:
58+
- cloudflare
59+
Transfer-Encoding:
60+
- chunked
61+
X-Robots-Tag:
62+
- none
63+
anthropic-organization-id:
64+
- 27796668-7351-40ac-acc4-024aee8995a5
65+
cf-cache-status:
66+
- DYNAMIC
67+
content-length:
68+
- '361'
69+
request-id:
70+
- req_011CZNFHxQDRZBhMWjsVMHQh
71+
server-timing:
72+
- x-originResponse;dur=327
73+
set-cookie:
74+
- _cfuvid=yDeqS1YweYY8i8ccTtSz_bw0CmmepS965cJPYQ4HCWE-1774370913.6565096-1.0.1.1-kTbTE.Sbl1JcCxMNIgb0nn9N_cAA7ECtmSuTerDB.zI;
75+
HttpOnly; SameSite=None; Secure; Path=/; Domain=api.anthropic.com
76+
strict-transport-security:
77+
- max-age=31536000; includeSubDomains; preload
78+
vary:
79+
- Accept-Encoding
80+
x-envoy-upstream-service-time:
81+
- '325'
82+
status:
83+
code: 200
84+
message: OK
85+
version: 1
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
interactions:
2+
- request:
3+
body: '{"requests":[{"custom_id":"req-1","params":{"model":"claude-3-haiku-20240307","max_tokens":100,"messages":[{"role":"user","content":"What
4+
is 2+2?"}]}},{"custom_id":"req-2","params":{"model":"claude-3-haiku-20240307","max_tokens":100,"messages":[{"role":"user","content":"What
5+
is 3+3?"}]}}]}'
6+
headers:
7+
Accept:
8+
- application/json
9+
Accept-Encoding:
10+
- gzip, deflate, zstd
11+
Connection:
12+
- keep-alive
13+
Content-Length:
14+
- '290'
15+
Content-Type:
16+
- application/json
17+
Host:
18+
- api.anthropic.com
19+
User-Agent:
20+
- Anthropic/Python 0.84.0
21+
X-Stainless-Arch:
22+
- arm64
23+
X-Stainless-Async:
24+
- 'false'
25+
X-Stainless-Lang:
26+
- python
27+
X-Stainless-OS:
28+
- MacOS
29+
X-Stainless-Package-Version:
30+
- 0.84.0
31+
X-Stainless-Runtime:
32+
- CPython
33+
X-Stainless-Runtime-Version:
34+
- 3.13.3
35+
anthropic-version:
36+
- '2023-06-01'
37+
x-stainless-read-timeout:
38+
- '600'
39+
x-stainless-retry-count:
40+
- '0'
41+
x-stainless-timeout:
42+
- NOT_GIVEN
43+
method: POST
44+
uri: https://api.anthropic.com/v1/messages/batches
45+
response:
46+
body:
47+
string: '{"id":"msgbatch_01AGJo81SZkaPs6vyZzDWPdP","type":"message_batch","processing_status":"in_progress","request_counts":{"processing":2,"succeeded":0,"errored":0,"canceled":0,"expired":0},"ended_at":null,"created_at":"2026-03-24T16:48:32.769942+00:00","expires_at":"2026-03-25T16:48:32.769942+00:00","archived_at":null,"cancel_initiated_at":null,"results_url":null}'
48+
headers:
49+
CF-RAY:
50+
- 9e1729fb1b493824-SJC
51+
Connection:
52+
- keep-alive
53+
Content-Security-Policy:
54+
- default-src 'none'; frame-ancestors 'none'
55+
Content-Type:
56+
- application/json
57+
Date:
58+
- Tue, 24 Mar 2026 16:48:32 GMT
59+
Server:
60+
- cloudflare
61+
Transfer-Encoding:
62+
- chunked
63+
X-Robots-Tag:
64+
- none
65+
anthropic-organization-id:
66+
- 27796668-7351-40ac-acc4-024aee8995a5
67+
cf-cache-status:
68+
- DYNAMIC
69+
content-length:
70+
- '361'
71+
request-id:
72+
- req_011CZNFHsS4jkRnAp2QVhfjZ
73+
server-timing:
74+
- x-originResponse;dur=325
75+
set-cookie:
76+
- _cfuvid=sNY6UUL2YIBy6w1kKrRez1Z82ZXsyNQVqBw3YyCGBQs-1774370912.495851-1.0.1.1-IyHcfjRHrdCZ0rzZZa7kqpMFe32i22VC65d87W8gKqM;
77+
HttpOnly; SameSite=None; Secure; Path=/; Domain=api.anthropic.com
78+
strict-transport-security:
79+
- max-age=31536000; includeSubDomains; preload
80+
vary:
81+
- Accept-Encoding
82+
x-envoy-upstream-service-time:
83+
- '323'
84+
status:
85+
code: 200
86+
message: OK
87+
version: 1

0 commit comments

Comments
 (0)