2
2
3
3
from __future__ import annotations
4
4
5
+ from typing import Optional
6
+ from typing_extensions import Literal
7
+
5
8
import httpx
6
9
7
10
from ..types import (
@@ -45,8 +48,12 @@ def create(
45
48
self ,
46
49
* ,
47
50
evaluation_id : str ,
48
- matcher : evaluation_assertion_create_params .Matcher ,
49
- target : str ,
51
+ json_path : Optional [str ],
52
+ target_value : str ,
53
+ tool_name : Optional [str ],
54
+ type : Literal [
55
+ "EXACT_MATCH" , "CONTAINS" , "JSON_EXACT_MATCH" , "JSON_CONTAINS" , "TOOL_CALLED" , "TOOL_CALLED_WITH"
56
+ ],
50
57
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
51
58
# The extra values given here take precedence over values defined on the client or passed to this method.
52
59
extra_headers : Headers | None = None ,
@@ -58,6 +65,14 @@ def create(
58
65
Creates a new evaluation assertion
59
66
60
67
Args:
68
+ json_path: A JSON path to use when matching the response. Only required when type is
69
+ `JSON_EXACT_MATCH` or `JSON_CONTAINS`.
70
+
71
+ tool_name: The name of the tool to match. Only required when type is `TOOL_CALLED` or
72
+ `TOOL_CALLED_WITH`.
73
+
74
+ type: The type of evaluation matcher to use.
75
+
61
76
extra_headers: Send extra headers
62
77
63
78
extra_query: Add additional query parameters to the request
@@ -71,8 +86,10 @@ def create(
71
86
body = maybe_transform (
72
87
{
73
88
"evaluation_id" : evaluation_id ,
74
- "matcher" : matcher ,
75
- "target" : target ,
89
+ "json_path" : json_path ,
90
+ "target_value" : target_value ,
91
+ "tool_name" : tool_name ,
92
+ "type" : type ,
76
93
},
77
94
evaluation_assertion_create_params .EvaluationAssertionCreateParams ,
78
95
),
@@ -87,8 +104,12 @@ def update(
87
104
id : str ,
88
105
* ,
89
106
evaluation_id : str ,
90
- matcher : evaluation_assertion_update_params .Matcher ,
91
- target : str ,
107
+ json_path : Optional [str ],
108
+ target_value : str ,
109
+ tool_name : Optional [str ],
110
+ type : Literal [
111
+ "EXACT_MATCH" , "CONTAINS" , "JSON_EXACT_MATCH" , "JSON_CONTAINS" , "TOOL_CALLED" , "TOOL_CALLED_WITH"
112
+ ],
92
113
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
93
114
# The extra values given here take precedence over values defined on the client or passed to this method.
94
115
extra_headers : Headers | None = None ,
@@ -100,6 +121,14 @@ def update(
100
121
Update an existing evaluation assertion by providing its ID and new data.
101
122
102
123
Args:
124
+ json_path: A JSON path to use when matching the response. Only required when type is
125
+ `JSON_EXACT_MATCH` or `JSON_CONTAINS`.
126
+
127
+ tool_name: The name of the tool to match. Only required when type is `TOOL_CALLED` or
128
+ `TOOL_CALLED_WITH`.
129
+
130
+ type: The type of evaluation matcher to use.
131
+
103
132
extra_headers: Send extra headers
104
133
105
134
extra_query: Add additional query parameters to the request
@@ -115,8 +144,10 @@ def update(
115
144
body = maybe_transform (
116
145
{
117
146
"evaluation_id" : evaluation_id ,
118
- "matcher" : matcher ,
119
- "target" : target ,
147
+ "json_path" : json_path ,
148
+ "target_value" : target_value ,
149
+ "tool_name" : tool_name ,
150
+ "type" : type ,
120
151
},
121
152
evaluation_assertion_update_params .EvaluationAssertionUpdateParams ,
122
153
),
@@ -245,8 +276,12 @@ async def create(
245
276
self ,
246
277
* ,
247
278
evaluation_id : str ,
248
- matcher : evaluation_assertion_create_params .Matcher ,
249
- target : str ,
279
+ json_path : Optional [str ],
280
+ target_value : str ,
281
+ tool_name : Optional [str ],
282
+ type : Literal [
283
+ "EXACT_MATCH" , "CONTAINS" , "JSON_EXACT_MATCH" , "JSON_CONTAINS" , "TOOL_CALLED" , "TOOL_CALLED_WITH"
284
+ ],
250
285
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
251
286
# The extra values given here take precedence over values defined on the client or passed to this method.
252
287
extra_headers : Headers | None = None ,
@@ -258,6 +293,14 @@ async def create(
258
293
Creates a new evaluation assertion
259
294
260
295
Args:
296
+ json_path: A JSON path to use when matching the response. Only required when type is
297
+ `JSON_EXACT_MATCH` or `JSON_CONTAINS`.
298
+
299
+ tool_name: The name of the tool to match. Only required when type is `TOOL_CALLED` or
300
+ `TOOL_CALLED_WITH`.
301
+
302
+ type: The type of evaluation matcher to use.
303
+
261
304
extra_headers: Send extra headers
262
305
263
306
extra_query: Add additional query parameters to the request
@@ -271,8 +314,10 @@ async def create(
271
314
body = await async_maybe_transform (
272
315
{
273
316
"evaluation_id" : evaluation_id ,
274
- "matcher" : matcher ,
275
- "target" : target ,
317
+ "json_path" : json_path ,
318
+ "target_value" : target_value ,
319
+ "tool_name" : tool_name ,
320
+ "type" : type ,
276
321
},
277
322
evaluation_assertion_create_params .EvaluationAssertionCreateParams ,
278
323
),
@@ -287,8 +332,12 @@ async def update(
287
332
id : str ,
288
333
* ,
289
334
evaluation_id : str ,
290
- matcher : evaluation_assertion_update_params .Matcher ,
291
- target : str ,
335
+ json_path : Optional [str ],
336
+ target_value : str ,
337
+ tool_name : Optional [str ],
338
+ type : Literal [
339
+ "EXACT_MATCH" , "CONTAINS" , "JSON_EXACT_MATCH" , "JSON_CONTAINS" , "TOOL_CALLED" , "TOOL_CALLED_WITH"
340
+ ],
292
341
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
293
342
# The extra values given here take precedence over values defined on the client or passed to this method.
294
343
extra_headers : Headers | None = None ,
@@ -300,6 +349,14 @@ async def update(
300
349
Update an existing evaluation assertion by providing its ID and new data.
301
350
302
351
Args:
352
+ json_path: A JSON path to use when matching the response. Only required when type is
353
+ `JSON_EXACT_MATCH` or `JSON_CONTAINS`.
354
+
355
+ tool_name: The name of the tool to match. Only required when type is `TOOL_CALLED` or
356
+ `TOOL_CALLED_WITH`.
357
+
358
+ type: The type of evaluation matcher to use.
359
+
303
360
extra_headers: Send extra headers
304
361
305
362
extra_query: Add additional query parameters to the request
@@ -315,8 +372,10 @@ async def update(
315
372
body = await async_maybe_transform (
316
373
{
317
374
"evaluation_id" : evaluation_id ,
318
- "matcher" : matcher ,
319
- "target" : target ,
375
+ "json_path" : json_path ,
376
+ "target_value" : target_value ,
377
+ "tool_name" : tool_name ,
378
+ "type" : type ,
320
379
},
321
380
evaluation_assertion_update_params .EvaluationAssertionUpdateParams ,
322
381
),
0 commit comments