Skip to content

Commit fa78fad

Browse files
committed
smaller image
1 parent 4f469c5 commit fa78fad

5 files changed

Lines changed: 465 additions & 1 deletion

File tree

-1.87 MB
Loading

py/src/braintrust/integrations/google_genai/cassettes/test_image_input.yaml

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

py/src/braintrust/integrations/langchain/cassettes/test_async_streaming.yaml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,134 @@ interactions:
125125
status:
126126
code: 200
127127
message: OK
128+
- request:
129+
body: '{"messages":[{"content":"Count from 1 to 3.","role":"user"}],"model":"gpt-4o-mini","max_completion_tokens":20,"stream":true,"stream_options":{"include_usage":true}}'
130+
headers:
131+
Accept:
132+
- application/json
133+
Accept-Encoding:
134+
- gzip, deflate, zstd
135+
Connection:
136+
- keep-alive
137+
Content-Length:
138+
- '164'
139+
Content-Type:
140+
- application/json
141+
Host:
142+
- api.openai.com
143+
User-Agent:
144+
- AsyncOpenAI/Python 2.31.0
145+
X-Stainless-Arch:
146+
- arm64
147+
X-Stainless-Async:
148+
- async:asyncio
149+
X-Stainless-Lang:
150+
- python
151+
X-Stainless-OS:
152+
- MacOS
153+
X-Stainless-Package-Version:
154+
- 2.31.0
155+
X-Stainless-Runtime:
156+
- CPython
157+
X-Stainless-Runtime-Version:
158+
- 3.13.3
159+
x-stainless-retry-count:
160+
- '0'
161+
method: POST
162+
uri: https://api.openai.com/v1/chat/completions
163+
response:
164+
body:
165+
string: 'data: {"id":"chatcmpl-DSVQD1XBoWXUGKVtNfL8ror4fge5n","object":"chat.completion.chunk","created":1775686341,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_218cd55417","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2lKrYc8ty"}
166+
167+
168+
data: {"id":"chatcmpl-DSVQD1XBoWXUGKVtNfL8ror4fge5n","object":"chat.completion.chunk","created":1775686341,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_218cd55417","choices":[{"index":0,"delta":{"content":"1"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wVbCzAcpKp"}
169+
170+
171+
data: {"id":"chatcmpl-DSVQD1XBoWXUGKVtNfL8ror4fge5n","object":"chat.completion.chunk","created":1775686341,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_218cd55417","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"m6WwxJtpRf"}
172+
173+
174+
data: {"id":"chatcmpl-DSVQD1XBoWXUGKVtNfL8ror4fge5n","object":"chat.completion.chunk","created":1775686341,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_218cd55417","choices":[{"index":0,"delta":{"content":"
175+
"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"H8D4HcHIkp"}
176+
177+
178+
data: {"id":"chatcmpl-DSVQD1XBoWXUGKVtNfL8ror4fge5n","object":"chat.completion.chunk","created":1775686341,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_218cd55417","choices":[{"index":0,"delta":{"content":"2"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"O2NmPCE95k"}
179+
180+
181+
data: {"id":"chatcmpl-DSVQD1XBoWXUGKVtNfL8ror4fge5n","object":"chat.completion.chunk","created":1775686341,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_218cd55417","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"8KkES6B5jM"}
182+
183+
184+
data: {"id":"chatcmpl-DSVQD1XBoWXUGKVtNfL8ror4fge5n","object":"chat.completion.chunk","created":1775686341,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_218cd55417","choices":[{"index":0,"delta":{"content":"
185+
"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KKKb8GOZy5"}
186+
187+
188+
data: {"id":"chatcmpl-DSVQD1XBoWXUGKVtNfL8ror4fge5n","object":"chat.completion.chunk","created":1775686341,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_218cd55417","choices":[{"index":0,"delta":{"content":"3"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"nVIteT42as"}
189+
190+
191+
data: {"id":"chatcmpl-DSVQD1XBoWXUGKVtNfL8ror4fge5n","object":"chat.completion.chunk","created":1775686341,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_218cd55417","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"35Svi7dgcD"}
192+
193+
194+
data: {"id":"chatcmpl-DSVQD1XBoWXUGKVtNfL8ror4fge5n","object":"chat.completion.chunk","created":1775686341,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_218cd55417","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"ztlc3"}
195+
196+
197+
data: {"id":"chatcmpl-DSVQD1XBoWXUGKVtNfL8ror4fge5n","object":"chat.completion.chunk","created":1775686341,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_218cd55417","choices":[],"usage":{"prompt_tokens":15,"completion_tokens":8,"total_tokens":23,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"yzAsW1Rd5HV"}
198+
199+
200+
data: [DONE]
201+
202+
203+
'
204+
headers:
205+
CF-Cache-Status:
206+
- DYNAMIC
207+
CF-Ray:
208+
- 9e949cf3a88eac33-YYZ
209+
Connection:
210+
- keep-alive
211+
Content-Type:
212+
- text/event-stream; charset=utf-8
213+
Date:
214+
- Wed, 08 Apr 2026 22:12:21 GMT
215+
Server:
216+
- cloudflare
217+
Strict-Transport-Security:
218+
- max-age=31536000; includeSubDomains; preload
219+
Transfer-Encoding:
220+
- chunked
221+
X-Content-Type-Options:
222+
- nosniff
223+
access-control-expose-headers:
224+
- X-Request-ID
225+
alt-svc:
226+
- h3=":443"; ma=86400
227+
openai-organization:
228+
- braintrust-data
229+
openai-processing-ms:
230+
- '175'
231+
openai-project:
232+
- proj_vsCSXafhhByzWOThMrJcZiw9
233+
openai-version:
234+
- '2020-10-01'
235+
set-cookie:
236+
- __cf_bm=wWzXTdF6CD7dt_ng4krmunwfJ3QRNotQ5WjeljxtF60-1775686341.7039106-1.0.1.1-i9Z0MoJ2Mldu3bDD6YLr3qdUueyLDItjj8.S_WMT.pSMR.E2y6a18w3jB6TS25AQ926x8fQgs5i0qbqibgrr7utK84.JQ7abVo8.Q1BRwQKaazqWl1VNe6.fHvfHP3iJ;
237+
HttpOnly; Secure; Path=/; Domain=api.openai.com; Expires=Wed, 08 Apr 2026
238+
22:42:21 GMT
239+
x-openai-proxy-wasm:
240+
- v0.1
241+
x-ratelimit-limit-requests:
242+
- '30000'
243+
x-ratelimit-limit-tokens:
244+
- '150000000'
245+
x-ratelimit-remaining-requests:
246+
- '29999'
247+
x-ratelimit-remaining-tokens:
248+
- '149999992'
249+
x-ratelimit-reset-requests:
250+
- 2ms
251+
x-ratelimit-reset-tokens:
252+
- 0s
253+
x-request-id:
254+
- req_2d691066e35d422d9ddf15b9c6620be3
255+
status:
256+
code: 200
257+
message: OK
128258
version: 1

py/src/braintrust/integrations/langchain/cassettes/test_image_input.yaml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,121 @@ interactions:
2525
status:
2626
code: 200
2727
message: OK
28+
- request:
29+
body: '{"messages":[{"content":[{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwADhQGAWjR9awAAAABJRU5ErkJggg=="}},{"type":"text","text":"What
30+
color is this image?"}],"role":"user"}],"model":"gpt-4o-mini","stream":false}'
31+
headers:
32+
Accept:
33+
- application/json
34+
Accept-Encoding:
35+
- gzip, deflate, zstd
36+
Connection:
37+
- keep-alive
38+
Content-Length:
39+
- '2611620'
40+
Content-Type:
41+
- application/json
42+
Host:
43+
- api.openai.com
44+
User-Agent:
45+
- OpenAI/Python 2.31.0
46+
X-Stainless-Arch:
47+
- arm64
48+
X-Stainless-Async:
49+
- 'false'
50+
X-Stainless-Lang:
51+
- python
52+
X-Stainless-OS:
53+
- MacOS
54+
X-Stainless-Package-Version:
55+
- 2.31.0
56+
X-Stainless-Raw-Response:
57+
- 'true'
58+
X-Stainless-Runtime:
59+
- CPython
60+
X-Stainless-Runtime-Version:
61+
- 3.13.3
62+
x-stainless-retry-count:
63+
- '0'
64+
method: POST
65+
uri: https://api.openai.com/v1/chat/completions
66+
response:
67+
body:
68+
string: "{\n \"id\": \"chatcmpl-DSVQ87v966X0mSkkofnHHz4EwHUQY\",\n \"object\":
69+
\"chat.completion\",\n \"created\": 1775686336,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
70+
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
71+
\"assistant\",\n \"content\": \"The image primarily features dark hues
72+
such as deep blues and grays, representing stormy skies and turbulent seas.
73+
There are also vibrant turquoise and white tones in the waves, creating a
74+
striking contrast against the darker backdrop. The overall mood is dramatic
75+
and intense, reflecting a stormy maritime scene.\",\n \"refusal\":
76+
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
77+
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
78+
25514,\n \"completion_tokens\": 58,\n \"total_tokens\": 25572,\n \"prompt_tokens_details\":
79+
{\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
80+
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
81+
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
82+
\"default\",\n \"system_fingerprint\": \"fp_a5086b7b9a\"\n}\n"
83+
headers:
84+
CF-Cache-Status:
85+
- DYNAMIC
86+
CF-Ray:
87+
- 9e949cc799cfb8f3-YYZ
88+
Connection:
89+
- keep-alive
90+
Content-Type:
91+
- application/json
92+
Date:
93+
- Wed, 08 Apr 2026 22:12:18 GMT
94+
Server:
95+
- cloudflare
96+
Strict-Transport-Security:
97+
- max-age=31536000; includeSubDomains; preload
98+
Transfer-Encoding:
99+
- chunked
100+
X-Content-Type-Options:
101+
- nosniff
102+
access-control-expose-headers:
103+
- X-Request-ID
104+
alt-svc:
105+
- h3=":443"; ma=86400
106+
content-length:
107+
- '1126'
108+
openai-organization:
109+
- braintrust-data
110+
openai-processing-ms:
111+
- '2465'
112+
openai-project:
113+
- proj_vsCSXafhhByzWOThMrJcZiw9
114+
openai-version:
115+
- '2020-10-01'
116+
set-cookie:
117+
- __cf_bm=G_Unvq0_4F3JXhBdmloUfKpQgDuRI1QdATA8QAYy8FM-1775686334.6570866-1.0.1.1-0kWt.Ec8Y93mWUCwh1emHBSSKY3oMRrEx46uvbbcgc_.RH2FT_1_QCJc_hxokqf7yt1X8qFtSbCulDMCm1I7Ftl_rfWFL9vdD07xEW0bFpsEhcnKow2yuq.SIgEe.0Lz;
118+
HttpOnly; Secure; Path=/; Domain=api.openai.com; Expires=Wed, 08 Apr 2026
119+
22:42:18 GMT
120+
x-openai-proxy-wasm:
121+
- v0.1
122+
x-ratelimit-limit-input-images:
123+
- '50000'
124+
x-ratelimit-limit-requests:
125+
- '30000'
126+
x-ratelimit-limit-tokens:
127+
- '150000000'
128+
x-ratelimit-remaining-input-images:
129+
- '49999'
130+
x-ratelimit-remaining-requests:
131+
- '29999'
132+
x-ratelimit-remaining-tokens:
133+
- '149999227'
134+
x-ratelimit-reset-input-images:
135+
- 1ms
136+
x-ratelimit-reset-requests:
137+
- 2ms
138+
x-ratelimit-reset-tokens:
139+
- 0s
140+
x-request-id:
141+
- req_ca1b62c4dd0e49c680388c064f82ad3f
142+
status:
143+
code: 200
144+
message: OK
28145
version: 1

0 commit comments

Comments
 (0)