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
|
@@ -50,9 +50,9 @@ class Testset {
|
|
|
50
50
|
this._options = _options;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* Retrieve
|
|
53
|
+
* Retrieve all Testsets with cursor-based pagination
|
|
54
54
|
*
|
|
55
|
-
* @param {
|
|
55
|
+
* @param {Scorecard.TestsetGetRequest} request
|
|
56
56
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
57
|
*
|
|
58
58
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -61,22 +61,32 @@ class Testset {
|
|
|
61
61
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
62
62
|
*
|
|
63
63
|
* @example
|
|
64
|
-
* await
|
|
64
|
+
* await client.testset.get()
|
|
65
65
|
*/
|
|
66
|
-
get(
|
|
66
|
+
get(request = {}, requestOptions) {
|
|
67
67
|
var _a, _b;
|
|
68
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const { cursor, size } = request;
|
|
70
|
+
const _queryParams = {};
|
|
71
|
+
if (cursor != null) {
|
|
72
|
+
_queryParams["cursor"] = cursor;
|
|
73
|
+
}
|
|
74
|
+
if (size != null) {
|
|
75
|
+
_queryParams["size"] = size.toString();
|
|
76
|
+
}
|
|
69
77
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
70
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default,
|
|
78
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/testset"),
|
|
71
79
|
method: "GET",
|
|
72
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
80
|
+
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
81
|
contentType: "application/json",
|
|
82
|
+
queryParameters: _queryParams,
|
|
83
|
+
requestType: "json",
|
|
74
84
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
75
85
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
76
86
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
77
87
|
});
|
|
78
88
|
if (_response.ok) {
|
|
79
|
-
return
|
|
89
|
+
return serializers.TestsetCursorPage.parseOrThrow(_response.body, {
|
|
80
90
|
unrecognizedObjectKeys: "passthrough",
|
|
81
91
|
allowUnrecognizedUnionMembers: true,
|
|
82
92
|
allowUnrecognizedEnumValues: true,
|
|
@@ -87,7 +97,7 @@ class Testset {
|
|
|
87
97
|
if (_response.error.reason === "status-code") {
|
|
88
98
|
switch (_response.error.statusCode) {
|
|
89
99
|
case 401:
|
|
90
|
-
throw new Scorecard.UnauthorizedError(
|
|
100
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
91
101
|
unrecognizedObjectKeys: "passthrough",
|
|
92
102
|
allowUnrecognizedUnionMembers: true,
|
|
93
103
|
allowUnrecognizedEnumValues: true,
|
|
@@ -95,7 +105,7 @@ class Testset {
|
|
|
95
105
|
breadcrumbsPrefix: ["response"],
|
|
96
106
|
}));
|
|
97
107
|
case 403:
|
|
98
|
-
throw new Scorecard.ForbiddenError(
|
|
108
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
99
109
|
unrecognizedObjectKeys: "passthrough",
|
|
100
110
|
allowUnrecognizedUnionMembers: true,
|
|
101
111
|
allowUnrecognizedEnumValues: true,
|
|
@@ -103,7 +113,7 @@ class Testset {
|
|
|
103
113
|
breadcrumbsPrefix: ["response"],
|
|
104
114
|
}));
|
|
105
115
|
case 404:
|
|
106
|
-
throw new Scorecard.NotFoundError(
|
|
116
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
107
117
|
unrecognizedObjectKeys: "passthrough",
|
|
108
118
|
allowUnrecognizedUnionMembers: true,
|
|
109
119
|
allowUnrecognizedEnumValues: true,
|
|
@@ -111,7 +121,7 @@ class Testset {
|
|
|
111
121
|
breadcrumbsPrefix: ["response"],
|
|
112
122
|
}));
|
|
113
123
|
case 422:
|
|
114
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
124
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
115
125
|
unrecognizedObjectKeys: "passthrough",
|
|
116
126
|
allowUnrecognizedUnionMembers: true,
|
|
117
127
|
allowUnrecognizedEnumValues: true,
|
|
@@ -152,7 +162,7 @@ class Testset {
|
|
|
152
162
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
153
163
|
*
|
|
154
164
|
* @example
|
|
155
|
-
* await
|
|
165
|
+
* await client.testset.delete(1)
|
|
156
166
|
*/
|
|
157
167
|
delete(testsetId, requestOptions) {
|
|
158
168
|
var _a, _b;
|
|
@@ -160,14 +170,109 @@ class Testset {
|
|
|
160
170
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
161
171
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}`),
|
|
162
172
|
method: "DELETE",
|
|
163
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
173
|
+
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())),
|
|
174
|
+
contentType: "application/json",
|
|
175
|
+
requestType: "json",
|
|
176
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
177
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
178
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
179
|
+
});
|
|
180
|
+
if (_response.ok) {
|
|
181
|
+
return serializers.Testset.parseOrThrow(_response.body, {
|
|
182
|
+
unrecognizedObjectKeys: "passthrough",
|
|
183
|
+
allowUnrecognizedUnionMembers: true,
|
|
184
|
+
allowUnrecognizedEnumValues: true,
|
|
185
|
+
skipValidation: true,
|
|
186
|
+
breadcrumbsPrefix: ["response"],
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
if (_response.error.reason === "status-code") {
|
|
190
|
+
switch (_response.error.statusCode) {
|
|
191
|
+
case 401:
|
|
192
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
193
|
+
unrecognizedObjectKeys: "passthrough",
|
|
194
|
+
allowUnrecognizedUnionMembers: true,
|
|
195
|
+
allowUnrecognizedEnumValues: true,
|
|
196
|
+
skipValidation: true,
|
|
197
|
+
breadcrumbsPrefix: ["response"],
|
|
198
|
+
}));
|
|
199
|
+
case 403:
|
|
200
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
201
|
+
unrecognizedObjectKeys: "passthrough",
|
|
202
|
+
allowUnrecognizedUnionMembers: true,
|
|
203
|
+
allowUnrecognizedEnumValues: true,
|
|
204
|
+
skipValidation: true,
|
|
205
|
+
breadcrumbsPrefix: ["response"],
|
|
206
|
+
}));
|
|
207
|
+
case 404:
|
|
208
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
209
|
+
unrecognizedObjectKeys: "passthrough",
|
|
210
|
+
allowUnrecognizedUnionMembers: true,
|
|
211
|
+
allowUnrecognizedEnumValues: true,
|
|
212
|
+
skipValidation: true,
|
|
213
|
+
breadcrumbsPrefix: ["response"],
|
|
214
|
+
}));
|
|
215
|
+
case 422:
|
|
216
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
217
|
+
unrecognizedObjectKeys: "passthrough",
|
|
218
|
+
allowUnrecognizedUnionMembers: true,
|
|
219
|
+
allowUnrecognizedEnumValues: true,
|
|
220
|
+
skipValidation: true,
|
|
221
|
+
breadcrumbsPrefix: ["response"],
|
|
222
|
+
}));
|
|
223
|
+
default:
|
|
224
|
+
throw new errors.ScorecardError({
|
|
225
|
+
statusCode: _response.error.statusCode,
|
|
226
|
+
body: _response.error.body,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
switch (_response.error.reason) {
|
|
231
|
+
case "non-json":
|
|
232
|
+
throw new errors.ScorecardError({
|
|
233
|
+
statusCode: _response.error.statusCode,
|
|
234
|
+
body: _response.error.rawBody,
|
|
235
|
+
});
|
|
236
|
+
case "timeout":
|
|
237
|
+
throw new errors.ScorecardTimeoutError();
|
|
238
|
+
case "unknown":
|
|
239
|
+
throw new errors.ScorecardError({
|
|
240
|
+
message: _response.error.errorMessage,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Update a Testset.
|
|
247
|
+
*
|
|
248
|
+
* @param {number} testsetId - The ID of the Testset to update.
|
|
249
|
+
* @param {Scorecard.TestsetUpdateParams} request
|
|
250
|
+
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
251
|
+
*
|
|
252
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
253
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
254
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
255
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* await client.testset.update(1)
|
|
259
|
+
*/
|
|
260
|
+
update(testsetId, request = {}, requestOptions) {
|
|
261
|
+
var _a, _b;
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
264
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}`),
|
|
265
|
+
method: "PATCH",
|
|
266
|
+
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())),
|
|
164
267
|
contentType: "application/json",
|
|
268
|
+
requestType: "json",
|
|
269
|
+
body: serializers.TestsetUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
165
270
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
166
271
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
167
272
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
168
273
|
});
|
|
169
274
|
if (_response.ok) {
|
|
170
|
-
return
|
|
275
|
+
return serializers.Testset.parseOrThrow(_response.body, {
|
|
171
276
|
unrecognizedObjectKeys: "passthrough",
|
|
172
277
|
allowUnrecognizedUnionMembers: true,
|
|
173
278
|
allowUnrecognizedEnumValues: true,
|
|
@@ -178,7 +283,7 @@ class Testset {
|
|
|
178
283
|
if (_response.error.reason === "status-code") {
|
|
179
284
|
switch (_response.error.statusCode) {
|
|
180
285
|
case 401:
|
|
181
|
-
throw new Scorecard.UnauthorizedError(
|
|
286
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
182
287
|
unrecognizedObjectKeys: "passthrough",
|
|
183
288
|
allowUnrecognizedUnionMembers: true,
|
|
184
289
|
allowUnrecognizedEnumValues: true,
|
|
@@ -186,7 +291,7 @@ class Testset {
|
|
|
186
291
|
breadcrumbsPrefix: ["response"],
|
|
187
292
|
}));
|
|
188
293
|
case 403:
|
|
189
|
-
throw new Scorecard.ForbiddenError(
|
|
294
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
190
295
|
unrecognizedObjectKeys: "passthrough",
|
|
191
296
|
allowUnrecognizedUnionMembers: true,
|
|
192
297
|
allowUnrecognizedEnumValues: true,
|
|
@@ -194,7 +299,7 @@ class Testset {
|
|
|
194
299
|
breadcrumbsPrefix: ["response"],
|
|
195
300
|
}));
|
|
196
301
|
case 404:
|
|
197
|
-
throw new Scorecard.NotFoundError(
|
|
302
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
198
303
|
unrecognizedObjectKeys: "passthrough",
|
|
199
304
|
allowUnrecognizedUnionMembers: true,
|
|
200
305
|
allowUnrecognizedEnumValues: true,
|
|
@@ -202,7 +307,7 @@ class Testset {
|
|
|
202
307
|
breadcrumbsPrefix: ["response"],
|
|
203
308
|
}));
|
|
204
309
|
case 422:
|
|
205
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
310
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
206
311
|
unrecognizedObjectKeys: "passthrough",
|
|
207
312
|
allowUnrecognizedUnionMembers: true,
|
|
208
313
|
allowUnrecognizedEnumValues: true,
|
|
@@ -243,7 +348,7 @@ class Testset {
|
|
|
243
348
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
244
349
|
*
|
|
245
350
|
* @example
|
|
246
|
-
* await
|
|
351
|
+
* await client.testset.create({
|
|
247
352
|
* name: "name"
|
|
248
353
|
* })
|
|
249
354
|
*/
|
|
@@ -253,15 +358,16 @@ class Testset {
|
|
|
253
358
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
254
359
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/testset"),
|
|
255
360
|
method: "POST",
|
|
256
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
361
|
+
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
362
|
contentType: "application/json",
|
|
258
|
-
|
|
363
|
+
requestType: "json",
|
|
364
|
+
body: serializers.TestsetCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
259
365
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
260
366
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
261
367
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
262
368
|
});
|
|
263
369
|
if (_response.ok) {
|
|
264
|
-
return
|
|
370
|
+
return serializers.Testset.parseOrThrow(_response.body, {
|
|
265
371
|
unrecognizedObjectKeys: "passthrough",
|
|
266
372
|
allowUnrecognizedUnionMembers: true,
|
|
267
373
|
allowUnrecognizedEnumValues: true,
|
|
@@ -272,7 +378,7 @@ class Testset {
|
|
|
272
378
|
if (_response.error.reason === "status-code") {
|
|
273
379
|
switch (_response.error.statusCode) {
|
|
274
380
|
case 401:
|
|
275
|
-
throw new Scorecard.UnauthorizedError(
|
|
381
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
276
382
|
unrecognizedObjectKeys: "passthrough",
|
|
277
383
|
allowUnrecognizedUnionMembers: true,
|
|
278
384
|
allowUnrecognizedEnumValues: true,
|
|
@@ -280,7 +386,7 @@ class Testset {
|
|
|
280
386
|
breadcrumbsPrefix: ["response"],
|
|
281
387
|
}));
|
|
282
388
|
case 403:
|
|
283
|
-
throw new Scorecard.ForbiddenError(
|
|
389
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
284
390
|
unrecognizedObjectKeys: "passthrough",
|
|
285
391
|
allowUnrecognizedUnionMembers: true,
|
|
286
392
|
allowUnrecognizedEnumValues: true,
|
|
@@ -288,7 +394,7 @@ class Testset {
|
|
|
288
394
|
breadcrumbsPrefix: ["response"],
|
|
289
395
|
}));
|
|
290
396
|
case 404:
|
|
291
|
-
throw new Scorecard.NotFoundError(
|
|
397
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
292
398
|
unrecognizedObjectKeys: "passthrough",
|
|
293
399
|
allowUnrecognizedUnionMembers: true,
|
|
294
400
|
allowUnrecognizedEnumValues: true,
|
|
@@ -296,7 +402,7 @@ class Testset {
|
|
|
296
402
|
breadcrumbsPrefix: ["response"],
|
|
297
403
|
}));
|
|
298
404
|
case 422:
|
|
299
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
405
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
300
406
|
unrecognizedObjectKeys: "passthrough",
|
|
301
407
|
allowUnrecognizedUnionMembers: true,
|
|
302
408
|
allowUnrecognizedEnumValues: true,
|
|
@@ -337,7 +443,7 @@ class Testset {
|
|
|
337
443
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
338
444
|
*
|
|
339
445
|
* @example
|
|
340
|
-
* await
|
|
446
|
+
* await client.testset.readSchema(1)
|
|
341
447
|
*/
|
|
342
448
|
readSchema(testsetId, requestOptions) {
|
|
343
449
|
var _a, _b;
|
|
@@ -345,14 +451,15 @@ class Testset {
|
|
|
345
451
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
346
452
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/schema`),
|
|
347
453
|
method: "GET",
|
|
348
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
454
|
+
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())),
|
|
349
455
|
contentType: "application/json",
|
|
456
|
+
requestType: "json",
|
|
350
457
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
351
458
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
352
459
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
353
460
|
});
|
|
354
461
|
if (_response.ok) {
|
|
355
|
-
return
|
|
462
|
+
return serializers.CustomSchema.parseOrThrow(_response.body, {
|
|
356
463
|
unrecognizedObjectKeys: "passthrough",
|
|
357
464
|
allowUnrecognizedUnionMembers: true,
|
|
358
465
|
allowUnrecognizedEnumValues: true,
|
|
@@ -363,7 +470,7 @@ class Testset {
|
|
|
363
470
|
if (_response.error.reason === "status-code") {
|
|
364
471
|
switch (_response.error.statusCode) {
|
|
365
472
|
case 401:
|
|
366
|
-
throw new Scorecard.UnauthorizedError(
|
|
473
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
367
474
|
unrecognizedObjectKeys: "passthrough",
|
|
368
475
|
allowUnrecognizedUnionMembers: true,
|
|
369
476
|
allowUnrecognizedEnumValues: true,
|
|
@@ -371,7 +478,7 @@ class Testset {
|
|
|
371
478
|
breadcrumbsPrefix: ["response"],
|
|
372
479
|
}));
|
|
373
480
|
case 403:
|
|
374
|
-
throw new Scorecard.ForbiddenError(
|
|
481
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
375
482
|
unrecognizedObjectKeys: "passthrough",
|
|
376
483
|
allowUnrecognizedUnionMembers: true,
|
|
377
484
|
allowUnrecognizedEnumValues: true,
|
|
@@ -379,7 +486,7 @@ class Testset {
|
|
|
379
486
|
breadcrumbsPrefix: ["response"],
|
|
380
487
|
}));
|
|
381
488
|
case 404:
|
|
382
|
-
throw new Scorecard.NotFoundError(
|
|
489
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
383
490
|
unrecognizedObjectKeys: "passthrough",
|
|
384
491
|
allowUnrecognizedUnionMembers: true,
|
|
385
492
|
allowUnrecognizedEnumValues: true,
|
|
@@ -387,7 +494,7 @@ class Testset {
|
|
|
387
494
|
breadcrumbsPrefix: ["response"],
|
|
388
495
|
}));
|
|
389
496
|
case 422:
|
|
390
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
497
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
391
498
|
unrecognizedObjectKeys: "passthrough",
|
|
392
499
|
allowUnrecognizedUnionMembers: true,
|
|
393
500
|
allowUnrecognizedEnumValues: true,
|
|
@@ -429,7 +536,7 @@ class Testset {
|
|
|
429
536
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
430
537
|
*
|
|
431
538
|
* @example
|
|
432
|
-
* await
|
|
539
|
+
* await client.testset.getTestcases(1)
|
|
433
540
|
*/
|
|
434
541
|
getTestcases(testsetId, request = {}, requestOptions) {
|
|
435
542
|
var _a, _b;
|
|
@@ -445,15 +552,16 @@ class Testset {
|
|
|
445
552
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
446
553
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase`),
|
|
447
554
|
method: "GET",
|
|
448
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
555
|
+
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())),
|
|
449
556
|
contentType: "application/json",
|
|
450
557
|
queryParameters: _queryParams,
|
|
558
|
+
requestType: "json",
|
|
451
559
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
452
560
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
453
561
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
454
562
|
});
|
|
455
563
|
if (_response.ok) {
|
|
456
|
-
return
|
|
564
|
+
return serializers.PaginatedTestcaseResponse.parseOrThrow(_response.body, {
|
|
457
565
|
unrecognizedObjectKeys: "passthrough",
|
|
458
566
|
allowUnrecognizedUnionMembers: true,
|
|
459
567
|
allowUnrecognizedEnumValues: true,
|
|
@@ -464,7 +572,7 @@ class Testset {
|
|
|
464
572
|
if (_response.error.reason === "status-code") {
|
|
465
573
|
switch (_response.error.statusCode) {
|
|
466
574
|
case 401:
|
|
467
|
-
throw new Scorecard.UnauthorizedError(
|
|
575
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
468
576
|
unrecognizedObjectKeys: "passthrough",
|
|
469
577
|
allowUnrecognizedUnionMembers: true,
|
|
470
578
|
allowUnrecognizedEnumValues: true,
|
|
@@ -472,7 +580,7 @@ class Testset {
|
|
|
472
580
|
breadcrumbsPrefix: ["response"],
|
|
473
581
|
}));
|
|
474
582
|
case 403:
|
|
475
|
-
throw new Scorecard.ForbiddenError(
|
|
583
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
476
584
|
unrecognizedObjectKeys: "passthrough",
|
|
477
585
|
allowUnrecognizedUnionMembers: true,
|
|
478
586
|
allowUnrecognizedEnumValues: true,
|
|
@@ -480,7 +588,7 @@ class Testset {
|
|
|
480
588
|
breadcrumbsPrefix: ["response"],
|
|
481
589
|
}));
|
|
482
590
|
case 404:
|
|
483
|
-
throw new Scorecard.NotFoundError(
|
|
591
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
484
592
|
unrecognizedObjectKeys: "passthrough",
|
|
485
593
|
allowUnrecognizedUnionMembers: true,
|
|
486
594
|
allowUnrecognizedEnumValues: true,
|
|
@@ -488,7 +596,7 @@ class Testset {
|
|
|
488
596
|
breadcrumbsPrefix: ["response"],
|
|
489
597
|
}));
|
|
490
598
|
case 422:
|
|
491
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
599
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
492
600
|
unrecognizedObjectKeys: "passthrough",
|
|
493
601
|
allowUnrecognizedUnionMembers: true,
|
|
494
602
|
allowUnrecognizedEnumValues: true,
|
|
@@ -15,4 +15,12 @@ export interface TestsetCreateParams {
|
|
|
15
15
|
/** Whether or not the testset uses retrieval. */
|
|
16
16
|
usingRetrieval?: boolean;
|
|
17
17
|
customSchema?: Scorecard.CustomSchema;
|
|
18
|
+
/** The ID of the project to create the testset in. Omitting this optional argument will create the testset inside your Organization's default project. */
|
|
19
|
+
projectId?: number;
|
|
20
|
+
/** The method of ingestion for the testset. */
|
|
21
|
+
ingestionMethod?: Scorecard.IngestionMethod;
|
|
22
|
+
/** Whether or not the testset is published. */
|
|
23
|
+
published?: boolean;
|
|
24
|
+
/** Whether or not the testset was created by the playground. */
|
|
25
|
+
createdByPlayground?: boolean;
|
|
18
26
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Scorecard from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {}
|
|
8
|
+
*/
|
|
9
|
+
export interface TestsetUpdateParams {
|
|
10
|
+
name?: string;
|
|
11
|
+
/** A description for the testset. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Whether or not the testset uses retrieval. */
|
|
14
|
+
usingRetrieval?: boolean;
|
|
15
|
+
customSchema?: Scorecard.CustomSchema;
|
|
16
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export { type TestsetGetRequest } from "./TestsetGetRequest";
|
|
2
|
+
export { type TestsetUpdateParams } from "./TestsetUpdateParams";
|
|
1
3
|
export { type TestsetCreateParams } from "./TestsetCreateParams";
|
|
2
4
|
export { type TestsetGetTestcasesRequest } from "./TestsetGetTestcasesRequest";
|
|
@@ -0,0 +1,72 @@
|
|
|
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 Tracing {
|
|
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 Tracing {
|
|
23
|
+
protected readonly _options: Tracing.Options;
|
|
24
|
+
constructor(_options: Tracing.Options);
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve traces
|
|
27
|
+
*
|
|
28
|
+
* @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
|
+
*
|
|
30
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
31
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
32
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* await client.tracing.traces()
|
|
36
|
+
*/
|
|
37
|
+
traces(requestOptions?: Tracing.RequestOptions): Promise<Scorecard.Trace[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Retrieve specified trace
|
|
40
|
+
*
|
|
41
|
+
* @param {string} traceId - The ID of the trace to retrieve spans from.
|
|
42
|
+
* @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
+
*
|
|
44
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
45
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
46
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
47
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* await client.tracing.trace("trace_id")
|
|
51
|
+
*/
|
|
52
|
+
trace(traceId: string, requestOptions?: Tracing.RequestOptions): Promise<Scorecard.Trace>;
|
|
53
|
+
/**
|
|
54
|
+
* Retrieve specified span
|
|
55
|
+
*
|
|
56
|
+
* @param {string} traceId - The ID of the trace which the span is a part of.
|
|
57
|
+
* @param {string} spanId - The ID of the span to retrieve.
|
|
58
|
+
* @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
|
|
59
|
+
*
|
|
60
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
61
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
62
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
63
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* await client.tracing.span("trace_id", "span_id")
|
|
67
|
+
*/
|
|
68
|
+
span(traceId: string, spanId: string, requestOptions?: Tracing.RequestOptions): Promise<Scorecard.Span>;
|
|
69
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
70
|
+
"X-API-Key": string;
|
|
71
|
+
}>;
|
|
72
|
+
}
|