Skip to content

Commit b9ca8a0

Browse files
feat(api): OpenAPI spec update via Stainless API (#175)
1 parent 7b594ab commit b9ca8a0

File tree

6 files changed

+59
-182
lines changed

6 files changed

+59
-182
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 21
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-101dab0674c0098868baea52c37050f14ce1dffeadecc3978c77e7b8a47c608c.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-ec010a81f2e8cfe74de9842b6fcd84599fd1d3f439ba3eb868fb5bdbfa2fa260.yml

src/prompt_foundry_python_sdk/resources/evaluation_assertions.py

Lines changed: 13 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Optional
5+
from typing import Optional
66
from typing_extensions import Literal
77

88
import httpx
@@ -47,21 +47,11 @@ def create(
4747
*,
4848
evaluation_id: str,
4949
json_path: Optional[str],
50-
target_threshold: Optional[float],
51-
target_values: Optional[List[str]],
50+
target_value: Optional[str],
5251
tool_name: Optional[str],
5352
type: Literal[
54-
"CONTAINS_ALL",
55-
"CONTAINS_ANY",
56-
"COST",
57-
"EXACT_MATCH",
58-
"LATENCY",
59-
"STARTS_WITH",
60-
"TOOL_CALLED",
61-
"TOOL_CALLED_WITH",
53+
"CONTAINS", "EXACT_MATCH", "JSON_CONTAINS", "JSON_EXACT_MATCH", "TOOL_CALLED", "TOOL_CALLED_WITH"
6254
],
63-
ignore_case: bool | NotGiven = NOT_GIVEN,
64-
negate: bool | NotGiven = NOT_GIVEN,
6555
weight: float | NotGiven = NOT_GIVEN,
6656
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6757
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -98,12 +88,9 @@ def create(
9888
{
9989
"evaluation_id": evaluation_id,
10090
"json_path": json_path,
101-
"target_threshold": target_threshold,
102-
"target_values": target_values,
91+
"target_value": target_value,
10392
"tool_name": tool_name,
10493
"type": type,
105-
"ignore_case": ignore_case,
106-
"negate": negate,
10794
"weight": weight,
10895
},
10996
evaluation_assertion_create_params.EvaluationAssertionCreateParams,
@@ -120,21 +107,11 @@ def update(
120107
*,
121108
evaluation_id: str,
122109
json_path: Optional[str],
123-
target_threshold: Optional[float],
124-
target_values: Optional[List[str]],
110+
target_value: Optional[str],
125111
tool_name: Optional[str],
126112
type: Literal[
127-
"CONTAINS_ALL",
128-
"CONTAINS_ANY",
129-
"COST",
130-
"EXACT_MATCH",
131-
"LATENCY",
132-
"STARTS_WITH",
133-
"TOOL_CALLED",
134-
"TOOL_CALLED_WITH",
113+
"CONTAINS", "EXACT_MATCH", "JSON_CONTAINS", "JSON_EXACT_MATCH", "TOOL_CALLED", "TOOL_CALLED_WITH"
135114
],
136-
ignore_case: bool | NotGiven = NOT_GIVEN,
137-
negate: bool | NotGiven = NOT_GIVEN,
138115
weight: float | NotGiven = NOT_GIVEN,
139116
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
140117
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -173,12 +150,9 @@ def update(
173150
{
174151
"evaluation_id": evaluation_id,
175152
"json_path": json_path,
176-
"target_threshold": target_threshold,
177-
"target_values": target_values,
153+
"target_value": target_value,
178154
"tool_name": tool_name,
179155
"type": type,
180-
"ignore_case": ignore_case,
181-
"negate": negate,
182156
"weight": weight,
183157
},
184158
evaluation_assertion_update_params.EvaluationAssertionUpdateParams,
@@ -309,21 +283,11 @@ async def create(
309283
*,
310284
evaluation_id: str,
311285
json_path: Optional[str],
312-
target_threshold: Optional[float],
313-
target_values: Optional[List[str]],
286+
target_value: Optional[str],
314287
tool_name: Optional[str],
315288
type: Literal[
316-
"CONTAINS_ALL",
317-
"CONTAINS_ANY",
318-
"COST",
319-
"EXACT_MATCH",
320-
"LATENCY",
321-
"STARTS_WITH",
322-
"TOOL_CALLED",
323-
"TOOL_CALLED_WITH",
289+
"CONTAINS", "EXACT_MATCH", "JSON_CONTAINS", "JSON_EXACT_MATCH", "TOOL_CALLED", "TOOL_CALLED_WITH"
324290
],
325-
ignore_case: bool | NotGiven = NOT_GIVEN,
326-
negate: bool | NotGiven = NOT_GIVEN,
327291
weight: float | NotGiven = NOT_GIVEN,
328292
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
329293
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -360,12 +324,9 @@ async def create(
360324
{
361325
"evaluation_id": evaluation_id,
362326
"json_path": json_path,
363-
"target_threshold": target_threshold,
364-
"target_values": target_values,
327+
"target_value": target_value,
365328
"tool_name": tool_name,
366329
"type": type,
367-
"ignore_case": ignore_case,
368-
"negate": negate,
369330
"weight": weight,
370331
},
371332
evaluation_assertion_create_params.EvaluationAssertionCreateParams,
@@ -382,21 +343,11 @@ async def update(
382343
*,
383344
evaluation_id: str,
384345
json_path: Optional[str],
385-
target_threshold: Optional[float],
386-
target_values: Optional[List[str]],
346+
target_value: Optional[str],
387347
tool_name: Optional[str],
388348
type: Literal[
389-
"CONTAINS_ALL",
390-
"CONTAINS_ANY",
391-
"COST",
392-
"EXACT_MATCH",
393-
"LATENCY",
394-
"STARTS_WITH",
395-
"TOOL_CALLED",
396-
"TOOL_CALLED_WITH",
349+
"CONTAINS", "EXACT_MATCH", "JSON_CONTAINS", "JSON_EXACT_MATCH", "TOOL_CALLED", "TOOL_CALLED_WITH"
397350
],
398-
ignore_case: bool | NotGiven = NOT_GIVEN,
399-
negate: bool | NotGiven = NOT_GIVEN,
400351
weight: float | NotGiven = NOT_GIVEN,
401352
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
402353
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -435,12 +386,9 @@ async def update(
435386
{
436387
"evaluation_id": evaluation_id,
437388
"json_path": json_path,
438-
"target_threshold": target_threshold,
439-
"target_values": target_values,
389+
"target_value": target_value,
440390
"tool_name": tool_name,
441391
"type": type,
442-
"ignore_case": ignore_case,
443-
"negate": negate,
444392
"weight": weight,
445393
},
446394
evaluation_assertion_update_params.EvaluationAssertionUpdateParams,
Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
3+
from typing import Optional
44
from typing_extensions import Literal
55

66
from pydantic import Field as FieldInfo
@@ -21,31 +21,16 @@ class EvaluationAssertion(BaseModel):
2121
Only required when type is `JSON_EXACT_MATCH` or `JSON_CONTAINS`.
2222
"""
2323

24-
target_threshold: Optional[float] = FieldInfo(alias="targetThreshold", default=None)
25-
26-
target_values: Optional[List[str]] = FieldInfo(alias="targetValues", default=None)
24+
target_value: Optional[str] = FieldInfo(alias="targetValue", default=None)
2725

2826
tool_name: Optional[str] = FieldInfo(alias="toolName", default=None)
2927
"""The name of the tool to match.
3028
3129
Only required when type is `TOOL_CALLED` or `TOOL_CALLED_WITH`.
3230
"""
3331

34-
type: Literal[
35-
"CONTAINS_ALL",
36-
"CONTAINS_ANY",
37-
"COST",
38-
"EXACT_MATCH",
39-
"LATENCY",
40-
"STARTS_WITH",
41-
"TOOL_CALLED",
42-
"TOOL_CALLED_WITH",
43-
]
32+
type: Literal["CONTAINS", "EXACT_MATCH", "JSON_CONTAINS", "JSON_EXACT_MATCH", "TOOL_CALLED", "TOOL_CALLED_WITH"]
4433
"""The type of evaluation matcher to use."""
4534

46-
ignore_case: Optional[bool] = FieldInfo(alias="ignoreCase", default=None)
47-
48-
negate: Optional[bool] = None
49-
5035
weight: Optional[float] = None
5136
"""How heavily to weigh the assertion within the evaluation."""

src/prompt_foundry_python_sdk/types/evaluation_assertion_create_params.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Optional
5+
from typing import Optional
66
from typing_extensions import Literal, Required, Annotated, TypedDict
77

88
from .._utils import PropertyInfo
@@ -19,9 +19,7 @@ class EvaluationAssertionCreateParams(TypedDict, total=False):
1919
Only required when type is `JSON_EXACT_MATCH` or `JSON_CONTAINS`.
2020
"""
2121

22-
target_threshold: Required[Annotated[Optional[float], PropertyInfo(alias="targetThreshold")]]
23-
24-
target_values: Required[Annotated[Optional[List[str]], PropertyInfo(alias="targetValues")]]
22+
target_value: Required[Annotated[Optional[str], PropertyInfo(alias="targetValue")]]
2523

2624
tool_name: Required[Annotated[Optional[str], PropertyInfo(alias="toolName")]]
2725
"""The name of the tool to match.
@@ -30,22 +28,9 @@ class EvaluationAssertionCreateParams(TypedDict, total=False):
3028
"""
3129

3230
type: Required[
33-
Literal[
34-
"CONTAINS_ALL",
35-
"CONTAINS_ANY",
36-
"COST",
37-
"EXACT_MATCH",
38-
"LATENCY",
39-
"STARTS_WITH",
40-
"TOOL_CALLED",
41-
"TOOL_CALLED_WITH",
42-
]
31+
Literal["CONTAINS", "EXACT_MATCH", "JSON_CONTAINS", "JSON_EXACT_MATCH", "TOOL_CALLED", "TOOL_CALLED_WITH"]
4332
]
4433
"""The type of evaluation matcher to use."""
4534

46-
ignore_case: Annotated[bool, PropertyInfo(alias="ignoreCase")]
47-
48-
negate: bool
49-
5035
weight: float
5136
"""How heavily to weigh the assertion within the evaluation."""

src/prompt_foundry_python_sdk/types/evaluation_assertion_update_params.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Optional
5+
from typing import Optional
66
from typing_extensions import Literal, Required, Annotated, TypedDict
77

88
from .._utils import PropertyInfo
@@ -19,9 +19,7 @@ class EvaluationAssertionUpdateParams(TypedDict, total=False):
1919
Only required when type is `JSON_EXACT_MATCH` or `JSON_CONTAINS`.
2020
"""
2121

22-
target_threshold: Required[Annotated[Optional[float], PropertyInfo(alias="targetThreshold")]]
23-
24-
target_values: Required[Annotated[Optional[List[str]], PropertyInfo(alias="targetValues")]]
22+
target_value: Required[Annotated[Optional[str], PropertyInfo(alias="targetValue")]]
2523

2624
tool_name: Required[Annotated[Optional[str], PropertyInfo(alias="toolName")]]
2725
"""The name of the tool to match.
@@ -30,22 +28,9 @@ class EvaluationAssertionUpdateParams(TypedDict, total=False):
3028
"""
3129

3230
type: Required[
33-
Literal[
34-
"CONTAINS_ALL",
35-
"CONTAINS_ANY",
36-
"COST",
37-
"EXACT_MATCH",
38-
"LATENCY",
39-
"STARTS_WITH",
40-
"TOOL_CALLED",
41-
"TOOL_CALLED_WITH",
42-
]
31+
Literal["CONTAINS", "EXACT_MATCH", "JSON_CONTAINS", "JSON_EXACT_MATCH", "TOOL_CALLED", "TOOL_CALLED_WITH"]
4332
]
4433
"""The type of evaluation matcher to use."""
4534

46-
ignore_case: Annotated[bool, PropertyInfo(alias="ignoreCase")]
47-
48-
negate: bool
49-
5035
weight: float
5136
"""How heavily to weigh the assertion within the evaluation."""

0 commit comments

Comments
 (0)