Skip to content

Commit d9b7fb1

Browse files
committed
Fix multi-modal tool output tests
1 parent bffbe4f commit d9b7fb1

8 files changed

+83
-89
lines changed

tests/models/cassettes/test_anthropic/test_image_as_binary_content_tool_response.yaml

+16-16
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interactions:
88
connection:
99
- keep-alive
1010
content-length:
11-
- '361'
11+
- '355'
1212
content-type:
1313
- application/json
1414
host:
@@ -18,7 +18,7 @@ interactions:
1818
max_tokens: 1024
1919
messages:
2020
- content:
21-
- text: What fruit is in the image you have access to via the get_image tool?
21+
- text: What fruit is in the image you can get from the get_image tool?
2222
type: text
2323
role: user
2424
model: claude-3-5-sonnet-latest
@@ -47,11 +47,11 @@ interactions:
4747
content:
4848
- text: Let me get the image and check what fruit it contains.
4949
type: text
50-
- id: toolu_01QGR8bP8KBcWZndsMrXMrP6
50+
- id: toolu_01GP7S71uzF8HZJLLzBFhCGp
5151
input: {}
5252
name: get_image
5353
type: tool_use
54-
id: msg_01PgghaQxK7X37k4mhPbb4CF
54+
id: msg_01NK8ACxV17ivNMiRxpE6Wm3
5555
model: claude-3-5-sonnet-20241022
5656
role: assistant
5757
stop_reason: tool_use
@@ -60,7 +60,7 @@ interactions:
6060
usage:
6161
cache_creation_input_tokens: 0
6262
cache_read_input_tokens: 0
63-
input_tokens: 373
63+
input_tokens: 372
6464
output_tokens: 49
6565
status:
6666
code: 200
@@ -74,7 +74,7 @@ interactions:
7474
connection:
7575
- keep-alive
7676
content-length:
77-
- '2780310'
77+
- '2780295'
7878
content-type:
7979
- application/json
8080
host:
@@ -84,21 +84,21 @@ interactions:
8484
max_tokens: 1024
8585
messages:
8686
- content:
87-
- text: What fruit is in the image you have access to via the get_image tool?
87+
- text: What fruit is in the image you can get from the get_image tool?
8888
type: text
8989
role: user
9090
- content:
9191
- text: Let me get the image and check what fruit it contains.
9292
type: text
93-
- id: toolu_01QGR8bP8KBcWZndsMrXMrP6
93+
- id: toolu_01GP7S71uzF8HZJLLzBFhCGp
9494
input: {}
9595
name: get_image
9696
type: tool_use
9797
role: assistant
9898
- content:
99-
- content: See attached file 1.
99+
- content: See file 1.
100100
is_error: false
101-
tool_use_id: toolu_01QGR8bP8KBcWZndsMrXMrP6
101+
tool_use_id: toolu_01GP7S71uzF8HZJLLzBFhCGp
102102
type: tool_result
103103
- text: 'This is file 1:'
104104
type: text
@@ -125,18 +125,18 @@ interactions:
125125
connection:
126126
- keep-alive
127127
content-length:
128-
- '559'
128+
- '631'
129129
content-type:
130130
- application/json
131131
transfer-encoding:
132132
- chunked
133133
parsed_body:
134134
content:
135135
- text: The image shows a kiwi fruit that has been cut in half, displaying its characteristic bright green flesh with
136-
small black seeds arranged in a circular pattern around a white center core. The kiwi's fuzzy brown skin is visible
137-
around the edges of the slice.
136+
small black seeds arranged in a circular pattern around a white center core. The slice shows the typical cross-section
137+
view of a kiwi with its distinctive radiating pattern and fuzzy brown skin visible around the edge.
138138
type: text
139-
id: msg_01FUHKDCoBBwfENKjKLZkyiz
139+
id: msg_01Tz1ufijp4cKBCMwfXsirYq
140140
model: claude-3-5-sonnet-20241022
141141
role: assistant
142142
stop_reason: end_turn
@@ -145,8 +145,8 @@ interactions:
145145
usage:
146146
cache_creation_input_tokens: 0
147147
cache_read_input_tokens: 0
148-
input_tokens: 2021
149-
output_tokens: 57
148+
input_tokens: 2019
149+
output_tokens: 69
150150
status:
151151
code: 200
152152
message: OK

tests/models/cassettes/test_gemini/test_image_as_binary_content_tool_response.yaml

+18-18
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interactions:
88
connection:
99
- keep-alive
1010
content-length:
11-
- '195'
11+
- '189'
1212
content-type:
1313
- application/json
1414
host:
@@ -17,7 +17,7 @@ interactions:
1717
parsed_body:
1818
contents:
1919
- parts:
20-
- text: What fruit is in the image you have access to via the get_image tool?
20+
- text: What fruit is in the image you can get from the get_image tool?
2121
role: user
2222
tools:
2323
function_declarations:
@@ -33,7 +33,7 @@ interactions:
3333
content-type:
3434
- application/json; charset=UTF-8
3535
server-timing:
36-
- gfet4t7; dur=2278
36+
- gfet4t7; dur=3372
3737
transfer-encoding:
3838
- chunked
3939
vary:
@@ -55,13 +55,13 @@ interactions:
5555
index: 0
5656
modelVersion: gemini-2.5-pro-preview-03-25
5757
usageMetadata:
58-
candidatesTokenCount: 195
59-
promptTokenCount: 39
58+
candidatesTokenCount: 175
59+
promptTokenCount: 38
6060
promptTokensDetails:
6161
- modality: TEXT
62-
tokenCount: 39
63-
thoughtsTokenCount: 167
64-
totalTokenCount: 234
62+
tokenCount: 38
63+
thoughtsTokenCount: 147
64+
totalTokenCount: 213
6565
status:
6666
code: 200
6767
message: OK
@@ -74,7 +74,7 @@ interactions:
7474
connection:
7575
- keep-alive
7676
content-length:
77-
- '2780011'
77+
- '2780005'
7878
content-type:
7979
- application/json
8080
host:
@@ -83,7 +83,7 @@ interactions:
8383
parsed_body:
8484
contents:
8585
- parts:
86-
- text: What fruit is in the image you have access to via the get_image tool?
86+
- text: What fruit is in the image you can get from the get_image tool?
8787
role: user
8888
- parts:
8989
- text: |+
@@ -113,11 +113,11 @@ interactions:
113113
alt-svc:
114114
- h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
115115
content-length:
116-
- '654'
116+
- '632'
117117
content-type:
118118
- application/json; charset=UTF-8
119119
server-timing:
120-
- gfet4t7; dur=9880
120+
- gfet4t7; dur=73564
121121
transfer-encoding:
122122
- chunked
123123
vary:
@@ -128,21 +128,21 @@ interactions:
128128
candidates:
129129
- content:
130130
parts:
131-
- text: The image shows a cross-section of a kiwifruit (often called kiwi).
131+
- text: The image shows a kiwi fruit, sliced in half.
132132
role: model
133133
finishReason: STOP
134134
index: 0
135135
modelVersion: gemini-2.5-pro-preview-03-25
136136
usageMetadata:
137-
candidatesTokenCount: 266
138-
promptTokenCount: 354
137+
candidatesTokenCount: 294
138+
promptTokenCount: 353
139139
promptTokensDetails:
140140
- modality: TEXT
141-
tokenCount: 96
141+
tokenCount: 95
142142
- modality: IMAGE
143143
tokenCount: 258
144-
thoughtsTokenCount: 249
145-
totalTokenCount: 620
144+
thoughtsTokenCount: 283
145+
totalTokenCount: 647
146146
status:
147147
code: 200
148148
message: OK

tests/models/cassettes/test_openai/test_image_as_binary_content_tool_response.yaml

+20-20
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interactions:
88
connection:
99
- keep-alive
1010
content-length:
11-
- '351'
11+
- '345'
1212
content-type:
1313
- application/json
1414
host:
@@ -17,7 +17,7 @@ interactions:
1717
parsed_body:
1818
messages:
1919
- content:
20-
- text: What fruit is in the image you have access to via the get_image tool?
20+
- text: What fruit is in the image you can get from the get_image tool?
2121
type: text
2222
role: user
2323
model: gpt-4o
@@ -49,7 +49,7 @@ interactions:
4949
openai-organization:
5050
- pydantic-28gund
5151
openai-processing-ms:
52-
- '390'
52+
- '408'
5353
openai-version:
5454
- '2020-10-01'
5555
strict-transport-security:
@@ -70,10 +70,10 @@ interactions:
7070
- function:
7171
arguments: '{}'
7272
name: get_image
73-
id: call_uiV1vG3liYlFd03A63hN0Ngh
73+
id: call_CzWeF2Dl3IjNLuItiMyJVtbG
7474
type: function
75-
created: 1744928565
76-
id: chatcmpl-BNRv3POfvMj6OulsODRijJ86Rp2yT
75+
created: 1744932074
76+
id: chatcmpl-BNSpeh1GuHnSUNaFuTQRGFCB5KJvG
7777
model: gpt-4o-2024-08-06
7878
object: chat.completion
7979
service_tier: default
@@ -85,11 +85,11 @@ interactions:
8585
audio_tokens: 0
8686
reasoning_tokens: 0
8787
rejected_prediction_tokens: 0
88-
prompt_tokens: 47
88+
prompt_tokens: 46
8989
prompt_tokens_details:
9090
audio_tokens: 0
9191
cached_tokens: 0
92-
total_tokens: 58
92+
total_tokens: 57
9393
status:
9494
code: 200
9595
message: OK
@@ -102,31 +102,31 @@ interactions:
102102
connection:
103103
- keep-alive
104104
content-length:
105-
- '2780195'
105+
- '2780189'
106106
content-type:
107107
- application/json
108108
cookie:
109-
- __cf_bm=A9QuwCuwm.MTzQmjDUAdJUwjkNmnw1OHxwmdZD3UVXA-1744928566-1.0.1.1-._MyKdRVsYIjdlxhZzFxu7Q7V4_cZ3wvYOHj9c_OPJJ1w6SYmuUODvCsgLH3LTyW1SlohO5kEKmOuvQgK0zjM2vlBzQQaejmPVJz.3_faPA;
110-
_cfuvid=n8GaXGmWNkc5zyzUn1iDyW9EPB3ZC6c8tsYBMXY9YHU-1744928566265-0.0.1.1-604800000
109+
- __cf_bm=77NF3JW0pM_C2Y_jR67Otekbn.jbMyHXL_KFz_0umvc-1744932074-1.0.1.1-LaMaPUTc90PPf8ruLRh0TSZZZp0ng0GcDyoN3DaNRhSvEXoIavc5fYa.1cvsDCVzqrIPkL9rwDR7HMIW.txKhLM.LlIf2SDxn05J95VGXK8;
110+
_cfuvid=ApBVMIPFw_HcDumjoezdbFZB6CZeUDcJGGaH8sskwyE-1744932074434-0.0.1.1-604800000
111111
host:
112112
- api.openai.com
113113
method: POST
114114
parsed_body:
115115
messages:
116116
- content:
117-
- text: What fruit is in the image you have access to via the get_image tool?
117+
- text: What fruit is in the image you can get from the get_image tool?
118118
type: text
119119
role: user
120120
- role: assistant
121121
tool_calls:
122122
- function:
123123
arguments: '{}'
124124
name: get_image
125-
id: call_uiV1vG3liYlFd03A63hN0Ngh
125+
id: call_CzWeF2Dl3IjNLuItiMyJVtbG
126126
type: function
127127
- content: See file 1.
128128
role: tool
129-
tool_call_id: call_uiV1vG3liYlFd03A63hN0Ngh
129+
tool_call_id: call_CzWeF2Dl3IjNLuItiMyJVtbG
130130
- content:
131131
- text: 'This is file 1:'
132132
type: text
@@ -163,7 +163,7 @@ interactions:
163163
openai-organization:
164164
- pydantic-28gund
165165
openai-processing-ms:
166-
- '2811'
166+
- '2217'
167167
openai-version:
168168
- '2020-10-01'
169169
strict-transport-security:
@@ -180,24 +180,24 @@ interactions:
180180
content: The fruit in the image is a kiwi.
181181
refusal: null
182182
role: assistant
183-
created: 1744928576
184-
id: chatcmpl-BNRvE0I0IfUk7lD6DgsVBDR1vk3ok
183+
created: 1744932148
184+
id: chatcmpl-BNSqqDpkpAR2xYTCOEodG8nVxKHLm
185185
model: gpt-4o-2024-08-06
186186
object: chat.completion
187187
service_tier: default
188-
system_fingerprint: fp_90122d973c
188+
system_fingerprint: fp_55d88aaf2f
189189
usage:
190190
completion_tokens: 11
191191
completion_tokens_details:
192192
accepted_prediction_tokens: 0
193193
audio_tokens: 0
194194
reasoning_tokens: 0
195195
rejected_prediction_tokens: 0
196-
prompt_tokens: 1181
196+
prompt_tokens: 1180
197197
prompt_tokens_details:
198198
audio_tokens: 0
199199
cached_tokens: 0
200-
total_tokens: 1192
200+
total_tokens: 1191
201201
status:
202202
code: 200
203203
message: OK

0 commit comments

Comments
 (0)