scorecard-ai 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +9 -3
- package/Client.js +8 -3
- package/api/resources/index.d.ts +3 -1
- package/api/resources/index.js +4 -2
- package/api/resources/prompt/client/Client.d.ts +27 -22
- package/api/resources/prompt/client/Client.js +110 -99
- package/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +15 -0
- package/api/resources/prompt/client/requests/index.d.ts +1 -0
- package/api/resources/run/client/Client.d.ts +6 -3
- package/api/resources/run/client/Client.js +26 -23
- package/api/resources/runMetric/client/Client.d.ts +4 -1
- package/api/resources/runMetric/client/Client.js +8 -7
- package/api/resources/score/client/Client.d.ts +5 -2
- package/api/resources/score/client/Client.js +18 -16
- package/api/resources/scoringConfig/client/Client.d.ts +62 -0
- package/{dist/api/resources/traces → api/resources/scoringConfig}/client/Client.js +114 -16
- package/api/resources/scoringConfig/client/index.d.ts +1 -0
- package/api/resources/scoringConfig/client/index.js +17 -0
- package/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +16 -0
- package/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/api/resources/testcase/client/Client.d.ts +55 -3
- package/api/resources/testcase/client/Client.js +308 -22
- package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
- package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
- package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
- package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
- package/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
- package/api/resources/testcase/client/requests/index.d.ts +3 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
- package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
- package/api/resources/testcase/types/index.d.ts +2 -0
- package/api/resources/testcase/types/index.js +2 -0
- package/api/resources/testrecord/client/Client.d.ts +5 -2
- package/api/resources/testrecord/client/Client.js +17 -15
- package/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +2 -0
- package/api/resources/testset/client/Client.d.ts +24 -5
- package/api/resources/testset/client/Client.js +135 -36
- package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +6 -0
- package/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
- package/api/resources/testset/client/requests/index.d.ts +1 -0
- package/api/resources/tracing/client/Client.d.ts +72 -0
- package/api/resources/tracing/client/Client.js +327 -0
- package/api/types/IngestionMethod.d.ts +8 -0
- package/api/types/IngestionMethod.js +10 -0
- package/api/types/ScoringConfig.d.ts +16 -0
- package/api/types/ScoringConfig.js +5 -0
- package/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
- package/api/types/TestcaseBatchDeletionResponse.js +5 -0
- package/api/types/Testrecord.d.ts +2 -0
- package/api/types/Trace.d.ts +2 -0
- package/api/types/index.d.ts +6 -4
- package/api/types/index.js +6 -4
- package/core/fetcher/Fetcher.d.ts +4 -1
- package/core/fetcher/Fetcher.js +19 -176
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +13 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +59 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +52 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +32 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +37 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
- package/core/runtime/runtime.d.ts +2 -1
- package/core/runtime/runtime.js +12 -1
- package/core/schemas/Schema.d.ts +7 -4
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +8 -19
- package/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/core/schemas/builders/list/list.js +31 -44
- package/core/schemas/builders/object/object.js +90 -111
- package/core/schemas/builders/object/types.d.ts +2 -2
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/core/schemas/builders/record/record.js +49 -60
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/core/schemas/builders/set/set.js +6 -15
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/core/schemas/builders/union/union.js +51 -62
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +9 -3
- package/dist/Client.js +8 -3
- package/dist/api/resources/index.d.ts +3 -1
- package/dist/api/resources/index.js +4 -2
- package/dist/api/resources/prompt/client/Client.d.ts +27 -22
- package/dist/api/resources/prompt/client/Client.js +110 -99
- package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +15 -0
- package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.js +5 -0
- package/dist/api/resources/prompt/client/requests/index.d.ts +1 -0
- package/dist/api/resources/run/client/Client.d.ts +6 -3
- package/dist/api/resources/run/client/Client.js +26 -23
- package/dist/api/resources/runMetric/client/Client.d.ts +4 -1
- package/dist/api/resources/runMetric/client/Client.js +8 -7
- package/dist/api/resources/score/client/Client.d.ts +5 -2
- package/dist/api/resources/score/client/Client.js +18 -16
- package/dist/api/resources/scoringConfig/client/Client.d.ts +62 -0
- package/{api/resources/traces → dist/api/resources/scoringConfig}/client/Client.js +114 -16
- package/dist/api/resources/scoringConfig/client/index.d.ts +1 -0
- package/dist/api/resources/scoringConfig/client/index.js +17 -0
- package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +16 -0
- package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +5 -0
- package/dist/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/dist/api/resources/scoringConfig/client/requests/index.js +2 -0
- package/dist/api/resources/testcase/client/Client.d.ts +55 -3
- package/dist/api/resources/testcase/client/Client.js +308 -22
- package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
- package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
- package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
- package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
- package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
- package/dist/api/resources/testcase/client/requests/index.d.ts +3 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
- package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
- package/dist/api/resources/testcase/types/index.d.ts +2 -0
- package/dist/api/resources/testcase/types/index.js +2 -0
- package/dist/api/resources/testrecord/client/Client.d.ts +5 -2
- package/dist/api/resources/testrecord/client/Client.js +17 -15
- package/dist/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +2 -0
- package/dist/api/resources/testset/client/Client.d.ts +24 -5
- package/dist/api/resources/testset/client/Client.js +135 -36
- package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +6 -0
- package/dist/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/dist/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
- package/dist/api/resources/testset/client/requests/index.d.ts +1 -0
- package/dist/api/resources/tracing/client/Client.d.ts +72 -0
- package/dist/api/resources/tracing/client/Client.js +327 -0
- package/dist/api/resources/tracing/client/index.js +2 -0
- package/dist/api/types/IngestionMethod.d.ts +8 -0
- package/dist/api/types/IngestionMethod.js +10 -0
- package/dist/api/types/ScoringConfig.d.ts +16 -0
- package/dist/api/types/ScoringConfig.js +5 -0
- package/dist/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
- package/dist/api/types/TestcaseBatchDeletionResponse.js +5 -0
- package/dist/api/types/Testrecord.d.ts +2 -0
- package/dist/api/types/Trace.d.ts +2 -0
- package/dist/api/types/index.d.ts +6 -4
- package/dist/api/types/index.js +6 -4
- package/dist/core/fetcher/Fetcher.d.ts +4 -1
- package/dist/core/fetcher/Fetcher.js +19 -176
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +13 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +59 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +52 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +32 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +37 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
- package/dist/core/runtime/runtime.d.ts +2 -1
- package/dist/core/runtime/runtime.js +12 -1
- package/dist/core/schemas/Schema.d.ts +7 -4
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +8 -19
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/dist/core/schemas/builders/list/list.js +31 -44
- package/dist/core/schemas/builders/object/object.js +90 -111
- package/dist/core/schemas/builders/object/types.d.ts +2 -2
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/dist/core/schemas/builders/record/record.js +49 -60
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/dist/core/schemas/builders/set/set.js +6 -15
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/dist/core/schemas/builders/union/union.js +51 -62
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/index.d.ts +3 -1
- package/dist/serialization/resources/index.js +4 -2
- package/dist/serialization/resources/scoringConfig/client/index.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/client/index.js +17 -0
- package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +14 -0
- package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +35 -0
- package/dist/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/client/requests/index.js +5 -0
- package/dist/serialization/resources/scoringConfig/index.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/index.js +17 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
- package/dist/serialization/resources/testcase/client/requests/index.d.ts +3 -0
- package/dist/serialization/resources/testcase/client/requests/index.js +7 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
- package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
- package/dist/serialization/resources/testcase/types/index.d.ts +2 -0
- package/dist/serialization/resources/testcase/types/index.js +2 -0
- package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
- package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +4 -0
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +4 -0
- package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
- package/dist/serialization/resources/testset/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/testset/client/requests/index.js +3 -1
- package/dist/serialization/resources/tracing/client/index.d.ts +1 -0
- package/{serialization/resources/traces → dist/serialization/resources/tracing}/client/index.js +2 -2
- package/dist/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
- package/dist/serialization/resources/tracing/client/traces.js +32 -0
- package/dist/serialization/resources/tracing/index.d.ts +1 -0
- package/dist/serialization/resources/tracing/index.js +17 -0
- package/dist/serialization/types/IngestionMethod.d.ts +10 -0
- package/dist/serialization/types/IngestionMethod.js +31 -0
- package/dist/serialization/types/JsonObject.js +2 -10
- package/dist/serialization/types/JsonObjectInputValue.js +3 -11
- package/dist/serialization/types/JsonObjectOutputValue.js +3 -11
- package/dist/serialization/types/ScoringConfig.d.ts +20 -0
- package/dist/serialization/types/ScoringConfig.js +41 -0
- package/dist/serialization/types/Span.js +2 -10
- package/dist/serialization/types/TestCaseCustomInputsValue.js +2 -10
- package/dist/serialization/types/TestCaseCustomLabelsValue.js +2 -10
- package/dist/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
- package/dist/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
- package/dist/serialization/types/Testrecord.d.ts +1 -0
- package/dist/serialization/types/Testrecord.js +1 -0
- package/dist/serialization/types/TestrecordCustomInputsValue.js +2 -10
- package/dist/serialization/types/TestrecordCustomLabelsValue.js +2 -10
- package/dist/serialization/types/TestrecordCustomOutputsValue.js +2 -10
- package/dist/serialization/types/Trace.d.ts +1 -0
- package/dist/serialization/types/Trace.js +2 -0
- package/dist/serialization/types/index.d.ts +6 -4
- package/dist/serialization/types/index.js +6 -4
- package/package.json +8 -2
- package/reference.md +657 -569
- package/serialization/resources/index.d.ts +3 -1
- package/serialization/resources/index.js +4 -2
- package/serialization/resources/scoringConfig/client/index.d.ts +1 -0
- package/serialization/resources/scoringConfig/client/index.js +17 -0
- package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +14 -0
- package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +35 -0
- package/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
- package/serialization/resources/scoringConfig/client/requests/index.js +5 -0
- package/serialization/resources/scoringConfig/index.d.ts +1 -0
- package/serialization/resources/scoringConfig/index.js +17 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
- package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
- package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
- package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
- package/serialization/resources/testcase/client/requests/index.d.ts +3 -0
- package/serialization/resources/testcase/client/requests/index.js +7 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
- package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
- package/serialization/resources/testcase/types/index.d.ts +2 -0
- package/serialization/resources/testcase/types/index.js +2 -0
- package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
- package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
- package/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +4 -0
- package/serialization/resources/testset/client/requests/TestsetCreateParams.js +4 -0
- package/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
- package/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
- package/serialization/resources/testset/client/requests/index.d.ts +1 -0
- package/serialization/resources/testset/client/requests/index.js +3 -1
- package/serialization/resources/tracing/client/index.d.ts +1 -0
- package/{dist/serialization/resources/traces → serialization/resources/tracing}/client/index.js +2 -2
- package/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
- package/serialization/resources/tracing/client/traces.js +32 -0
- package/serialization/resources/tracing/index.d.ts +1 -0
- package/serialization/resources/tracing/index.js +17 -0
- package/serialization/types/IngestionMethod.d.ts +10 -0
- package/serialization/types/IngestionMethod.js +31 -0
- package/serialization/types/JsonObject.js +2 -10
- package/serialization/types/JsonObjectInputValue.js +3 -11
- package/serialization/types/JsonObjectOutputValue.js +3 -11
- package/serialization/types/ScoringConfig.d.ts +20 -0
- package/serialization/types/ScoringConfig.js +41 -0
- package/serialization/types/Span.js +2 -10
- package/serialization/types/TestCaseCustomInputsValue.js +2 -10
- package/serialization/types/TestCaseCustomLabelsValue.js +2 -10
- package/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
- package/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
- package/serialization/types/Testrecord.d.ts +1 -0
- package/serialization/types/Testrecord.js +1 -0
- package/serialization/types/TestrecordCustomInputsValue.js +2 -10
- package/serialization/types/TestrecordCustomLabelsValue.js +2 -10
- package/serialization/types/TestrecordCustomOutputsValue.js +2 -10
- package/serialization/types/Trace.d.ts +1 -0
- package/serialization/types/Trace.js +2 -0
- package/serialization/types/index.d.ts +6 -4
- package/serialization/types/index.js +6 -4
- package/api/resources/traces/client/Client.d.ts +0 -40
- package/api/types/TestCaseCreate.d.ts +0 -10
- package/dist/api/resources/traces/client/Client.d.ts +0 -40
- package/dist/api/types/TestCaseCreate.d.ts +0 -10
- package/dist/serialization/resources/traces/client/index.d.ts +0 -1
- package/dist/serialization/types/TestCaseCreate.d.ts +0 -16
- package/serialization/resources/traces/client/index.d.ts +0 -1
- package/serialization/types/TestCaseCreate.d.ts +0 -16
- /package/api/{types/TestCaseCreate.js → resources/prompt/client/requests/PromptGetByNameRequest.js} +0 -0
- /package/{dist/api/types/TestCaseCreate.js → api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js} +0 -0
- /package/api/resources/{traces/client → scoringConfig/client/requests}/index.js +0 -0
- /package/api/resources/{traces → scoringConfig}/index.d.ts +0 -0
- /package/api/resources/{traces → scoringConfig}/index.js +0 -0
- /package/api/resources/{traces → tracing}/client/index.d.ts +0 -0
- /package/{dist/api/resources/traces → api/resources/tracing}/client/index.js +0 -0
- /package/{dist/api/resources/traces → api/resources/tracing}/index.d.ts +0 -0
- /package/{dist/api/resources/traces → api/resources/tracing}/index.js +0 -0
- /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.d.ts +0 -0
- /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.js +0 -0
- /package/dist/api/resources/{traces → tracing}/client/index.d.ts +0 -0
- /package/{serialization/resources/traces → dist/api/resources/tracing}/index.d.ts +0 -0
- /package/{serialization/resources/traces → dist/api/resources/tracing}/index.js +0 -0
|
@@ -11,14 +11,34 @@ export declare namespace Prompt {
|
|
|
11
11
|
fetcher?: core.FetchFunction;
|
|
12
12
|
}
|
|
13
13
|
interface RequestOptions {
|
|
14
|
+
/** The maximum time to wait for a response in seconds. */
|
|
14
15
|
timeoutInSeconds?: number;
|
|
16
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
15
17
|
maxRetries?: number;
|
|
18
|
+
/** A hook to abort the request. */
|
|
16
19
|
abortSignal?: AbortSignal;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
export declare class Prompt {
|
|
20
23
|
protected readonly _options: Prompt.Options;
|
|
21
24
|
constructor(_options: Prompt.Options);
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve a prod prompt by name
|
|
27
|
+
*
|
|
28
|
+
* @param {Scorecard.PromptGetByNameRequest} request
|
|
29
|
+
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
|
+
*
|
|
31
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
32
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
33
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
34
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* await client.prompt.getByName({
|
|
38
|
+
* name: "name"
|
|
39
|
+
* })
|
|
40
|
+
*/
|
|
41
|
+
getByName(request: Scorecard.PromptGetByNameRequest, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
|
|
22
42
|
/**
|
|
23
43
|
* Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in app).
|
|
24
44
|
*
|
|
@@ -35,7 +55,7 @@ export declare class Prompt {
|
|
|
35
55
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
36
56
|
*
|
|
37
57
|
* @example
|
|
38
|
-
* await
|
|
58
|
+
* await client.prompt.create({
|
|
39
59
|
* promptTemplate: "<system>\nYou are a helpful assistant. Use the provided context to answer the user's query.\n\nContext: {context}\n</system>\n\n<user>\n{user_query}\n</user>",
|
|
40
60
|
* name: "Prompt Name",
|
|
41
61
|
* description: "Description of the prompt",
|
|
@@ -48,7 +68,7 @@ export declare class Prompt {
|
|
|
48
68
|
* })
|
|
49
69
|
*
|
|
50
70
|
* @example
|
|
51
|
-
* await
|
|
71
|
+
* await client.prompt.create({
|
|
52
72
|
* promptTemplate: "<system>\nYou are a helpful assistant. Use the provided context to answer the user's query.\n\nContext: {context}\n</system>\n\n<user>\n{user_query}\n</user>",
|
|
53
73
|
* parentId: "7ac3cbd5-3b99-4e72-97f3-9cd2e749cace",
|
|
54
74
|
* description: "Description of the prompt",
|
|
@@ -74,13 +94,13 @@ export declare class Prompt {
|
|
|
74
94
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
75
95
|
*
|
|
76
96
|
* @example
|
|
77
|
-
* await
|
|
97
|
+
* await client.prompt.get("id")
|
|
78
98
|
*/
|
|
79
99
|
get(id: string, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
|
|
80
100
|
/**
|
|
81
|
-
* Delete a
|
|
101
|
+
* Delete a scoring config.
|
|
82
102
|
*
|
|
83
|
-
* @param {string} id - The id of the
|
|
103
|
+
* @param {string} id - The id of the scoring config to delete.
|
|
84
104
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
85
105
|
*
|
|
86
106
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -89,7 +109,7 @@ export declare class Prompt {
|
|
|
89
109
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
90
110
|
*
|
|
91
111
|
* @example
|
|
92
|
-
* await
|
|
112
|
+
* await client.prompt.delete("id")
|
|
93
113
|
*/
|
|
94
114
|
delete(id: string, requestOptions?: Prompt.RequestOptions): Promise<unknown>;
|
|
95
115
|
/**
|
|
@@ -107,26 +127,11 @@ export declare class Prompt {
|
|
|
107
127
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
108
128
|
*
|
|
109
129
|
* @example
|
|
110
|
-
* await
|
|
130
|
+
* await client.prompt.update("id", {
|
|
111
131
|
* isProd: true
|
|
112
132
|
* })
|
|
113
133
|
*/
|
|
114
134
|
update(id: string, request?: Scorecard.PromptUpdateParams, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
|
|
115
|
-
/**
|
|
116
|
-
* Retrieve a prod prompt by name
|
|
117
|
-
*
|
|
118
|
-
* @param {string} name - Name of the prompt.
|
|
119
|
-
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
120
|
-
*
|
|
121
|
-
* @throws {@link Scorecard.UnauthorizedError}
|
|
122
|
-
* @throws {@link Scorecard.ForbiddenError}
|
|
123
|
-
* @throws {@link Scorecard.NotFoundError}
|
|
124
|
-
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* await scorecard.prompt.getByName("name")
|
|
128
|
-
*/
|
|
129
|
-
getByName(name: string, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
|
|
130
135
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
131
136
|
"X-API-Key": string;
|
|
132
137
|
}>;
|
|
@@ -42,21 +42,17 @@ exports.Prompt = void 0;
|
|
|
42
42
|
const environments = __importStar(require("../../../../environments"));
|
|
43
43
|
const core = __importStar(require("../../../../core"));
|
|
44
44
|
const Scorecard = __importStar(require("../../../index"));
|
|
45
|
-
const serializers = __importStar(require("../../../../serialization/index"));
|
|
46
45
|
const url_join_1 = __importDefault(require("url-join"));
|
|
46
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
47
47
|
const errors = __importStar(require("../../../../errors/index"));
|
|
48
48
|
class Prompt {
|
|
49
49
|
constructor(_options) {
|
|
50
50
|
this._options = _options;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* A root prompt can be created by providing the `name` param, and it will always be tagged as prod.
|
|
56
|
-
*
|
|
57
|
-
* A child prompt can be created by providing the `parent_id` param. Note that the `name` param in this case will be ignored as all descendents from a root prompt would share the root's name. `is_prod` can also be provided to configure whether a child should be tagged as prod.
|
|
53
|
+
* Retrieve a prod prompt by name
|
|
58
54
|
*
|
|
59
|
-
* @param {Scorecard.
|
|
55
|
+
* @param {Scorecard.PromptGetByNameRequest} request
|
|
60
56
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
57
|
*
|
|
62
58
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -65,47 +61,29 @@ class Prompt {
|
|
|
65
61
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
66
62
|
*
|
|
67
63
|
* @example
|
|
68
|
-
* await
|
|
69
|
-
*
|
|
70
|
-
* name: "Prompt Name",
|
|
71
|
-
* description: "Description of the prompt",
|
|
72
|
-
* modelParams: {
|
|
73
|
-
* "param1": "value1",
|
|
74
|
-
* "param2": 0.1,
|
|
75
|
-
* "param3": 100,
|
|
76
|
-
* "param4": true
|
|
77
|
-
* }
|
|
78
|
-
* })
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* await scorecard.prompt.create({
|
|
82
|
-
* promptTemplate: "<system>\nYou are a helpful assistant. Use the provided context to answer the user's query.\n\nContext: {context}\n</system>\n\n<user>\n{user_query}\n</user>",
|
|
83
|
-
* parentId: "7ac3cbd5-3b99-4e72-97f3-9cd2e749cace",
|
|
84
|
-
* description: "Description of the prompt",
|
|
85
|
-
* modelParams: {
|
|
86
|
-
* "param1": "value1",
|
|
87
|
-
* "param2": 0.1,
|
|
88
|
-
* "param3": 100,
|
|
89
|
-
* "param4": true
|
|
90
|
-
* },
|
|
91
|
-
* isProd: true
|
|
64
|
+
* await client.prompt.getByName({
|
|
65
|
+
* name: "name"
|
|
92
66
|
* })
|
|
93
67
|
*/
|
|
94
|
-
|
|
68
|
+
getByName(request, requestOptions) {
|
|
95
69
|
var _a, _b;
|
|
96
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const { name } = request;
|
|
72
|
+
const _queryParams = {};
|
|
73
|
+
_queryParams["name"] = name;
|
|
97
74
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
98
75
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/prompt"),
|
|
99
|
-
method: "
|
|
100
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
76
|
+
method: "GET",
|
|
77
|
+
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())),
|
|
101
78
|
contentType: "application/json",
|
|
102
|
-
|
|
79
|
+
queryParameters: _queryParams,
|
|
80
|
+
requestType: "json",
|
|
103
81
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
104
82
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
105
83
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
106
84
|
});
|
|
107
85
|
if (_response.ok) {
|
|
108
|
-
return
|
|
86
|
+
return serializers.Prompt.parseOrThrow(_response.body, {
|
|
109
87
|
unrecognizedObjectKeys: "passthrough",
|
|
110
88
|
allowUnrecognizedUnionMembers: true,
|
|
111
89
|
allowUnrecognizedEnumValues: true,
|
|
@@ -116,7 +94,7 @@ class Prompt {
|
|
|
116
94
|
if (_response.error.reason === "status-code") {
|
|
117
95
|
switch (_response.error.statusCode) {
|
|
118
96
|
case 401:
|
|
119
|
-
throw new Scorecard.UnauthorizedError(
|
|
97
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
120
98
|
unrecognizedObjectKeys: "passthrough",
|
|
121
99
|
allowUnrecognizedUnionMembers: true,
|
|
122
100
|
allowUnrecognizedEnumValues: true,
|
|
@@ -124,7 +102,7 @@ class Prompt {
|
|
|
124
102
|
breadcrumbsPrefix: ["response"],
|
|
125
103
|
}));
|
|
126
104
|
case 403:
|
|
127
|
-
throw new Scorecard.ForbiddenError(
|
|
105
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
128
106
|
unrecognizedObjectKeys: "passthrough",
|
|
129
107
|
allowUnrecognizedUnionMembers: true,
|
|
130
108
|
allowUnrecognizedEnumValues: true,
|
|
@@ -132,7 +110,7 @@ class Prompt {
|
|
|
132
110
|
breadcrumbsPrefix: ["response"],
|
|
133
111
|
}));
|
|
134
112
|
case 404:
|
|
135
|
-
throw new Scorecard.NotFoundError(
|
|
113
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
136
114
|
unrecognizedObjectKeys: "passthrough",
|
|
137
115
|
allowUnrecognizedUnionMembers: true,
|
|
138
116
|
allowUnrecognizedEnumValues: true,
|
|
@@ -140,7 +118,7 @@ class Prompt {
|
|
|
140
118
|
breadcrumbsPrefix: ["response"],
|
|
141
119
|
}));
|
|
142
120
|
case 422:
|
|
143
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
121
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
144
122
|
unrecognizedObjectKeys: "passthrough",
|
|
145
123
|
allowUnrecognizedUnionMembers: true,
|
|
146
124
|
allowUnrecognizedEnumValues: true,
|
|
@@ -170,9 +148,13 @@ class Prompt {
|
|
|
170
148
|
});
|
|
171
149
|
}
|
|
172
150
|
/**
|
|
173
|
-
*
|
|
151
|
+
* Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in app).
|
|
174
152
|
*
|
|
175
|
-
*
|
|
153
|
+
* A root prompt can be created by providing the `name` param, and it will always be tagged as prod.
|
|
154
|
+
*
|
|
155
|
+
* A child prompt can be created by providing the `parent_id` param. Note that the `name` param in this case will be ignored as all descendents from a root prompt would share the root's name. `is_prod` can also be provided to configure whether a child should be tagged as prod.
|
|
156
|
+
*
|
|
157
|
+
* @param {Scorecard.PromptCreateParams} request
|
|
176
158
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
177
159
|
*
|
|
178
160
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -181,22 +163,48 @@ class Prompt {
|
|
|
181
163
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
182
164
|
*
|
|
183
165
|
* @example
|
|
184
|
-
* await
|
|
166
|
+
* await client.prompt.create({
|
|
167
|
+
* promptTemplate: "<system>\nYou are a helpful assistant. Use the provided context to answer the user's query.\n\nContext: {context}\n</system>\n\n<user>\n{user_query}\n</user>",
|
|
168
|
+
* name: "Prompt Name",
|
|
169
|
+
* description: "Description of the prompt",
|
|
170
|
+
* modelParams: {
|
|
171
|
+
* "param1": "value1",
|
|
172
|
+
* "param2": 0.1,
|
|
173
|
+
* "param3": 100,
|
|
174
|
+
* "param4": true
|
|
175
|
+
* }
|
|
176
|
+
* })
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* await client.prompt.create({
|
|
180
|
+
* promptTemplate: "<system>\nYou are a helpful assistant. Use the provided context to answer the user's query.\n\nContext: {context}\n</system>\n\n<user>\n{user_query}\n</user>",
|
|
181
|
+
* parentId: "7ac3cbd5-3b99-4e72-97f3-9cd2e749cace",
|
|
182
|
+
* description: "Description of the prompt",
|
|
183
|
+
* modelParams: {
|
|
184
|
+
* "param1": "value1",
|
|
185
|
+
* "param2": 0.1,
|
|
186
|
+
* "param3": 100,
|
|
187
|
+
* "param4": true
|
|
188
|
+
* },
|
|
189
|
+
* isProd: true
|
|
190
|
+
* })
|
|
185
191
|
*/
|
|
186
|
-
|
|
192
|
+
create(request, requestOptions) {
|
|
187
193
|
var _a, _b;
|
|
188
194
|
return __awaiter(this, void 0, void 0, function* () {
|
|
189
195
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
190
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default,
|
|
191
|
-
method: "
|
|
192
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
196
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/prompt"),
|
|
197
|
+
method: "POST",
|
|
198
|
+
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())),
|
|
193
199
|
contentType: "application/json",
|
|
200
|
+
requestType: "json",
|
|
201
|
+
body: serializers.PromptCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
194
202
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
195
203
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
196
204
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
197
205
|
});
|
|
198
206
|
if (_response.ok) {
|
|
199
|
-
return
|
|
207
|
+
return serializers.Prompt.parseOrThrow(_response.body, {
|
|
200
208
|
unrecognizedObjectKeys: "passthrough",
|
|
201
209
|
allowUnrecognizedUnionMembers: true,
|
|
202
210
|
allowUnrecognizedEnumValues: true,
|
|
@@ -207,7 +215,7 @@ class Prompt {
|
|
|
207
215
|
if (_response.error.reason === "status-code") {
|
|
208
216
|
switch (_response.error.statusCode) {
|
|
209
217
|
case 401:
|
|
210
|
-
throw new Scorecard.UnauthorizedError(
|
|
218
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
211
219
|
unrecognizedObjectKeys: "passthrough",
|
|
212
220
|
allowUnrecognizedUnionMembers: true,
|
|
213
221
|
allowUnrecognizedEnumValues: true,
|
|
@@ -215,7 +223,7 @@ class Prompt {
|
|
|
215
223
|
breadcrumbsPrefix: ["response"],
|
|
216
224
|
}));
|
|
217
225
|
case 403:
|
|
218
|
-
throw new Scorecard.ForbiddenError(
|
|
226
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
219
227
|
unrecognizedObjectKeys: "passthrough",
|
|
220
228
|
allowUnrecognizedUnionMembers: true,
|
|
221
229
|
allowUnrecognizedEnumValues: true,
|
|
@@ -223,7 +231,7 @@ class Prompt {
|
|
|
223
231
|
breadcrumbsPrefix: ["response"],
|
|
224
232
|
}));
|
|
225
233
|
case 404:
|
|
226
|
-
throw new Scorecard.NotFoundError(
|
|
234
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
227
235
|
unrecognizedObjectKeys: "passthrough",
|
|
228
236
|
allowUnrecognizedUnionMembers: true,
|
|
229
237
|
allowUnrecognizedEnumValues: true,
|
|
@@ -231,7 +239,7 @@ class Prompt {
|
|
|
231
239
|
breadcrumbsPrefix: ["response"],
|
|
232
240
|
}));
|
|
233
241
|
case 422:
|
|
234
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
242
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
235
243
|
unrecognizedObjectKeys: "passthrough",
|
|
236
244
|
allowUnrecognizedUnionMembers: true,
|
|
237
245
|
allowUnrecognizedEnumValues: true,
|
|
@@ -261,9 +269,9 @@ class Prompt {
|
|
|
261
269
|
});
|
|
262
270
|
}
|
|
263
271
|
/**
|
|
264
|
-
*
|
|
272
|
+
* Retrieve a prompt by id
|
|
265
273
|
*
|
|
266
|
-
* @param {string} id - The id of the
|
|
274
|
+
* @param {string} id - The id of the prompt to get.
|
|
267
275
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
268
276
|
*
|
|
269
277
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -272,27 +280,34 @@ class Prompt {
|
|
|
272
280
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
273
281
|
*
|
|
274
282
|
* @example
|
|
275
|
-
* await
|
|
283
|
+
* await client.prompt.get("id")
|
|
276
284
|
*/
|
|
277
|
-
|
|
285
|
+
get(id, requestOptions) {
|
|
278
286
|
var _a, _b;
|
|
279
287
|
return __awaiter(this, void 0, void 0, function* () {
|
|
280
288
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
281
289
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
|
|
282
|
-
method: "
|
|
283
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
290
|
+
method: "GET",
|
|
291
|
+
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())),
|
|
284
292
|
contentType: "application/json",
|
|
293
|
+
requestType: "json",
|
|
285
294
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
286
295
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
287
296
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
288
297
|
});
|
|
289
298
|
if (_response.ok) {
|
|
290
|
-
return _response.body
|
|
299
|
+
return serializers.Prompt.parseOrThrow(_response.body, {
|
|
300
|
+
unrecognizedObjectKeys: "passthrough",
|
|
301
|
+
allowUnrecognizedUnionMembers: true,
|
|
302
|
+
allowUnrecognizedEnumValues: true,
|
|
303
|
+
skipValidation: true,
|
|
304
|
+
breadcrumbsPrefix: ["response"],
|
|
305
|
+
});
|
|
291
306
|
}
|
|
292
307
|
if (_response.error.reason === "status-code") {
|
|
293
308
|
switch (_response.error.statusCode) {
|
|
294
309
|
case 401:
|
|
295
|
-
throw new Scorecard.UnauthorizedError(
|
|
310
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
296
311
|
unrecognizedObjectKeys: "passthrough",
|
|
297
312
|
allowUnrecognizedUnionMembers: true,
|
|
298
313
|
allowUnrecognizedEnumValues: true,
|
|
@@ -300,7 +315,7 @@ class Prompt {
|
|
|
300
315
|
breadcrumbsPrefix: ["response"],
|
|
301
316
|
}));
|
|
302
317
|
case 403:
|
|
303
|
-
throw new Scorecard.ForbiddenError(
|
|
318
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
304
319
|
unrecognizedObjectKeys: "passthrough",
|
|
305
320
|
allowUnrecognizedUnionMembers: true,
|
|
306
321
|
allowUnrecognizedEnumValues: true,
|
|
@@ -308,7 +323,7 @@ class Prompt {
|
|
|
308
323
|
breadcrumbsPrefix: ["response"],
|
|
309
324
|
}));
|
|
310
325
|
case 404:
|
|
311
|
-
throw new Scorecard.NotFoundError(
|
|
326
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
312
327
|
unrecognizedObjectKeys: "passthrough",
|
|
313
328
|
allowUnrecognizedUnionMembers: true,
|
|
314
329
|
allowUnrecognizedEnumValues: true,
|
|
@@ -316,7 +331,7 @@ class Prompt {
|
|
|
316
331
|
breadcrumbsPrefix: ["response"],
|
|
317
332
|
}));
|
|
318
333
|
case 422:
|
|
319
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
334
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
320
335
|
unrecognizedObjectKeys: "passthrough",
|
|
321
336
|
allowUnrecognizedUnionMembers: true,
|
|
322
337
|
allowUnrecognizedEnumValues: true,
|
|
@@ -346,12 +361,9 @@ class Prompt {
|
|
|
346
361
|
});
|
|
347
362
|
}
|
|
348
363
|
/**
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
* `is_prod` tags the provided prompt as the production prompt within the prompt graph.
|
|
364
|
+
* Delete a scoring config.
|
|
352
365
|
*
|
|
353
|
-
* @param {string} id - The id of the
|
|
354
|
-
* @param {Scorecard.PromptUpdateParams} request
|
|
366
|
+
* @param {string} id - The id of the scoring config to delete.
|
|
355
367
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
356
368
|
*
|
|
357
369
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -360,36 +372,28 @@ class Prompt {
|
|
|
360
372
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
361
373
|
*
|
|
362
374
|
* @example
|
|
363
|
-
* await
|
|
364
|
-
* isProd: true
|
|
365
|
-
* })
|
|
375
|
+
* await client.prompt.delete("id")
|
|
366
376
|
*/
|
|
367
|
-
|
|
377
|
+
delete(id, requestOptions) {
|
|
368
378
|
var _a, _b;
|
|
369
379
|
return __awaiter(this, void 0, void 0, function* () {
|
|
370
380
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
371
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/
|
|
372
|
-
method: "
|
|
373
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
381
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/scoring_config/${encodeURIComponent(id)}`),
|
|
382
|
+
method: "DELETE",
|
|
383
|
+
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())),
|
|
374
384
|
contentType: "application/json",
|
|
375
|
-
|
|
385
|
+
requestType: "json",
|
|
376
386
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
377
387
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
378
388
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
379
389
|
});
|
|
380
390
|
if (_response.ok) {
|
|
381
|
-
return
|
|
382
|
-
unrecognizedObjectKeys: "passthrough",
|
|
383
|
-
allowUnrecognizedUnionMembers: true,
|
|
384
|
-
allowUnrecognizedEnumValues: true,
|
|
385
|
-
skipValidation: true,
|
|
386
|
-
breadcrumbsPrefix: ["response"],
|
|
387
|
-
});
|
|
391
|
+
return _response.body;
|
|
388
392
|
}
|
|
389
393
|
if (_response.error.reason === "status-code") {
|
|
390
394
|
switch (_response.error.statusCode) {
|
|
391
395
|
case 401:
|
|
392
|
-
throw new Scorecard.UnauthorizedError(
|
|
396
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
393
397
|
unrecognizedObjectKeys: "passthrough",
|
|
394
398
|
allowUnrecognizedUnionMembers: true,
|
|
395
399
|
allowUnrecognizedEnumValues: true,
|
|
@@ -397,7 +401,7 @@ class Prompt {
|
|
|
397
401
|
breadcrumbsPrefix: ["response"],
|
|
398
402
|
}));
|
|
399
403
|
case 403:
|
|
400
|
-
throw new Scorecard.ForbiddenError(
|
|
404
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
401
405
|
unrecognizedObjectKeys: "passthrough",
|
|
402
406
|
allowUnrecognizedUnionMembers: true,
|
|
403
407
|
allowUnrecognizedEnumValues: true,
|
|
@@ -405,7 +409,7 @@ class Prompt {
|
|
|
405
409
|
breadcrumbsPrefix: ["response"],
|
|
406
410
|
}));
|
|
407
411
|
case 404:
|
|
408
|
-
throw new Scorecard.NotFoundError(
|
|
412
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
409
413
|
unrecognizedObjectKeys: "passthrough",
|
|
410
414
|
allowUnrecognizedUnionMembers: true,
|
|
411
415
|
allowUnrecognizedEnumValues: true,
|
|
@@ -413,7 +417,7 @@ class Prompt {
|
|
|
413
417
|
breadcrumbsPrefix: ["response"],
|
|
414
418
|
}));
|
|
415
419
|
case 422:
|
|
416
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
420
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
417
421
|
unrecognizedObjectKeys: "passthrough",
|
|
418
422
|
allowUnrecognizedUnionMembers: true,
|
|
419
423
|
allowUnrecognizedEnumValues: true,
|
|
@@ -443,9 +447,12 @@ class Prompt {
|
|
|
443
447
|
});
|
|
444
448
|
}
|
|
445
449
|
/**
|
|
446
|
-
*
|
|
450
|
+
* Update a prompt.
|
|
447
451
|
*
|
|
448
|
-
*
|
|
452
|
+
* `is_prod` tags the provided prompt as the production prompt within the prompt graph.
|
|
453
|
+
*
|
|
454
|
+
* @param {string} id - The id of the prompt to update.
|
|
455
|
+
* @param {Scorecard.PromptUpdateParams} request
|
|
449
456
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
450
457
|
*
|
|
451
458
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -454,22 +461,26 @@ class Prompt {
|
|
|
454
461
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
455
462
|
*
|
|
456
463
|
* @example
|
|
457
|
-
* await
|
|
464
|
+
* await client.prompt.update("id", {
|
|
465
|
+
* isProd: true
|
|
466
|
+
* })
|
|
458
467
|
*/
|
|
459
|
-
|
|
468
|
+
update(id, request = {}, requestOptions) {
|
|
460
469
|
var _a, _b;
|
|
461
470
|
return __awaiter(this, void 0, void 0, function* () {
|
|
462
471
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
463
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt
|
|
464
|
-
method: "
|
|
465
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
472
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
|
|
473
|
+
method: "PATCH",
|
|
474
|
+
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())),
|
|
466
475
|
contentType: "application/json",
|
|
476
|
+
requestType: "json",
|
|
477
|
+
body: serializers.PromptUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
467
478
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
468
479
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
469
480
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
470
481
|
});
|
|
471
482
|
if (_response.ok) {
|
|
472
|
-
return
|
|
483
|
+
return serializers.Prompt.parseOrThrow(_response.body, {
|
|
473
484
|
unrecognizedObjectKeys: "passthrough",
|
|
474
485
|
allowUnrecognizedUnionMembers: true,
|
|
475
486
|
allowUnrecognizedEnumValues: true,
|
|
@@ -480,7 +491,7 @@ class Prompt {
|
|
|
480
491
|
if (_response.error.reason === "status-code") {
|
|
481
492
|
switch (_response.error.statusCode) {
|
|
482
493
|
case 401:
|
|
483
|
-
throw new Scorecard.UnauthorizedError(
|
|
494
|
+
throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
484
495
|
unrecognizedObjectKeys: "passthrough",
|
|
485
496
|
allowUnrecognizedUnionMembers: true,
|
|
486
497
|
allowUnrecognizedEnumValues: true,
|
|
@@ -488,7 +499,7 @@ class Prompt {
|
|
|
488
499
|
breadcrumbsPrefix: ["response"],
|
|
489
500
|
}));
|
|
490
501
|
case 403:
|
|
491
|
-
throw new Scorecard.ForbiddenError(
|
|
502
|
+
throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
492
503
|
unrecognizedObjectKeys: "passthrough",
|
|
493
504
|
allowUnrecognizedUnionMembers: true,
|
|
494
505
|
allowUnrecognizedEnumValues: true,
|
|
@@ -496,7 +507,7 @@ class Prompt {
|
|
|
496
507
|
breadcrumbsPrefix: ["response"],
|
|
497
508
|
}));
|
|
498
509
|
case 404:
|
|
499
|
-
throw new Scorecard.NotFoundError(
|
|
510
|
+
throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
500
511
|
unrecognizedObjectKeys: "passthrough",
|
|
501
512
|
allowUnrecognizedUnionMembers: true,
|
|
502
513
|
allowUnrecognizedEnumValues: true,
|
|
@@ -504,7 +515,7 @@ class Prompt {
|
|
|
504
515
|
breadcrumbsPrefix: ["response"],
|
|
505
516
|
}));
|
|
506
517
|
case 422:
|
|
507
|
-
throw new Scorecard.UnprocessableEntityError(
|
|
518
|
+
throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
508
519
|
unrecognizedObjectKeys: "passthrough",
|
|
509
520
|
allowUnrecognizedUnionMembers: true,
|
|
510
521
|
allowUnrecognizedEnumValues: true,
|
|
@@ -11,8 +11,11 @@ export declare namespace Run {
|
|
|
11
11
|
fetcher?: core.FetchFunction;
|
|
12
12
|
}
|
|
13
13
|
interface RequestOptions {
|
|
14
|
+
/** The maximum time to wait for a response in seconds. */
|
|
14
15
|
timeoutInSeconds?: number;
|
|
16
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
15
17
|
maxRetries?: number;
|
|
18
|
+
/** A hook to abort the request. */
|
|
16
19
|
abortSignal?: AbortSignal;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
@@ -31,7 +34,7 @@ export declare class Run {
|
|
|
31
34
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
32
35
|
*
|
|
33
36
|
* @example
|
|
34
|
-
* await
|
|
37
|
+
* await client.run.create()
|
|
35
38
|
*/
|
|
36
39
|
create(request?: Scorecard.RunCreateParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
|
|
37
40
|
/**
|
|
@@ -46,7 +49,7 @@ export declare class Run {
|
|
|
46
49
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
47
50
|
*
|
|
48
51
|
* @example
|
|
49
|
-
* await
|
|
52
|
+
* await client.run.get(1)
|
|
50
53
|
*/
|
|
51
54
|
get(runId: number, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
|
|
52
55
|
/**
|
|
@@ -62,7 +65,7 @@ export declare class Run {
|
|
|
62
65
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
63
66
|
*
|
|
64
67
|
* @example
|
|
65
|
-
* await
|
|
68
|
+
* await client.run.updateStatus(1)
|
|
66
69
|
*/
|
|
67
70
|
updateStatus(runId: number, request?: Scorecard.UpdateStatusParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
|
|
68
71
|
protected _getCustomAuthorizationHeaders(): Promise<{
|