Skip to content

Commit 49fd7b4

Browse files
stainless-app[bot]Stainless Bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#182)
1 parent c8a0ea4 commit 49fd7b4

File tree

3 files changed

+53
-21
lines changed

3 files changed

+53
-21
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-ec010a81f2e8cfe74de9842b6fcd84599fd1d3f439ba3eb868fb5bdbfa2fa260.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-101dab0674c0098868baea52c37050f14ce1dffeadecc3978c77e7b8a47c608c.yml

src/resources/evaluation-assertions.ts

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

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

7678
/**
7779
* The name of the tool to match. Only required when type is `TOOL_CALLED` or
@@ -83,13 +85,19 @@ export interface EvaluationAssertion {
8385
* The type of evaluation matcher to use.
8486
*/
8587
type:
86-
| 'CONTAINS'
88+
| 'CONTAINS_ALL'
89+
| 'CONTAINS_ANY'
90+
| 'COST'
8791
| 'EXACT_MATCH'
88-
| 'JSON_CONTAINS'
89-
| 'JSON_EXACT_MATCH'
92+
| 'LATENCY'
93+
| 'STARTS_WITH'
9094
| 'TOOL_CALLED'
9195
| 'TOOL_CALLED_WITH';
9296

97+
ignoreCase?: boolean;
98+
99+
negate?: boolean;
100+
93101
/**
94102
* How heavily to weigh the assertion within the evaluation.
95103
*/
@@ -111,7 +119,9 @@ export interface EvaluationAssertionCreateParams {
111119
*/
112120
jsonPath: string | null;
113121

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

116126
/**
117127
* The name of the tool to match. Only required when type is `TOOL_CALLED` or
@@ -123,13 +133,19 @@ export interface EvaluationAssertionCreateParams {
123133
* The type of evaluation matcher to use.
124134
*/
125135
type:
126-
| 'CONTAINS'
136+
| 'CONTAINS_ALL'
137+
| 'CONTAINS_ANY'
138+
| 'COST'
127139
| 'EXACT_MATCH'
128-
| 'JSON_CONTAINS'
129-
| 'JSON_EXACT_MATCH'
140+
| 'LATENCY'
141+
| 'STARTS_WITH'
130142
| 'TOOL_CALLED'
131143
| 'TOOL_CALLED_WITH';
132144

145+
ignoreCase?: boolean;
146+
147+
negate?: boolean;
148+
133149
/**
134150
* How heavily to weigh the assertion within the evaluation.
135151
*/
@@ -145,7 +161,9 @@ export interface EvaluationAssertionUpdateParams {
145161
*/
146162
jsonPath: string | null;
147163

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

150168
/**
151169
* The name of the tool to match. Only required when type is `TOOL_CALLED` or
@@ -157,13 +175,19 @@ export interface EvaluationAssertionUpdateParams {
157175
* The type of evaluation matcher to use.
158176
*/
159177
type:
160-
| 'CONTAINS'
178+
| 'CONTAINS_ALL'
179+
| 'CONTAINS_ANY'
180+
| 'COST'
161181
| 'EXACT_MATCH'
162-
| 'JSON_CONTAINS'
163-
| 'JSON_EXACT_MATCH'
182+
| 'LATENCY'
183+
| 'STARTS_WITH'
164184
| 'TOOL_CALLED'
165185
| 'TOOL_CALLED_WITH';
166186

187+
ignoreCase?: boolean;
188+
189+
negate?: boolean;
190+
167191
/**
168192
* How heavily to weigh the assertion within the evaluation.
169193
*/

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ describe('resource evaluationAssertions', () => {
1313
const responsePromise = promptFoundry.evaluationAssertions.create({
1414
evaluationId: 'evaluationId',
1515
jsonPath: 'jsonPath',
16-
targetValue: 'targetValue',
16+
targetThreshold: 0,
17+
targetValues: ['string', 'string', 'string'],
1718
toolName: 'toolName',
18-
type: 'CONTAINS',
19+
type: 'CONTAINS_ALL',
1920
});
2021
const rawResponse = await responsePromise.asResponse();
2122
expect(rawResponse).toBeInstanceOf(Response);
@@ -30,9 +31,12 @@ describe('resource evaluationAssertions', () => {
3031
const response = await promptFoundry.evaluationAssertions.create({
3132
evaluationId: 'evaluationId',
3233
jsonPath: 'jsonPath',
33-
targetValue: 'targetValue',
34+
targetThreshold: 0,
35+
targetValues: ['string', 'string', 'string'],
3436
toolName: 'toolName',
35-
type: 'CONTAINS',
37+
type: 'CONTAINS_ALL',
38+
ignoreCase: true,
39+
negate: true,
3640
weight: 0,
3741
});
3842
});
@@ -41,9 +45,10 @@ describe('resource evaluationAssertions', () => {
4145
const responsePromise = promptFoundry.evaluationAssertions.update('1212121', {
4246
evaluationId: 'evaluationId',
4347
jsonPath: 'jsonPath',
44-
targetValue: 'targetValue',
48+
targetThreshold: 0,
49+
targetValues: ['string', 'string', 'string'],
4550
toolName: 'toolName',
46-
type: 'CONTAINS',
51+
type: 'CONTAINS_ALL',
4752
});
4853
const rawResponse = await responsePromise.asResponse();
4954
expect(rawResponse).toBeInstanceOf(Response);
@@ -58,9 +63,12 @@ describe('resource evaluationAssertions', () => {
5863
const response = await promptFoundry.evaluationAssertions.update('1212121', {
5964
evaluationId: 'evaluationId',
6065
jsonPath: 'jsonPath',
61-
targetValue: 'targetValue',
66+
targetThreshold: 0,
67+
targetValues: ['string', 'string', 'string'],
6268
toolName: 'toolName',
63-
type: 'CONTAINS',
69+
type: 'CONTAINS_ALL',
70+
ignoreCase: true,
71+
negate: true,
6472
weight: 0,
6573
});
6674
});

0 commit comments

Comments
 (0)