Skip to content

Commit a04deb8

Browse files
stainless-app[bot]Stainless Bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#178)
1 parent 136fe6a commit a04deb8

File tree

5 files changed

+52
-1
lines changed

5 files changed

+52
-1
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-441451c27073e45d1bdc832c5b66c26d90bd185bd94bd461b91257fbf0987ef2.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-2203adbcfccbd119a54a1fe9a29de02b1993184022804cfa4bc32947c8c1eb06.yml

src/resources/evaluation-assertions.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ export interface EvaluationAssertion {
8989
| 'JSON_EXACT_MATCH'
9090
| 'TOOL_CALLED'
9191
| 'TOOL_CALLED_WITH';
92+
93+
/**
94+
* How heavily to weigh the assertion within the evaluation.
95+
*/
96+
weight?: number;
9297
}
9398

9499
export type EvaluationAssertionListResponse = Array<EvaluationAssertion>;
@@ -124,6 +129,11 @@ export interface EvaluationAssertionCreateParams {
124129
| 'JSON_EXACT_MATCH'
125130
| 'TOOL_CALLED'
126131
| 'TOOL_CALLED_WITH';
132+
133+
/**
134+
* How heavily to weigh the assertion within the evaluation.
135+
*/
136+
weight?: number;
127137
}
128138

129139
export interface EvaluationAssertionUpdateParams {
@@ -153,6 +163,11 @@ export interface EvaluationAssertionUpdateParams {
153163
| 'JSON_EXACT_MATCH'
154164
| 'TOOL_CALLED'
155165
| 'TOOL_CALLED_WITH';
166+
167+
/**
168+
* How heavily to weigh the assertion within the evaluation.
169+
*/
170+
weight?: number;
156171
}
157172

158173
export interface EvaluationAssertionListParams {

src/resources/evaluations.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ export interface Evaluation {
5959
* The template variables added to the prompt when executing the prompt.
6060
*/
6161
variables: Record<string, string | null>;
62+
63+
/**
64+
* What percentage of assertions must pass for the evaluation to pass.
65+
*/
66+
threshold?: number;
67+
68+
/**
69+
* How heavily to weigh the evaluation within the prompt.
70+
*/
71+
weight?: number;
6272
}
6373

6474
export namespace Evaluation {
@@ -155,6 +165,16 @@ export interface EvaluationCreateParams {
155165
* The template variables added to the prompt when executing the prompt.
156166
*/
157167
variables: Record<string, string | null>;
168+
169+
/**
170+
* What percentage of assertions must pass for the evaluation to pass.
171+
*/
172+
threshold?: number;
173+
174+
/**
175+
* How heavily to weigh the evaluation within the prompt.
176+
*/
177+
weight?: number;
158178
}
159179

160180
export namespace EvaluationCreateParams {
@@ -245,6 +265,16 @@ export interface EvaluationUpdateParams {
245265
* The template variables added to the prompt when executing the prompt.
246266
*/
247267
variables: Record<string, string | null>;
268+
269+
/**
270+
* What percentage of assertions must pass for the evaluation to pass.
271+
*/
272+
threshold?: number;
273+
274+
/**
275+
* How heavily to weigh the evaluation within the prompt.
276+
*/
277+
weight?: number;
248278
}
249279

250280
export namespace EvaluationUpdateParams {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ describe('resource evaluationAssertions', () => {
3333
targetValue: 'targetValue',
3434
toolName: 'toolName',
3535
type: 'CONTAINS',
36+
weight: 0,
3637
});
3738
});
3839

@@ -60,6 +61,7 @@ describe('resource evaluationAssertions', () => {
6061
targetValue: 'targetValue',
6162
toolName: 'toolName',
6263
type: 'CONTAINS',
64+
weight: 0,
6365
});
6466
});
6567

tests/api-resources/evaluations.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ describe('resource evaluations', () => {
7979
],
8080
promptId: 'promptId',
8181
variables: { foo: 'string' },
82+
threshold: 0,
83+
weight: 0,
8284
});
8385
});
8486

@@ -152,6 +154,8 @@ describe('resource evaluations', () => {
152154
],
153155
promptId: 'promptId',
154156
variables: { foo: 'string' },
157+
threshold: 0,
158+
weight: 0,
155159
});
156160
});
157161

0 commit comments

Comments
 (0)