From 9b6e084ac37e2fae27657cbcf1eba732244ddb63 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 23 Jul 2024 16:35:22 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API --- .stats.yml | 2 +- src/resources/evaluation-assertions.ts | 15 ++++++++++ src/resources/evaluations.ts | 30 +++++++++++++++++++ .../evaluation-assertions.test.ts | 2 ++ tests/api-resources/evaluations.test.ts | 4 +++ 5 files changed, 52 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ddfeae1..4082efa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/src/resources/evaluation-assertions.ts b/src/resources/evaluation-assertions.ts index 46a7c23..b0d6631 100644 --- a/src/resources/evaluation-assertions.ts +++ b/src/resources/evaluation-assertions.ts @@ -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; @@ -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 { @@ -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 { diff --git a/src/resources/evaluations.ts b/src/resources/evaluations.ts index 2b10b2e..2699522 100644 --- a/src/resources/evaluations.ts +++ b/src/resources/evaluations.ts @@ -59,6 +59,16 @@ export interface Evaluation { * The template variables added to the prompt when executing the prompt. */ variables: Record; + + /** + * 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 { @@ -155,6 +165,16 @@ export interface EvaluationCreateParams { * The template variables added to the prompt when executing the prompt. */ variables: Record; + + /** + * 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 { @@ -245,6 +265,16 @@ export interface EvaluationUpdateParams { * The template variables added to the prompt when executing the prompt. */ variables: Record; + + /** + * 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 { diff --git a/tests/api-resources/evaluation-assertions.test.ts b/tests/api-resources/evaluation-assertions.test.ts index df8e9ae..76bda47 100644 --- a/tests/api-resources/evaluation-assertions.test.ts +++ b/tests/api-resources/evaluation-assertions.test.ts @@ -33,6 +33,7 @@ describe('resource evaluationAssertions', () => { targetValue: 'targetValue', toolName: 'toolName', type: 'CONTAINS', + weight: 0, }); }); @@ -60,6 +61,7 @@ describe('resource evaluationAssertions', () => { targetValue: 'targetValue', toolName: 'toolName', type: 'CONTAINS', + weight: 0, }); }); diff --git a/tests/api-resources/evaluations.test.ts b/tests/api-resources/evaluations.test.ts index b51cd36..f73d7df 100644 --- a/tests/api-resources/evaluations.test.ts +++ b/tests/api-resources/evaluations.test.ts @@ -79,6 +79,8 @@ describe('resource evaluations', () => { ], promptId: 'promptId', variables: { foo: 'string' }, + threshold: 0, + weight: 0, }); }); @@ -152,6 +154,8 @@ describe('resource evaluations', () => { ], promptId: 'promptId', variables: { foo: 'string' }, + threshold: 0, + weight: 0, }); });