scorecard-ai 0.5.4 → 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/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 +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/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 +24 -5
- package/api/resources/testset/client/Client.js +135 -36
- package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +6 -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/IngestionMethod.d.ts +8 -0
- package/api/types/IngestionMethod.js +10 -0
- package/api/types/ScoringConfig.d.ts +16 -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/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/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 +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/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 +24 -5
- package/dist/api/resources/testset/client/Client.js +135 -36
- package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +6 -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/IngestionMethod.d.ts +8 -0
- package/dist/api/types/IngestionMethod.js +10 -0
- package/dist/api/types/ScoringConfig.d.ts +16 -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/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/package.json +8 -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/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
|
@@ -38,22 +38,119 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.
|
|
41
|
+
exports.ScoringConfig = void 0;
|
|
42
42
|
const environments = __importStar(require("../../../../environments"));
|
|
43
43
|
const core = __importStar(require("../../../../core"));
|
|
44
44
|
const Scorecard = __importStar(require("../../../index"));
|
|
45
|
-
const url_join_1 = __importDefault(require("url-join"));
|
|
46
45
|
const serializers = __importStar(require("../../../../serialization/index"));
|
|
46
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
47
47
|
const errors = __importStar(require("../../../../errors/index"));
|
|
48
|
-
class
|
|
48
|
+
class ScoringConfig {
|
|
49
49
|
constructor(_options) {
|
|
50
50
|
this._options = _options;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Create a new scoring config.
|
|
54
|
+
*
|
|
55
|
+
* @param {Scorecard.ScoringConfigCreateParams} request
|
|
56
|
+
* @param {ScoringConfig.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
59
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
60
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
61
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* await client.scoringConfig.create({
|
|
65
|
+
* name: "Scoring Config Name",
|
|
66
|
+
* description: "Description of the scoring config",
|
|
67
|
+
* metrics: [1, 2, 3]
|
|
68
|
+
* })
|
|
69
|
+
*/
|
|
70
|
+
create(request = {}, requestOptions) {
|
|
71
|
+
var _a, _b;
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
74
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/scoring_config"),
|
|
75
|
+
method: "POST",
|
|
76
|
+
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())),
|
|
77
|
+
contentType: "application/json",
|
|
78
|
+
requestType: "json",
|
|
79
|
+
body: serializers.ScoringConfigCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
80
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
81
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
82
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
83
|
+
});
|
|
84
|
+
if (_response.ok) {
|
|
85
|
+
return serializers.ScoringConfig.parseOrThrow(_response.body, {
|
|
86
|
+
unrecognizedObjectKeys: "passthrough",
|
|
87
|
+
allowUnrecognizedUnionMembers: true,
|
|
88
|
+
allowUnrecognizedEnumValues: true,
|
|
89
|
+
skipValidation: true,
|
|
90
|
+
breadcrumbsPrefix: ["response"],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (_response.error.reason === "status-code") {
|
|
94
|
+
switch (_response.error.statusCode) {
|
|
95
|
+
case 401:
|
|
96
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
97
|
+
unrecognizedObjectKeys: "passthrough",
|
|
98
|
+
allowUnrecognizedUnionMembers: true,
|
|
99
|
+
allowUnrecognizedEnumValues: true,
|
|
100
|
+
skipValidation: true,
|
|
101
|
+
breadcrumbsPrefix: ["response"],
|
|
102
|
+
}));
|
|
103
|
+
case 403:
|
|
104
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
105
|
+
unrecognizedObjectKeys: "passthrough",
|
|
106
|
+
allowUnrecognizedUnionMembers: true,
|
|
107
|
+
allowUnrecognizedEnumValues: true,
|
|
108
|
+
skipValidation: true,
|
|
109
|
+
breadcrumbsPrefix: ["response"],
|
|
110
|
+
}));
|
|
111
|
+
case 404:
|
|
112
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
113
|
+
unrecognizedObjectKeys: "passthrough",
|
|
114
|
+
allowUnrecognizedUnionMembers: true,
|
|
115
|
+
allowUnrecognizedEnumValues: true,
|
|
116
|
+
skipValidation: true,
|
|
117
|
+
breadcrumbsPrefix: ["response"],
|
|
118
|
+
}));
|
|
119
|
+
case 422:
|
|
120
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
121
|
+
unrecognizedObjectKeys: "passthrough",
|
|
122
|
+
allowUnrecognizedUnionMembers: true,
|
|
123
|
+
allowUnrecognizedEnumValues: true,
|
|
124
|
+
skipValidation: true,
|
|
125
|
+
breadcrumbsPrefix: ["response"],
|
|
126
|
+
}));
|
|
127
|
+
default:
|
|
128
|
+
throw new errors.ScorecardError({
|
|
129
|
+
statusCode: _response.error.statusCode,
|
|
130
|
+
body: _response.error.body,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
switch (_response.error.reason) {
|
|
135
|
+
case "non-json":
|
|
136
|
+
throw new errors.ScorecardError({
|
|
137
|
+
statusCode: _response.error.statusCode,
|
|
138
|
+
body: _response.error.rawBody,
|
|
139
|
+
});
|
|
140
|
+
case "timeout":
|
|
141
|
+
throw new errors.ScorecardTimeoutError();
|
|
142
|
+
case "unknown":
|
|
143
|
+
throw new errors.ScorecardError({
|
|
144
|
+
message: _response.error.errorMessage,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Retrieve a scoring config by id
|
|
54
151
|
*
|
|
55
|
-
* @param {string}
|
|
56
|
-
* @param {
|
|
152
|
+
* @param {string} id - The id of the scoring config to get.
|
|
153
|
+
* @param {ScoringConfig.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
154
|
*
|
|
58
155
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
59
156
|
* @throws {@link Scorecard.ForbiddenError}
|
|
@@ -61,22 +158,23 @@ class Traces {
|
|
|
61
158
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
62
159
|
*
|
|
63
160
|
* @example
|
|
64
|
-
* await
|
|
161
|
+
* await client.scoringConfig.get("id")
|
|
65
162
|
*/
|
|
66
|
-
get(
|
|
163
|
+
get(id, requestOptions) {
|
|
67
164
|
var _a, _b;
|
|
68
165
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
166
|
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, `v1/
|
|
167
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/scoring_config/${encodeURIComponent(id)}`),
|
|
71
168
|
method: "GET",
|
|
72
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
169
|
+
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())),
|
|
73
170
|
contentType: "application/json",
|
|
171
|
+
requestType: "json",
|
|
74
172
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
75
173
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
76
174
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
77
175
|
});
|
|
78
176
|
if (_response.ok) {
|
|
79
|
-
return
|
|
177
|
+
return serializers.ScoringConfig.parseOrThrow(_response.body, {
|
|
80
178
|
unrecognizedObjectKeys: "passthrough",
|
|
81
179
|
allowUnrecognizedUnionMembers: true,
|
|
82
180
|
allowUnrecognizedEnumValues: true,
|
|
@@ -87,7 +185,7 @@ class Traces {
|
|
|
87
185
|
if (_response.error.reason === "status-code") {
|
|
88
186
|
switch (_response.error.statusCode) {
|
|
89
187
|
case 401:
|
|
90
|
-
throw new Scorecard.UnauthorizedError(
|
|
188
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
91
189
|
unrecognizedObjectKeys: "passthrough",
|
|
92
190
|
allowUnrecognizedUnionMembers: true,
|
|
93
191
|
allowUnrecognizedEnumValues: true,
|
|
@@ -95,7 +193,7 @@ class Traces {
|
|
|
95
193
|
breadcrumbsPrefix: ["response"],
|
|
96
194
|
}));
|
|
97
195
|
case 403:
|
|
98
|
-
throw new Scorecard.ForbiddenError(
|
|
196
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
99
197
|
unrecognizedObjectKeys: "passthrough",
|
|
100
198
|
allowUnrecognizedUnionMembers: true,
|
|
101
199
|
allowUnrecognizedEnumValues: true,
|
|
@@ -103,7 +201,7 @@ class Traces {
|
|
|
103
201
|
breadcrumbsPrefix: ["response"],
|
|
104
202
|
}));
|
|
105
203
|
case 404:
|
|
106
|
-
throw new Scorecard.NotFoundError(
|
|
204
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
107
205
|
unrecognizedObjectKeys: "passthrough",
|
|
108
206
|
allowUnrecognizedUnionMembers: true,
|
|
109
207
|
allowUnrecognizedEnumValues: true,
|
|
@@ -111,7 +209,7 @@ class Traces {
|
|
|
111
209
|
breadcrumbsPrefix: ["response"],
|
|
112
210
|
}));
|
|
113
211
|
case 422:
|
|
114
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
212
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
115
213
|
unrecognizedObjectKeys: "passthrough",
|
|
116
214
|
allowUnrecognizedUnionMembers: true,
|
|
117
215
|
allowUnrecognizedEnumValues: true,
|
|
@@ -148,4 +246,4 @@ class Traces {
|
|
|
148
246
|
});
|
|
149
247
|
}
|
|
150
248
|
}
|
|
151
|
-
exports.
|
|
249
|
+
exports.ScoringConfig = ScoringConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* name: "Scoring Config Name",
|
|
8
|
+
* description: "Description of the scoring config",
|
|
9
|
+
* metrics: [1, 2, 3]
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export interface ScoringConfigCreateParams {
|
|
13
|
+
name?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
metrics?: number[];
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type ScoringConfigCreateParams } from "./ScoringConfigCreateParams";
|
|
@@ -11,8 +11,11 @@ export declare namespace Testcase {
|
|
|
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 Testcase {
|
|
|
32
35
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
33
36
|
*
|
|
34
37
|
* @example
|
|
35
|
-
* await
|
|
38
|
+
* await client.testcase.create(1)
|
|
36
39
|
*/
|
|
37
40
|
create(testsetId: number, request?: Scorecard.TestcaseCreateParams, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestCase>;
|
|
38
41
|
/**
|
|
@@ -48,7 +51,7 @@ export declare class Testcase {
|
|
|
48
51
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
49
52
|
*
|
|
50
53
|
* @example
|
|
51
|
-
* await
|
|
54
|
+
* await client.testcase.get(1, 1)
|
|
52
55
|
*/
|
|
53
56
|
get(testcaseId: number, testsetId: number, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestCase>;
|
|
54
57
|
/**
|
|
@@ -64,9 +67,58 @@ export declare class Testcase {
|
|
|
64
67
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
65
68
|
*
|
|
66
69
|
* @example
|
|
67
|
-
* await
|
|
70
|
+
* await client.testcase.delete(1, 1)
|
|
68
71
|
*/
|
|
69
72
|
delete(testcaseId: number, testsetId: number, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestcaseDeletionResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Update a Testcase.
|
|
75
|
+
*
|
|
76
|
+
* @param {number} testcaseId - The ID of the Testcase to update.
|
|
77
|
+
* @param {number} testsetId - The ID of the Testset to retrieve the Testcase from.
|
|
78
|
+
* @param {Scorecard.TestcaseUpdateParams} request
|
|
79
|
+
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
|
+
*
|
|
81
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
82
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
83
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
84
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* await client.testcase.update(1, 1)
|
|
88
|
+
*/
|
|
89
|
+
update(testcaseId: number, testsetId: number, request?: Scorecard.TestcaseUpdateParams, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestCase>;
|
|
90
|
+
/**
|
|
91
|
+
* Batch copy Testcases
|
|
92
|
+
*
|
|
93
|
+
* @param {number} testsetId - The ID of the Testset to create the Testcase in.
|
|
94
|
+
* @param {Scorecard.TestcaseBatchCopyParams} request
|
|
95
|
+
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
96
|
+
*
|
|
97
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
98
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
99
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
100
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* await client.testcase.batchCopy(1)
|
|
104
|
+
*/
|
|
105
|
+
batchCopy(testsetId: number, request?: Scorecard.TestcaseBatchCopyParams, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestCase>;
|
|
106
|
+
/**
|
|
107
|
+
* Batch delete Testcases
|
|
108
|
+
*
|
|
109
|
+
* @param {number} testsetId - The ID of the Testset from which the Testcases will be deleted.
|
|
110
|
+
* @param {Scorecard.TestcaseBatchDeleteParams} request
|
|
111
|
+
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
112
|
+
*
|
|
113
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
114
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
115
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
116
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* await client.testcase.batchDelete(1)
|
|
120
|
+
*/
|
|
121
|
+
batchDelete(testsetId: number, request?: Scorecard.TestcaseBatchDeleteParams, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestcaseBatchDeletionResponse>;
|
|
70
122
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
71
123
|
"X-API-Key": string;
|
|
72
124
|
}>;
|