22
33from __future__ import annotations
44
5+ from typing import Optional
6+ from typing_extensions import Literal
7+
58import httpx
69
710from ..types import (
@@ -45,8 +48,12 @@ def create(
4548 self ,
4649 * ,
4750 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+ ],
5057 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5158 # The extra values given here take precedence over values defined on the client or passed to this method.
5259 extra_headers : Headers | None = None ,
@@ -58,6 +65,14 @@ def create(
5865 Creates a new evaluation assertion
5966
6067 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+
6176 extra_headers: Send extra headers
6277
6378 extra_query: Add additional query parameters to the request
@@ -71,8 +86,10 @@ def create(
7186 body = maybe_transform (
7287 {
7388 "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 ,
7693 },
7794 evaluation_assertion_create_params .EvaluationAssertionCreateParams ,
7895 ),
@@ -87,8 +104,12 @@ def update(
87104 id : str ,
88105 * ,
89106 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+ ],
92113 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
93114 # The extra values given here take precedence over values defined on the client or passed to this method.
94115 extra_headers : Headers | None = None ,
@@ -100,6 +121,14 @@ def update(
100121 Update an existing evaluation assertion by providing its ID and new data.
101122
102123 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+
103132 extra_headers: Send extra headers
104133
105134 extra_query: Add additional query parameters to the request
@@ -115,8 +144,10 @@ def update(
115144 body = maybe_transform (
116145 {
117146 "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 ,
120151 },
121152 evaluation_assertion_update_params .EvaluationAssertionUpdateParams ,
122153 ),
@@ -245,8 +276,12 @@ async def create(
245276 self ,
246277 * ,
247278 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+ ],
250285 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
251286 # The extra values given here take precedence over values defined on the client or passed to this method.
252287 extra_headers : Headers | None = None ,
@@ -258,6 +293,14 @@ async def create(
258293 Creates a new evaluation assertion
259294
260295 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+
261304 extra_headers: Send extra headers
262305
263306 extra_query: Add additional query parameters to the request
@@ -271,8 +314,10 @@ async def create(
271314 body = await async_maybe_transform (
272315 {
273316 "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 ,
276321 },
277322 evaluation_assertion_create_params .EvaluationAssertionCreateParams ,
278323 ),
@@ -287,8 +332,12 @@ async def update(
287332 id : str ,
288333 * ,
289334 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+ ],
292341 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
293342 # The extra values given here take precedence over values defined on the client or passed to this method.
294343 extra_headers : Headers | None = None ,
@@ -300,6 +349,14 @@ async def update(
300349 Update an existing evaluation assertion by providing its ID and new data.
301350
302351 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+
303360 extra_headers: Send extra headers
304361
305362 extra_query: Add additional query parameters to the request
@@ -315,8 +372,10 @@ async def update(
315372 body = await async_maybe_transform (
316373 {
317374 "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 ,
320379 },
321380 evaluation_assertion_update_params .EvaluationAssertionUpdateParams ,
322381 ),
0 commit comments