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
|
@@ -25,22 +25,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
__setModuleDefault(result, mod);
|
|
26
26
|
return result;
|
|
27
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
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
29
|
exports.TestCaseCustomLabelsValue = void 0;
|
|
30
|
+
const serializers = __importStar(require("../index"));
|
|
39
31
|
const core = __importStar(require("../../core"));
|
|
40
32
|
const FileUrl_1 = require("./FileUrl");
|
|
41
33
|
exports.TestCaseCustomLabelsValue = core.serialization.undiscriminatedUnion([
|
|
42
34
|
FileUrl_1.FileUrl,
|
|
43
|
-
core.serialization.lazyObject(() =>
|
|
35
|
+
core.serialization.lazyObject(() => serializers.JsonObject),
|
|
44
36
|
core.serialization.string(),
|
|
45
37
|
core.serialization.number(),
|
|
46
38
|
core.serialization.number(),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../index";
|
|
5
|
+
import * as Scorecard from "../../api/index";
|
|
6
|
+
import * as core from "../../core";
|
|
7
|
+
export declare const TestcaseBatchDeletionResponse: core.serialization.ObjectSchema<serializers.TestcaseBatchDeletionResponse.Raw, Scorecard.TestcaseBatchDeletionResponse>;
|
|
8
|
+
export declare namespace TestcaseBatchDeletionResponse {
|
|
9
|
+
interface Raw {
|
|
10
|
+
ids: number[];
|
|
11
|
+
detail: string;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -26,12 +26,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.TestcaseBatchDeletionResponse = void 0;
|
|
30
30
|
const core = __importStar(require("../../core"));
|
|
31
|
-
exports.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
context: core.serialization.string().optional(),
|
|
35
|
-
response: core.serialization.string().optional(),
|
|
36
|
-
ideal: core.serialization.string().optional(),
|
|
31
|
+
exports.TestcaseBatchDeletionResponse = core.serialization.object({
|
|
32
|
+
ids: core.serialization.list(core.serialization.number()),
|
|
33
|
+
detail: core.serialization.string(),
|
|
37
34
|
});
|
|
@@ -28,5 +28,6 @@ export declare namespace Testrecord {
|
|
|
28
28
|
prompt?: string | null;
|
|
29
29
|
model_params?: Record<string, TestrecordModelParamsValue.Raw | null | undefined> | null;
|
|
30
30
|
model_debug_info?: Record<string, TestrecordModelDebugInfoValue.Raw | null | undefined> | null;
|
|
31
|
+
error_message?: string | null;
|
|
31
32
|
}
|
|
32
33
|
}
|
|
@@ -50,4 +50,5 @@ exports.Testrecord = core.serialization.object({
|
|
|
50
50
|
prompt: core.serialization.string().optional(),
|
|
51
51
|
modelParams: core.serialization.property("model_params", core.serialization.record(core.serialization.string(), TestrecordModelParamsValue_1.TestrecordModelParamsValue.optional()).optional()),
|
|
52
52
|
modelDebugInfo: core.serialization.property("model_debug_info", core.serialization.record(core.serialization.string(), TestrecordModelDebugInfoValue_1.TestrecordModelDebugInfoValue.optional()).optional()),
|
|
53
|
+
errorMessage: core.serialization.property("error_message", core.serialization.string().optional()),
|
|
53
54
|
});
|
|
@@ -25,21 +25,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
__setModuleDefault(result, mod);
|
|
26
26
|
return result;
|
|
27
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
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
29
|
exports.TestrecordCustomInputsValue = void 0;
|
|
30
|
+
const serializers = __importStar(require("../index"));
|
|
39
31
|
const core = __importStar(require("../../core"));
|
|
40
32
|
const FileUrl_1 = require("./FileUrl");
|
|
41
33
|
exports.TestrecordCustomInputsValue = core.serialization.undiscriminatedUnion([
|
|
42
34
|
core.serialization.string(),
|
|
43
35
|
FileUrl_1.FileUrl,
|
|
44
|
-
core.serialization.lazyObject(() =>
|
|
36
|
+
core.serialization.lazyObject(() => serializers.JsonObject),
|
|
45
37
|
]);
|
|
@@ -25,21 +25,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
__setModuleDefault(result, mod);
|
|
26
26
|
return result;
|
|
27
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
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
29
|
exports.TestrecordCustomLabelsValue = void 0;
|
|
30
|
+
const serializers = __importStar(require("../index"));
|
|
39
31
|
const core = __importStar(require("../../core"));
|
|
40
32
|
const FileUrl_1 = require("./FileUrl");
|
|
41
33
|
exports.TestrecordCustomLabelsValue = core.serialization.undiscriminatedUnion([
|
|
42
34
|
core.serialization.string(),
|
|
43
35
|
FileUrl_1.FileUrl,
|
|
44
|
-
core.serialization.lazyObject(() =>
|
|
36
|
+
core.serialization.lazyObject(() => serializers.JsonObject),
|
|
45
37
|
]);
|
|
@@ -25,21 +25,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
__setModuleDefault(result, mod);
|
|
26
26
|
return result;
|
|
27
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
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
29
|
exports.TestrecordCustomOutputsValue = void 0;
|
|
30
|
+
const serializers = __importStar(require("../index"));
|
|
39
31
|
const core = __importStar(require("../../core"));
|
|
40
32
|
const FileUrl_1 = require("./FileUrl");
|
|
41
33
|
exports.TestrecordCustomOutputsValue = core.serialization.undiscriminatedUnion([
|
|
42
34
|
core.serialization.string(),
|
|
43
35
|
FileUrl_1.FileUrl,
|
|
44
|
-
core.serialization.lazyObject(() =>
|
|
36
|
+
core.serialization.lazyObject(() => serializers.JsonObject),
|
|
45
37
|
]);
|
|
@@ -27,9 +27,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.Trace = void 0;
|
|
30
|
+
const serializers = __importStar(require("../index"));
|
|
30
31
|
const core = __importStar(require("../../core"));
|
|
31
32
|
exports.Trace = core.serialization.object({
|
|
32
33
|
traceId: core.serialization.property("TraceId", core.serialization.string()),
|
|
33
34
|
start: core.serialization.property("Start", core.serialization.date()),
|
|
34
35
|
end: core.serialization.property("End", core.serialization.date()),
|
|
36
|
+
spans: core.serialization.property("Spans", core.serialization.list(core.serialization.lazyObject(() => serializers.Span)).optional()),
|
|
35
37
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from "./CreateRunParams";
|
|
2
1
|
export * from "./CustomSchema";
|
|
3
2
|
export * from "./CustomVariable";
|
|
4
3
|
export * from "./DataTypeEnum";
|
|
5
4
|
export * from "./FileUrl";
|
|
6
5
|
export * from "./Grade";
|
|
7
6
|
export * from "./HttpValidationError";
|
|
7
|
+
export * from "./IngestionMethod";
|
|
8
8
|
export * from "./JsonObjectInputValue";
|
|
9
9
|
export * from "./JsonObject";
|
|
10
10
|
export * from "./JsonObjectOutputValue";
|
|
@@ -17,13 +17,12 @@ export * from "./Run";
|
|
|
17
17
|
export * from "./RunMetric";
|
|
18
18
|
export * from "./RunStatus";
|
|
19
19
|
export * from "./ScoreStatus";
|
|
20
|
+
export * from "./ScoringConfig";
|
|
20
21
|
export * from "./Span";
|
|
21
22
|
export * from "./TestCaseCustomInputsValue";
|
|
22
23
|
export * from "./TestCaseCustomLabelsValue";
|
|
23
24
|
export * from "./TestCase";
|
|
24
|
-
export * from "./
|
|
25
|
-
export * from "./TestRecordCreate";
|
|
26
|
-
export * from "./TestSetCreate";
|
|
25
|
+
export * from "./TestcaseBatchDeletionResponse";
|
|
27
26
|
export * from "./TestcaseDeletionResponse";
|
|
28
27
|
export * from "./TestrecordCustomInputsValue";
|
|
29
28
|
export * from "./TestrecordCustomLabelsValue";
|
|
@@ -38,3 +37,6 @@ export * from "./UnauthorizedErrorBody";
|
|
|
38
37
|
export * from "./ValidationErrorLocItem";
|
|
39
38
|
export * from "./ValidationError";
|
|
40
39
|
export * from "./CreateGithubWorkflowParams";
|
|
40
|
+
export * from "./CreateRunParams";
|
|
41
|
+
export * from "./TestRecordCreate";
|
|
42
|
+
export * from "./TestSetCreate";
|
|
@@ -14,13 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./CreateRunParams"), exports);
|
|
18
17
|
__exportStar(require("./CustomSchema"), exports);
|
|
19
18
|
__exportStar(require("./CustomVariable"), exports);
|
|
20
19
|
__exportStar(require("./DataTypeEnum"), exports);
|
|
21
20
|
__exportStar(require("./FileUrl"), exports);
|
|
22
21
|
__exportStar(require("./Grade"), exports);
|
|
23
22
|
__exportStar(require("./HttpValidationError"), exports);
|
|
23
|
+
__exportStar(require("./IngestionMethod"), exports);
|
|
24
24
|
__exportStar(require("./JsonObjectInputValue"), exports);
|
|
25
25
|
__exportStar(require("./JsonObject"), exports);
|
|
26
26
|
__exportStar(require("./JsonObjectOutputValue"), exports);
|
|
@@ -33,13 +33,12 @@ __exportStar(require("./Run"), exports);
|
|
|
33
33
|
__exportStar(require("./RunMetric"), exports);
|
|
34
34
|
__exportStar(require("./RunStatus"), exports);
|
|
35
35
|
__exportStar(require("./ScoreStatus"), exports);
|
|
36
|
+
__exportStar(require("./ScoringConfig"), exports);
|
|
36
37
|
__exportStar(require("./Span"), exports);
|
|
37
38
|
__exportStar(require("./TestCaseCustomInputsValue"), exports);
|
|
38
39
|
__exportStar(require("./TestCaseCustomLabelsValue"), exports);
|
|
39
40
|
__exportStar(require("./TestCase"), exports);
|
|
40
|
-
__exportStar(require("./
|
|
41
|
-
__exportStar(require("./TestRecordCreate"), exports);
|
|
42
|
-
__exportStar(require("./TestSetCreate"), exports);
|
|
41
|
+
__exportStar(require("./TestcaseBatchDeletionResponse"), exports);
|
|
43
42
|
__exportStar(require("./TestcaseDeletionResponse"), exports);
|
|
44
43
|
__exportStar(require("./TestrecordCustomInputsValue"), exports);
|
|
45
44
|
__exportStar(require("./TestrecordCustomLabelsValue"), exports);
|
|
@@ -54,3 +53,6 @@ __exportStar(require("./UnauthorizedErrorBody"), exports);
|
|
|
54
53
|
__exportStar(require("./ValidationErrorLocItem"), exports);
|
|
55
54
|
__exportStar(require("./ValidationError"), exports);
|
|
56
55
|
__exportStar(require("./CreateGithubWorkflowParams"), exports);
|
|
56
|
+
__exportStar(require("./CreateRunParams"), exports);
|
|
57
|
+
__exportStar(require("./TestRecordCreate"), exports);
|
|
58
|
+
__exportStar(require("./TestSetCreate"), exports);
|
package/dist/telemetry.d.ts
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
declare const trace: any;
|
|
2
|
-
declare const OTLPTraceExporter: any;
|
|
3
|
-
declare const Resource: any;
|
|
4
|
-
declare const BatchSpanProcessor: any, ConsoleSpanExporter: any, NodeTracerProvider: any;
|
|
5
|
-
declare const SEMRESATTRS_SERVICE_NAME: any;
|
|
6
1
|
declare function checkInstalled(...modules: string[]): boolean;
|
package/dist/telemetry.js
CHANGED
|
@@ -8,11 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
const { trace } = require('@opentelemetry/api');
|
|
12
|
-
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
|
|
13
|
-
const { Resource } = require('@opentelemetry/resources');
|
|
14
|
-
const { BatchSpanProcessor, ConsoleSpanExporter, NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
|
|
15
|
-
const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');
|
|
16
11
|
function checkInstalled(...modules) {
|
|
17
12
|
for (let i = 0; i < modules.length; i++) {
|
|
18
13
|
let module = modules[i];
|
|
@@ -27,6 +22,23 @@ function checkInstalled(...modules) {
|
|
|
27
22
|
}
|
|
28
23
|
module.exports = {
|
|
29
24
|
setup(name, scorecardConfig, debug = false) {
|
|
25
|
+
const required = [
|
|
26
|
+
'@opentelemetry/api',
|
|
27
|
+
'@opentelemetry/core',
|
|
28
|
+
'@opentelemetry/exporter-trace-otlp-http',
|
|
29
|
+
'@opentelemetry/resources',
|
|
30
|
+
'@opentelemetry/sdk-trace-node',
|
|
31
|
+
'@opentelemetry/semantic-conventions'
|
|
32
|
+
];
|
|
33
|
+
if (!checkInstalled(...required)) {
|
|
34
|
+
throw new Error(`Required OpenTelemetry packages not installed. Please ensure that all necessary peerDependencies are installed:\n${required.map(module => `- ${module}`).join('\n')}`);
|
|
35
|
+
}
|
|
36
|
+
const { propagation, trace } = require('@opentelemetry/api');
|
|
37
|
+
const { CompositePropagator, W3CBaggagePropagator, W3CTraceContextPropagator } = require('@opentelemetry/core');
|
|
38
|
+
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
|
|
39
|
+
const { Resource } = require('@opentelemetry/resources');
|
|
40
|
+
const { BatchSpanProcessor, ConsoleSpanExporter, NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
|
|
41
|
+
const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');
|
|
30
42
|
const resource = Resource.default().merge(new Resource({
|
|
31
43
|
[SEMRESATTRS_SERVICE_NAME]: name,
|
|
32
44
|
}));
|
|
@@ -38,6 +50,12 @@ module.exports = {
|
|
|
38
50
|
const processor = new BatchSpanProcessor(consoleExporter);
|
|
39
51
|
provider.addSpanProcessor(processor);
|
|
40
52
|
}
|
|
53
|
+
propagation.setGlobalPropagator(new CompositePropagator({
|
|
54
|
+
propagators: [
|
|
55
|
+
new W3CTraceContextPropagator(),
|
|
56
|
+
new W3CBaggagePropagator()
|
|
57
|
+
]
|
|
58
|
+
}));
|
|
41
59
|
const url = scorecardConfig.telemetryUrl ? scorecardConfig.telemetryUrl : 'https://telemetry.getscorecard.ai';
|
|
42
60
|
const otlpExporter = new OTLPTraceExporter({
|
|
43
61
|
url: `${url}/v1/traces`,
|
|
@@ -48,11 +66,11 @@ module.exports = {
|
|
|
48
66
|
const processor = new BatchSpanProcessor(otlpExporter);
|
|
49
67
|
provider.addSpanProcessor(processor);
|
|
50
68
|
provider.register();
|
|
51
|
-
if (checkInstalled('@langchain/core')) {
|
|
69
|
+
if (checkInstalled('@langchain/core', '@arizeai/openinference-instrumentation-langchain', '@opentelemetry/instrumentation')) {
|
|
52
70
|
const { LangChainInstrumentation } = require('@arizeai/openinference-instrumentation-langchain');
|
|
53
71
|
new LangChainInstrumentation().manuallyInstrument(require('@langchain/core/callbacks/manager'));
|
|
54
72
|
}
|
|
55
|
-
if (checkInstalled('openai')) {
|
|
73
|
+
if (checkInstalled('openai', '@arizeai/openinference-instrumentation-openai', '@opentelemetry/instrumentation')) {
|
|
56
74
|
const { OpenAIInstrumentation } = require('@arizeai/openinference-instrumentation-openai');
|
|
57
75
|
new OpenAIInstrumentation().manuallyInstrument(require('openai'));
|
|
58
76
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ScorecardClient as FernClient } from "../Client";
|
|
2
2
|
export declare namespace ScorecardClient {
|
|
3
|
+
interface Options extends Omit<FernClient.Options, "fetcher"> {
|
|
4
|
+
}
|
|
3
5
|
interface RequestOptions extends FernClient.RequestOptions {
|
|
4
6
|
}
|
|
5
7
|
interface RunTestArgs {
|
|
@@ -18,6 +20,7 @@ export declare namespace ScorecardClient {
|
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
export declare class ScorecardClient extends FernClient {
|
|
23
|
+
constructor(options: ScorecardClient.Options);
|
|
21
24
|
/**
|
|
22
25
|
* Runs all tests within a testset
|
|
23
26
|
*/
|
|
@@ -33,9 +33,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
exports.ScorecardClient = void 0;
|
|
36
|
+
const api_1 = require("@opentelemetry/api");
|
|
36
37
|
const Client_1 = require("../Client");
|
|
38
|
+
const core_1 = require("../core");
|
|
37
39
|
const errors = __importStar(require("../errors"));
|
|
38
40
|
class ScorecardClient extends Client_1.ScorecardClient {
|
|
41
|
+
constructor(options) {
|
|
42
|
+
const fetcher = (args) => {
|
|
43
|
+
var _a;
|
|
44
|
+
args.headers = (_a = args.headers) !== null && _a !== void 0 ? _a : {};
|
|
45
|
+
api_1.propagation.inject(api_1.context.active(), args.headers);
|
|
46
|
+
return (0, core_1.fetcher)(args);
|
|
47
|
+
};
|
|
48
|
+
super(Object.assign(Object.assign({}, options), { fetcher }));
|
|
49
|
+
}
|
|
39
50
|
/**
|
|
40
51
|
* Runs all tests within a testset
|
|
41
52
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scorecard-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": "https://github.com/scorecard-ai/scorecard-node",
|
|
6
6
|
"license": "See LICENSE",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"url-join": "4.0.1",
|
|
17
|
-
"form-data": "4.0.0",
|
|
17
|
+
"form-data": "^4.0.0",
|
|
18
18
|
"formdata-node": "^6.0.3",
|
|
19
19
|
"node-fetch": "2.7.0",
|
|
20
20
|
"qs": "6.11.2"
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"@arizeai/openinference-instrumentation-openai": "^0.2.0",
|
|
25
25
|
"@langchain/core": "^0.1.63",
|
|
26
26
|
"@opentelemetry/api": "*",
|
|
27
|
+
"@opentelemetry/core": "*",
|
|
27
28
|
"@opentelemetry/exporter-trace-otlp-http": "*",
|
|
28
29
|
"@opentelemetry/instrumentation": ">=0.40.0",
|
|
29
30
|
"@opentelemetry/resources": "*",
|
|
@@ -44,6 +45,9 @@
|
|
|
44
45
|
"@opentelemetry/api": {
|
|
45
46
|
"optional": false
|
|
46
47
|
},
|
|
48
|
+
"@opentelemetry/core": {
|
|
49
|
+
"optional": false
|
|
50
|
+
},
|
|
47
51
|
"@opentelemetry/exporter-trace-otlp-http": {
|
|
48
52
|
"optional": false
|
|
49
53
|
},
|
|
@@ -67,6 +71,7 @@
|
|
|
67
71
|
"@types/url-join": "4.0.1",
|
|
68
72
|
"@types/qs": "6.9.8",
|
|
69
73
|
"@types/node-fetch": "2.6.9",
|
|
74
|
+
"fetch-mock-jest": "^1.5.1",
|
|
70
75
|
"jest": "29.7.0",
|
|
71
76
|
"@types/jest": "29.5.5",
|
|
72
77
|
"ts-jest": "29.1.1",
|
|
@@ -78,11 +83,17 @@
|
|
|
78
83
|
"@arizeai/openinference-instrumentation-openai": "^0.2.0",
|
|
79
84
|
"@langchain/core": "^0.1.63",
|
|
80
85
|
"@opentelemetry/api": "latest",
|
|
86
|
+
"@opentelemetry/core": "latest",
|
|
81
87
|
"@opentelemetry/exporter-trace-otlp-http": "latest",
|
|
82
88
|
"@opentelemetry/instrumentation": "latest",
|
|
83
89
|
"@opentelemetry/resources": "latest",
|
|
84
90
|
"@opentelemetry/sdk-trace-node": "latest",
|
|
85
91
|
"@opentelemetry/semantic-conventions": "latest",
|
|
86
92
|
"openai": "^4.47.1"
|
|
93
|
+
},
|
|
94
|
+
"browser": {
|
|
95
|
+
"fs": false,
|
|
96
|
+
"os": false,
|
|
97
|
+
"path": false
|
|
87
98
|
}
|
|
88
99
|
}
|