scorecard-ai 0.5.4 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +9 -3
- package/Client.js +8 -3
- package/README.md +9 -9
- package/api/resources/index.d.ts +3 -1
- package/api/resources/index.js +4 -2
- package/api/resources/prompt/client/Client.d.ts +49 -25
- package/api/resources/prompt/client/Client.js +194 -72
- package/api/resources/prompt/client/requests/PromptCreateParams.d.ts +8 -2
- package/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +19 -0
- package/api/resources/prompt/client/requests/PromptListPromptsRequest.d.ts +21 -0
- package/api/resources/prompt/client/requests/index.d.ts +2 -0
- package/api/resources/run/client/Client.d.ts +6 -3
- package/api/resources/run/client/Client.js +26 -23
- package/api/resources/runMetric/client/Client.d.ts +4 -1
- package/api/resources/runMetric/client/Client.js +8 -7
- package/api/resources/score/client/Client.d.ts +5 -2
- package/api/resources/score/client/Client.js +18 -16
- package/api/resources/scoringConfig/client/Client.d.ts +78 -0
- package/api/resources/scoringConfig/client/Client.js +336 -0
- package/api/resources/scoringConfig/client/index.d.ts +1 -0
- package/api/resources/scoringConfig/client/index.js +17 -0
- package/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +18 -0
- package/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +5 -0
- package/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/api/resources/testcase/client/Client.d.ts +55 -3
- package/api/resources/testcase/client/Client.js +308 -22
- package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
- package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
- package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
- package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
- package/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
- package/api/resources/testcase/client/requests/index.d.ts +3 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
- package/api/resources/testcase/types/index.d.ts +2 -0
- package/api/resources/testcase/types/index.js +2 -0
- package/api/resources/testrecord/client/Client.d.ts +5 -2
- package/api/resources/testrecord/client/Client.js +17 -15
- package/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +2 -0
- package/api/resources/testset/client/Client.d.ts +27 -8
- package/api/resources/testset/client/Client.js +148 -40
- package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -0
- package/api/resources/testset/client/requests/TestsetGetRequest.d.ts +11 -0
- package/api/resources/testset/client/requests/TestsetGetRequest.js +5 -0
- package/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
- package/api/resources/testset/client/requests/index.d.ts +2 -0
- package/api/resources/tracing/client/Client.d.ts +72 -0
- package/api/resources/tracing/client/Client.js +327 -0
- package/api/types/IngestionMethod.d.ts +8 -0
- package/api/types/IngestionMethod.js +10 -0
- package/api/types/Prompt.d.ts +2 -0
- package/api/types/PromptCursorPage.d.ts +17 -0
- package/api/types/PromptCursorPage.js +5 -0
- package/api/types/ScoringConfig.d.ts +18 -0
- package/api/types/ScoringConfig.js +5 -0
- package/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
- package/api/types/TestcaseBatchDeletionResponse.js +5 -0
- package/api/types/Testrecord.d.ts +2 -0
- package/api/types/Testset.d.ts +2 -0
- package/api/types/TestsetCursorPage.d.ts +17 -0
- package/api/types/TestsetCursorPage.js +5 -0
- package/api/types/Trace.d.ts +2 -0
- package/api/types/index.d.ts +8 -4
- package/api/types/index.js +8 -4
- package/core/fetcher/Fetcher.d.ts +4 -1
- package/core/fetcher/Fetcher.js +19 -176
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +13 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +59 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +52 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +32 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +37 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
- package/core/runtime/runtime.d.ts +2 -1
- package/core/runtime/runtime.js +12 -1
- package/core/schemas/Schema.d.ts +7 -4
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +8 -19
- package/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/core/schemas/builders/list/list.js +31 -44
- package/core/schemas/builders/object/object.js +90 -111
- package/core/schemas/builders/object/types.d.ts +2 -2
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/core/schemas/builders/record/record.js +49 -60
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/core/schemas/builders/set/set.js +6 -15
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/core/schemas/builders/union/union.js +51 -62
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +9 -3
- package/dist/Client.js +8 -3
- package/dist/api/resources/index.d.ts +3 -1
- package/dist/api/resources/index.js +4 -2
- package/dist/api/resources/prompt/client/Client.d.ts +49 -25
- package/dist/api/resources/prompt/client/Client.js +194 -72
- package/dist/api/resources/prompt/client/requests/PromptCreateParams.d.ts +8 -2
- package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +19 -0
- package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.js +5 -0
- package/dist/api/resources/prompt/client/requests/PromptListPromptsRequest.d.ts +21 -0
- package/dist/api/resources/prompt/client/requests/PromptListPromptsRequest.js +5 -0
- package/dist/api/resources/prompt/client/requests/index.d.ts +2 -0
- package/dist/api/resources/run/client/Client.d.ts +6 -3
- package/dist/api/resources/run/client/Client.js +26 -23
- package/dist/api/resources/runMetric/client/Client.d.ts +4 -1
- package/dist/api/resources/runMetric/client/Client.js +8 -7
- package/dist/api/resources/score/client/Client.d.ts +5 -2
- package/dist/api/resources/score/client/Client.js +18 -16
- package/dist/api/resources/scoringConfig/client/Client.d.ts +78 -0
- package/dist/api/resources/scoringConfig/client/Client.js +336 -0
- package/dist/api/resources/scoringConfig/client/index.d.ts +1 -0
- package/dist/api/resources/scoringConfig/client/index.js +17 -0
- package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +18 -0
- package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +5 -0
- package/dist/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/dist/api/resources/scoringConfig/client/requests/index.js +2 -0
- package/dist/api/resources/testcase/client/Client.d.ts +55 -3
- package/dist/api/resources/testcase/client/Client.js +308 -22
- package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
- package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
- package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
- package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
- package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
- package/dist/api/resources/testcase/client/requests/index.d.ts +3 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
- package/dist/api/resources/testcase/types/index.d.ts +2 -0
- package/dist/api/resources/testcase/types/index.js +2 -0
- package/dist/api/resources/testrecord/client/Client.d.ts +5 -2
- package/dist/api/resources/testrecord/client/Client.js +17 -15
- package/dist/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +2 -0
- package/dist/api/resources/testset/client/Client.d.ts +27 -8
- package/dist/api/resources/testset/client/Client.js +148 -40
- package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -0
- package/dist/api/resources/testset/client/requests/TestsetGetRequest.d.ts +11 -0
- package/dist/api/resources/testset/client/requests/TestsetGetRequest.js +5 -0
- package/dist/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/dist/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
- package/dist/api/resources/testset/client/requests/index.d.ts +2 -0
- package/dist/api/resources/tracing/client/Client.d.ts +72 -0
- package/dist/api/resources/tracing/client/Client.js +327 -0
- package/dist/api/resources/tracing/client/index.js +2 -0
- package/dist/api/types/IngestionMethod.d.ts +8 -0
- package/dist/api/types/IngestionMethod.js +10 -0
- package/dist/api/types/Prompt.d.ts +2 -0
- package/dist/api/types/PromptCursorPage.d.ts +17 -0
- package/dist/api/types/PromptCursorPage.js +5 -0
- package/dist/api/types/ScoringConfig.d.ts +18 -0
- package/dist/api/types/ScoringConfig.js +5 -0
- package/dist/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
- package/dist/api/types/TestcaseBatchDeletionResponse.js +5 -0
- package/dist/api/types/Testrecord.d.ts +2 -0
- package/dist/api/types/Testset.d.ts +2 -0
- package/dist/api/types/TestsetCursorPage.d.ts +17 -0
- package/dist/api/types/TestsetCursorPage.js +5 -0
- package/dist/api/types/Trace.d.ts +2 -0
- package/dist/api/types/index.d.ts +8 -4
- package/dist/api/types/index.js +8 -4
- package/dist/core/fetcher/Fetcher.d.ts +4 -1
- package/dist/core/fetcher/Fetcher.js +19 -176
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +13 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +59 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +52 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +32 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +37 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
- package/dist/core/runtime/runtime.d.ts +2 -1
- package/dist/core/runtime/runtime.js +12 -1
- package/dist/core/schemas/Schema.d.ts +7 -4
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +8 -19
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/dist/core/schemas/builders/list/list.js +31 -44
- package/dist/core/schemas/builders/object/object.js +90 -111
- package/dist/core/schemas/builders/object/types.d.ts +2 -2
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/dist/core/schemas/builders/record/record.js +49 -60
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/dist/core/schemas/builders/set/set.js +6 -15
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/dist/core/schemas/builders/union/union.js +51 -62
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/index.d.ts +3 -1
- package/dist/serialization/resources/index.js +4 -2
- package/dist/serialization/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -0
- package/dist/serialization/resources/prompt/client/requests/PromptCreateParams.js +2 -0
- package/dist/serialization/resources/scoringConfig/client/index.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/client/index.js +17 -0
- package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +15 -0
- package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +36 -0
- package/dist/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/client/requests/index.js +5 -0
- package/dist/serialization/resources/scoringConfig/index.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/index.js +17 -0
- package/dist/serialization/resources/testcase/client/batchCopy.d.ts +11 -0
- package/dist/serialization/resources/testcase/client/batchCopy.js +32 -0
- package/dist/serialization/resources/testcase/client/index.d.ts +1 -0
- package/dist/serialization/resources/testcase/client/index.js +14 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
- package/dist/serialization/resources/testcase/client/requests/index.d.ts +3 -0
- package/dist/serialization/resources/testcase/client/requests/index.js +7 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
- package/dist/serialization/resources/testcase/types/index.d.ts +2 -0
- package/dist/serialization/resources/testcase/types/index.js +2 -0
- package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
- package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +5 -0
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +5 -0
- package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
- package/dist/serialization/resources/testset/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/testset/client/requests/index.js +3 -1
- package/dist/serialization/resources/tracing/client/index.d.ts +1 -0
- package/{serialization/resources/traces → dist/serialization/resources/tracing}/client/index.js +2 -2
- package/dist/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
- package/dist/serialization/resources/tracing/client/traces.js +32 -0
- package/dist/serialization/resources/tracing/index.d.ts +1 -0
- package/dist/serialization/resources/tracing/index.js +17 -0
- package/dist/serialization/types/IngestionMethod.d.ts +10 -0
- package/dist/serialization/types/IngestionMethod.js +31 -0
- package/dist/serialization/types/JsonObject.js +2 -10
- package/dist/serialization/types/JsonObjectInputValue.js +3 -11
- package/dist/serialization/types/JsonObjectOutputValue.js +3 -11
- package/dist/serialization/types/Prompt.d.ts +1 -0
- package/dist/serialization/types/Prompt.js +1 -0
- package/dist/serialization/types/PromptCursorPage.d.ts +18 -0
- package/dist/serialization/types/PromptCursorPage.js +39 -0
- package/dist/serialization/types/ScoringConfig.d.ts +21 -0
- package/dist/serialization/types/ScoringConfig.js +42 -0
- package/dist/serialization/types/Span.js +2 -10
- package/dist/serialization/types/TestCaseCustomInputsValue.js +2 -10
- package/dist/serialization/types/TestCaseCustomLabelsValue.js +2 -10
- package/dist/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
- package/dist/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
- package/dist/serialization/types/Testrecord.d.ts +1 -0
- package/dist/serialization/types/Testrecord.js +1 -0
- package/dist/serialization/types/TestrecordCustomInputsValue.js +2 -10
- package/dist/serialization/types/TestrecordCustomLabelsValue.js +2 -10
- package/dist/serialization/types/TestrecordCustomOutputsValue.js +2 -10
- package/dist/serialization/types/Testset.d.ts +1 -0
- package/dist/serialization/types/Testset.js +1 -0
- package/dist/serialization/types/TestsetCursorPage.d.ts +18 -0
- package/dist/serialization/types/TestsetCursorPage.js +39 -0
- package/dist/serialization/types/Trace.d.ts +1 -0
- package/dist/serialization/types/Trace.js +2 -0
- package/dist/serialization/types/index.d.ts +8 -4
- package/dist/serialization/types/index.js +8 -4
- package/package.json +8 -2
- package/reference.md +840 -623
- package/serialization/resources/index.d.ts +3 -1
- package/serialization/resources/index.js +4 -2
- package/serialization/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -0
- package/serialization/resources/prompt/client/requests/PromptCreateParams.js +2 -0
- package/serialization/resources/scoringConfig/client/index.d.ts +1 -0
- package/serialization/resources/scoringConfig/client/index.js +17 -0
- package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +15 -0
- package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +36 -0
- package/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/serialization/resources/scoringConfig/client/requests/index.js +5 -0
- package/serialization/resources/scoringConfig/index.d.ts +1 -0
- package/serialization/resources/scoringConfig/index.js +17 -0
- package/serialization/resources/testcase/client/batchCopy.d.ts +11 -0
- package/serialization/resources/testcase/client/batchCopy.js +32 -0
- package/serialization/resources/testcase/client/index.d.ts +1 -0
- package/serialization/resources/testcase/client/index.js +14 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
- package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
- package/serialization/resources/testcase/client/requests/index.d.ts +3 -0
- package/serialization/resources/testcase/client/requests/index.js +7 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
- package/serialization/resources/testcase/types/index.d.ts +2 -0
- package/serialization/resources/testcase/types/index.js +2 -0
- package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
- package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
- package/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +5 -0
- package/serialization/resources/testset/client/requests/TestsetCreateParams.js +5 -0
- package/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
- package/serialization/resources/testset/client/requests/index.d.ts +1 -0
- package/serialization/resources/testset/client/requests/index.js +3 -1
- package/serialization/resources/tracing/client/index.d.ts +1 -0
- package/{dist/serialization/resources/traces → serialization/resources/tracing}/client/index.js +2 -2
- package/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
- package/serialization/resources/tracing/client/traces.js +32 -0
- package/serialization/resources/tracing/index.d.ts +1 -0
- package/serialization/resources/tracing/index.js +17 -0
- package/serialization/types/IngestionMethod.d.ts +10 -0
- package/serialization/types/IngestionMethod.js +31 -0
- package/serialization/types/JsonObject.js +2 -10
- package/serialization/types/JsonObjectInputValue.js +3 -11
- package/serialization/types/JsonObjectOutputValue.js +3 -11
- package/serialization/types/Prompt.d.ts +1 -0
- package/serialization/types/Prompt.js +1 -0
- package/serialization/types/PromptCursorPage.d.ts +18 -0
- package/serialization/types/PromptCursorPage.js +39 -0
- package/serialization/types/ScoringConfig.d.ts +21 -0
- package/serialization/types/ScoringConfig.js +42 -0
- package/serialization/types/Span.js +2 -10
- package/serialization/types/TestCaseCustomInputsValue.js +2 -10
- package/serialization/types/TestCaseCustomLabelsValue.js +2 -10
- package/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
- package/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
- package/serialization/types/Testrecord.d.ts +1 -0
- package/serialization/types/Testrecord.js +1 -0
- package/serialization/types/TestrecordCustomInputsValue.js +2 -10
- package/serialization/types/TestrecordCustomLabelsValue.js +2 -10
- package/serialization/types/TestrecordCustomOutputsValue.js +2 -10
- package/serialization/types/Testset.d.ts +1 -0
- package/serialization/types/Testset.js +1 -0
- package/serialization/types/TestsetCursorPage.d.ts +18 -0
- package/serialization/types/TestsetCursorPage.js +39 -0
- package/serialization/types/Trace.d.ts +1 -0
- package/serialization/types/Trace.js +2 -0
- package/serialization/types/index.d.ts +8 -4
- package/serialization/types/index.js +8 -4
- package/api/resources/traces/client/Client.d.ts +0 -40
- package/api/resources/traces/client/Client.js +0 -151
- package/api/types/TestCaseCreate.d.ts +0 -10
- package/dist/api/resources/traces/client/Client.d.ts +0 -40
- package/dist/api/resources/traces/client/Client.js +0 -151
- package/dist/api/types/TestCaseCreate.d.ts +0 -10
- package/dist/serialization/resources/traces/client/index.d.ts +0 -1
- package/dist/serialization/types/TestCaseCreate.d.ts +0 -16
- package/serialization/resources/traces/client/index.d.ts +0 -1
- package/serialization/types/TestCaseCreate.d.ts +0 -16
- /package/api/{types/TestCaseCreate.js → resources/prompt/client/requests/PromptGetByNameRequest.js} +0 -0
- /package/{dist/api/types/TestCaseCreate.js → api/resources/prompt/client/requests/PromptListPromptsRequest.js} +0 -0
- /package/api/resources/{traces/client → scoringConfig/client/requests}/index.js +0 -0
- /package/api/resources/{traces → scoringConfig}/index.d.ts +0 -0
- /package/api/resources/{traces → scoringConfig}/index.js +0 -0
- /package/api/resources/{traces → tracing}/client/index.d.ts +0 -0
- /package/{dist/api/resources/traces → api/resources/tracing}/client/index.js +0 -0
- /package/{dist/api/resources/traces → api/resources/tracing}/index.d.ts +0 -0
- /package/{dist/api/resources/traces → api/resources/tracing}/index.js +0 -0
- /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.d.ts +0 -0
- /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.js +0 -0
- /package/dist/api/resources/{traces → tracing}/client/index.d.ts +0 -0
- /package/{serialization/resources/traces → dist/api/resources/tracing}/index.d.ts +0 -0
- /package/{serialization/resources/traces → dist/api/resources/tracing}/index.js +0 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
38
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.Tracing = void 0;
|
|
42
|
+
const environments = __importStar(require("../../../../environments"));
|
|
43
|
+
const core = __importStar(require("../../../../core"));
|
|
44
|
+
const Scorecard = __importStar(require("../../../index"));
|
|
45
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
46
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
47
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
48
|
+
class Tracing {
|
|
49
|
+
constructor(_options) {
|
|
50
|
+
this._options = _options;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Retrieve traces
|
|
54
|
+
*
|
|
55
|
+
* @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
|
+
*
|
|
57
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
58
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
59
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* await client.tracing.traces()
|
|
63
|
+
*/
|
|
64
|
+
traces(requestOptions) {
|
|
65
|
+
var _a, _b;
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
68
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/traces"),
|
|
69
|
+
method: "GET",
|
|
70
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
71
|
+
contentType: "application/json",
|
|
72
|
+
requestType: "json",
|
|
73
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
74
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
75
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
76
|
+
});
|
|
77
|
+
if (_response.ok) {
|
|
78
|
+
return serializers.tracing.traces.Response.parseOrThrow(_response.body, {
|
|
79
|
+
unrecognizedObjectKeys: "passthrough",
|
|
80
|
+
allowUnrecognizedUnionMembers: true,
|
|
81
|
+
allowUnrecognizedEnumValues: true,
|
|
82
|
+
skipValidation: true,
|
|
83
|
+
breadcrumbsPrefix: ["response"],
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (_response.error.reason === "status-code") {
|
|
87
|
+
switch (_response.error.statusCode) {
|
|
88
|
+
case 401:
|
|
89
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
90
|
+
unrecognizedObjectKeys: "passthrough",
|
|
91
|
+
allowUnrecognizedUnionMembers: true,
|
|
92
|
+
allowUnrecognizedEnumValues: true,
|
|
93
|
+
skipValidation: true,
|
|
94
|
+
breadcrumbsPrefix: ["response"],
|
|
95
|
+
}));
|
|
96
|
+
case 403:
|
|
97
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
98
|
+
unrecognizedObjectKeys: "passthrough",
|
|
99
|
+
allowUnrecognizedUnionMembers: true,
|
|
100
|
+
allowUnrecognizedEnumValues: true,
|
|
101
|
+
skipValidation: true,
|
|
102
|
+
breadcrumbsPrefix: ["response"],
|
|
103
|
+
}));
|
|
104
|
+
case 404:
|
|
105
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
106
|
+
unrecognizedObjectKeys: "passthrough",
|
|
107
|
+
allowUnrecognizedUnionMembers: true,
|
|
108
|
+
allowUnrecognizedEnumValues: true,
|
|
109
|
+
skipValidation: true,
|
|
110
|
+
breadcrumbsPrefix: ["response"],
|
|
111
|
+
}));
|
|
112
|
+
default:
|
|
113
|
+
throw new errors.ScorecardError({
|
|
114
|
+
statusCode: _response.error.statusCode,
|
|
115
|
+
body: _response.error.body,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
switch (_response.error.reason) {
|
|
120
|
+
case "non-json":
|
|
121
|
+
throw new errors.ScorecardError({
|
|
122
|
+
statusCode: _response.error.statusCode,
|
|
123
|
+
body: _response.error.rawBody,
|
|
124
|
+
});
|
|
125
|
+
case "timeout":
|
|
126
|
+
throw new errors.ScorecardTimeoutError();
|
|
127
|
+
case "unknown":
|
|
128
|
+
throw new errors.ScorecardError({
|
|
129
|
+
message: _response.error.errorMessage,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Retrieve specified trace
|
|
136
|
+
*
|
|
137
|
+
* @param {string} traceId - The ID of the trace to retrieve spans from.
|
|
138
|
+
* @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
|
|
139
|
+
*
|
|
140
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
141
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
142
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
143
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* await client.tracing.trace("trace_id")
|
|
147
|
+
*/
|
|
148
|
+
trace(traceId, requestOptions) {
|
|
149
|
+
var _a, _b;
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
152
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/traces/${encodeURIComponent(traceId)}`),
|
|
153
|
+
method: "GET",
|
|
154
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
155
|
+
contentType: "application/json",
|
|
156
|
+
requestType: "json",
|
|
157
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
158
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
159
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
160
|
+
});
|
|
161
|
+
if (_response.ok) {
|
|
162
|
+
return serializers.Trace.parseOrThrow(_response.body, {
|
|
163
|
+
unrecognizedObjectKeys: "passthrough",
|
|
164
|
+
allowUnrecognizedUnionMembers: true,
|
|
165
|
+
allowUnrecognizedEnumValues: true,
|
|
166
|
+
skipValidation: true,
|
|
167
|
+
breadcrumbsPrefix: ["response"],
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
if (_response.error.reason === "status-code") {
|
|
171
|
+
switch (_response.error.statusCode) {
|
|
172
|
+
case 401:
|
|
173
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
174
|
+
unrecognizedObjectKeys: "passthrough",
|
|
175
|
+
allowUnrecognizedUnionMembers: true,
|
|
176
|
+
allowUnrecognizedEnumValues: true,
|
|
177
|
+
skipValidation: true,
|
|
178
|
+
breadcrumbsPrefix: ["response"],
|
|
179
|
+
}));
|
|
180
|
+
case 403:
|
|
181
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
182
|
+
unrecognizedObjectKeys: "passthrough",
|
|
183
|
+
allowUnrecognizedUnionMembers: true,
|
|
184
|
+
allowUnrecognizedEnumValues: true,
|
|
185
|
+
skipValidation: true,
|
|
186
|
+
breadcrumbsPrefix: ["response"],
|
|
187
|
+
}));
|
|
188
|
+
case 404:
|
|
189
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
190
|
+
unrecognizedObjectKeys: "passthrough",
|
|
191
|
+
allowUnrecognizedUnionMembers: true,
|
|
192
|
+
allowUnrecognizedEnumValues: true,
|
|
193
|
+
skipValidation: true,
|
|
194
|
+
breadcrumbsPrefix: ["response"],
|
|
195
|
+
}));
|
|
196
|
+
case 422:
|
|
197
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
198
|
+
unrecognizedObjectKeys: "passthrough",
|
|
199
|
+
allowUnrecognizedUnionMembers: true,
|
|
200
|
+
allowUnrecognizedEnumValues: true,
|
|
201
|
+
skipValidation: true,
|
|
202
|
+
breadcrumbsPrefix: ["response"],
|
|
203
|
+
}));
|
|
204
|
+
default:
|
|
205
|
+
throw new errors.ScorecardError({
|
|
206
|
+
statusCode: _response.error.statusCode,
|
|
207
|
+
body: _response.error.body,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
switch (_response.error.reason) {
|
|
212
|
+
case "non-json":
|
|
213
|
+
throw new errors.ScorecardError({
|
|
214
|
+
statusCode: _response.error.statusCode,
|
|
215
|
+
body: _response.error.rawBody,
|
|
216
|
+
});
|
|
217
|
+
case "timeout":
|
|
218
|
+
throw new errors.ScorecardTimeoutError();
|
|
219
|
+
case "unknown":
|
|
220
|
+
throw new errors.ScorecardError({
|
|
221
|
+
message: _response.error.errorMessage,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Retrieve specified span
|
|
228
|
+
*
|
|
229
|
+
* @param {string} traceId - The ID of the trace which the span is a part of.
|
|
230
|
+
* @param {string} spanId - The ID of the span to retrieve.
|
|
231
|
+
* @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
|
|
232
|
+
*
|
|
233
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
234
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
235
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
236
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* await client.tracing.span("trace_id", "span_id")
|
|
240
|
+
*/
|
|
241
|
+
span(traceId, spanId, requestOptions) {
|
|
242
|
+
var _a, _b;
|
|
243
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
245
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/traces/${encodeURIComponent(traceId)}/spans/${encodeURIComponent(spanId)}`),
|
|
246
|
+
method: "GET",
|
|
247
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
248
|
+
contentType: "application/json",
|
|
249
|
+
requestType: "json",
|
|
250
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
251
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
252
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
253
|
+
});
|
|
254
|
+
if (_response.ok) {
|
|
255
|
+
return serializers.Span.parseOrThrow(_response.body, {
|
|
256
|
+
unrecognizedObjectKeys: "passthrough",
|
|
257
|
+
allowUnrecognizedUnionMembers: true,
|
|
258
|
+
allowUnrecognizedEnumValues: true,
|
|
259
|
+
skipValidation: true,
|
|
260
|
+
breadcrumbsPrefix: ["response"],
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
if (_response.error.reason === "status-code") {
|
|
264
|
+
switch (_response.error.statusCode) {
|
|
265
|
+
case 401:
|
|
266
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
267
|
+
unrecognizedObjectKeys: "passthrough",
|
|
268
|
+
allowUnrecognizedUnionMembers: true,
|
|
269
|
+
allowUnrecognizedEnumValues: true,
|
|
270
|
+
skipValidation: true,
|
|
271
|
+
breadcrumbsPrefix: ["response"],
|
|
272
|
+
}));
|
|
273
|
+
case 403:
|
|
274
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
275
|
+
unrecognizedObjectKeys: "passthrough",
|
|
276
|
+
allowUnrecognizedUnionMembers: true,
|
|
277
|
+
allowUnrecognizedEnumValues: true,
|
|
278
|
+
skipValidation: true,
|
|
279
|
+
breadcrumbsPrefix: ["response"],
|
|
280
|
+
}));
|
|
281
|
+
case 404:
|
|
282
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
283
|
+
unrecognizedObjectKeys: "passthrough",
|
|
284
|
+
allowUnrecognizedUnionMembers: true,
|
|
285
|
+
allowUnrecognizedEnumValues: true,
|
|
286
|
+
skipValidation: true,
|
|
287
|
+
breadcrumbsPrefix: ["response"],
|
|
288
|
+
}));
|
|
289
|
+
case 422:
|
|
290
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
291
|
+
unrecognizedObjectKeys: "passthrough",
|
|
292
|
+
allowUnrecognizedUnionMembers: true,
|
|
293
|
+
allowUnrecognizedEnumValues: true,
|
|
294
|
+
skipValidation: true,
|
|
295
|
+
breadcrumbsPrefix: ["response"],
|
|
296
|
+
}));
|
|
297
|
+
default:
|
|
298
|
+
throw new errors.ScorecardError({
|
|
299
|
+
statusCode: _response.error.statusCode,
|
|
300
|
+
body: _response.error.body,
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
switch (_response.error.reason) {
|
|
305
|
+
case "non-json":
|
|
306
|
+
throw new errors.ScorecardError({
|
|
307
|
+
statusCode: _response.error.statusCode,
|
|
308
|
+
body: _response.error.rawBody,
|
|
309
|
+
});
|
|
310
|
+
case "timeout":
|
|
311
|
+
throw new errors.ScorecardTimeoutError();
|
|
312
|
+
case "unknown":
|
|
313
|
+
throw new errors.ScorecardError({
|
|
314
|
+
message: _response.error.errorMessage,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
_getCustomAuthorizationHeaders() {
|
|
320
|
+
var _a;
|
|
321
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
322
|
+
const apiKeyValue = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["SCORECARD_API_KEY"];
|
|
323
|
+
return { "X-API-Key": apiKeyValue };
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
exports.Tracing = Tracing;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IngestionMethod = void 0;
|
|
7
|
+
exports.IngestionMethod = {
|
|
8
|
+
Csv: "csv",
|
|
9
|
+
Logging: "logging",
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Scorecard from "../index";
|
|
5
|
+
export interface PromptCursorPage {
|
|
6
|
+
items: Scorecard.Prompt[];
|
|
7
|
+
/** Total items */
|
|
8
|
+
total?: number;
|
|
9
|
+
/** Cursor to refetch the current page */
|
|
10
|
+
currentPage?: string;
|
|
11
|
+
/** Cursor to refetch the current page starting from the last item */
|
|
12
|
+
currentPageBackwards?: string;
|
|
13
|
+
/** Cursor for the previous page */
|
|
14
|
+
previousPage?: string;
|
|
15
|
+
/** Cursor for the next page */
|
|
16
|
+
nextPage?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface ScoringConfig {
|
|
5
|
+
/** The organization this resource belongs to. */
|
|
6
|
+
orgId?: string;
|
|
7
|
+
/** The user this record belongs to. */
|
|
8
|
+
userId?: string;
|
|
9
|
+
id?: number;
|
|
10
|
+
name?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
config?: Record<string, unknown>;
|
|
13
|
+
isArchived?: boolean;
|
|
14
|
+
metrics?: number[];
|
|
15
|
+
createdAt?: Date;
|
|
16
|
+
/** The ID of the project the scoring config belongs to. */
|
|
17
|
+
projectId?: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface TestcaseBatchDeletionResponse {
|
|
5
|
+
/** The IDs of the testcases that were deleted. */
|
|
6
|
+
ids: number[];
|
|
7
|
+
/** The message indicating the testcases were deleted. */
|
|
8
|
+
detail: string;
|
|
9
|
+
}
|
|
@@ -31,4 +31,6 @@ export interface Testrecord {
|
|
|
31
31
|
modelParams?: Record<string, Scorecard.TestrecordModelParamsValue | undefined>;
|
|
32
32
|
/** Debug information produced during the testrecord's generation. */
|
|
33
33
|
modelDebugInfo?: Record<string, Scorecard.TestrecordModelDebugInfoValue | undefined>;
|
|
34
|
+
/** The error message for the testrecord. */
|
|
35
|
+
errorMessage?: string;
|
|
34
36
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Scorecard from "../index";
|
|
5
|
+
export interface TestsetCursorPage {
|
|
6
|
+
items: Scorecard.Testset[];
|
|
7
|
+
/** Total items */
|
|
8
|
+
total?: number;
|
|
9
|
+
/** Cursor to refetch the current page */
|
|
10
|
+
currentPage?: string;
|
|
11
|
+
/** Cursor to refetch the current page starting from the last item */
|
|
12
|
+
currentPageBackwards?: string;
|
|
13
|
+
/** Cursor for the previous page */
|
|
14
|
+
previousPage?: string;
|
|
15
|
+
/** Cursor for the next page */
|
|
16
|
+
nextPage?: string;
|
|
17
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from "./CreateRunParams";
|
|
2
1
|
export * from "./CustomSchema";
|
|
3
2
|
export * from "./CustomVariable";
|
|
4
3
|
export * from "./DataTypeEnum";
|
|
5
4
|
export * from "./FileUrl";
|
|
6
5
|
export * from "./Grade";
|
|
7
6
|
export * from "./HttpValidationError";
|
|
7
|
+
export * from "./IngestionMethod";
|
|
8
8
|
export * from "./JsonObjectInputValue";
|
|
9
9
|
export * from "./JsonObject";
|
|
10
10
|
export * from "./JsonObjectOutputValue";
|
|
@@ -12,18 +12,18 @@ export * from "./NotFoundErrorBody";
|
|
|
12
12
|
export * from "./PaginatedTestcaseResponse";
|
|
13
13
|
export * from "./PromptModelParamsValue";
|
|
14
14
|
export * from "./Prompt";
|
|
15
|
+
export * from "./PromptCursorPage";
|
|
15
16
|
export * from "./RoleEnum";
|
|
16
17
|
export * from "./Run";
|
|
17
18
|
export * from "./RunMetric";
|
|
18
19
|
export * from "./RunStatus";
|
|
19
20
|
export * from "./ScoreStatus";
|
|
21
|
+
export * from "./ScoringConfig";
|
|
20
22
|
export * from "./Span";
|
|
21
23
|
export * from "./TestCaseCustomInputsValue";
|
|
22
24
|
export * from "./TestCaseCustomLabelsValue";
|
|
23
25
|
export * from "./TestCase";
|
|
24
|
-
export * from "./
|
|
25
|
-
export * from "./TestRecordCreate";
|
|
26
|
-
export * from "./TestSetCreate";
|
|
26
|
+
export * from "./TestcaseBatchDeletionResponse";
|
|
27
27
|
export * from "./TestcaseDeletionResponse";
|
|
28
28
|
export * from "./TestrecordCustomInputsValue";
|
|
29
29
|
export * from "./TestrecordCustomLabelsValue";
|
|
@@ -32,9 +32,13 @@ export * from "./TestrecordModelParamsValue";
|
|
|
32
32
|
export * from "./TestrecordModelDebugInfoValue";
|
|
33
33
|
export * from "./Testrecord";
|
|
34
34
|
export * from "./Testset";
|
|
35
|
+
export * from "./TestsetCursorPage";
|
|
35
36
|
export * from "./Trace";
|
|
36
37
|
export * from "./UnauthenticatedError";
|
|
37
38
|
export * from "./UnauthorizedErrorBody";
|
|
38
39
|
export * from "./ValidationErrorLocItem";
|
|
39
40
|
export * from "./ValidationError";
|
|
40
41
|
export * from "./CreateGithubWorkflowParams";
|
|
42
|
+
export * from "./CreateRunParams";
|
|
43
|
+
export * from "./TestRecordCreate";
|
|
44
|
+
export * from "./TestSetCreate";
|
package/dist/api/types/index.js
CHANGED
|
@@ -14,13 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./CreateRunParams"), exports);
|
|
18
17
|
__exportStar(require("./CustomSchema"), exports);
|
|
19
18
|
__exportStar(require("./CustomVariable"), exports);
|
|
20
19
|
__exportStar(require("./DataTypeEnum"), exports);
|
|
21
20
|
__exportStar(require("./FileUrl"), exports);
|
|
22
21
|
__exportStar(require("./Grade"), exports);
|
|
23
22
|
__exportStar(require("./HttpValidationError"), exports);
|
|
23
|
+
__exportStar(require("./IngestionMethod"), exports);
|
|
24
24
|
__exportStar(require("./JsonObjectInputValue"), exports);
|
|
25
25
|
__exportStar(require("./JsonObject"), exports);
|
|
26
26
|
__exportStar(require("./JsonObjectOutputValue"), exports);
|
|
@@ -28,18 +28,18 @@ __exportStar(require("./NotFoundErrorBody"), exports);
|
|
|
28
28
|
__exportStar(require("./PaginatedTestcaseResponse"), exports);
|
|
29
29
|
__exportStar(require("./PromptModelParamsValue"), exports);
|
|
30
30
|
__exportStar(require("./Prompt"), exports);
|
|
31
|
+
__exportStar(require("./PromptCursorPage"), exports);
|
|
31
32
|
__exportStar(require("./RoleEnum"), exports);
|
|
32
33
|
__exportStar(require("./Run"), exports);
|
|
33
34
|
__exportStar(require("./RunMetric"), exports);
|
|
34
35
|
__exportStar(require("./RunStatus"), exports);
|
|
35
36
|
__exportStar(require("./ScoreStatus"), exports);
|
|
37
|
+
__exportStar(require("./ScoringConfig"), exports);
|
|
36
38
|
__exportStar(require("./Span"), exports);
|
|
37
39
|
__exportStar(require("./TestCaseCustomInputsValue"), exports);
|
|
38
40
|
__exportStar(require("./TestCaseCustomLabelsValue"), exports);
|
|
39
41
|
__exportStar(require("./TestCase"), exports);
|
|
40
|
-
__exportStar(require("./
|
|
41
|
-
__exportStar(require("./TestRecordCreate"), exports);
|
|
42
|
-
__exportStar(require("./TestSetCreate"), exports);
|
|
42
|
+
__exportStar(require("./TestcaseBatchDeletionResponse"), exports);
|
|
43
43
|
__exportStar(require("./TestcaseDeletionResponse"), exports);
|
|
44
44
|
__exportStar(require("./TestrecordCustomInputsValue"), exports);
|
|
45
45
|
__exportStar(require("./TestrecordCustomLabelsValue"), exports);
|
|
@@ -48,9 +48,13 @@ __exportStar(require("./TestrecordModelParamsValue"), exports);
|
|
|
48
48
|
__exportStar(require("./TestrecordModelDebugInfoValue"), exports);
|
|
49
49
|
__exportStar(require("./Testrecord"), exports);
|
|
50
50
|
__exportStar(require("./Testset"), exports);
|
|
51
|
+
__exportStar(require("./TestsetCursorPage"), exports);
|
|
51
52
|
__exportStar(require("./Trace"), exports);
|
|
52
53
|
__exportStar(require("./UnauthenticatedError"), exports);
|
|
53
54
|
__exportStar(require("./UnauthorizedErrorBody"), exports);
|
|
54
55
|
__exportStar(require("./ValidationErrorLocItem"), exports);
|
|
55
56
|
__exportStar(require("./ValidationError"), exports);
|
|
56
57
|
__exportStar(require("./CreateGithubWorkflowParams"), exports);
|
|
58
|
+
__exportStar(require("./CreateRunParams"), exports);
|
|
59
|
+
__exportStar(require("./TestRecordCreate"), exports);
|
|
60
|
+
__exportStar(require("./TestSetCreate"), exports);
|
|
@@ -12,7 +12,9 @@ export declare namespace Fetcher {
|
|
|
12
12
|
maxRetries?: number;
|
|
13
13
|
withCredentials?: boolean;
|
|
14
14
|
abortSignal?: AbortSignal;
|
|
15
|
-
|
|
15
|
+
requestType?: "json" | "file" | "bytes";
|
|
16
|
+
responseType?: "json" | "blob" | "sse" | "streaming" | "text";
|
|
17
|
+
duplex?: "half";
|
|
16
18
|
}
|
|
17
19
|
type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
|
|
18
20
|
interface FailedStatusCodeError {
|
|
@@ -33,4 +35,5 @@ export declare namespace Fetcher {
|
|
|
33
35
|
errorMessage: string;
|
|
34
36
|
}
|
|
35
37
|
}
|
|
38
|
+
export declare function fetcherImpl<R = unknown>(args: Fetcher.Args): Promise<APIResponse<R, Fetcher.Error>>;
|
|
36
39
|
export declare const fetcher: FetchFunction;
|