scorecard-ai 0.5.3 → 0.6.0
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/api/resources/index.d.ts +3 -1
- package/api/resources/index.js +4 -2
- package/api/resources/prompt/client/Client.d.ts +27 -22
- package/api/resources/prompt/client/Client.js +110 -99
- package/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +15 -0
- package/api/resources/prompt/client/requests/index.d.ts +1 -0
- package/api/resources/run/client/Client.d.ts +6 -3
- package/api/resources/run/client/Client.js +26 -23
- package/api/resources/run/client/requests/RunCreateParams.d.ts +1 -0
- 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/score/client/requests/ScoreCreateParams.d.ts +3 -0
- package/api/resources/score/client/requests/ScoreUpdateParams.d.ts +3 -0
- package/api/resources/scoringConfig/client/Client.d.ts +62 -0
- package/{dist/api/resources/traces → api/resources/scoringConfig}/client/Client.js +114 -16
- 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 +16 -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/TestcaseCreateParams.d.ts +2 -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 +9 -0
- package/api/resources/testset/client/Client.d.ts +24 -5
- package/api/resources/testset/client/Client.js +135 -36
- package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -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 +1 -0
- package/api/resources/tracing/client/Client.d.ts +72 -0
- package/api/resources/tracing/client/Client.js +327 -0
- package/api/types/Grade.d.ts +11 -0
- package/api/types/IngestionMethod.d.ts +8 -0
- package/api/types/IngestionMethod.js +10 -0
- package/api/types/PaginatedTestcaseResponse.d.ts +2 -0
- package/api/types/Prompt.d.ts +2 -0
- package/api/types/Run.d.ts +14 -0
- package/api/types/ScoringConfig.d.ts +16 -0
- package/api/types/ScoringConfig.js +5 -0
- package/api/types/TestCase.d.ts +4 -0
- package/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
- package/api/types/TestcaseBatchDeletionResponse.js +5 -0
- package/api/types/Testrecord.d.ts +14 -0
- package/api/types/Testset.d.ts +11 -0
- package/api/types/Trace.d.ts +2 -0
- package/api/types/index.d.ts +6 -4
- package/api/types/index.js +6 -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 +27 -22
- package/dist/api/resources/prompt/client/Client.js +110 -99
- package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +15 -0
- package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.js +5 -0
- package/dist/api/resources/prompt/client/requests/index.d.ts +1 -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/run/client/requests/RunCreateParams.d.ts +1 -0
- 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/score/client/requests/ScoreCreateParams.d.ts +3 -0
- package/dist/api/resources/score/client/requests/ScoreUpdateParams.d.ts +3 -0
- package/dist/api/resources/scoringConfig/client/Client.d.ts +62 -0
- package/{api/resources/traces → dist/api/resources/scoringConfig}/client/Client.js +114 -16
- 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 +16 -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/TestcaseCreateParams.d.ts +2 -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 +9 -0
- package/dist/api/resources/testset/client/Client.d.ts +24 -5
- package/dist/api/resources/testset/client/Client.js +135 -36
- package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -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 +1 -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/Grade.d.ts +11 -0
- package/dist/api/types/IngestionMethod.d.ts +8 -0
- package/dist/api/types/IngestionMethod.js +10 -0
- package/dist/api/types/PaginatedTestcaseResponse.d.ts +2 -0
- package/dist/api/types/Prompt.d.ts +2 -0
- package/dist/api/types/Run.d.ts +14 -0
- package/dist/api/types/ScoringConfig.d.ts +16 -0
- package/dist/api/types/ScoringConfig.js +5 -0
- package/dist/api/types/TestCase.d.ts +4 -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 +14 -0
- package/dist/api/types/Testset.d.ts +11 -0
- package/dist/api/types/Trace.d.ts +2 -0
- package/dist/api/types/index.d.ts +6 -4
- package/dist/api/types/index.js +6 -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/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 +14 -0
- package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +35 -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/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 +4 -0
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +4 -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/ScoringConfig.d.ts +20 -0
- package/dist/serialization/types/ScoringConfig.js +41 -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/Trace.d.ts +1 -0
- package/dist/serialization/types/Trace.js +2 -0
- package/dist/serialization/types/index.d.ts +6 -4
- package/dist/serialization/types/index.js +6 -4
- package/dist/telemetry.d.ts +0 -5
- package/dist/telemetry.js +25 -7
- package/dist/wrapper/ScorecardClient.d.ts +3 -0
- package/dist/wrapper/ScorecardClient.js +11 -0
- package/package.json +13 -2
- package/reference.md +657 -569
- package/serialization/resources/index.d.ts +3 -1
- package/serialization/resources/index.js +4 -2
- 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 +14 -0
- package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +35 -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/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 +4 -0
- package/serialization/resources/testset/client/requests/TestsetCreateParams.js +4 -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/ScoringConfig.d.ts +20 -0
- package/serialization/types/ScoringConfig.js +41 -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/Trace.d.ts +1 -0
- package/serialization/types/Trace.js +2 -0
- package/serialization/types/index.d.ts +6 -4
- package/serialization/types/index.js +6 -4
- package/telemetry.d.ts +0 -5
- package/telemetry.js +25 -7
- package/wrapper/ScorecardClient.d.ts +3 -0
- package/wrapper/ScorecardClient.js +11 -0
- package/api/resources/traces/client/Client.d.ts +0 -40
- package/api/types/TestCaseCreate.d.ts +0 -10
- package/dist/api/resources/traces/client/Client.d.ts +0 -40
- 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/scoringConfig/client/requests/ScoringConfigCreateParams.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
|
@@ -62,7 +62,7 @@ class Testcase {
|
|
|
62
62
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
|
-
* await
|
|
65
|
+
* await client.testcase.create(1)
|
|
66
66
|
*/
|
|
67
67
|
create(testsetId, request = {}, requestOptions) {
|
|
68
68
|
var _a, _b;
|
|
@@ -70,15 +70,16 @@ class Testcase {
|
|
|
70
70
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
71
71
|
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`),
|
|
72
72
|
method: "POST",
|
|
73
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
73
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
74
74
|
contentType: "application/json",
|
|
75
|
-
|
|
75
|
+
requestType: "json",
|
|
76
|
+
body: serializers.TestcaseCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
76
77
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
77
78
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
78
79
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
79
80
|
});
|
|
80
81
|
if (_response.ok) {
|
|
81
|
-
return
|
|
82
|
+
return serializers.TestCase.parseOrThrow(_response.body, {
|
|
82
83
|
unrecognizedObjectKeys: "passthrough",
|
|
83
84
|
allowUnrecognizedUnionMembers: true,
|
|
84
85
|
allowUnrecognizedEnumValues: true,
|
|
@@ -89,7 +90,7 @@ class Testcase {
|
|
|
89
90
|
if (_response.error.reason === "status-code") {
|
|
90
91
|
switch (_response.error.statusCode) {
|
|
91
92
|
case 401:
|
|
92
|
-
throw new Scorecard.UnauthorizedError(
|
|
93
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
93
94
|
unrecognizedObjectKeys: "passthrough",
|
|
94
95
|
allowUnrecognizedUnionMembers: true,
|
|
95
96
|
allowUnrecognizedEnumValues: true,
|
|
@@ -97,7 +98,7 @@ class Testcase {
|
|
|
97
98
|
breadcrumbsPrefix: ["response"],
|
|
98
99
|
}));
|
|
99
100
|
case 403:
|
|
100
|
-
throw new Scorecard.ForbiddenError(
|
|
101
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
101
102
|
unrecognizedObjectKeys: "passthrough",
|
|
102
103
|
allowUnrecognizedUnionMembers: true,
|
|
103
104
|
allowUnrecognizedEnumValues: true,
|
|
@@ -105,7 +106,7 @@ class Testcase {
|
|
|
105
106
|
breadcrumbsPrefix: ["response"],
|
|
106
107
|
}));
|
|
107
108
|
case 404:
|
|
108
|
-
throw new Scorecard.NotFoundError(
|
|
109
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
109
110
|
unrecognizedObjectKeys: "passthrough",
|
|
110
111
|
allowUnrecognizedUnionMembers: true,
|
|
111
112
|
allowUnrecognizedEnumValues: true,
|
|
@@ -113,7 +114,7 @@ class Testcase {
|
|
|
113
114
|
breadcrumbsPrefix: ["response"],
|
|
114
115
|
}));
|
|
115
116
|
case 422:
|
|
116
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
117
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
117
118
|
unrecognizedObjectKeys: "passthrough",
|
|
118
119
|
allowUnrecognizedUnionMembers: true,
|
|
119
120
|
allowUnrecognizedEnumValues: true,
|
|
@@ -155,7 +156,7 @@ class Testcase {
|
|
|
155
156
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
156
157
|
*
|
|
157
158
|
* @example
|
|
158
|
-
* await
|
|
159
|
+
* await client.testcase.get(1, 1)
|
|
159
160
|
*/
|
|
160
161
|
get(testcaseId, testsetId, requestOptions) {
|
|
161
162
|
var _a, _b;
|
|
@@ -163,14 +164,15 @@ class Testcase {
|
|
|
163
164
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
164
165
|
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/${encodeURIComponent(testcaseId)}`),
|
|
165
166
|
method: "GET",
|
|
166
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
167
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
167
168
|
contentType: "application/json",
|
|
169
|
+
requestType: "json",
|
|
168
170
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
169
171
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
170
172
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
171
173
|
});
|
|
172
174
|
if (_response.ok) {
|
|
173
|
-
return
|
|
175
|
+
return serializers.TestCase.parseOrThrow(_response.body, {
|
|
174
176
|
unrecognizedObjectKeys: "passthrough",
|
|
175
177
|
allowUnrecognizedUnionMembers: true,
|
|
176
178
|
allowUnrecognizedEnumValues: true,
|
|
@@ -181,7 +183,7 @@ class Testcase {
|
|
|
181
183
|
if (_response.error.reason === "status-code") {
|
|
182
184
|
switch (_response.error.statusCode) {
|
|
183
185
|
case 401:
|
|
184
|
-
throw new Scorecard.UnauthorizedError(
|
|
186
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
185
187
|
unrecognizedObjectKeys: "passthrough",
|
|
186
188
|
allowUnrecognizedUnionMembers: true,
|
|
187
189
|
allowUnrecognizedEnumValues: true,
|
|
@@ -189,7 +191,7 @@ class Testcase {
|
|
|
189
191
|
breadcrumbsPrefix: ["response"],
|
|
190
192
|
}));
|
|
191
193
|
case 403:
|
|
192
|
-
throw new Scorecard.ForbiddenError(
|
|
194
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
193
195
|
unrecognizedObjectKeys: "passthrough",
|
|
194
196
|
allowUnrecognizedUnionMembers: true,
|
|
195
197
|
allowUnrecognizedEnumValues: true,
|
|
@@ -197,7 +199,7 @@ class Testcase {
|
|
|
197
199
|
breadcrumbsPrefix: ["response"],
|
|
198
200
|
}));
|
|
199
201
|
case 404:
|
|
200
|
-
throw new Scorecard.NotFoundError(
|
|
202
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
201
203
|
unrecognizedObjectKeys: "passthrough",
|
|
202
204
|
allowUnrecognizedUnionMembers: true,
|
|
203
205
|
allowUnrecognizedEnumValues: true,
|
|
@@ -205,7 +207,7 @@ class Testcase {
|
|
|
205
207
|
breadcrumbsPrefix: ["response"],
|
|
206
208
|
}));
|
|
207
209
|
case 422:
|
|
208
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
210
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
209
211
|
unrecognizedObjectKeys: "passthrough",
|
|
210
212
|
allowUnrecognizedUnionMembers: true,
|
|
211
213
|
allowUnrecognizedEnumValues: true,
|
|
@@ -247,7 +249,7 @@ class Testcase {
|
|
|
247
249
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
248
250
|
*
|
|
249
251
|
* @example
|
|
250
|
-
* await
|
|
252
|
+
* await client.testcase.delete(1, 1)
|
|
251
253
|
*/
|
|
252
254
|
delete(testcaseId, testsetId, requestOptions) {
|
|
253
255
|
var _a, _b;
|
|
@@ -255,14 +257,15 @@ class Testcase {
|
|
|
255
257
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
256
258
|
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/${encodeURIComponent(testcaseId)}`),
|
|
257
259
|
method: "DELETE",
|
|
258
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
260
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
259
261
|
contentType: "application/json",
|
|
262
|
+
requestType: "json",
|
|
260
263
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
261
264
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
262
265
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
263
266
|
});
|
|
264
267
|
if (_response.ok) {
|
|
265
|
-
return
|
|
268
|
+
return serializers.TestcaseDeletionResponse.parseOrThrow(_response.body, {
|
|
266
269
|
unrecognizedObjectKeys: "passthrough",
|
|
267
270
|
allowUnrecognizedUnionMembers: true,
|
|
268
271
|
allowUnrecognizedEnumValues: true,
|
|
@@ -273,7 +276,7 @@ class Testcase {
|
|
|
273
276
|
if (_response.error.reason === "status-code") {
|
|
274
277
|
switch (_response.error.statusCode) {
|
|
275
278
|
case 401:
|
|
276
|
-
throw new Scorecard.UnauthorizedError(
|
|
279
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
277
280
|
unrecognizedObjectKeys: "passthrough",
|
|
278
281
|
allowUnrecognizedUnionMembers: true,
|
|
279
282
|
allowUnrecognizedEnumValues: true,
|
|
@@ -281,7 +284,7 @@ class Testcase {
|
|
|
281
284
|
breadcrumbsPrefix: ["response"],
|
|
282
285
|
}));
|
|
283
286
|
case 403:
|
|
284
|
-
throw new Scorecard.ForbiddenError(
|
|
287
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
285
288
|
unrecognizedObjectKeys: "passthrough",
|
|
286
289
|
allowUnrecognizedUnionMembers: true,
|
|
287
290
|
allowUnrecognizedEnumValues: true,
|
|
@@ -289,7 +292,7 @@ class Testcase {
|
|
|
289
292
|
breadcrumbsPrefix: ["response"],
|
|
290
293
|
}));
|
|
291
294
|
case 404:
|
|
292
|
-
throw new Scorecard.NotFoundError(
|
|
295
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
293
296
|
unrecognizedObjectKeys: "passthrough",
|
|
294
297
|
allowUnrecognizedUnionMembers: true,
|
|
295
298
|
allowUnrecognizedEnumValues: true,
|
|
@@ -297,7 +300,290 @@ class Testcase {
|
|
|
297
300
|
breadcrumbsPrefix: ["response"],
|
|
298
301
|
}));
|
|
299
302
|
case 422:
|
|
300
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
303
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
304
|
+
unrecognizedObjectKeys: "passthrough",
|
|
305
|
+
allowUnrecognizedUnionMembers: true,
|
|
306
|
+
allowUnrecognizedEnumValues: true,
|
|
307
|
+
skipValidation: true,
|
|
308
|
+
breadcrumbsPrefix: ["response"],
|
|
309
|
+
}));
|
|
310
|
+
default:
|
|
311
|
+
throw new errors.ScorecardError({
|
|
312
|
+
statusCode: _response.error.statusCode,
|
|
313
|
+
body: _response.error.body,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
switch (_response.error.reason) {
|
|
318
|
+
case "non-json":
|
|
319
|
+
throw new errors.ScorecardError({
|
|
320
|
+
statusCode: _response.error.statusCode,
|
|
321
|
+
body: _response.error.rawBody,
|
|
322
|
+
});
|
|
323
|
+
case "timeout":
|
|
324
|
+
throw new errors.ScorecardTimeoutError();
|
|
325
|
+
case "unknown":
|
|
326
|
+
throw new errors.ScorecardError({
|
|
327
|
+
message: _response.error.errorMessage,
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Update a Testcase.
|
|
334
|
+
*
|
|
335
|
+
* @param {number} testcaseId - The ID of the Testcase to update.
|
|
336
|
+
* @param {number} testsetId - The ID of the Testset to retrieve the Testcase from.
|
|
337
|
+
* @param {Scorecard.TestcaseUpdateParams} request
|
|
338
|
+
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
339
|
+
*
|
|
340
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
341
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
342
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
343
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* await client.testcase.update(1, 1)
|
|
347
|
+
*/
|
|
348
|
+
update(testcaseId, testsetId, request = {}, requestOptions) {
|
|
349
|
+
var _a, _b;
|
|
350
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
351
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
352
|
+
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/${encodeURIComponent(testcaseId)}`),
|
|
353
|
+
method: "PATCH",
|
|
354
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
355
|
+
contentType: "application/json",
|
|
356
|
+
requestType: "json",
|
|
357
|
+
body: serializers.TestcaseUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
358
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
359
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
360
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
361
|
+
});
|
|
362
|
+
if (_response.ok) {
|
|
363
|
+
return serializers.TestCase.parseOrThrow(_response.body, {
|
|
364
|
+
unrecognizedObjectKeys: "passthrough",
|
|
365
|
+
allowUnrecognizedUnionMembers: true,
|
|
366
|
+
allowUnrecognizedEnumValues: true,
|
|
367
|
+
skipValidation: true,
|
|
368
|
+
breadcrumbsPrefix: ["response"],
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
if (_response.error.reason === "status-code") {
|
|
372
|
+
switch (_response.error.statusCode) {
|
|
373
|
+
case 401:
|
|
374
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
375
|
+
unrecognizedObjectKeys: "passthrough",
|
|
376
|
+
allowUnrecognizedUnionMembers: true,
|
|
377
|
+
allowUnrecognizedEnumValues: true,
|
|
378
|
+
skipValidation: true,
|
|
379
|
+
breadcrumbsPrefix: ["response"],
|
|
380
|
+
}));
|
|
381
|
+
case 403:
|
|
382
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
383
|
+
unrecognizedObjectKeys: "passthrough",
|
|
384
|
+
allowUnrecognizedUnionMembers: true,
|
|
385
|
+
allowUnrecognizedEnumValues: true,
|
|
386
|
+
skipValidation: true,
|
|
387
|
+
breadcrumbsPrefix: ["response"],
|
|
388
|
+
}));
|
|
389
|
+
case 404:
|
|
390
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
391
|
+
unrecognizedObjectKeys: "passthrough",
|
|
392
|
+
allowUnrecognizedUnionMembers: true,
|
|
393
|
+
allowUnrecognizedEnumValues: true,
|
|
394
|
+
skipValidation: true,
|
|
395
|
+
breadcrumbsPrefix: ["response"],
|
|
396
|
+
}));
|
|
397
|
+
case 422:
|
|
398
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
399
|
+
unrecognizedObjectKeys: "passthrough",
|
|
400
|
+
allowUnrecognizedUnionMembers: true,
|
|
401
|
+
allowUnrecognizedEnumValues: true,
|
|
402
|
+
skipValidation: true,
|
|
403
|
+
breadcrumbsPrefix: ["response"],
|
|
404
|
+
}));
|
|
405
|
+
default:
|
|
406
|
+
throw new errors.ScorecardError({
|
|
407
|
+
statusCode: _response.error.statusCode,
|
|
408
|
+
body: _response.error.body,
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
switch (_response.error.reason) {
|
|
413
|
+
case "non-json":
|
|
414
|
+
throw new errors.ScorecardError({
|
|
415
|
+
statusCode: _response.error.statusCode,
|
|
416
|
+
body: _response.error.rawBody,
|
|
417
|
+
});
|
|
418
|
+
case "timeout":
|
|
419
|
+
throw new errors.ScorecardTimeoutError();
|
|
420
|
+
case "unknown":
|
|
421
|
+
throw new errors.ScorecardError({
|
|
422
|
+
message: _response.error.errorMessage,
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Batch copy Testcases
|
|
429
|
+
*
|
|
430
|
+
* @param {number} testsetId - The ID of the Testset to create the Testcase in.
|
|
431
|
+
* @param {Scorecard.TestcaseBatchCopyParams} request
|
|
432
|
+
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
433
|
+
*
|
|
434
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
435
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
436
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
437
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
438
|
+
*
|
|
439
|
+
* @example
|
|
440
|
+
* await client.testcase.batchCopy(1)
|
|
441
|
+
*/
|
|
442
|
+
batchCopy(testsetId, request = {}, requestOptions) {
|
|
443
|
+
var _a, _b;
|
|
444
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
445
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
446
|
+
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/batch_copy`),
|
|
447
|
+
method: "POST",
|
|
448
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
449
|
+
contentType: "application/json",
|
|
450
|
+
requestType: "json",
|
|
451
|
+
body: serializers.TestcaseBatchCopyParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
452
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
453
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
454
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
455
|
+
});
|
|
456
|
+
if (_response.ok) {
|
|
457
|
+
return serializers.TestCase.parseOrThrow(_response.body, {
|
|
458
|
+
unrecognizedObjectKeys: "passthrough",
|
|
459
|
+
allowUnrecognizedUnionMembers: true,
|
|
460
|
+
allowUnrecognizedEnumValues: true,
|
|
461
|
+
skipValidation: true,
|
|
462
|
+
breadcrumbsPrefix: ["response"],
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
if (_response.error.reason === "status-code") {
|
|
466
|
+
switch (_response.error.statusCode) {
|
|
467
|
+
case 401:
|
|
468
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
469
|
+
unrecognizedObjectKeys: "passthrough",
|
|
470
|
+
allowUnrecognizedUnionMembers: true,
|
|
471
|
+
allowUnrecognizedEnumValues: true,
|
|
472
|
+
skipValidation: true,
|
|
473
|
+
breadcrumbsPrefix: ["response"],
|
|
474
|
+
}));
|
|
475
|
+
case 403:
|
|
476
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
477
|
+
unrecognizedObjectKeys: "passthrough",
|
|
478
|
+
allowUnrecognizedUnionMembers: true,
|
|
479
|
+
allowUnrecognizedEnumValues: true,
|
|
480
|
+
skipValidation: true,
|
|
481
|
+
breadcrumbsPrefix: ["response"],
|
|
482
|
+
}));
|
|
483
|
+
case 404:
|
|
484
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
485
|
+
unrecognizedObjectKeys: "passthrough",
|
|
486
|
+
allowUnrecognizedUnionMembers: true,
|
|
487
|
+
allowUnrecognizedEnumValues: true,
|
|
488
|
+
skipValidation: true,
|
|
489
|
+
breadcrumbsPrefix: ["response"],
|
|
490
|
+
}));
|
|
491
|
+
case 422:
|
|
492
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
493
|
+
unrecognizedObjectKeys: "passthrough",
|
|
494
|
+
allowUnrecognizedUnionMembers: true,
|
|
495
|
+
allowUnrecognizedEnumValues: true,
|
|
496
|
+
skipValidation: true,
|
|
497
|
+
breadcrumbsPrefix: ["response"],
|
|
498
|
+
}));
|
|
499
|
+
default:
|
|
500
|
+
throw new errors.ScorecardError({
|
|
501
|
+
statusCode: _response.error.statusCode,
|
|
502
|
+
body: _response.error.body,
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
switch (_response.error.reason) {
|
|
507
|
+
case "non-json":
|
|
508
|
+
throw new errors.ScorecardError({
|
|
509
|
+
statusCode: _response.error.statusCode,
|
|
510
|
+
body: _response.error.rawBody,
|
|
511
|
+
});
|
|
512
|
+
case "timeout":
|
|
513
|
+
throw new errors.ScorecardTimeoutError();
|
|
514
|
+
case "unknown":
|
|
515
|
+
throw new errors.ScorecardError({
|
|
516
|
+
message: _response.error.errorMessage,
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Batch delete Testcases
|
|
523
|
+
*
|
|
524
|
+
* @param {number} testsetId - The ID of the Testset from which the Testcases will be deleted.
|
|
525
|
+
* @param {Scorecard.TestcaseBatchDeleteParams} request
|
|
526
|
+
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
527
|
+
*
|
|
528
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
529
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
530
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
531
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
532
|
+
*
|
|
533
|
+
* @example
|
|
534
|
+
* await client.testcase.batchDelete(1)
|
|
535
|
+
*/
|
|
536
|
+
batchDelete(testsetId, request = {}, requestOptions) {
|
|
537
|
+
var _a, _b;
|
|
538
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
539
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
540
|
+
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/batch_delete`),
|
|
541
|
+
method: "PATCH",
|
|
542
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
543
|
+
contentType: "application/json",
|
|
544
|
+
requestType: "json",
|
|
545
|
+
body: serializers.TestcaseBatchDeleteParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
546
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
547
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
548
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
549
|
+
});
|
|
550
|
+
if (_response.ok) {
|
|
551
|
+
return serializers.TestcaseBatchDeletionResponse.parseOrThrow(_response.body, {
|
|
552
|
+
unrecognizedObjectKeys: "passthrough",
|
|
553
|
+
allowUnrecognizedUnionMembers: true,
|
|
554
|
+
allowUnrecognizedEnumValues: true,
|
|
555
|
+
skipValidation: true,
|
|
556
|
+
breadcrumbsPrefix: ["response"],
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
if (_response.error.reason === "status-code") {
|
|
560
|
+
switch (_response.error.statusCode) {
|
|
561
|
+
case 401:
|
|
562
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
563
|
+
unrecognizedObjectKeys: "passthrough",
|
|
564
|
+
allowUnrecognizedUnionMembers: true,
|
|
565
|
+
allowUnrecognizedEnumValues: true,
|
|
566
|
+
skipValidation: true,
|
|
567
|
+
breadcrumbsPrefix: ["response"],
|
|
568
|
+
}));
|
|
569
|
+
case 403:
|
|
570
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
571
|
+
unrecognizedObjectKeys: "passthrough",
|
|
572
|
+
allowUnrecognizedUnionMembers: true,
|
|
573
|
+
allowUnrecognizedEnumValues: true,
|
|
574
|
+
skipValidation: true,
|
|
575
|
+
breadcrumbsPrefix: ["response"],
|
|
576
|
+
}));
|
|
577
|
+
case 404:
|
|
578
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
579
|
+
unrecognizedObjectKeys: "passthrough",
|
|
580
|
+
allowUnrecognizedUnionMembers: true,
|
|
581
|
+
allowUnrecognizedEnumValues: true,
|
|
582
|
+
skipValidation: true,
|
|
583
|
+
breadcrumbsPrefix: ["response"],
|
|
584
|
+
}));
|
|
585
|
+
case 422:
|
|
586
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
301
587
|
unrecognizedObjectKeys: "passthrough",
|
|
302
588
|
allowUnrecognizedUnionMembers: true,
|
|
303
589
|
allowUnrecognizedEnumValues: true,
|
|
@@ -9,7 +9,9 @@ import * as Scorecard from "../../../../index";
|
|
|
9
9
|
export interface TestcaseCreateParams {
|
|
10
10
|
/** The user query to be executed. */
|
|
11
11
|
userQuery?: string;
|
|
12
|
+
/** The context to be used while generating the testcase. */
|
|
12
13
|
context?: string;
|
|
14
|
+
/** The ideal response to the user query. */
|
|
13
15
|
ideal?: string;
|
|
14
16
|
customInputs?: Record<string, Scorecard.TestcaseCreateParamsCustomInputsValue | undefined>;
|
|
15
17
|
customLabels?: Record<string, Scorecard.TestcaseCreateParamsCustomLabelsValue | undefined>;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 TestcaseUpdateParams {
|
|
10
|
+
/** The user query to be executed. */
|
|
11
|
+
userQuery?: string;
|
|
12
|
+
/** The context to be used while generating the testcase. */
|
|
13
|
+
context?: string;
|
|
14
|
+
/** The ideal response to the user query. */
|
|
15
|
+
ideal?: string;
|
|
16
|
+
customInputs?: Record<string, Scorecard.TestcaseUpdateParamsCustomInputsValue | undefined>;
|
|
17
|
+
customLabels?: Record<string, Scorecard.TestcaseUpdateParamsCustomLabelsValue | undefined>;
|
|
18
|
+
}
|
|
@@ -1 +1,4 @@
|
|
|
1
1
|
export { type TestcaseCreateParams } from "./TestcaseCreateParams";
|
|
2
|
+
export { type TestcaseUpdateParams } from "./TestcaseUpdateParams";
|
|
3
|
+
export { type TestcaseBatchCopyParams } from "./TestcaseBatchCopyParams";
|
|
4
|
+
export { type TestcaseBatchDeleteParams } from "./TestcaseBatchDeleteParams";
|
|
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./TestcaseCreateParamsCustomInputsValue"), exports);
|
|
18
18
|
__exportStar(require("./TestcaseCreateParamsCustomLabelsValue"), exports);
|
|
19
|
+
__exportStar(require("./TestcaseUpdateParamsCustomInputsValue"), exports);
|
|
20
|
+
__exportStar(require("./TestcaseUpdateParamsCustomLabelsValue"), exports);
|
|
@@ -11,8 +11,11 @@ export declare namespace Testrecord {
|
|
|
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
|
}
|
|
@@ -32,7 +35,7 @@ export declare class Testrecord {
|
|
|
32
35
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
33
36
|
*
|
|
34
37
|
* @example
|
|
35
|
-
* await
|
|
38
|
+
* await client.testrecord.get(1, 1)
|
|
36
39
|
*/
|
|
37
40
|
get(testrecordId: number, runId: number, requestOptions?: Testrecord.RequestOptions): Promise<Scorecard.Testrecord>;
|
|
38
41
|
/**
|
|
@@ -48,7 +51,7 @@ export declare class Testrecord {
|
|
|
48
51
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
49
52
|
*
|
|
50
53
|
* @example
|
|
51
|
-
* await
|
|
54
|
+
* await client.testrecord.create(1)
|
|
52
55
|
*/
|
|
53
56
|
create(runId: number, request?: Scorecard.TestrecordCreateParams, requestOptions?: Testrecord.RequestOptions): Promise<Scorecard.Testrecord>;
|
|
54
57
|
protected _getCustomAuthorizationHeaders(): Promise<{
|