Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-441451c27073e45d1bdc832c5b66c26d90bd185bd94bd461b91257fbf0987ef2.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-2203adbcfccbd119a54a1fe9a29de02b1993184022804cfa4bc32947c8c1eb06.yml
15 changes: 15 additions & 0 deletions src/resources/evaluation-assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ export interface EvaluationAssertion {
| 'JSON_EXACT_MATCH'
| 'TOOL_CALLED'
| 'TOOL_CALLED_WITH';

/**
* How heavily to weigh the assertion within the evaluation.
*/
weight?: number;
}

export type EvaluationAssertionListResponse = Array<EvaluationAssertion>;
Expand Down Expand Up @@ -124,6 +129,11 @@ export interface EvaluationAssertionCreateParams {
| 'JSON_EXACT_MATCH'
| 'TOOL_CALLED'
| 'TOOL_CALLED_WITH';

/**
* How heavily to weigh the assertion within the evaluation.
*/
weight?: number;
}

export interface EvaluationAssertionUpdateParams {
Expand Down Expand Up @@ -153,6 +163,11 @@ export interface EvaluationAssertionUpdateParams {
| 'JSON_EXACT_MATCH'
| 'TOOL_CALLED'
| 'TOOL_CALLED_WITH';

/**
* How heavily to weigh the assertion within the evaluation.
*/
weight?: number;
}

export interface EvaluationAssertionListParams {
Expand Down
30 changes: 30 additions & 0 deletions src/resources/evaluations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ export interface Evaluation {
* The template variables added to the prompt when executing the prompt.
*/
variables: Record<string, string | null>;

/**
* What percentage of assertions must pass for the evaluation to pass.
*/
threshold?: number;

/**
* How heavily to weigh the evaluation within the prompt.
*/
weight?: number;
}

export namespace Evaluation {
Expand Down Expand Up @@ -155,6 +165,16 @@ export interface EvaluationCreateParams {
* The template variables added to the prompt when executing the prompt.
*/
variables: Record<string, string | null>;

/**
* What percentage of assertions must pass for the evaluation to pass.
*/
threshold?: number;

/**
* How heavily to weigh the evaluation within the prompt.
*/
weight?: number;
}

export namespace EvaluationCreateParams {
Expand Down Expand Up @@ -245,6 +265,16 @@ export interface EvaluationUpdateParams {
* The template variables added to the prompt when executing the prompt.
*/
variables: Record<string, string | null>;

/**
* What percentage of assertions must pass for the evaluation to pass.
*/
threshold?: number;

/**
* How heavily to weigh the evaluation within the prompt.
*/
weight?: number;
}

export namespace EvaluationUpdateParams {
Expand Down
2 changes: 2 additions & 0 deletions tests/api-resources/evaluation-assertions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ describe('resource evaluationAssertions', () => {
targetValue: 'targetValue',
toolName: 'toolName',
type: 'CONTAINS',
weight: 0,
});
});

Expand Down Expand Up @@ -60,6 +61,7 @@ describe('resource evaluationAssertions', () => {
targetValue: 'targetValue',
toolName: 'toolName',
type: 'CONTAINS',
weight: 0,
});
});

Expand Down
4 changes: 4 additions & 0 deletions tests/api-resources/evaluations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ describe('resource evaluations', () => {
],
promptId: 'promptId',
variables: { foo: 'string' },
threshold: 0,
weight: 0,
});
});

Expand Down Expand Up @@ -152,6 +154,8 @@ describe('resource evaluations', () => {
],
promptId: 'promptId',
variables: { foo: 'string' },
threshold: 0,
weight: 0,
});
});

Expand Down