You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/verifications/openai_api/fixtures/test_cases/chat_completion.yaml
+218Lines changed: 218 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -131,3 +131,221 @@ test_tool_calling:
131
131
type: object
132
132
type: function
133
133
output: get_weather_tool_call
134
+
135
+
test_chat_multi_turn_tool_calling:
136
+
test_name: test_chat_multi_turn_tool_calling
137
+
test_params:
138
+
case:
139
+
- case_id: "text_then_weather_tool"
140
+
input:
141
+
messages:
142
+
- - role: user
143
+
content: "What's the name of the Sun in latin?"
144
+
- - role: user
145
+
content: "What's the weather like in San Francisco?"
146
+
tools:
147
+
- function:
148
+
description: Get the current weather
149
+
name: get_weather
150
+
parameters:
151
+
type: object
152
+
properties:
153
+
location:
154
+
description: "The city and state (both required), e.g. San Francisco, CA."
155
+
type: string
156
+
required: ["location"]
157
+
type: function
158
+
tool_responses:
159
+
- response: "{'response': '70 degrees and foggy'}"
160
+
expected:
161
+
- num_tool_calls: 0
162
+
answer: ["sol"]
163
+
- num_tool_calls: 1
164
+
tool_name: get_weather
165
+
tool_arguments:
166
+
location: "San Francisco, CA"
167
+
- num_tool_calls: 0
168
+
answer: ["foggy", "70 degrees"]
169
+
- case_id: "weather_tool_then_text"
170
+
input:
171
+
messages:
172
+
- - role: user
173
+
content: "What's the weather like in San Francisco?"
174
+
tools:
175
+
- function:
176
+
description: Get the current weather
177
+
name: get_weather
178
+
parameters:
179
+
type: object
180
+
properties:
181
+
location:
182
+
description: "The city and state (both required), e.g. San Francisco, CA."
183
+
type: string
184
+
required: ["location"]
185
+
type: function
186
+
tool_responses:
187
+
- response: "{'response': '70 degrees and foggy'}"
188
+
expected:
189
+
- num_tool_calls: 1
190
+
tool_name: get_weather
191
+
tool_arguments:
192
+
location: "San Francisco, CA"
193
+
- num_tool_calls: 0
194
+
answer: ["foggy", "70 degrees"]
195
+
- case_id: "add_product_tool"
196
+
input:
197
+
messages:
198
+
- - role: user
199
+
content: "Please add a new product with name 'Widget', price 19.99, in stock, and tags ['new', 'sale'] and give me the product id."
200
+
tools:
201
+
- function:
202
+
description: Add a new product
203
+
name: addProduct
204
+
parameters:
205
+
type: object
206
+
properties:
207
+
name:
208
+
description: "Name of the product"
209
+
type: string
210
+
price:
211
+
description: "Price of the product"
212
+
type: number
213
+
inStock:
214
+
description: "Availability status of the product."
215
+
type: boolean
216
+
tags:
217
+
description: "List of product tags"
218
+
type: array
219
+
items:
220
+
type: string
221
+
required: ["name", "price", "inStock"]
222
+
type: function
223
+
tool_responses:
224
+
- response: "{'response': 'Successfully added product with id: 123'}"
225
+
expected:
226
+
- num_tool_calls: 1
227
+
tool_name: addProduct
228
+
tool_arguments:
229
+
name: "Widget"
230
+
price: 19.99
231
+
inStock: true
232
+
tags:
233
+
- "new"
234
+
- "sale"
235
+
- num_tool_calls: 0
236
+
answer: ["123", "product id: 123"]
237
+
- case_id: "get_then_create_event_tool"
238
+
input:
239
+
messages:
240
+
- - role: system
241
+
content: "Todays date is 2025-03-01."
242
+
- role: user
243
+
content: "Do i have any meetings on March 3rd at 10 am? Yes or no?"
244
+
- - role: user
245
+
content: "Alright then, Create an event named 'Team Building', scheduled for that time same time, in the 'Main Conference Room' and add Alice, Bob, Charlie to it. Give me the created event id."
0 commit comments