Skip to content

Commit 2cfd479

Browse files
feat(api): OpenAPI spec update via Stainless API (#184)
1 parent f25c05b commit 2cfd479

File tree

3 files changed

+21
-53
lines changed

3 files changed

+21
-53
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/resources/evaluation-assertions.ts

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ export interface EvaluationAssertion {
7171
*/
7272
jsonPath: string | null;
7373

74-
targetThreshold: number | null;
75-
76-
targetValues: Array<string> | null;
74+
targetValue: string | null;
7775

7876
/**
7977
* The name of the tool to match. Only required when type is `TOOL_CALLED` or
@@ -85,19 +83,13 @@ export interface EvaluationAssertion {
8583
* The type of evaluation matcher to use.
8684
*/
8785
type:
88-
| 'CONTAINS_ALL'
89-
| 'CONTAINS_ANY'
90-
| 'COST'
86+
| 'CONTAINS'
9187
| 'EXACT_MATCH'
92-
| 'LATENCY'
93-
| 'STARTS_WITH'
88+
| 'JSON_CONTAINS'
89+
| 'JSON_EXACT_MATCH'
9490
| 'TOOL_CALLED'
9591
| 'TOOL_CALLED_WITH';
9692

97-
ignoreCase?: boolean;
98-
99-
negate?: boolean;
100-
10193
/**
10294
* How heavily to weigh the assertion within the evaluation.
10395
*/
@@ -119,9 +111,7 @@ export interface EvaluationAssertionCreateParams {
119111
*/
120112
jsonPath: string | null;
121113

122-
targetThreshold: number | null;
123-
124-
targetValues: Array<string> | null;
114+
targetValue: string | null;
125115

126116
/**
127117
* The name of the tool to match. Only required when type is `TOOL_CALLED` or
@@ -133,19 +123,13 @@ export interface EvaluationAssertionCreateParams {
133123
* The type of evaluation matcher to use.
134124
*/
135125
type:
136-
| 'CONTAINS_ALL'
137-
| 'CONTAINS_ANY'
138-
| 'COST'
126+
| 'CONTAINS'
139127
| 'EXACT_MATCH'
140-
| 'LATENCY'
141-
| 'STARTS_WITH'
128+
| 'JSON_CONTAINS'
129+
| 'JSON_EXACT_MATCH'
142130
| 'TOOL_CALLED'
143131
| 'TOOL_CALLED_WITH';
144132

145-
ignoreCase?: boolean;
146-
147-
negate?: boolean;
148-
149133
/**
150134
* How heavily to weigh the assertion within the evaluation.
151135
*/
@@ -161,9 +145,7 @@ export interface EvaluationAssertionUpdateParams {
161145
*/
162146
jsonPath: string | null;
163147

164-
targetThreshold: number | null;
165-
166-
targetValues: Array<string> | null;
148+
targetValue: string | null;
167149

168150
/**
169151
* The name of the tool to match. Only required when type is `TOOL_CALLED` or
@@ -175,19 +157,13 @@ export interface EvaluationAssertionUpdateParams {
175157
* The type of evaluation matcher to use.
176158
*/
177159
type:
178-
| 'CONTAINS_ALL'
179-
| 'CONTAINS_ANY'
180-
| 'COST'
160+
| 'CONTAINS'
181161
| 'EXACT_MATCH'
182-
| 'LATENCY'
183-
| 'STARTS_WITH'
162+
| 'JSON_CONTAINS'
163+
| 'JSON_EXACT_MATCH'
184164
| 'TOOL_CALLED'
185165
| 'TOOL_CALLED_WITH';
186166

187-
ignoreCase?: boolean;
188-
189-
negate?: boolean;
190-
191167
/**
192168
* How heavily to weigh the assertion within the evaluation.
193169
*/

tests/api-resources/evaluation-assertions.test.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ describe('resource evaluationAssertions', () => {
1313
const responsePromise = promptFoundry.evaluationAssertions.create({
1414
evaluationId: 'evaluationId',
1515
jsonPath: 'jsonPath',
16-
targetThreshold: 0,
17-
targetValues: ['string', 'string', 'string'],
16+
targetValue: 'targetValue',
1817
toolName: 'toolName',
19-
type: 'CONTAINS_ALL',
18+
type: 'CONTAINS',
2019
});
2120
const rawResponse = await responsePromise.asResponse();
2221
expect(rawResponse).toBeInstanceOf(Response);
@@ -31,12 +30,9 @@ describe('resource evaluationAssertions', () => {
3130
const response = await promptFoundry.evaluationAssertions.create({
3231
evaluationId: 'evaluationId',
3332
jsonPath: 'jsonPath',
34-
targetThreshold: 0,
35-
targetValues: ['string', 'string', 'string'],
33+
targetValue: 'targetValue',
3634
toolName: 'toolName',
37-
type: 'CONTAINS_ALL',
38-
ignoreCase: true,
39-
negate: true,
35+
type: 'CONTAINS',
4036
weight: 0,
4137
});
4238
});
@@ -45,10 +41,9 @@ describe('resource evaluationAssertions', () => {
4541
const responsePromise = promptFoundry.evaluationAssertions.update('1212121', {
4642
evaluationId: 'evaluationId',
4743
jsonPath: 'jsonPath',
48-
targetThreshold: 0,
49-
targetValues: ['string', 'string', 'string'],
44+
targetValue: 'targetValue',
5045
toolName: 'toolName',
51-
type: 'CONTAINS_ALL',
46+
type: 'CONTAINS',
5247
});
5348
const rawResponse = await responsePromise.asResponse();
5449
expect(rawResponse).toBeInstanceOf(Response);
@@ -63,12 +58,9 @@ describe('resource evaluationAssertions', () => {
6358
const response = await promptFoundry.evaluationAssertions.update('1212121', {
6459
evaluationId: 'evaluationId',
6560
jsonPath: 'jsonPath',
66-
targetThreshold: 0,
67-
targetValues: ['string', 'string', 'string'],
61+
targetValue: 'targetValue',
6862
toolName: 'toolName',
69-
type: 'CONTAINS_ALL',
70-
ignoreCase: true,
71-
negate: true,
63+
type: 'CONTAINS',
7264
weight: 0,
7365
});
7466
});

0 commit comments

Comments
 (0)