scorecard-ai 0.5.4 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +9 -3
- package/Client.js +8 -3
- package/README.md +9 -9
- package/api/resources/index.d.ts +3 -1
- package/api/resources/index.js +4 -2
- package/api/resources/prompt/client/Client.d.ts +49 -25
- package/api/resources/prompt/client/Client.js +194 -72
- package/api/resources/prompt/client/requests/PromptCreateParams.d.ts +8 -2
- package/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +19 -0
- package/api/resources/prompt/client/requests/PromptListPromptsRequest.d.ts +21 -0
- package/api/resources/prompt/client/requests/index.d.ts +2 -0
- package/api/resources/run/client/Client.d.ts +6 -3
- package/api/resources/run/client/Client.js +26 -23
- package/api/resources/runMetric/client/Client.d.ts +4 -1
- package/api/resources/runMetric/client/Client.js +8 -7
- package/api/resources/score/client/Client.d.ts +5 -2
- package/api/resources/score/client/Client.js +18 -16
- package/api/resources/scoringConfig/client/Client.d.ts +78 -0
- package/api/resources/scoringConfig/client/Client.js +336 -0
- package/api/resources/scoringConfig/client/index.d.ts +1 -0
- package/api/resources/scoringConfig/client/index.js +17 -0
- package/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +18 -0
- package/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +5 -0
- package/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/api/resources/testcase/client/Client.d.ts +55 -3
- package/api/resources/testcase/client/Client.js +308 -22
- package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
- package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
- package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
- package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
- package/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
- package/api/resources/testcase/client/requests/index.d.ts +3 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
- package/api/resources/testcase/types/index.d.ts +2 -0
- package/api/resources/testcase/types/index.js +2 -0
- package/api/resources/testrecord/client/Client.d.ts +5 -2
- package/api/resources/testrecord/client/Client.js +17 -15
- package/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +2 -0
- package/api/resources/testset/client/Client.d.ts +27 -8
- package/api/resources/testset/client/Client.js +148 -40
- package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -0
- package/api/resources/testset/client/requests/TestsetGetRequest.d.ts +11 -0
- package/api/resources/testset/client/requests/TestsetGetRequest.js +5 -0
- package/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
- package/api/resources/testset/client/requests/index.d.ts +2 -0
- package/api/resources/tracing/client/Client.d.ts +72 -0
- package/api/resources/tracing/client/Client.js +327 -0
- package/api/types/IngestionMethod.d.ts +8 -0
- package/api/types/IngestionMethod.js +10 -0
- package/api/types/Prompt.d.ts +2 -0
- package/api/types/PromptCursorPage.d.ts +17 -0
- package/api/types/PromptCursorPage.js +5 -0
- package/api/types/ScoringConfig.d.ts +18 -0
- package/api/types/ScoringConfig.js +5 -0
- package/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
- package/api/types/TestcaseBatchDeletionResponse.js +5 -0
- package/api/types/Testrecord.d.ts +2 -0
- package/api/types/Testset.d.ts +2 -0
- package/api/types/TestsetCursorPage.d.ts +17 -0
- package/api/types/TestsetCursorPage.js +5 -0
- package/api/types/Trace.d.ts +2 -0
- package/api/types/index.d.ts +8 -4
- package/api/types/index.js +8 -4
- package/core/fetcher/Fetcher.d.ts +4 -1
- package/core/fetcher/Fetcher.js +19 -176
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +13 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +59 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +52 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +32 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +37 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
- package/core/runtime/runtime.d.ts +2 -1
- package/core/runtime/runtime.js +12 -1
- package/core/schemas/Schema.d.ts +7 -4
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +8 -19
- package/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/core/schemas/builders/list/list.js +31 -44
- package/core/schemas/builders/object/object.js +90 -111
- package/core/schemas/builders/object/types.d.ts +2 -2
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/core/schemas/builders/record/record.js +49 -60
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/core/schemas/builders/set/set.js +6 -15
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/core/schemas/builders/union/union.js +51 -62
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +9 -3
- package/dist/Client.js +8 -3
- package/dist/api/resources/index.d.ts +3 -1
- package/dist/api/resources/index.js +4 -2
- package/dist/api/resources/prompt/client/Client.d.ts +49 -25
- package/dist/api/resources/prompt/client/Client.js +194 -72
- package/dist/api/resources/prompt/client/requests/PromptCreateParams.d.ts +8 -2
- package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +19 -0
- package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.js +5 -0
- package/dist/api/resources/prompt/client/requests/PromptListPromptsRequest.d.ts +21 -0
- package/dist/api/resources/prompt/client/requests/PromptListPromptsRequest.js +5 -0
- package/dist/api/resources/prompt/client/requests/index.d.ts +2 -0
- package/dist/api/resources/run/client/Client.d.ts +6 -3
- package/dist/api/resources/run/client/Client.js +26 -23
- package/dist/api/resources/runMetric/client/Client.d.ts +4 -1
- package/dist/api/resources/runMetric/client/Client.js +8 -7
- package/dist/api/resources/score/client/Client.d.ts +5 -2
- package/dist/api/resources/score/client/Client.js +18 -16
- package/dist/api/resources/scoringConfig/client/Client.d.ts +78 -0
- package/dist/api/resources/scoringConfig/client/Client.js +336 -0
- package/dist/api/resources/scoringConfig/client/index.d.ts +1 -0
- package/dist/api/resources/scoringConfig/client/index.js +17 -0
- package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +18 -0
- package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +5 -0
- package/dist/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/dist/api/resources/scoringConfig/client/requests/index.js +2 -0
- package/dist/api/resources/testcase/client/Client.d.ts +55 -3
- package/dist/api/resources/testcase/client/Client.js +308 -22
- package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
- package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
- package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
- package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
- package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
- package/dist/api/resources/testcase/client/requests/index.d.ts +3 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
- package/dist/api/resources/testcase/types/index.d.ts +2 -0
- package/dist/api/resources/testcase/types/index.js +2 -0
- package/dist/api/resources/testrecord/client/Client.d.ts +5 -2
- package/dist/api/resources/testrecord/client/Client.js +17 -15
- package/dist/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +2 -0
- package/dist/api/resources/testset/client/Client.d.ts +27 -8
- package/dist/api/resources/testset/client/Client.js +148 -40
- package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -0
- package/dist/api/resources/testset/client/requests/TestsetGetRequest.d.ts +11 -0
- package/dist/api/resources/testset/client/requests/TestsetGetRequest.js +5 -0
- package/dist/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/dist/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
- package/dist/api/resources/testset/client/requests/index.d.ts +2 -0
- package/dist/api/resources/tracing/client/Client.d.ts +72 -0
- package/dist/api/resources/tracing/client/Client.js +327 -0
- package/dist/api/resources/tracing/client/index.js +2 -0
- package/dist/api/types/IngestionMethod.d.ts +8 -0
- package/dist/api/types/IngestionMethod.js +10 -0
- package/dist/api/types/Prompt.d.ts +2 -0
- package/dist/api/types/PromptCursorPage.d.ts +17 -0
- package/dist/api/types/PromptCursorPage.js +5 -0
- package/dist/api/types/ScoringConfig.d.ts +18 -0
- package/dist/api/types/ScoringConfig.js +5 -0
- package/dist/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
- package/dist/api/types/TestcaseBatchDeletionResponse.js +5 -0
- package/dist/api/types/Testrecord.d.ts +2 -0
- package/dist/api/types/Testset.d.ts +2 -0
- package/dist/api/types/TestsetCursorPage.d.ts +17 -0
- package/dist/api/types/TestsetCursorPage.js +5 -0
- package/dist/api/types/Trace.d.ts +2 -0
- package/dist/api/types/index.d.ts +8 -4
- package/dist/api/types/index.js +8 -4
- package/dist/core/fetcher/Fetcher.d.ts +4 -1
- package/dist/core/fetcher/Fetcher.js +19 -176
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +13 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +59 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +52 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +32 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +37 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
- package/dist/core/runtime/runtime.d.ts +2 -1
- package/dist/core/runtime/runtime.js +12 -1
- package/dist/core/schemas/Schema.d.ts +7 -4
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +8 -19
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/dist/core/schemas/builders/list/list.js +31 -44
- package/dist/core/schemas/builders/object/object.js +90 -111
- package/dist/core/schemas/builders/object/types.d.ts +2 -2
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/dist/core/schemas/builders/record/record.js +49 -60
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/dist/core/schemas/builders/set/set.js +6 -15
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/dist/core/schemas/builders/union/union.js +51 -62
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/index.d.ts +3 -1
- package/dist/serialization/resources/index.js +4 -2
- package/dist/serialization/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -0
- package/dist/serialization/resources/prompt/client/requests/PromptCreateParams.js +2 -0
- package/dist/serialization/resources/scoringConfig/client/index.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/client/index.js +17 -0
- package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +15 -0
- package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +36 -0
- package/dist/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/client/requests/index.js +5 -0
- package/dist/serialization/resources/scoringConfig/index.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/index.js +17 -0
- package/dist/serialization/resources/testcase/client/batchCopy.d.ts +11 -0
- package/dist/serialization/resources/testcase/client/batchCopy.js +32 -0
- package/dist/serialization/resources/testcase/client/index.d.ts +1 -0
- package/dist/serialization/resources/testcase/client/index.js +14 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
- package/dist/serialization/resources/testcase/client/requests/index.d.ts +3 -0
- package/dist/serialization/resources/testcase/client/requests/index.js +7 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
- package/dist/serialization/resources/testcase/types/index.d.ts +2 -0
- package/dist/serialization/resources/testcase/types/index.js +2 -0
- package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
- package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +5 -0
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +5 -0
- package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
- package/dist/serialization/resources/testset/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/testset/client/requests/index.js +3 -1
- package/dist/serialization/resources/tracing/client/index.d.ts +1 -0
- package/{serialization/resources/traces → dist/serialization/resources/tracing}/client/index.js +2 -2
- package/dist/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
- package/dist/serialization/resources/tracing/client/traces.js +32 -0
- package/dist/serialization/resources/tracing/index.d.ts +1 -0
- package/dist/serialization/resources/tracing/index.js +17 -0
- package/dist/serialization/types/IngestionMethod.d.ts +10 -0
- package/dist/serialization/types/IngestionMethod.js +31 -0
- package/dist/serialization/types/JsonObject.js +2 -10
- package/dist/serialization/types/JsonObjectInputValue.js +3 -11
- package/dist/serialization/types/JsonObjectOutputValue.js +3 -11
- package/dist/serialization/types/Prompt.d.ts +1 -0
- package/dist/serialization/types/Prompt.js +1 -0
- package/dist/serialization/types/PromptCursorPage.d.ts +18 -0
- package/dist/serialization/types/PromptCursorPage.js +39 -0
- package/dist/serialization/types/ScoringConfig.d.ts +21 -0
- package/dist/serialization/types/ScoringConfig.js +42 -0
- package/dist/serialization/types/Span.js +2 -10
- package/dist/serialization/types/TestCaseCustomInputsValue.js +2 -10
- package/dist/serialization/types/TestCaseCustomLabelsValue.js +2 -10
- package/dist/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
- package/dist/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
- package/dist/serialization/types/Testrecord.d.ts +1 -0
- package/dist/serialization/types/Testrecord.js +1 -0
- package/dist/serialization/types/TestrecordCustomInputsValue.js +2 -10
- package/dist/serialization/types/TestrecordCustomLabelsValue.js +2 -10
- package/dist/serialization/types/TestrecordCustomOutputsValue.js +2 -10
- package/dist/serialization/types/Testset.d.ts +1 -0
- package/dist/serialization/types/Testset.js +1 -0
- package/dist/serialization/types/TestsetCursorPage.d.ts +18 -0
- package/dist/serialization/types/TestsetCursorPage.js +39 -0
- package/dist/serialization/types/Trace.d.ts +1 -0
- package/dist/serialization/types/Trace.js +2 -0
- package/dist/serialization/types/index.d.ts +8 -4
- package/dist/serialization/types/index.js +8 -4
- package/package.json +8 -2
- package/reference.md +840 -623
- package/serialization/resources/index.d.ts +3 -1
- package/serialization/resources/index.js +4 -2
- package/serialization/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -0
- package/serialization/resources/prompt/client/requests/PromptCreateParams.js +2 -0
- package/serialization/resources/scoringConfig/client/index.d.ts +1 -0
- package/serialization/resources/scoringConfig/client/index.js +17 -0
- package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +15 -0
- package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +36 -0
- package/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/serialization/resources/scoringConfig/client/requests/index.js +5 -0
- package/serialization/resources/scoringConfig/index.d.ts +1 -0
- package/serialization/resources/scoringConfig/index.js +17 -0
- package/serialization/resources/testcase/client/batchCopy.d.ts +11 -0
- package/serialization/resources/testcase/client/batchCopy.js +32 -0
- package/serialization/resources/testcase/client/index.d.ts +1 -0
- package/serialization/resources/testcase/client/index.js +14 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
- package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
- package/serialization/resources/testcase/client/requests/index.d.ts +3 -0
- package/serialization/resources/testcase/client/requests/index.js +7 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
- package/serialization/resources/testcase/types/index.d.ts +2 -0
- package/serialization/resources/testcase/types/index.js +2 -0
- package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
- package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
- package/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +5 -0
- package/serialization/resources/testset/client/requests/TestsetCreateParams.js +5 -0
- package/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
- package/serialization/resources/testset/client/requests/index.d.ts +1 -0
- package/serialization/resources/testset/client/requests/index.js +3 -1
- package/serialization/resources/tracing/client/index.d.ts +1 -0
- package/{dist/serialization/resources/traces → serialization/resources/tracing}/client/index.js +2 -2
- package/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
- package/serialization/resources/tracing/client/traces.js +32 -0
- package/serialization/resources/tracing/index.d.ts +1 -0
- package/serialization/resources/tracing/index.js +17 -0
- package/serialization/types/IngestionMethod.d.ts +10 -0
- package/serialization/types/IngestionMethod.js +31 -0
- package/serialization/types/JsonObject.js +2 -10
- package/serialization/types/JsonObjectInputValue.js +3 -11
- package/serialization/types/JsonObjectOutputValue.js +3 -11
- package/serialization/types/Prompt.d.ts +1 -0
- package/serialization/types/Prompt.js +1 -0
- package/serialization/types/PromptCursorPage.d.ts +18 -0
- package/serialization/types/PromptCursorPage.js +39 -0
- package/serialization/types/ScoringConfig.d.ts +21 -0
- package/serialization/types/ScoringConfig.js +42 -0
- package/serialization/types/Span.js +2 -10
- package/serialization/types/TestCaseCustomInputsValue.js +2 -10
- package/serialization/types/TestCaseCustomLabelsValue.js +2 -10
- package/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
- package/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
- package/serialization/types/Testrecord.d.ts +1 -0
- package/serialization/types/Testrecord.js +1 -0
- package/serialization/types/TestrecordCustomInputsValue.js +2 -10
- package/serialization/types/TestrecordCustomLabelsValue.js +2 -10
- package/serialization/types/TestrecordCustomOutputsValue.js +2 -10
- package/serialization/types/Testset.d.ts +1 -0
- package/serialization/types/Testset.js +1 -0
- package/serialization/types/TestsetCursorPage.d.ts +18 -0
- package/serialization/types/TestsetCursorPage.js +39 -0
- package/serialization/types/Trace.d.ts +1 -0
- package/serialization/types/Trace.js +2 -0
- package/serialization/types/index.d.ts +8 -4
- package/serialization/types/index.js +8 -4
- package/api/resources/traces/client/Client.d.ts +0 -40
- package/api/resources/traces/client/Client.js +0 -151
- package/api/types/TestCaseCreate.d.ts +0 -10
- package/dist/api/resources/traces/client/Client.d.ts +0 -40
- package/dist/api/resources/traces/client/Client.js +0 -151
- package/dist/api/types/TestCaseCreate.d.ts +0 -10
- package/dist/serialization/resources/traces/client/index.d.ts +0 -1
- package/dist/serialization/types/TestCaseCreate.d.ts +0 -16
- package/serialization/resources/traces/client/index.d.ts +0 -1
- package/serialization/types/TestCaseCreate.d.ts +0 -16
- /package/api/{types/TestCaseCreate.js → resources/prompt/client/requests/PromptGetByNameRequest.js} +0 -0
- /package/{dist/api/types/TestCaseCreate.js → api/resources/prompt/client/requests/PromptListPromptsRequest.js} +0 -0
- /package/api/resources/{traces/client → scoringConfig/client/requests}/index.js +0 -0
- /package/api/resources/{traces → scoringConfig}/index.d.ts +0 -0
- /package/api/resources/{traces → scoringConfig}/index.js +0 -0
- /package/api/resources/{traces → tracing}/client/index.d.ts +0 -0
- /package/{dist/api/resources/traces → api/resources/tracing}/client/index.js +0 -0
- /package/{dist/api/resources/traces → api/resources/tracing}/index.d.ts +0 -0
- /package/{dist/api/resources/traces → api/resources/tracing}/index.js +0 -0
- /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.d.ts +0 -0
- /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.js +0 -0
- /package/dist/api/resources/{traces → tracing}/client/index.d.ts +0 -0
- /package/{serialization/resources/traces → dist/api/resources/tracing}/index.d.ts +0 -0
- /package/{serialization/resources/traces → dist/api/resources/tracing}/index.js +0 -0
|
@@ -11,8 +11,11 @@ export declare namespace Run {
|
|
|
11
11
|
fetcher?: core.FetchFunction;
|
|
12
12
|
}
|
|
13
13
|
interface RequestOptions {
|
|
14
|
+
/** The maximum time to wait for a response in seconds. */
|
|
14
15
|
timeoutInSeconds?: number;
|
|
16
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
15
17
|
maxRetries?: number;
|
|
18
|
+
/** A hook to abort the request. */
|
|
16
19
|
abortSignal?: AbortSignal;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
@@ -31,7 +34,7 @@ export declare class Run {
|
|
|
31
34
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
32
35
|
*
|
|
33
36
|
* @example
|
|
34
|
-
* await
|
|
37
|
+
* await client.run.create()
|
|
35
38
|
*/
|
|
36
39
|
create(request?: Scorecard.RunCreateParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
|
|
37
40
|
/**
|
|
@@ -46,7 +49,7 @@ export declare class Run {
|
|
|
46
49
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
47
50
|
*
|
|
48
51
|
* @example
|
|
49
|
-
* await
|
|
52
|
+
* await client.run.get(1)
|
|
50
53
|
*/
|
|
51
54
|
get(runId: number, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
|
|
52
55
|
/**
|
|
@@ -62,7 +65,7 @@ export declare class Run {
|
|
|
62
65
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
63
66
|
*
|
|
64
67
|
* @example
|
|
65
|
-
* await
|
|
68
|
+
* await client.run.updateStatus(1)
|
|
66
69
|
*/
|
|
67
70
|
updateStatus(runId: number, request?: Scorecard.UpdateStatusParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
|
|
68
71
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
@@ -61,7 +61,7 @@ class Run {
|
|
|
61
61
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
62
62
|
*
|
|
63
63
|
* @example
|
|
64
|
-
* await
|
|
64
|
+
* await client.run.create()
|
|
65
65
|
*/
|
|
66
66
|
create(request = {}, requestOptions) {
|
|
67
67
|
var _a, _b;
|
|
@@ -69,15 +69,16 @@ class Run {
|
|
|
69
69
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
70
70
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/run"),
|
|
71
71
|
method: "POST",
|
|
72
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
72
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
73
73
|
contentType: "application/json",
|
|
74
|
-
|
|
74
|
+
requestType: "json",
|
|
75
|
+
body: serializers.RunCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
75
76
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
76
77
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
77
78
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
78
79
|
});
|
|
79
80
|
if (_response.ok) {
|
|
80
|
-
return
|
|
81
|
+
return serializers.Run.parseOrThrow(_response.body, {
|
|
81
82
|
unrecognizedObjectKeys: "passthrough",
|
|
82
83
|
allowUnrecognizedUnionMembers: true,
|
|
83
84
|
allowUnrecognizedEnumValues: true,
|
|
@@ -88,7 +89,7 @@ class Run {
|
|
|
88
89
|
if (_response.error.reason === "status-code") {
|
|
89
90
|
switch (_response.error.statusCode) {
|
|
90
91
|
case 401:
|
|
91
|
-
throw new Scorecard.UnauthorizedError(
|
|
92
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
92
93
|
unrecognizedObjectKeys: "passthrough",
|
|
93
94
|
allowUnrecognizedUnionMembers: true,
|
|
94
95
|
allowUnrecognizedEnumValues: true,
|
|
@@ -96,7 +97,7 @@ class Run {
|
|
|
96
97
|
breadcrumbsPrefix: ["response"],
|
|
97
98
|
}));
|
|
98
99
|
case 403:
|
|
99
|
-
throw new Scorecard.ForbiddenError(
|
|
100
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
100
101
|
unrecognizedObjectKeys: "passthrough",
|
|
101
102
|
allowUnrecognizedUnionMembers: true,
|
|
102
103
|
allowUnrecognizedEnumValues: true,
|
|
@@ -104,7 +105,7 @@ class Run {
|
|
|
104
105
|
breadcrumbsPrefix: ["response"],
|
|
105
106
|
}));
|
|
106
107
|
case 404:
|
|
107
|
-
throw new Scorecard.NotFoundError(
|
|
108
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
108
109
|
unrecognizedObjectKeys: "passthrough",
|
|
109
110
|
allowUnrecognizedUnionMembers: true,
|
|
110
111
|
allowUnrecognizedEnumValues: true,
|
|
@@ -112,7 +113,7 @@ class Run {
|
|
|
112
113
|
breadcrumbsPrefix: ["response"],
|
|
113
114
|
}));
|
|
114
115
|
case 422:
|
|
115
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
116
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
116
117
|
unrecognizedObjectKeys: "passthrough",
|
|
117
118
|
allowUnrecognizedUnionMembers: true,
|
|
118
119
|
allowUnrecognizedEnumValues: true,
|
|
@@ -153,7 +154,7 @@ class Run {
|
|
|
153
154
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
154
155
|
*
|
|
155
156
|
* @example
|
|
156
|
-
* await
|
|
157
|
+
* await client.run.get(1)
|
|
157
158
|
*/
|
|
158
159
|
get(runId, requestOptions) {
|
|
159
160
|
var _a, _b;
|
|
@@ -161,14 +162,15 @@ class Run {
|
|
|
161
162
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
162
163
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}`),
|
|
163
164
|
method: "GET",
|
|
164
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
165
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
165
166
|
contentType: "application/json",
|
|
167
|
+
requestType: "json",
|
|
166
168
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
167
169
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
168
170
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
169
171
|
});
|
|
170
172
|
if (_response.ok) {
|
|
171
|
-
return
|
|
173
|
+
return serializers.Run.parseOrThrow(_response.body, {
|
|
172
174
|
unrecognizedObjectKeys: "passthrough",
|
|
173
175
|
allowUnrecognizedUnionMembers: true,
|
|
174
176
|
allowUnrecognizedEnumValues: true,
|
|
@@ -179,7 +181,7 @@ class Run {
|
|
|
179
181
|
if (_response.error.reason === "status-code") {
|
|
180
182
|
switch (_response.error.statusCode) {
|
|
181
183
|
case 401:
|
|
182
|
-
throw new Scorecard.UnauthorizedError(
|
|
184
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
183
185
|
unrecognizedObjectKeys: "passthrough",
|
|
184
186
|
allowUnrecognizedUnionMembers: true,
|
|
185
187
|
allowUnrecognizedEnumValues: true,
|
|
@@ -187,7 +189,7 @@ class Run {
|
|
|
187
189
|
breadcrumbsPrefix: ["response"],
|
|
188
190
|
}));
|
|
189
191
|
case 403:
|
|
190
|
-
throw new Scorecard.ForbiddenError(
|
|
192
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
191
193
|
unrecognizedObjectKeys: "passthrough",
|
|
192
194
|
allowUnrecognizedUnionMembers: true,
|
|
193
195
|
allowUnrecognizedEnumValues: true,
|
|
@@ -195,7 +197,7 @@ class Run {
|
|
|
195
197
|
breadcrumbsPrefix: ["response"],
|
|
196
198
|
}));
|
|
197
199
|
case 404:
|
|
198
|
-
throw new Scorecard.NotFoundError(
|
|
200
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
199
201
|
unrecognizedObjectKeys: "passthrough",
|
|
200
202
|
allowUnrecognizedUnionMembers: true,
|
|
201
203
|
allowUnrecognizedEnumValues: true,
|
|
@@ -203,7 +205,7 @@ class Run {
|
|
|
203
205
|
breadcrumbsPrefix: ["response"],
|
|
204
206
|
}));
|
|
205
207
|
case 422:
|
|
206
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
208
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
207
209
|
unrecognizedObjectKeys: "passthrough",
|
|
208
210
|
allowUnrecognizedUnionMembers: true,
|
|
209
211
|
allowUnrecognizedEnumValues: true,
|
|
@@ -245,7 +247,7 @@ class Run {
|
|
|
245
247
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
246
248
|
*
|
|
247
249
|
* @example
|
|
248
|
-
* await
|
|
250
|
+
* await client.run.updateStatus(1)
|
|
249
251
|
*/
|
|
250
252
|
updateStatus(runId, request = {}, requestOptions) {
|
|
251
253
|
var _a, _b;
|
|
@@ -253,15 +255,16 @@ class Run {
|
|
|
253
255
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
254
256
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/status`),
|
|
255
257
|
method: "PATCH",
|
|
256
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
258
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
257
259
|
contentType: "application/json",
|
|
258
|
-
|
|
260
|
+
requestType: "json",
|
|
261
|
+
body: serializers.UpdateStatusParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
259
262
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
260
263
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
261
264
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
262
265
|
});
|
|
263
266
|
if (_response.ok) {
|
|
264
|
-
return
|
|
267
|
+
return serializers.Run.parseOrThrow(_response.body, {
|
|
265
268
|
unrecognizedObjectKeys: "passthrough",
|
|
266
269
|
allowUnrecognizedUnionMembers: true,
|
|
267
270
|
allowUnrecognizedEnumValues: true,
|
|
@@ -272,7 +275,7 @@ class Run {
|
|
|
272
275
|
if (_response.error.reason === "status-code") {
|
|
273
276
|
switch (_response.error.statusCode) {
|
|
274
277
|
case 401:
|
|
275
|
-
throw new Scorecard.UnauthorizedError(
|
|
278
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
276
279
|
unrecognizedObjectKeys: "passthrough",
|
|
277
280
|
allowUnrecognizedUnionMembers: true,
|
|
278
281
|
allowUnrecognizedEnumValues: true,
|
|
@@ -280,7 +283,7 @@ class Run {
|
|
|
280
283
|
breadcrumbsPrefix: ["response"],
|
|
281
284
|
}));
|
|
282
285
|
case 403:
|
|
283
|
-
throw new Scorecard.ForbiddenError(
|
|
286
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
284
287
|
unrecognizedObjectKeys: "passthrough",
|
|
285
288
|
allowUnrecognizedUnionMembers: true,
|
|
286
289
|
allowUnrecognizedEnumValues: true,
|
|
@@ -288,7 +291,7 @@ class Run {
|
|
|
288
291
|
breadcrumbsPrefix: ["response"],
|
|
289
292
|
}));
|
|
290
293
|
case 404:
|
|
291
|
-
throw new Scorecard.NotFoundError(
|
|
294
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
292
295
|
unrecognizedObjectKeys: "passthrough",
|
|
293
296
|
allowUnrecognizedUnionMembers: true,
|
|
294
297
|
allowUnrecognizedEnumValues: true,
|
|
@@ -296,7 +299,7 @@ class Run {
|
|
|
296
299
|
breadcrumbsPrefix: ["response"],
|
|
297
300
|
}));
|
|
298
301
|
case 422:
|
|
299
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
302
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
300
303
|
unrecognizedObjectKeys: "passthrough",
|
|
301
304
|
allowUnrecognizedUnionMembers: true,
|
|
302
305
|
allowUnrecognizedEnumValues: true,
|
|
@@ -11,8 +11,11 @@ export declare namespace RunMetric {
|
|
|
11
11
|
fetcher?: core.FetchFunction;
|
|
12
12
|
}
|
|
13
13
|
interface RequestOptions {
|
|
14
|
+
/** The maximum time to wait for a response in seconds. */
|
|
14
15
|
timeoutInSeconds?: number;
|
|
16
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
15
17
|
maxRetries?: number;
|
|
18
|
+
/** A hook to abort the request. */
|
|
16
19
|
abortSignal?: AbortSignal;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
@@ -31,7 +34,7 @@ export declare class RunMetric {
|
|
|
31
34
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
32
35
|
*
|
|
33
36
|
* @example
|
|
34
|
-
* await
|
|
37
|
+
* await client.runMetric.get(1)
|
|
35
38
|
*/
|
|
36
39
|
get(runId: number, requestOptions?: RunMetric.RequestOptions): Promise<Scorecard.RunMetric[]>;
|
|
37
40
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
@@ -61,7 +61,7 @@ class RunMetric {
|
|
|
61
61
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
62
62
|
*
|
|
63
63
|
* @example
|
|
64
|
-
* await
|
|
64
|
+
* await client.runMetric.get(1)
|
|
65
65
|
*/
|
|
66
66
|
get(runId, requestOptions) {
|
|
67
67
|
var _a, _b;
|
|
@@ -69,14 +69,15 @@ class RunMetric {
|
|
|
69
69
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
70
70
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run_metric/${encodeURIComponent(runId)}`),
|
|
71
71
|
method: "GET",
|
|
72
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
72
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
73
73
|
contentType: "application/json",
|
|
74
|
+
requestType: "json",
|
|
74
75
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
75
76
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
76
77
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
77
78
|
});
|
|
78
79
|
if (_response.ok) {
|
|
79
|
-
return
|
|
80
|
+
return serializers.runMetric.get.Response.parseOrThrow(_response.body, {
|
|
80
81
|
unrecognizedObjectKeys: "passthrough",
|
|
81
82
|
allowUnrecognizedUnionMembers: true,
|
|
82
83
|
allowUnrecognizedEnumValues: true,
|
|
@@ -87,7 +88,7 @@ class RunMetric {
|
|
|
87
88
|
if (_response.error.reason === "status-code") {
|
|
88
89
|
switch (_response.error.statusCode) {
|
|
89
90
|
case 401:
|
|
90
|
-
throw new Scorecard.UnauthorizedError(
|
|
91
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
91
92
|
unrecognizedObjectKeys: "passthrough",
|
|
92
93
|
allowUnrecognizedUnionMembers: true,
|
|
93
94
|
allowUnrecognizedEnumValues: true,
|
|
@@ -95,7 +96,7 @@ class RunMetric {
|
|
|
95
96
|
breadcrumbsPrefix: ["response"],
|
|
96
97
|
}));
|
|
97
98
|
case 403:
|
|
98
|
-
throw new Scorecard.ForbiddenError(
|
|
99
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
99
100
|
unrecognizedObjectKeys: "passthrough",
|
|
100
101
|
allowUnrecognizedUnionMembers: true,
|
|
101
102
|
allowUnrecognizedEnumValues: true,
|
|
@@ -103,7 +104,7 @@ class RunMetric {
|
|
|
103
104
|
breadcrumbsPrefix: ["response"],
|
|
104
105
|
}));
|
|
105
106
|
case 404:
|
|
106
|
-
throw new Scorecard.NotFoundError(
|
|
107
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
107
108
|
unrecognizedObjectKeys: "passthrough",
|
|
108
109
|
allowUnrecognizedUnionMembers: true,
|
|
109
110
|
allowUnrecognizedEnumValues: true,
|
|
@@ -111,7 +112,7 @@ class RunMetric {
|
|
|
111
112
|
breadcrumbsPrefix: ["response"],
|
|
112
113
|
}));
|
|
113
114
|
case 422:
|
|
114
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
115
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
115
116
|
unrecognizedObjectKeys: "passthrough",
|
|
116
117
|
allowUnrecognizedUnionMembers: true,
|
|
117
118
|
allowUnrecognizedEnumValues: true,
|
|
@@ -11,8 +11,11 @@ export declare namespace Score {
|
|
|
11
11
|
fetcher?: core.FetchFunction;
|
|
12
12
|
}
|
|
13
13
|
interface RequestOptions {
|
|
14
|
+
/** The maximum time to wait for a response in seconds. */
|
|
14
15
|
timeoutInSeconds?: number;
|
|
16
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
15
17
|
maxRetries?: number;
|
|
18
|
+
/** A hook to abort the request. */
|
|
16
19
|
abortSignal?: AbortSignal;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
@@ -33,7 +36,7 @@ export declare class Score {
|
|
|
33
36
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
34
37
|
*
|
|
35
38
|
* @example
|
|
36
|
-
* await
|
|
39
|
+
* await client.score.create(1, 1, {
|
|
37
40
|
* metricId: 1
|
|
38
41
|
* })
|
|
39
42
|
*/
|
|
@@ -53,7 +56,7 @@ export declare class Score {
|
|
|
53
56
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
54
57
|
*
|
|
55
58
|
* @example
|
|
56
|
-
* await
|
|
59
|
+
* await client.score.update(1, 1, 1)
|
|
57
60
|
*/
|
|
58
61
|
update(runId: number, testrecordId: number, scoreId: number, request?: Scorecard.ScoreUpdateParams, requestOptions?: Score.RequestOptions): Promise<Scorecard.Grade>;
|
|
59
62
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
@@ -63,7 +63,7 @@ class Score {
|
|
|
63
63
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
64
64
|
*
|
|
65
65
|
* @example
|
|
66
|
-
* await
|
|
66
|
+
* await client.score.create(1, 1, {
|
|
67
67
|
* metricId: 1
|
|
68
68
|
* })
|
|
69
69
|
*/
|
|
@@ -73,15 +73,16 @@ class Score {
|
|
|
73
73
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
74
74
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord/${encodeURIComponent(testrecordId)}/score`),
|
|
75
75
|
method: "POST",
|
|
76
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
76
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
77
77
|
contentType: "application/json",
|
|
78
|
-
|
|
78
|
+
requestType: "json",
|
|
79
|
+
body: serializers.ScoreCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
79
80
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
80
81
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
81
82
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
82
83
|
});
|
|
83
84
|
if (_response.ok) {
|
|
84
|
-
return
|
|
85
|
+
return serializers.Grade.parseOrThrow(_response.body, {
|
|
85
86
|
unrecognizedObjectKeys: "passthrough",
|
|
86
87
|
allowUnrecognizedUnionMembers: true,
|
|
87
88
|
allowUnrecognizedEnumValues: true,
|
|
@@ -92,7 +93,7 @@ class Score {
|
|
|
92
93
|
if (_response.error.reason === "status-code") {
|
|
93
94
|
switch (_response.error.statusCode) {
|
|
94
95
|
case 401:
|
|
95
|
-
throw new Scorecard.UnauthorizedError(
|
|
96
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
96
97
|
unrecognizedObjectKeys: "passthrough",
|
|
97
98
|
allowUnrecognizedUnionMembers: true,
|
|
98
99
|
allowUnrecognizedEnumValues: true,
|
|
@@ -100,7 +101,7 @@ class Score {
|
|
|
100
101
|
breadcrumbsPrefix: ["response"],
|
|
101
102
|
}));
|
|
102
103
|
case 403:
|
|
103
|
-
throw new Scorecard.ForbiddenError(
|
|
104
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
104
105
|
unrecognizedObjectKeys: "passthrough",
|
|
105
106
|
allowUnrecognizedUnionMembers: true,
|
|
106
107
|
allowUnrecognizedEnumValues: true,
|
|
@@ -108,7 +109,7 @@ class Score {
|
|
|
108
109
|
breadcrumbsPrefix: ["response"],
|
|
109
110
|
}));
|
|
110
111
|
case 404:
|
|
111
|
-
throw new Scorecard.NotFoundError(
|
|
112
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
112
113
|
unrecognizedObjectKeys: "passthrough",
|
|
113
114
|
allowUnrecognizedUnionMembers: true,
|
|
114
115
|
allowUnrecognizedEnumValues: true,
|
|
@@ -116,7 +117,7 @@ class Score {
|
|
|
116
117
|
breadcrumbsPrefix: ["response"],
|
|
117
118
|
}));
|
|
118
119
|
case 422:
|
|
119
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
120
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
120
121
|
unrecognizedObjectKeys: "passthrough",
|
|
121
122
|
allowUnrecognizedUnionMembers: true,
|
|
122
123
|
allowUnrecognizedEnumValues: true,
|
|
@@ -160,7 +161,7 @@ class Score {
|
|
|
160
161
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
161
162
|
*
|
|
162
163
|
* @example
|
|
163
|
-
* await
|
|
164
|
+
* await client.score.update(1, 1, 1)
|
|
164
165
|
*/
|
|
165
166
|
update(runId, testrecordId, scoreId, request = {}, requestOptions) {
|
|
166
167
|
var _a, _b;
|
|
@@ -168,15 +169,16 @@ class Score {
|
|
|
168
169
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
169
170
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord/${encodeURIComponent(testrecordId)}/score/${encodeURIComponent(scoreId)}`),
|
|
170
171
|
method: "PATCH",
|
|
171
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
172
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
172
173
|
contentType: "application/json",
|
|
173
|
-
|
|
174
|
+
requestType: "json",
|
|
175
|
+
body: serializers.ScoreUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
174
176
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
175
177
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
176
178
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
177
179
|
});
|
|
178
180
|
if (_response.ok) {
|
|
179
|
-
return
|
|
181
|
+
return serializers.Grade.parseOrThrow(_response.body, {
|
|
180
182
|
unrecognizedObjectKeys: "passthrough",
|
|
181
183
|
allowUnrecognizedUnionMembers: true,
|
|
182
184
|
allowUnrecognizedEnumValues: true,
|
|
@@ -187,7 +189,7 @@ class Score {
|
|
|
187
189
|
if (_response.error.reason === "status-code") {
|
|
188
190
|
switch (_response.error.statusCode) {
|
|
189
191
|
case 401:
|
|
190
|
-
throw new Scorecard.UnauthorizedError(
|
|
192
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
191
193
|
unrecognizedObjectKeys: "passthrough",
|
|
192
194
|
allowUnrecognizedUnionMembers: true,
|
|
193
195
|
allowUnrecognizedEnumValues: true,
|
|
@@ -195,7 +197,7 @@ class Score {
|
|
|
195
197
|
breadcrumbsPrefix: ["response"],
|
|
196
198
|
}));
|
|
197
199
|
case 403:
|
|
198
|
-
throw new Scorecard.ForbiddenError(
|
|
200
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
199
201
|
unrecognizedObjectKeys: "passthrough",
|
|
200
202
|
allowUnrecognizedUnionMembers: true,
|
|
201
203
|
allowUnrecognizedEnumValues: true,
|
|
@@ -203,7 +205,7 @@ class Score {
|
|
|
203
205
|
breadcrumbsPrefix: ["response"],
|
|
204
206
|
}));
|
|
205
207
|
case 404:
|
|
206
|
-
throw new Scorecard.NotFoundError(
|
|
208
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
207
209
|
unrecognizedObjectKeys: "passthrough",
|
|
208
210
|
allowUnrecognizedUnionMembers: true,
|
|
209
211
|
allowUnrecognizedEnumValues: true,
|
|
@@ -211,7 +213,7 @@ class Score {
|
|
|
211
213
|
breadcrumbsPrefix: ["response"],
|
|
212
214
|
}));
|
|
213
215
|
case 422:
|
|
214
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
216
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
215
217
|
unrecognizedObjectKeys: "passthrough",
|
|
216
218
|
allowUnrecognizedUnionMembers: true,
|
|
217
219
|
allowUnrecognizedEnumValues: true,
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
5
|
+
import * as core from "../../../../core";
|
|
6
|
+
import * as Scorecard from "../../../index";
|
|
7
|
+
export declare namespace ScoringConfig {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ScorecardEnvironment | string>;
|
|
10
|
+
apiKey: core.Supplier<string>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
12
|
+
}
|
|
13
|
+
interface RequestOptions {
|
|
14
|
+
/** The maximum time to wait for a response in seconds. */
|
|
15
|
+
timeoutInSeconds?: number;
|
|
16
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
17
|
+
maxRetries?: number;
|
|
18
|
+
/** A hook to abort the request. */
|
|
19
|
+
abortSignal?: AbortSignal;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export declare class ScoringConfig {
|
|
23
|
+
protected readonly _options: ScoringConfig.Options;
|
|
24
|
+
constructor(_options: ScoringConfig.Options);
|
|
25
|
+
/**
|
|
26
|
+
* Create a new scoring config.
|
|
27
|
+
*
|
|
28
|
+
* @param {Scorecard.ScoringConfigCreateParams} request
|
|
29
|
+
* @param {ScoringConfig.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
|
+
*
|
|
31
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
32
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
33
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
34
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* await client.scoringConfig.create({
|
|
38
|
+
* name: "Scoring Config Name",
|
|
39
|
+
* description: "Description of the scoring config",
|
|
40
|
+
* metrics: [1, 2, 3],
|
|
41
|
+
* projectId: 1
|
|
42
|
+
* })
|
|
43
|
+
*/
|
|
44
|
+
create(request?: Scorecard.ScoringConfigCreateParams, requestOptions?: ScoringConfig.RequestOptions): Promise<Scorecard.ScoringConfig>;
|
|
45
|
+
/**
|
|
46
|
+
* Retrieve a scoring config by id
|
|
47
|
+
*
|
|
48
|
+
* @param {string} id - The id of the scoring config to get.
|
|
49
|
+
* @param {ScoringConfig.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
|
+
*
|
|
51
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
52
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
53
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
54
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* await client.scoringConfig.get("id")
|
|
58
|
+
*/
|
|
59
|
+
get(id: string, requestOptions?: ScoringConfig.RequestOptions): Promise<Scorecard.ScoringConfig>;
|
|
60
|
+
/**
|
|
61
|
+
* Delete a scoring config.
|
|
62
|
+
*
|
|
63
|
+
* @param {string} id - The id of the scoring config to delete.
|
|
64
|
+
* @param {ScoringConfig.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
|
+
*
|
|
66
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
67
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
68
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
69
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* await client.scoringConfig.delete("id")
|
|
73
|
+
*/
|
|
74
|
+
delete(id: string, requestOptions?: ScoringConfig.RequestOptions): Promise<unknown>;
|
|
75
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
76
|
+
"X-API-Key": string;
|
|
77
|
+
}>;
|
|
78
|
+
}
|