scorecard-ai 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +9 -3
- package/Client.js +8 -3
- package/api/resources/index.d.ts +3 -1
- package/api/resources/index.js +4 -2
- package/api/resources/prompt/client/Client.d.ts +27 -22
- package/api/resources/prompt/client/Client.js +110 -99
- package/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +15 -0
- package/api/resources/prompt/client/requests/index.d.ts +1 -0
- package/api/resources/run/client/Client.d.ts +6 -3
- package/api/resources/run/client/Client.js +26 -23
- package/api/resources/run/client/requests/RunCreateParams.d.ts +1 -0
- package/api/resources/runMetric/client/Client.d.ts +4 -1
- package/api/resources/runMetric/client/Client.js +8 -7
- package/api/resources/score/client/Client.d.ts +5 -2
- package/api/resources/score/client/Client.js +18 -16
- package/api/resources/score/client/requests/ScoreCreateParams.d.ts +3 -0
- package/api/resources/score/client/requests/ScoreUpdateParams.d.ts +3 -0
- package/api/resources/scoringConfig/client/Client.d.ts +62 -0
- package/{dist/api/resources/traces → api/resources/scoringConfig}/client/Client.js +114 -16
- package/api/resources/scoringConfig/client/index.d.ts +1 -0
- package/api/resources/scoringConfig/client/index.js +17 -0
- package/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +16 -0
- package/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/api/resources/testcase/client/Client.d.ts +55 -3
- package/api/resources/testcase/client/Client.js +308 -22
- package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
- package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
- package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
- package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
- package/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +2 -0
- package/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
- package/api/resources/testcase/client/requests/index.d.ts +3 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
- package/api/resources/testcase/types/index.d.ts +2 -0
- package/api/resources/testcase/types/index.js +2 -0
- package/api/resources/testrecord/client/Client.d.ts +5 -2
- package/api/resources/testrecord/client/Client.js +17 -15
- package/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +9 -0
- package/api/resources/testset/client/Client.d.ts +24 -5
- package/api/resources/testset/client/Client.js +135 -36
- package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -0
- package/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
- package/api/resources/testset/client/requests/index.d.ts +1 -0
- package/api/resources/tracing/client/Client.d.ts +72 -0
- package/api/resources/tracing/client/Client.js +327 -0
- package/api/types/Grade.d.ts +11 -0
- package/api/types/IngestionMethod.d.ts +8 -0
- package/api/types/IngestionMethod.js +10 -0
- package/api/types/PaginatedTestcaseResponse.d.ts +2 -0
- package/api/types/Prompt.d.ts +2 -0
- package/api/types/Run.d.ts +14 -0
- package/api/types/ScoringConfig.d.ts +16 -0
- package/api/types/ScoringConfig.js +5 -0
- package/api/types/TestCase.d.ts +4 -0
- package/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
- package/api/types/TestcaseBatchDeletionResponse.js +5 -0
- package/api/types/Testrecord.d.ts +14 -0
- package/api/types/Testset.d.ts +11 -0
- package/api/types/Trace.d.ts +2 -0
- package/api/types/index.d.ts +6 -4
- package/api/types/index.js +6 -4
- package/core/fetcher/Fetcher.d.ts +4 -1
- package/core/fetcher/Fetcher.js +19 -176
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +13 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +59 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +52 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +32 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +37 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
- package/core/runtime/runtime.d.ts +2 -1
- package/core/runtime/runtime.js +12 -1
- package/core/schemas/Schema.d.ts +7 -4
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +8 -19
- package/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/core/schemas/builders/list/list.js +31 -44
- package/core/schemas/builders/object/object.js +90 -111
- package/core/schemas/builders/object/types.d.ts +2 -2
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/core/schemas/builders/record/record.js +49 -60
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/core/schemas/builders/set/set.js +6 -15
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/core/schemas/builders/union/union.js +51 -62
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +9 -3
- package/dist/Client.js +8 -3
- package/dist/api/resources/index.d.ts +3 -1
- package/dist/api/resources/index.js +4 -2
- package/dist/api/resources/prompt/client/Client.d.ts +27 -22
- package/dist/api/resources/prompt/client/Client.js +110 -99
- package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +15 -0
- package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.js +5 -0
- package/dist/api/resources/prompt/client/requests/index.d.ts +1 -0
- package/dist/api/resources/run/client/Client.d.ts +6 -3
- package/dist/api/resources/run/client/Client.js +26 -23
- package/dist/api/resources/run/client/requests/RunCreateParams.d.ts +1 -0
- package/dist/api/resources/runMetric/client/Client.d.ts +4 -1
- package/dist/api/resources/runMetric/client/Client.js +8 -7
- package/dist/api/resources/score/client/Client.d.ts +5 -2
- package/dist/api/resources/score/client/Client.js +18 -16
- package/dist/api/resources/score/client/requests/ScoreCreateParams.d.ts +3 -0
- package/dist/api/resources/score/client/requests/ScoreUpdateParams.d.ts +3 -0
- package/dist/api/resources/scoringConfig/client/Client.d.ts +62 -0
- package/{api/resources/traces → dist/api/resources/scoringConfig}/client/Client.js +114 -16
- package/dist/api/resources/scoringConfig/client/index.d.ts +1 -0
- package/dist/api/resources/scoringConfig/client/index.js +17 -0
- package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +16 -0
- package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +5 -0
- package/dist/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/dist/api/resources/scoringConfig/client/requests/index.js +2 -0
- package/dist/api/resources/testcase/client/Client.d.ts +55 -3
- package/dist/api/resources/testcase/client/Client.js +308 -22
- package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
- package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
- package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
- package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
- package/dist/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +2 -0
- package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
- package/dist/api/resources/testcase/client/requests/index.d.ts +3 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
- package/dist/api/resources/testcase/types/index.d.ts +2 -0
- package/dist/api/resources/testcase/types/index.js +2 -0
- package/dist/api/resources/testrecord/client/Client.d.ts +5 -2
- package/dist/api/resources/testrecord/client/Client.js +17 -15
- package/dist/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +9 -0
- package/dist/api/resources/testset/client/Client.d.ts +24 -5
- package/dist/api/resources/testset/client/Client.js +135 -36
- package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -0
- package/dist/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/dist/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
- package/dist/api/resources/testset/client/requests/index.d.ts +1 -0
- package/dist/api/resources/tracing/client/Client.d.ts +72 -0
- package/dist/api/resources/tracing/client/Client.js +327 -0
- package/dist/api/resources/tracing/client/index.js +2 -0
- package/dist/api/types/Grade.d.ts +11 -0
- package/dist/api/types/IngestionMethod.d.ts +8 -0
- package/dist/api/types/IngestionMethod.js +10 -0
- package/dist/api/types/PaginatedTestcaseResponse.d.ts +2 -0
- package/dist/api/types/Prompt.d.ts +2 -0
- package/dist/api/types/Run.d.ts +14 -0
- package/dist/api/types/ScoringConfig.d.ts +16 -0
- package/dist/api/types/ScoringConfig.js +5 -0
- package/dist/api/types/TestCase.d.ts +4 -0
- package/dist/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
- package/dist/api/types/TestcaseBatchDeletionResponse.js +5 -0
- package/dist/api/types/Testrecord.d.ts +14 -0
- package/dist/api/types/Testset.d.ts +11 -0
- package/dist/api/types/Trace.d.ts +2 -0
- package/dist/api/types/index.d.ts +6 -4
- package/dist/api/types/index.js +6 -4
- package/dist/core/fetcher/Fetcher.d.ts +4 -1
- package/dist/core/fetcher/Fetcher.js +19 -176
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +13 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +59 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +52 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +32 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +37 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
- package/dist/core/runtime/runtime.d.ts +2 -1
- package/dist/core/runtime/runtime.js +12 -1
- package/dist/core/schemas/Schema.d.ts +7 -4
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +8 -19
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/dist/core/schemas/builders/list/list.js +31 -44
- package/dist/core/schemas/builders/object/object.js +90 -111
- package/dist/core/schemas/builders/object/types.d.ts +2 -2
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/dist/core/schemas/builders/record/record.js +49 -60
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/dist/core/schemas/builders/set/set.js +6 -15
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/dist/core/schemas/builders/union/union.js +51 -62
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/index.d.ts +3 -1
- package/dist/serialization/resources/index.js +4 -2
- package/dist/serialization/resources/scoringConfig/client/index.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/client/index.js +17 -0
- package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +14 -0
- package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +35 -0
- package/dist/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/client/requests/index.js +5 -0
- package/dist/serialization/resources/scoringConfig/index.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/index.js +17 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
- package/dist/serialization/resources/testcase/client/requests/index.d.ts +3 -0
- package/dist/serialization/resources/testcase/client/requests/index.js +7 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
- package/dist/serialization/resources/testcase/types/index.d.ts +2 -0
- package/dist/serialization/resources/testcase/types/index.js +2 -0
- package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
- package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +4 -0
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +4 -0
- package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
- package/dist/serialization/resources/testset/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/testset/client/requests/index.js +3 -1
- package/dist/serialization/resources/tracing/client/index.d.ts +1 -0
- package/{serialization/resources/traces → dist/serialization/resources/tracing}/client/index.js +2 -2
- package/dist/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
- package/dist/serialization/resources/tracing/client/traces.js +32 -0
- package/dist/serialization/resources/tracing/index.d.ts +1 -0
- package/dist/serialization/resources/tracing/index.js +17 -0
- package/dist/serialization/types/IngestionMethod.d.ts +10 -0
- package/dist/serialization/types/IngestionMethod.js +31 -0
- package/dist/serialization/types/JsonObject.js +2 -10
- package/dist/serialization/types/JsonObjectInputValue.js +3 -11
- package/dist/serialization/types/JsonObjectOutputValue.js +3 -11
- package/dist/serialization/types/ScoringConfig.d.ts +20 -0
- package/dist/serialization/types/ScoringConfig.js +41 -0
- package/dist/serialization/types/Span.js +2 -10
- package/dist/serialization/types/TestCaseCustomInputsValue.js +2 -10
- package/dist/serialization/types/TestCaseCustomLabelsValue.js +2 -10
- package/dist/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
- package/dist/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
- package/dist/serialization/types/Testrecord.d.ts +1 -0
- package/dist/serialization/types/Testrecord.js +1 -0
- package/dist/serialization/types/TestrecordCustomInputsValue.js +2 -10
- package/dist/serialization/types/TestrecordCustomLabelsValue.js +2 -10
- package/dist/serialization/types/TestrecordCustomOutputsValue.js +2 -10
- package/dist/serialization/types/Trace.d.ts +1 -0
- package/dist/serialization/types/Trace.js +2 -0
- package/dist/serialization/types/index.d.ts +6 -4
- package/dist/serialization/types/index.js +6 -4
- package/dist/telemetry.d.ts +0 -5
- package/dist/telemetry.js +25 -7
- package/dist/wrapper/ScorecardClient.d.ts +3 -0
- package/dist/wrapper/ScorecardClient.js +11 -0
- package/package.json +13 -2
- package/reference.md +657 -569
- package/serialization/resources/index.d.ts +3 -1
- package/serialization/resources/index.js +4 -2
- package/serialization/resources/scoringConfig/client/index.d.ts +1 -0
- package/serialization/resources/scoringConfig/client/index.js +17 -0
- package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +14 -0
- package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +35 -0
- package/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/serialization/resources/scoringConfig/client/requests/index.js +5 -0
- package/serialization/resources/scoringConfig/index.d.ts +1 -0
- package/serialization/resources/scoringConfig/index.js +17 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
- package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
- package/serialization/resources/testcase/client/requests/index.d.ts +3 -0
- package/serialization/resources/testcase/client/requests/index.js +7 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
- package/serialization/resources/testcase/types/index.d.ts +2 -0
- package/serialization/resources/testcase/types/index.js +2 -0
- package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
- package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
- package/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +4 -0
- package/serialization/resources/testset/client/requests/TestsetCreateParams.js +4 -0
- package/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
- package/serialization/resources/testset/client/requests/index.d.ts +1 -0
- package/serialization/resources/testset/client/requests/index.js +3 -1
- package/serialization/resources/tracing/client/index.d.ts +1 -0
- package/{dist/serialization/resources/traces → serialization/resources/tracing}/client/index.js +2 -2
- package/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
- package/serialization/resources/tracing/client/traces.js +32 -0
- package/serialization/resources/tracing/index.d.ts +1 -0
- package/serialization/resources/tracing/index.js +17 -0
- package/serialization/types/IngestionMethod.d.ts +10 -0
- package/serialization/types/IngestionMethod.js +31 -0
- package/serialization/types/JsonObject.js +2 -10
- package/serialization/types/JsonObjectInputValue.js +3 -11
- package/serialization/types/JsonObjectOutputValue.js +3 -11
- package/serialization/types/ScoringConfig.d.ts +20 -0
- package/serialization/types/ScoringConfig.js +41 -0
- package/serialization/types/Span.js +2 -10
- package/serialization/types/TestCaseCustomInputsValue.js +2 -10
- package/serialization/types/TestCaseCustomLabelsValue.js +2 -10
- package/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
- package/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
- package/serialization/types/Testrecord.d.ts +1 -0
- package/serialization/types/Testrecord.js +1 -0
- package/serialization/types/TestrecordCustomInputsValue.js +2 -10
- package/serialization/types/TestrecordCustomLabelsValue.js +2 -10
- package/serialization/types/TestrecordCustomOutputsValue.js +2 -10
- package/serialization/types/Trace.d.ts +1 -0
- package/serialization/types/Trace.js +2 -0
- package/serialization/types/index.d.ts +6 -4
- package/serialization/types/index.js +6 -4
- package/telemetry.d.ts +0 -5
- package/telemetry.js +25 -7
- package/wrapper/ScorecardClient.d.ts +3 -0
- package/wrapper/ScorecardClient.js +11 -0
- package/api/resources/traces/client/Client.d.ts +0 -40
- package/api/types/TestCaseCreate.d.ts +0 -10
- package/dist/api/resources/traces/client/Client.d.ts +0 -40
- package/dist/api/types/TestCaseCreate.d.ts +0 -10
- package/dist/serialization/resources/traces/client/index.d.ts +0 -1
- package/dist/serialization/types/TestCaseCreate.d.ts +0 -16
- package/serialization/resources/traces/client/index.d.ts +0 -1
- package/serialization/types/TestCaseCreate.d.ts +0 -16
- /package/api/{types/TestCaseCreate.js → resources/prompt/client/requests/PromptGetByNameRequest.js} +0 -0
- /package/{dist/api/types/TestCaseCreate.js → api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js} +0 -0
- /package/api/resources/{traces/client → scoringConfig/client/requests}/index.js +0 -0
- /package/api/resources/{traces → scoringConfig}/index.d.ts +0 -0
- /package/api/resources/{traces → scoringConfig}/index.js +0 -0
- /package/api/resources/{traces → tracing}/client/index.d.ts +0 -0
- /package/{dist/api/resources/traces → api/resources/tracing}/client/index.js +0 -0
- /package/{dist/api/resources/traces → api/resources/tracing}/index.d.ts +0 -0
- /package/{dist/api/resources/traces → api/resources/tracing}/index.js +0 -0
- /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.d.ts +0 -0
- /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.js +0 -0
- /package/dist/api/resources/{traces → tracing}/client/index.d.ts +0 -0
- /package/{serialization/resources/traces → dist/api/resources/tracing}/index.d.ts +0 -0
- /package/{serialization/resources/traces → dist/api/resources/tracing}/index.js +0 -0
|
@@ -10,7 +10,15 @@ import * as Scorecard from "../../../../index";
|
|
|
10
10
|
*/
|
|
11
11
|
export interface TestsetCreateParams {
|
|
12
12
|
name: string;
|
|
13
|
+
/** A description for the testset. */
|
|
13
14
|
description?: string;
|
|
15
|
+
/** Whether or not the testset uses retrieval. */
|
|
14
16
|
usingRetrieval?: boolean;
|
|
15
17
|
customSchema?: Scorecard.CustomSchema;
|
|
18
|
+
/** The ID of the project to create the testset in. Omitting this optional argument will create the testset inside your Organization's default project. */
|
|
19
|
+
projectId?: number;
|
|
20
|
+
/** The method of ingestion for the testset. */
|
|
21
|
+
ingestionMethod?: Scorecard.IngestionMethod;
|
|
22
|
+
/** Whether or not the testset is published. */
|
|
23
|
+
published?: boolean;
|
|
16
24
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Scorecard from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {}
|
|
8
|
+
*/
|
|
9
|
+
export interface TestsetUpdateParams {
|
|
10
|
+
name?: string;
|
|
11
|
+
/** A description for the testset. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Whether or not the testset uses retrieval. */
|
|
14
|
+
usingRetrieval?: boolean;
|
|
15
|
+
customSchema?: Scorecard.CustomSchema;
|
|
16
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
5
|
+
import * as core from "../../../../core";
|
|
6
|
+
import * as Scorecard from "../../../index";
|
|
7
|
+
export declare namespace Tracing {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ScorecardEnvironment | string>;
|
|
10
|
+
apiKey: core.Supplier<string>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
12
|
+
}
|
|
13
|
+
interface RequestOptions {
|
|
14
|
+
/** The maximum time to wait for a response in seconds. */
|
|
15
|
+
timeoutInSeconds?: number;
|
|
16
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
17
|
+
maxRetries?: number;
|
|
18
|
+
/** A hook to abort the request. */
|
|
19
|
+
abortSignal?: AbortSignal;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export declare class Tracing {
|
|
23
|
+
protected readonly _options: Tracing.Options;
|
|
24
|
+
constructor(_options: Tracing.Options);
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve traces
|
|
27
|
+
*
|
|
28
|
+
* @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
|
+
*
|
|
30
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
31
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
32
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* await client.tracing.traces()
|
|
36
|
+
*/
|
|
37
|
+
traces(requestOptions?: Tracing.RequestOptions): Promise<Scorecard.Trace[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Retrieve specified trace
|
|
40
|
+
*
|
|
41
|
+
* @param {string} traceId - The ID of the trace to retrieve spans from.
|
|
42
|
+
* @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
+
*
|
|
44
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
45
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
46
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
47
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* await client.tracing.trace("trace_id")
|
|
51
|
+
*/
|
|
52
|
+
trace(traceId: string, requestOptions?: Tracing.RequestOptions): Promise<Scorecard.Trace>;
|
|
53
|
+
/**
|
|
54
|
+
* Retrieve specified span
|
|
55
|
+
*
|
|
56
|
+
* @param {string} traceId - The ID of the trace which the span is a part of.
|
|
57
|
+
* @param {string} spanId - The ID of the span to retrieve.
|
|
58
|
+
* @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
|
|
59
|
+
*
|
|
60
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
61
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
62
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
63
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* await client.tracing.span("trace_id", "span_id")
|
|
67
|
+
*/
|
|
68
|
+
span(traceId: string, spanId: string, requestOptions?: Tracing.RequestOptions): Promise<Scorecard.Span>;
|
|
69
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
70
|
+
"X-API-Key": string;
|
|
71
|
+
}>;
|
|
72
|
+
}
|
|
@@ -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.0", "User-Agent": "scorecard-ai/0.6.0", "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.0", "User-Agent": "scorecard-ai/0.6.0", "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.0", "User-Agent": "scorecard-ai/0.6.0", "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;
|
|
@@ -4,19 +4,30 @@
|
|
|
4
4
|
import * as Scorecard from "../index";
|
|
5
5
|
export interface Grade {
|
|
6
6
|
userId?: string;
|
|
7
|
+
/** The ID of the grade. */
|
|
7
8
|
id?: number;
|
|
9
|
+
/** The ID of the run that created the grade. */
|
|
8
10
|
runId?: number;
|
|
11
|
+
/** The ID of the testcase associated with the grade. */
|
|
9
12
|
testcaseId?: number;
|
|
13
|
+
/** The ID of the testrecord for which the grade was created. */
|
|
10
14
|
testrecordId?: number;
|
|
15
|
+
/** The ID of the metric used to compute the grade. */
|
|
11
16
|
metricId?: number;
|
|
17
|
+
/** The binary score assigned to the grade. */
|
|
12
18
|
binaryScore?: boolean;
|
|
19
|
+
/** The integer score assigned to the grade. */
|
|
13
20
|
intScore?: number;
|
|
21
|
+
/** The reasoning for the assigned score. */
|
|
14
22
|
reasoning?: string;
|
|
15
23
|
/** Indicates if a human should assign a grade. */
|
|
16
24
|
humanEval?: boolean;
|
|
17
25
|
/** The status of the grade. */
|
|
18
26
|
status?: Scorecard.ScoreStatus;
|
|
27
|
+
/** The error message if the grade was not created successfully. */
|
|
19
28
|
errorMessage?: string;
|
|
29
|
+
/** when the grade was created. */
|
|
20
30
|
createdAt?: Date;
|
|
31
|
+
/** when the grade was last updated. */
|
|
21
32
|
updatedAt?: Date;
|
|
22
33
|
}
|
|
@@ -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
|
+
};
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
import * as Scorecard from "../index";
|
|
5
5
|
export interface PaginatedTestcaseResponse {
|
|
6
6
|
count: number;
|
|
7
|
+
/** The URL to fetch the next page of testcases. */
|
|
7
8
|
next?: string;
|
|
9
|
+
/** The URL to fetch the previous page of testcases. */
|
|
8
10
|
previous?: string;
|
|
9
11
|
/** The list of Testcases retrieved in this page. */
|
|
10
12
|
results: Scorecard.TestCase[];
|
package/dist/api/types/Run.d.ts
CHANGED
|
@@ -3,18 +3,32 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface Run {
|
|
5
5
|
id?: number;
|
|
6
|
+
/** The creation date and time of the run. */
|
|
6
7
|
createdAt?: Date;
|
|
8
|
+
/** The last time the run was updated. */
|
|
7
9
|
updatedAt?: Date;
|
|
10
|
+
/** The start time of the run. */
|
|
8
11
|
executionStartTime?: Date;
|
|
12
|
+
/** The end time of the run. */
|
|
9
13
|
executionEndTime?: Date;
|
|
14
|
+
/** The testset that was executed in this run. */
|
|
10
15
|
testsetId?: number;
|
|
16
|
+
/** The current status of the run. */
|
|
11
17
|
status?: string;
|
|
18
|
+
/** The maximum number of testcases to run. */
|
|
12
19
|
limitTestcases?: number;
|
|
20
|
+
/** How the run was created. */
|
|
13
21
|
source?: string;
|
|
22
|
+
/** The model parameters used when generating the run. */
|
|
14
23
|
modelParams?: Record<string, unknown>;
|
|
24
|
+
/** Notes about the run. */
|
|
15
25
|
notes?: string;
|
|
26
|
+
/** The ID of the scoring configuration the run uses. */
|
|
16
27
|
scoringConfigId?: number;
|
|
28
|
+
/** The prompt template to be used while executing the run. */
|
|
17
29
|
promptTemplate?: string;
|
|
30
|
+
/** The start time of scoring the run's results. */
|
|
18
31
|
scoringStartTime?: Date;
|
|
32
|
+
/** The end time of scoring the run's results. */
|
|
19
33
|
scoringEndTime?: Date;
|
|
20
34
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
}
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as Scorecard from "../index";
|
|
5
5
|
export interface TestCase {
|
|
6
|
+
/** The ID of the testcase. */
|
|
6
7
|
id?: number;
|
|
8
|
+
/** The creation date and time of the testcase. */
|
|
7
9
|
createdAt?: Date;
|
|
8
10
|
/** The ID of the testset the testcase belongs to. */
|
|
9
11
|
testsetId: number;
|
|
10
12
|
/** The user query for the testcase. */
|
|
11
13
|
userQuery: string;
|
|
14
|
+
/** The context for the testcase. */
|
|
12
15
|
context?: string;
|
|
16
|
+
/** The ideal response for the testcase. */
|
|
13
17
|
ideal?: string;
|
|
14
18
|
customInputs?: Record<string, Scorecard.TestCaseCustomInputsValue | undefined>;
|
|
15
19
|
customLabels?: Record<string, Scorecard.TestCaseCustomLabelsValue | undefined>;
|
|
@@ -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
|
+
}
|
|
@@ -4,19 +4,33 @@
|
|
|
4
4
|
import * as Scorecard from "../index";
|
|
5
5
|
export interface Testrecord {
|
|
6
6
|
id?: number;
|
|
7
|
+
/** The creation date and time of the testrecord. */
|
|
7
8
|
createdAt?: Date;
|
|
9
|
+
/** The ID of the run the testrecord belongs to. */
|
|
8
10
|
runId?: number;
|
|
11
|
+
/** The ID of the testset the testrecord belongs to. */
|
|
9
12
|
testsetId?: number;
|
|
13
|
+
/** The ID of the testcase the testrecord belongs to. */
|
|
10
14
|
testcaseId?: number;
|
|
15
|
+
/** The user query for the testrecord. */
|
|
11
16
|
userQuery?: string;
|
|
17
|
+
/** The context for the testrecord. */
|
|
12
18
|
context?: string;
|
|
19
|
+
/** The actual response of the model for the testrecord. */
|
|
13
20
|
modelResponse?: string;
|
|
21
|
+
/** The ideal response for the testrecord. */
|
|
14
22
|
ideal?: string;
|
|
15
23
|
customInputs?: Record<string, Scorecard.TestrecordCustomInputsValue | undefined>;
|
|
16
24
|
customLabels?: Record<string, Scorecard.TestrecordCustomLabelsValue | undefined>;
|
|
17
25
|
customOutputs?: Record<string, Scorecard.TestrecordCustomOutputsValue | undefined>;
|
|
26
|
+
/** The current status of the testrecord. */
|
|
18
27
|
status?: string;
|
|
28
|
+
/** The prompt used to generate the testrecord. */
|
|
19
29
|
prompt?: string;
|
|
30
|
+
/** The model parameters used when generating the testrecord. */
|
|
20
31
|
modelParams?: Record<string, Scorecard.TestrecordModelParamsValue | undefined>;
|
|
32
|
+
/** Debug information produced during the testrecord's generation. */
|
|
21
33
|
modelDebugInfo?: Record<string, Scorecard.TestrecordModelDebugInfoValue | undefined>;
|
|
34
|
+
/** The error message for the testrecord. */
|
|
35
|
+
errorMessage?: string;
|
|
22
36
|
}
|