scorecard-ai 0.2.0 → 0.3.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 -0
- package/Client.js +15 -0
- package/api/errors/ForbiddenError.d.ts +2 -2
- package/api/errors/ForbiddenError.js +1 -1
- package/api/errors/NotFoundError.d.ts +2 -2
- package/api/errors/NotFoundError.js +1 -1
- package/api/errors/UnauthorizedError.d.ts +2 -2
- package/api/errors/UnauthorizedError.js +1 -1
- package/api/errors/UnprocessableEntityError.d.ts +2 -2
- package/api/errors/UnprocessableEntityError.js +1 -1
- package/api/resources/index.d.ts +5 -0
- package/api/resources/index.js +6 -1
- package/api/resources/prompt/client/Client.d.ts +151 -0
- package/api/resources/prompt/client/Client.js +699 -0
- package/api/resources/prompt/client/index.d.ts +1 -0
- package/api/resources/prompt/client/index.js +17 -0
- package/api/resources/prompt/client/requests/PromptCreateParams.d.ts +40 -0
- package/api/resources/prompt/client/requests/PromptUpdateParams.d.ts +13 -0
- package/api/resources/prompt/client/requests/index.d.ts +2 -0
- package/api/resources/prompt/client/requests/index.js +2 -0
- package/api/resources/prompt/index.d.ts +2 -0
- package/api/resources/prompt/index.js +18 -0
- package/api/resources/prompt/types/PromptCreateParamsModelParamsValue.d.ts +4 -0
- package/api/resources/prompt/types/index.d.ts +1 -0
- package/api/resources/prompt/types/index.js +17 -0
- package/api/resources/run/client/Client.d.ts +19 -3
- package/api/resources/run/client/Client.js +30 -25
- package/api/resources/run/client/requests/RunCreateParams.d.ts +3 -2
- package/api/resources/run/client/requests/UpdateStatusParams.d.ts +1 -1
- package/api/resources/run/client/requests/index.d.ts +2 -2
- package/api/resources/runMetric/client/Client.d.ts +38 -0
- package/api/resources/runMetric/client/Client.js +150 -0
- package/api/resources/runMetric/client/index.d.ts +1 -0
- package/api/resources/runMetric/client/index.js +2 -0
- package/api/resources/runMetric/index.d.ts +1 -0
- package/api/resources/runMetric/index.js +17 -0
- package/api/resources/score/client/Client.d.ts +18 -2
- package/api/resources/score/client/Client.js +28 -18
- package/api/resources/score/client/requests/index.d.ts +2 -2
- package/api/resources/testcase/client/Client.d.ts +19 -1
- package/api/resources/testcase/client/Client.js +31 -24
- package/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +1 -1
- package/api/resources/testcase/client/requests/index.d.ts +1 -1
- package/api/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +1 -1
- package/api/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +1 -1
- package/api/resources/testrecord/client/Client.d.ts +15 -2
- package/api/resources/testrecord/client/Client.js +25 -18
- package/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -1
- package/api/resources/testrecord/client/requests/index.d.ts +1 -1
- package/api/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.d.ts +1 -1
- package/api/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.d.ts +1 -1
- package/api/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.d.ts +1 -1
- package/api/resources/testset/client/Client.d.ts +26 -2
- package/api/resources/testset/client/Client.js +41 -38
- package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +1 -1
- package/api/resources/testset/client/requests/index.d.ts +2 -2
- package/api/resources/traces/client/Client.d.ts +38 -0
- package/api/resources/traces/client/Client.js +150 -0
- package/api/resources/traces/client/index.d.ts +1 -0
- package/api/resources/traces/client/index.js +2 -0
- package/api/resources/traces/index.d.ts +1 -0
- package/api/resources/traces/index.js +17 -0
- package/api/types/CustomSchema.d.ts +1 -1
- package/api/types/CustomVariable.d.ts +1 -1
- package/api/types/Grade.d.ts +4 -2
- package/api/types/HttpValidationError.d.ts +1 -1
- package/api/types/JsonObject.d.ts +1 -1
- package/api/types/JsonObjectInputValue.d.ts +1 -1
- package/api/types/JsonObjectOutputValue.d.ts +1 -1
- package/api/types/PaginatedTestcaseResponse.d.ts +1 -1
- package/api/types/Prompt.d.ts +18 -0
- package/api/types/{AppCreateRunParams.d.ts → PromptModelParamsValue.d.ts} +1 -1
- package/api/types/RunMetric.d.ts +9 -0
- package/api/types/Span.d.ts +29 -0
- package/api/types/TestCase.d.ts +1 -1
- package/api/types/TestCaseCustomInputsValue.d.ts +1 -1
- package/api/types/TestCaseCustomLabelsValue.d.ts +1 -1
- package/api/types/Testrecord.d.ts +1 -1
- package/api/types/TestrecordCustomInputsValue.d.ts +1 -1
- package/api/types/TestrecordCustomLabelsValue.d.ts +1 -1
- package/api/types/TestrecordCustomOutputsValue.d.ts +1 -1
- package/api/types/Testset.d.ts +1 -1
- package/api/types/Trace.d.ts +8 -0
- package/api/types/ValidationError.d.ts +1 -1
- package/api/types/index.d.ts +5 -8
- package/api/types/index.js +5 -8
- package/core/fetcher/Fetcher.d.ts +2 -2
- package/core/fetcher/Fetcher.js +78 -23
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/runtime/index.d.ts +1 -0
- package/core/runtime/index.js +5 -0
- package/core/runtime/runtime.d.ts +8 -0
- package/core/runtime/runtime.js +82 -0
- package/core/schemas/builders/object/object.js +11 -15
- package/dist/Client.d.ts +9 -0
- package/dist/Client.js +15 -0
- package/dist/api/errors/ForbiddenError.d.ts +2 -2
- package/dist/api/errors/ForbiddenError.js +1 -1
- package/dist/api/errors/NotFoundError.d.ts +2 -2
- package/dist/api/errors/NotFoundError.js +1 -1
- package/dist/api/errors/UnauthorizedError.d.ts +2 -2
- package/dist/api/errors/UnauthorizedError.js +1 -1
- package/dist/api/errors/UnprocessableEntityError.d.ts +2 -2
- package/dist/api/errors/UnprocessableEntityError.js +1 -1
- package/dist/api/resources/index.d.ts +5 -0
- package/dist/api/resources/index.js +6 -1
- package/dist/api/resources/prompt/client/Client.d.ts +151 -0
- package/dist/api/resources/prompt/client/Client.js +699 -0
- package/dist/api/resources/prompt/client/index.d.ts +1 -0
- package/dist/api/resources/prompt/client/index.js +17 -0
- package/dist/api/resources/prompt/client/requests/PromptCreateParams.d.ts +40 -0
- package/dist/api/resources/prompt/client/requests/PromptUpdateParams.d.ts +13 -0
- package/dist/api/resources/prompt/client/requests/index.d.ts +2 -0
- package/dist/api/resources/prompt/client/requests/index.js +2 -0
- package/dist/api/resources/prompt/index.d.ts +2 -0
- package/dist/api/resources/prompt/index.js +18 -0
- package/dist/api/resources/prompt/types/PromptCreateParamsModelParamsValue.d.ts +4 -0
- package/dist/api/resources/prompt/types/index.d.ts +1 -0
- package/dist/api/resources/prompt/types/index.js +17 -0
- package/dist/api/resources/run/client/Client.d.ts +19 -3
- package/dist/api/resources/run/client/Client.js +30 -25
- package/dist/api/resources/run/client/requests/RunCreateParams.d.ts +3 -2
- package/dist/api/resources/run/client/requests/UpdateStatusParams.d.ts +1 -1
- package/dist/api/resources/run/client/requests/index.d.ts +2 -2
- package/dist/api/resources/runMetric/client/Client.d.ts +38 -0
- package/dist/api/resources/runMetric/client/Client.js +150 -0
- package/dist/api/resources/runMetric/client/index.d.ts +1 -0
- package/dist/api/resources/runMetric/client/index.js +2 -0
- package/dist/api/resources/runMetric/index.d.ts +1 -0
- package/dist/api/resources/runMetric/index.js +17 -0
- package/dist/api/resources/score/client/Client.d.ts +18 -2
- package/dist/api/resources/score/client/Client.js +28 -18
- package/dist/api/resources/score/client/requests/index.d.ts +2 -2
- package/dist/api/resources/testcase/client/Client.d.ts +19 -1
- package/dist/api/resources/testcase/client/Client.js +31 -24
- package/dist/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +1 -1
- package/dist/api/resources/testcase/client/requests/index.d.ts +1 -1
- package/dist/api/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +1 -1
- package/dist/api/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +1 -1
- package/dist/api/resources/testrecord/client/Client.d.ts +15 -2
- package/dist/api/resources/testrecord/client/Client.js +25 -18
- package/dist/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -1
- package/dist/api/resources/testrecord/client/requests/index.d.ts +1 -1
- package/dist/api/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.d.ts +1 -1
- package/dist/api/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.d.ts +1 -1
- package/dist/api/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.d.ts +1 -1
- package/dist/api/resources/testset/client/Client.d.ts +26 -2
- package/dist/api/resources/testset/client/Client.js +41 -38
- package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +1 -1
- package/dist/api/resources/testset/client/requests/index.d.ts +2 -2
- package/dist/api/resources/traces/client/Client.d.ts +38 -0
- package/dist/api/resources/traces/client/Client.js +150 -0
- package/dist/api/resources/traces/client/index.d.ts +1 -0
- package/dist/api/resources/traces/client/index.js +2 -0
- package/dist/api/resources/traces/index.d.ts +1 -0
- package/dist/api/resources/traces/index.js +17 -0
- package/dist/api/types/CustomSchema.d.ts +1 -1
- package/dist/api/types/CustomVariable.d.ts +1 -1
- package/dist/api/types/Grade.d.ts +4 -2
- package/dist/api/types/HttpValidationError.d.ts +1 -1
- package/dist/api/types/JsonObject.d.ts +1 -1
- package/dist/api/types/JsonObjectInputValue.d.ts +1 -1
- package/dist/api/types/JsonObjectOutputValue.d.ts +1 -1
- package/dist/api/types/PaginatedTestcaseResponse.d.ts +1 -1
- package/dist/api/types/Prompt.d.ts +18 -0
- package/{api/types/AppTestSetCreate.d.ts → dist/api/types/PromptModelParamsValue.d.ts} +1 -1
- package/dist/api/types/RunMetric.d.ts +9 -0
- package/dist/api/types/Span.d.ts +29 -0
- package/dist/api/types/TestCase.d.ts +1 -1
- package/dist/api/types/TestCaseCustomInputsValue.d.ts +1 -1
- package/dist/api/types/TestCaseCustomLabelsValue.d.ts +1 -1
- package/dist/api/types/Testrecord.d.ts +1 -1
- package/dist/api/types/TestrecordCustomInputsValue.d.ts +1 -1
- package/dist/api/types/TestrecordCustomLabelsValue.d.ts +1 -1
- package/dist/api/types/TestrecordCustomOutputsValue.d.ts +1 -1
- package/dist/api/types/Testset.d.ts +1 -1
- package/dist/api/types/Trace.d.ts +8 -0
- package/dist/api/types/ValidationError.d.ts +1 -1
- package/dist/api/types/index.d.ts +5 -8
- package/dist/api/types/index.js +5 -8
- package/dist/core/fetcher/Fetcher.d.ts +2 -2
- package/dist/core/fetcher/Fetcher.js +78 -23
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.d.ts +8 -0
- package/dist/core/runtime/runtime.js +82 -0
- package/dist/core/schemas/builders/object/object.js +11 -15
- package/dist/serialization/resources/index.d.ts +5 -0
- package/dist/serialization/resources/index.js +6 -1
- package/dist/serialization/resources/prompt/client/getGraph.d.ts +11 -0
- package/dist/serialization/{types/AppCreateRunParams.js → resources/prompt/client/getGraph.js} +4 -3
- package/dist/serialization/resources/prompt/client/getProds.d.ts +11 -0
- package/dist/serialization/{types/AppTestRecordCreate.js → resources/prompt/client/getProds.js} +4 -3
- package/dist/serialization/resources/prompt/client/getRoots.d.ts +11 -0
- package/dist/serialization/{types/AppTestSetCreate.js → resources/prompt/client/getRoots.js} +4 -3
- package/dist/serialization/resources/prompt/client/index.d.ts +4 -0
- package/dist/serialization/resources/prompt/client/index.js +33 -0
- package/dist/serialization/resources/prompt/client/requests/PromptCreateParams.d.ts +18 -0
- package/dist/serialization/resources/prompt/client/requests/PromptCreateParams.js +39 -0
- package/dist/serialization/resources/prompt/client/requests/PromptUpdateParams.d.ts +13 -0
- package/dist/serialization/resources/prompt/client/requests/PromptUpdateParams.js +34 -0
- package/dist/serialization/resources/prompt/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/prompt/client/requests/index.js +7 -0
- package/dist/serialization/resources/prompt/index.d.ts +2 -0
- package/dist/serialization/resources/prompt/index.js +18 -0
- package/dist/serialization/resources/prompt/types/PromptCreateParamsModelParamsValue.d.ts +10 -0
- package/dist/serialization/resources/prompt/types/PromptCreateParamsModelParamsValue.js +36 -0
- package/dist/serialization/resources/prompt/types/index.d.ts +1 -0
- package/dist/serialization/resources/prompt/types/index.js +17 -0
- package/dist/serialization/resources/run/client/requests/RunCreateParams.d.ts +3 -2
- package/dist/serialization/resources/run/client/requests/RunCreateParams.js +1 -0
- package/dist/serialization/resources/run/client/requests/UpdateStatusParams.d.ts +4 -3
- package/dist/serialization/resources/run/client/requests/UpdateStatusParams.js +2 -10
- package/dist/serialization/resources/runMetric/client/get.d.ts +11 -0
- package/dist/serialization/resources/runMetric/client/get.js +32 -0
- package/dist/serialization/resources/runMetric/client/index.d.ts +1 -0
- package/dist/serialization/{types/ModelParams.js → resources/runMetric/client/index.js} +2 -6
- package/dist/serialization/resources/runMetric/index.d.ts +1 -0
- package/dist/serialization/resources/runMetric/index.js +17 -0
- package/dist/serialization/resources/score/client/requests/ScoreCreateParams.d.ts +2 -2
- package/dist/serialization/resources/score/client/requests/ScoreUpdateParams.d.ts +2 -2
- package/dist/serialization/resources/testcase/client/requests/TestcaseCreateParams.d.ts +6 -4
- package/dist/serialization/resources/testcase/client/requests/TestcaseCreateParams.js +4 -15
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +4 -3
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +4 -3
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -1
- package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +12 -7
- package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +10 -24
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.d.ts +4 -3
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -1
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.d.ts +4 -3
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -1
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.d.ts +4 -3
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -1
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsModelDebugInfoValue.d.ts +2 -2
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsModelParamsValue.d.ts +2 -2
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +4 -3
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +2 -10
- package/dist/serialization/resources/traces/client/get.d.ts +10 -0
- package/dist/serialization/resources/traces/client/get.js +40 -0
- package/dist/serialization/resources/traces/client/index.d.ts +1 -0
- package/{serialization/types/ModelParams.js → dist/serialization/resources/traces/client/index.js} +2 -6
- package/dist/serialization/resources/traces/index.d.ts +1 -0
- package/dist/serialization/resources/traces/index.js +17 -0
- package/dist/serialization/types/CreateGithubWorkflowParams.d.ts +2 -2
- package/dist/serialization/types/CreateRunParams.d.ts +2 -2
- package/dist/serialization/types/CustomSchema.d.ts +4 -3
- package/dist/serialization/types/CustomSchema.js +2 -12
- package/dist/serialization/types/CustomVariable.d.ts +6 -4
- package/dist/serialization/types/CustomVariable.js +4 -11
- package/dist/serialization/types/DataTypeEnum.d.ts +2 -2
- package/dist/serialization/types/FileUrl.d.ts +2 -2
- package/dist/serialization/types/Grade.d.ts +7 -4
- package/dist/serialization/types/Grade.js +5 -11
- package/dist/serialization/types/HttpValidationError.d.ts +4 -3
- package/dist/serialization/types/HttpValidationError.js +2 -12
- package/dist/serialization/types/JsonObject.d.ts +2 -2
- package/dist/serialization/types/JsonObjectInputValue.d.ts +2 -2
- package/dist/serialization/types/JsonObjectOutputValue.d.ts +2 -2
- package/dist/serialization/types/NotFoundErrorBody.d.ts +2 -2
- package/dist/serialization/types/PaginatedTestcaseResponse.d.ts +4 -3
- package/dist/serialization/types/PaginatedTestcaseResponse.js +2 -10
- package/dist/serialization/types/Prompt.d.ts +24 -0
- package/dist/serialization/types/Prompt.js +45 -0
- package/dist/serialization/types/PromptModelParamsValue.d.ts +10 -0
- package/dist/serialization/types/PromptModelParamsValue.js +35 -0
- package/dist/serialization/types/RoleEnum.d.ts +2 -2
- package/dist/serialization/types/Run.d.ts +2 -2
- package/dist/serialization/types/RunMetric.d.ts +15 -0
- package/dist/serialization/types/RunMetric.js +36 -0
- package/dist/serialization/types/RunStatus.d.ts +2 -2
- package/dist/serialization/types/ScoreStatus.d.ts +2 -2
- package/dist/serialization/types/Span.d.ts +34 -0
- package/dist/serialization/types/Span.js +64 -0
- package/dist/serialization/types/TestCase.d.ts +6 -4
- package/dist/serialization/types/TestCase.js +4 -15
- package/dist/serialization/types/TestCaseCreate.d.ts +2 -2
- package/dist/serialization/types/TestCaseCustomInputsValue.d.ts +4 -3
- package/dist/serialization/types/TestCaseCustomInputsValue.js +2 -1
- package/dist/serialization/types/TestCaseCustomLabelsValue.d.ts +4 -3
- package/dist/serialization/types/TestCaseCustomLabelsValue.js +2 -1
- package/dist/serialization/types/TestRecordCreate.d.ts +2 -2
- package/dist/serialization/types/TestSetCreate.d.ts +2 -2
- package/dist/serialization/types/Testrecord.d.ts +12 -7
- package/dist/serialization/types/Testrecord.js +10 -24
- package/dist/serialization/types/TestrecordCustomInputsValue.d.ts +4 -3
- package/dist/serialization/types/TestrecordCustomInputsValue.js +2 -1
- package/dist/serialization/types/TestrecordCustomLabelsValue.d.ts +4 -3
- package/dist/serialization/types/TestrecordCustomLabelsValue.js +2 -1
- package/dist/serialization/types/TestrecordCustomOutputsValue.d.ts +4 -3
- package/dist/serialization/types/TestrecordCustomOutputsValue.js +2 -1
- package/dist/serialization/types/TestrecordModelDebugInfoValue.d.ts +2 -2
- package/dist/serialization/types/TestrecordModelParamsValue.d.ts +2 -2
- package/dist/serialization/types/Testset.d.ts +4 -3
- package/dist/serialization/types/Testset.js +2 -10
- package/dist/serialization/types/Trace.d.ts +14 -0
- package/dist/serialization/types/Trace.js +35 -0
- package/dist/serialization/types/UnauthenticatedError.d.ts +2 -2
- package/dist/serialization/types/UnauthorizedErrorBody.d.ts +2 -2
- package/dist/serialization/types/ValidationError.d.ts +4 -3
- package/dist/serialization/types/ValidationError.js +2 -10
- package/dist/serialization/types/ValidationErrorLocItem.d.ts +2 -2
- package/dist/serialization/types/index.d.ts +5 -8
- package/dist/serialization/types/index.js +5 -8
- package/jest.config.js +5 -0
- package/package.json +11 -4
- package/reference.md +2145 -0
- package/serialization/resources/index.d.ts +5 -0
- package/serialization/resources/index.js +6 -1
- package/serialization/resources/prompt/client/getGraph.d.ts +11 -0
- package/{dist/serialization/types/ExecutionParams.js → serialization/resources/prompt/client/getGraph.js} +4 -3
- package/serialization/resources/prompt/client/getProds.d.ts +11 -0
- package/serialization/resources/prompt/client/getProds.js +32 -0
- package/serialization/resources/prompt/client/getRoots.d.ts +11 -0
- package/serialization/resources/prompt/client/getRoots.js +32 -0
- package/serialization/resources/prompt/client/index.d.ts +4 -0
- package/serialization/resources/prompt/client/index.js +33 -0
- package/serialization/resources/prompt/client/requests/PromptCreateParams.d.ts +18 -0
- package/serialization/resources/prompt/client/requests/PromptCreateParams.js +39 -0
- package/serialization/resources/prompt/client/requests/PromptUpdateParams.d.ts +13 -0
- package/serialization/resources/prompt/client/requests/PromptUpdateParams.js +34 -0
- package/serialization/resources/prompt/client/requests/index.d.ts +2 -0
- package/serialization/resources/prompt/client/requests/index.js +7 -0
- package/serialization/resources/prompt/index.d.ts +2 -0
- package/serialization/resources/prompt/index.js +18 -0
- package/serialization/resources/prompt/types/PromptCreateParamsModelParamsValue.d.ts +10 -0
- package/serialization/resources/prompt/types/PromptCreateParamsModelParamsValue.js +36 -0
- package/serialization/resources/prompt/types/index.d.ts +1 -0
- package/serialization/resources/prompt/types/index.js +17 -0
- package/serialization/resources/run/client/requests/RunCreateParams.d.ts +3 -2
- package/serialization/resources/run/client/requests/RunCreateParams.js +1 -0
- package/serialization/resources/run/client/requests/UpdateStatusParams.d.ts +4 -3
- package/serialization/resources/run/client/requests/UpdateStatusParams.js +2 -10
- package/serialization/resources/runMetric/client/get.d.ts +11 -0
- package/serialization/resources/runMetric/client/get.js +32 -0
- package/serialization/resources/runMetric/client/index.d.ts +1 -0
- package/{dist/serialization/types/ScoringParams.js → serialization/resources/runMetric/client/index.js} +2 -6
- package/serialization/resources/runMetric/index.d.ts +1 -0
- package/serialization/resources/runMetric/index.js +17 -0
- package/serialization/resources/score/client/requests/ScoreCreateParams.d.ts +2 -2
- package/serialization/resources/score/client/requests/ScoreUpdateParams.d.ts +2 -2
- package/serialization/resources/testcase/client/requests/TestcaseCreateParams.d.ts +6 -4
- package/serialization/resources/testcase/client/requests/TestcaseCreateParams.js +4 -15
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +4 -3
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +4 -3
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -1
- package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +12 -7
- package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +10 -24
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.d.ts +4 -3
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -1
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.d.ts +4 -3
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -1
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.d.ts +4 -3
- package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -1
- package/serialization/resources/testrecord/types/TestrecordCreateParamsModelDebugInfoValue.d.ts +2 -2
- package/serialization/resources/testrecord/types/TestrecordCreateParamsModelParamsValue.d.ts +2 -2
- package/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +4 -3
- package/serialization/resources/testset/client/requests/TestsetCreateParams.js +2 -10
- package/serialization/resources/traces/client/get.d.ts +10 -0
- package/serialization/resources/traces/client/get.js +40 -0
- package/serialization/resources/traces/client/index.d.ts +1 -0
- package/serialization/{types/ScoringParams.js → resources/traces/client/index.js} +2 -6
- package/serialization/resources/traces/index.d.ts +1 -0
- package/serialization/resources/traces/index.js +17 -0
- package/serialization/types/CreateGithubWorkflowParams.d.ts +2 -2
- package/serialization/types/CreateRunParams.d.ts +2 -2
- package/serialization/types/CustomSchema.d.ts +4 -3
- package/serialization/types/CustomSchema.js +2 -12
- package/serialization/types/CustomVariable.d.ts +6 -4
- package/serialization/types/CustomVariable.js +4 -11
- package/serialization/types/DataTypeEnum.d.ts +2 -2
- package/serialization/types/FileUrl.d.ts +2 -2
- package/serialization/types/Grade.d.ts +7 -4
- package/serialization/types/Grade.js +5 -11
- package/serialization/types/HttpValidationError.d.ts +4 -3
- package/serialization/types/HttpValidationError.js +2 -12
- package/serialization/types/JsonObject.d.ts +2 -2
- package/serialization/types/JsonObjectInputValue.d.ts +2 -2
- package/serialization/types/JsonObjectOutputValue.d.ts +2 -2
- package/serialization/types/NotFoundErrorBody.d.ts +2 -2
- package/serialization/types/PaginatedTestcaseResponse.d.ts +4 -3
- package/serialization/types/PaginatedTestcaseResponse.js +2 -10
- package/serialization/types/Prompt.d.ts +24 -0
- package/serialization/types/Prompt.js +45 -0
- package/serialization/types/PromptModelParamsValue.d.ts +10 -0
- package/serialization/types/PromptModelParamsValue.js +35 -0
- package/serialization/types/RoleEnum.d.ts +2 -2
- package/serialization/types/Run.d.ts +2 -2
- package/serialization/types/RunMetric.d.ts +15 -0
- package/serialization/types/RunMetric.js +36 -0
- package/serialization/types/RunStatus.d.ts +2 -2
- package/serialization/types/ScoreStatus.d.ts +2 -2
- package/serialization/types/Span.d.ts +34 -0
- package/serialization/types/Span.js +64 -0
- package/serialization/types/TestCase.d.ts +6 -4
- package/serialization/types/TestCase.js +4 -15
- package/serialization/types/TestCaseCreate.d.ts +2 -2
- package/serialization/types/TestCaseCustomInputsValue.d.ts +4 -3
- package/serialization/types/TestCaseCustomInputsValue.js +2 -1
- package/serialization/types/TestCaseCustomLabelsValue.d.ts +4 -3
- package/serialization/types/TestCaseCustomLabelsValue.js +2 -1
- package/serialization/types/TestRecordCreate.d.ts +2 -2
- package/serialization/types/TestSetCreate.d.ts +2 -2
- package/serialization/types/Testrecord.d.ts +12 -7
- package/serialization/types/Testrecord.js +10 -24
- package/serialization/types/TestrecordCustomInputsValue.d.ts +4 -3
- package/serialization/types/TestrecordCustomInputsValue.js +2 -1
- package/serialization/types/TestrecordCustomLabelsValue.d.ts +4 -3
- package/serialization/types/TestrecordCustomLabelsValue.js +2 -1
- package/serialization/types/TestrecordCustomOutputsValue.d.ts +4 -3
- package/serialization/types/TestrecordCustomOutputsValue.js +2 -1
- package/serialization/types/TestrecordModelDebugInfoValue.d.ts +2 -2
- package/serialization/types/TestrecordModelParamsValue.d.ts +2 -2
- package/serialization/types/Testset.d.ts +4 -3
- package/serialization/types/Testset.js +2 -10
- package/serialization/types/Trace.d.ts +14 -0
- package/serialization/types/Trace.js +35 -0
- package/serialization/types/UnauthenticatedError.d.ts +2 -2
- package/serialization/types/UnauthorizedErrorBody.d.ts +2 -2
- package/serialization/types/ValidationError.d.ts +4 -3
- package/serialization/types/ValidationError.js +2 -10
- package/serialization/types/ValidationErrorLocItem.d.ts +2 -2
- package/serialization/types/index.d.ts +5 -8
- package/serialization/types/index.js +5 -8
- package/api/types/AppTestRecordCreate.d.ts +0 -4
- package/api/types/ExecutionParams.d.ts +0 -4
- package/api/types/ModelParams.d.ts +0 -4
- package/api/types/ScoreExecutionParams.d.ts +0 -4
- package/api/types/ScoringParams.d.ts +0 -4
- package/api/types/TestCaseCreateInput.d.ts +0 -4
- package/dist/api/types/AppCreateRunParams.d.ts +0 -4
- package/dist/api/types/AppTestRecordCreate.d.ts +0 -4
- package/dist/api/types/AppTestSetCreate.d.ts +0 -4
- package/dist/api/types/ExecutionParams.d.ts +0 -4
- package/dist/api/types/ModelParams.d.ts +0 -4
- package/dist/api/types/ScoreExecutionParams.d.ts +0 -4
- package/dist/api/types/ScoringParams.d.ts +0 -4
- package/dist/api/types/TestCaseCreateInput.d.ts +0 -4
- package/dist/serialization/types/AppCreateRunParams.d.ts +0 -10
- package/dist/serialization/types/AppTestRecordCreate.d.ts +0 -10
- package/dist/serialization/types/AppTestSetCreate.d.ts +0 -10
- package/dist/serialization/types/ExecutionParams.d.ts +0 -10
- package/dist/serialization/types/ModelParams.d.ts +0 -10
- package/dist/serialization/types/ScoreExecutionParams.d.ts +0 -10
- package/dist/serialization/types/ScoreExecutionParams.js +0 -31
- package/dist/serialization/types/ScoringParams.d.ts +0 -10
- package/dist/serialization/types/TestCaseCreateInput.d.ts +0 -10
- package/dist/serialization/types/TestCaseCreateInput.js +0 -31
- package/serialization/types/AppCreateRunParams.d.ts +0 -10
- package/serialization/types/AppCreateRunParams.js +0 -31
- package/serialization/types/AppTestRecordCreate.d.ts +0 -10
- package/serialization/types/AppTestRecordCreate.js +0 -31
- package/serialization/types/AppTestSetCreate.d.ts +0 -10
- package/serialization/types/AppTestSetCreate.js +0 -31
- package/serialization/types/ExecutionParams.d.ts +0 -10
- package/serialization/types/ExecutionParams.js +0 -31
- package/serialization/types/ModelParams.d.ts +0 -10
- package/serialization/types/ScoreExecutionParams.d.ts +0 -10
- package/serialization/types/ScoreExecutionParams.js +0 -31
- package/serialization/types/ScoringParams.d.ts +0 -10
- package/serialization/types/TestCaseCreateInput.d.ts +0 -10
- package/serialization/types/TestCaseCreateInput.js +0 -31
- /package/api/{types/AppCreateRunParams.js → resources/prompt/client/requests/PromptCreateParams.js} +0 -0
- /package/api/{types/AppTestRecordCreate.js → resources/prompt/client/requests/PromptUpdateParams.js} +0 -0
- /package/api/{types/AppTestSetCreate.js → resources/prompt/types/PromptCreateParamsModelParamsValue.js} +0 -0
- /package/api/types/{ExecutionParams.js → Prompt.js} +0 -0
- /package/api/types/{ModelParams.js → PromptModelParamsValue.js} +0 -0
- /package/api/types/{ScoreExecutionParams.js → RunMetric.js} +0 -0
- /package/api/types/{ScoringParams.js → Span.js} +0 -0
- /package/api/types/{TestCaseCreateInput.js → Trace.js} +0 -0
- /package/dist/api/{types/AppCreateRunParams.js → resources/prompt/client/requests/PromptCreateParams.js} +0 -0
- /package/dist/api/{types/AppTestRecordCreate.js → resources/prompt/client/requests/PromptUpdateParams.js} +0 -0
- /package/dist/api/{types/AppTestSetCreate.js → resources/prompt/types/PromptCreateParamsModelParamsValue.js} +0 -0
- /package/dist/api/types/{ExecutionParams.js → Prompt.js} +0 -0
- /package/dist/api/types/{ModelParams.js → PromptModelParamsValue.js} +0 -0
- /package/dist/api/types/{ScoreExecutionParams.js → RunMetric.js} +0 -0
- /package/dist/api/types/{ScoringParams.js → Span.js} +0 -0
- /package/dist/api/types/{TestCaseCreateInput.js → Trace.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Scorecard from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* promptTemplate: "You are a virtual assistant",
|
|
9
|
+
* name: "Prompt Name",
|
|
10
|
+
* description: "Description of the prompt",
|
|
11
|
+
* modelParams: {
|
|
12
|
+
* "param1": "value1",
|
|
13
|
+
* "param2": 0.1,
|
|
14
|
+
* "param3": 100,
|
|
15
|
+
* "param4": true
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* {
|
|
21
|
+
* promptTemplate: "You are a virtual assistant",
|
|
22
|
+
* parentId: "7ac3cbd5-3b99-4e72-97f3-9cd2e749cace",
|
|
23
|
+
* description: "Description of the prompt",
|
|
24
|
+
* modelParams: {
|
|
25
|
+
* "param1": "value1",
|
|
26
|
+
* "param2": 0.1,
|
|
27
|
+
* "param3": 100,
|
|
28
|
+
* "param4": true
|
|
29
|
+
* },
|
|
30
|
+
* isProd: true
|
|
31
|
+
* }
|
|
32
|
+
*/
|
|
33
|
+
export interface PromptCreateParams {
|
|
34
|
+
promptTemplate: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
parentId?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
modelParams?: Record<string, Scorecard.PromptCreateParamsModelParamsValue | undefined>;
|
|
39
|
+
isProd?: boolean;
|
|
40
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./client"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PromptCreateParamsModelParamsValue";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./PromptCreateParamsModelParamsValue"), exports);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "../../../../environments";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
import * as Scorecard from "
|
|
6
|
+
import * as Scorecard from "../../../index";
|
|
7
7
|
export declare namespace Run {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ScorecardEnvironment | string>;
|
|
@@ -19,6 +19,10 @@ export declare class Run {
|
|
|
19
19
|
constructor(_options: Run.Options);
|
|
20
20
|
/**
|
|
21
21
|
* Create a new Run
|
|
22
|
+
*
|
|
23
|
+
* @param {Scorecard.RunCreateParams} request
|
|
24
|
+
* @param {Run.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
|
+
*
|
|
22
26
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
23
27
|
* @throws {@link Scorecard.ForbiddenError}
|
|
24
28
|
* @throws {@link Scorecard.NotFoundError}
|
|
@@ -27,17 +31,21 @@ export declare class Run {
|
|
|
27
31
|
* @example
|
|
28
32
|
* await scorecard.run.create({
|
|
29
33
|
* testsetId: 1,
|
|
30
|
-
* scoringConfigId: 2,
|
|
31
34
|
* status: "RUNNING_EXECUTION",
|
|
32
35
|
* modelParams: {
|
|
33
36
|
* "param1": "value1",
|
|
34
37
|
* "param2": "value2"
|
|
35
|
-
* }
|
|
38
|
+
* },
|
|
39
|
+
* metrics: [1, 2]
|
|
36
40
|
* })
|
|
37
41
|
*/
|
|
38
42
|
create(request?: Scorecard.RunCreateParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
|
|
39
43
|
/**
|
|
40
44
|
* Retrieve a Run metadata
|
|
45
|
+
*
|
|
46
|
+
* @param {number} runId - The id of the run to retrieve.
|
|
47
|
+
* @param {Run.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
|
+
*
|
|
41
49
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
42
50
|
* @throws {@link Scorecard.ForbiddenError}
|
|
43
51
|
* @throws {@link Scorecard.NotFoundError}
|
|
@@ -49,6 +57,11 @@ export declare class Run {
|
|
|
49
57
|
get(runId: number, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
|
|
50
58
|
/**
|
|
51
59
|
* Update the status of a run.
|
|
60
|
+
*
|
|
61
|
+
* @param {number} runId - The id of the run to update.
|
|
62
|
+
* @param {Scorecard.UpdateStatusParams} request
|
|
63
|
+
* @param {Run.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
52
65
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
53
66
|
* @throws {@link Scorecard.ForbiddenError}
|
|
54
67
|
* @throws {@link Scorecard.NotFoundError}
|
|
@@ -60,4 +73,7 @@ export declare class Run {
|
|
|
60
73
|
* })
|
|
61
74
|
*/
|
|
62
75
|
updateStatus(runId: number, request: Scorecard.UpdateStatusParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
|
|
76
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
77
|
+
"X-API-Key": string;
|
|
78
|
+
}>;
|
|
63
79
|
}
|
|
@@ -41,16 +41,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
41
41
|
exports.Run = void 0;
|
|
42
42
|
const environments = __importStar(require("../../../../environments"));
|
|
43
43
|
const core = __importStar(require("../../../../core"));
|
|
44
|
-
const Scorecard = __importStar(require("
|
|
45
|
-
const serializers = __importStar(require("../../../../serialization"));
|
|
44
|
+
const Scorecard = __importStar(require("../../../index"));
|
|
45
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
46
46
|
const url_join_1 = __importDefault(require("url-join"));
|
|
47
|
-
const errors = __importStar(require("../../../../errors"));
|
|
47
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
48
48
|
class Run {
|
|
49
49
|
constructor(_options) {
|
|
50
50
|
this._options = _options;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Create a new Run
|
|
54
|
+
*
|
|
55
|
+
* @param {Scorecard.RunCreateParams} request
|
|
56
|
+
* @param {Run.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
54
58
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
55
59
|
* @throws {@link Scorecard.ForbiddenError}
|
|
56
60
|
* @throws {@link Scorecard.NotFoundError}
|
|
@@ -59,12 +63,12 @@ class Run {
|
|
|
59
63
|
* @example
|
|
60
64
|
* await scorecard.run.create({
|
|
61
65
|
* testsetId: 1,
|
|
62
|
-
* scoringConfigId: 2,
|
|
63
66
|
* status: "RUNNING_EXECUTION",
|
|
64
67
|
* modelParams: {
|
|
65
68
|
* "param1": "value1",
|
|
66
69
|
* "param2": "value2"
|
|
67
|
-
* }
|
|
70
|
+
* },
|
|
71
|
+
* metrics: [1, 2]
|
|
68
72
|
* })
|
|
69
73
|
*/
|
|
70
74
|
create(request = {}, requestOptions) {
|
|
@@ -73,12 +77,7 @@ class Run {
|
|
|
73
77
|
const _response = yield core.fetcher({
|
|
74
78
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, "v1/run"),
|
|
75
79
|
method: "POST",
|
|
76
|
-
headers: {
|
|
77
|
-
"X-API-Key": yield core.Supplier.get(this._options.apiKey),
|
|
78
|
-
"X-Fern-Language": "JavaScript",
|
|
79
|
-
"X-Fern-SDK-Name": "scorecard-ai",
|
|
80
|
-
"X-Fern-SDK-Version": "0.2.0",
|
|
81
|
-
},
|
|
80
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
82
81
|
contentType: "application/json",
|
|
83
82
|
body: yield serializers.RunCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
84
83
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -151,6 +150,10 @@ class Run {
|
|
|
151
150
|
}
|
|
152
151
|
/**
|
|
153
152
|
* Retrieve a Run metadata
|
|
153
|
+
*
|
|
154
|
+
* @param {number} runId - The id of the run to retrieve.
|
|
155
|
+
* @param {Run.RequestOptions} requestOptions - Request-specific configuration.
|
|
156
|
+
*
|
|
154
157
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
155
158
|
* @throws {@link Scorecard.ForbiddenError}
|
|
156
159
|
* @throws {@link Scorecard.NotFoundError}
|
|
@@ -163,14 +166,9 @@ class Run {
|
|
|
163
166
|
var _a;
|
|
164
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
165
168
|
const _response = yield core.fetcher({
|
|
166
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${runId}`),
|
|
169
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}`),
|
|
167
170
|
method: "GET",
|
|
168
|
-
headers: {
|
|
169
|
-
"X-API-Key": yield core.Supplier.get(this._options.apiKey),
|
|
170
|
-
"X-Fern-Language": "JavaScript",
|
|
171
|
-
"X-Fern-SDK-Name": "scorecard-ai",
|
|
172
|
-
"X-Fern-SDK-Version": "0.2.0",
|
|
173
|
-
},
|
|
171
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
174
172
|
contentType: "application/json",
|
|
175
173
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
176
174
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -242,6 +240,11 @@ class Run {
|
|
|
242
240
|
}
|
|
243
241
|
/**
|
|
244
242
|
* Update the status of a run.
|
|
243
|
+
*
|
|
244
|
+
* @param {number} runId - The id of the run to update.
|
|
245
|
+
* @param {Scorecard.UpdateStatusParams} request
|
|
246
|
+
* @param {Run.RequestOptions} requestOptions - Request-specific configuration.
|
|
247
|
+
*
|
|
245
248
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
246
249
|
* @throws {@link Scorecard.ForbiddenError}
|
|
247
250
|
* @throws {@link Scorecard.NotFoundError}
|
|
@@ -256,14 +259,9 @@ class Run {
|
|
|
256
259
|
var _a;
|
|
257
260
|
return __awaiter(this, void 0, void 0, function* () {
|
|
258
261
|
const _response = yield core.fetcher({
|
|
259
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${runId}/status`),
|
|
262
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/status`),
|
|
260
263
|
method: "PATCH",
|
|
261
|
-
headers: {
|
|
262
|
-
"X-API-Key": yield core.Supplier.get(this._options.apiKey),
|
|
263
|
-
"X-Fern-Language": "JavaScript",
|
|
264
|
-
"X-Fern-SDK-Name": "scorecard-ai",
|
|
265
|
-
"X-Fern-SDK-Version": "0.2.0",
|
|
266
|
-
},
|
|
264
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
267
265
|
contentType: "application/json",
|
|
268
266
|
body: yield serializers.UpdateStatusParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
269
267
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -334,5 +332,12 @@ class Run {
|
|
|
334
332
|
}
|
|
335
333
|
});
|
|
336
334
|
}
|
|
335
|
+
_getCustomAuthorizationHeaders() {
|
|
336
|
+
var _a;
|
|
337
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
338
|
+
const apiKeyValue = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["SCORECARD_API_KEY"];
|
|
339
|
+
return { "X-API-Key": apiKeyValue };
|
|
340
|
+
});
|
|
341
|
+
}
|
|
337
342
|
}
|
|
338
343
|
exports.Run = Run;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
7
|
* testsetId: 1,
|
|
8
|
-
* scoringConfigId: 2,
|
|
9
8
|
* status: "RUNNING_EXECUTION",
|
|
10
9
|
* modelParams: {
|
|
11
10
|
* "param1": "value1",
|
|
12
11
|
* "param2": "value2"
|
|
13
|
-
* }
|
|
12
|
+
* },
|
|
13
|
+
* metrics: [1, 2]
|
|
14
14
|
* }
|
|
15
15
|
*/
|
|
16
16
|
export interface RunCreateParams {
|
|
@@ -21,4 +21,5 @@ export interface RunCreateParams {
|
|
|
21
21
|
source?: string;
|
|
22
22
|
notes?: string;
|
|
23
23
|
promptTemplate?: string;
|
|
24
|
+
metrics?: number[];
|
|
24
25
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RunCreateParams } from "./RunCreateParams";
|
|
2
|
-
export { UpdateStatusParams } from "./UpdateStatusParams";
|
|
1
|
+
export { type RunCreateParams } from "./RunCreateParams";
|
|
2
|
+
export { type UpdateStatusParams } from "./UpdateStatusParams";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
5
|
+
import * as core from "../../../../core";
|
|
6
|
+
import * as Scorecard from "../../../index";
|
|
7
|
+
export declare namespace RunMetric {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ScorecardEnvironment | string>;
|
|
10
|
+
apiKey: core.Supplier<string>;
|
|
11
|
+
}
|
|
12
|
+
interface RequestOptions {
|
|
13
|
+
timeoutInSeconds?: number;
|
|
14
|
+
maxRetries?: number;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export declare class RunMetric {
|
|
18
|
+
protected readonly _options: RunMetric.Options;
|
|
19
|
+
constructor(_options: RunMetric.Options);
|
|
20
|
+
/**
|
|
21
|
+
* Retrieve metrics associated with a run
|
|
22
|
+
*
|
|
23
|
+
* @param {number} runId - The id of the run to retrieve.
|
|
24
|
+
* @param {RunMetric.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
|
+
*
|
|
26
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
27
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
28
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
29
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* await scorecard.runMetric.get(1)
|
|
33
|
+
*/
|
|
34
|
+
get(runId: number, requestOptions?: RunMetric.RequestOptions): Promise<Scorecard.RunMetric[]>;
|
|
35
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
36
|
+
"X-API-Key": string;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
38
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.RunMetric = void 0;
|
|
42
|
+
const environments = __importStar(require("../../../../environments"));
|
|
43
|
+
const core = __importStar(require("../../../../core"));
|
|
44
|
+
const Scorecard = __importStar(require("../../../index"));
|
|
45
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
46
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
47
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
48
|
+
class RunMetric {
|
|
49
|
+
constructor(_options) {
|
|
50
|
+
this._options = _options;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Retrieve metrics associated with a run
|
|
54
|
+
*
|
|
55
|
+
* @param {number} runId - The id of the run to retrieve.
|
|
56
|
+
* @param {RunMetric.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
59
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
60
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
61
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* await scorecard.runMetric.get(1)
|
|
65
|
+
*/
|
|
66
|
+
get(runId, requestOptions) {
|
|
67
|
+
var _a;
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const _response = yield core.fetcher({
|
|
70
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run_metric/${encodeURIComponent(runId)}`),
|
|
71
|
+
method: "GET",
|
|
72
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
73
|
+
contentType: "application/json",
|
|
74
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
75
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
76
|
+
});
|
|
77
|
+
if (_response.ok) {
|
|
78
|
+
return yield serializers.runMetric.get.Response.parseOrThrow(_response.body, {
|
|
79
|
+
unrecognizedObjectKeys: "passthrough",
|
|
80
|
+
allowUnrecognizedUnionMembers: true,
|
|
81
|
+
allowUnrecognizedEnumValues: true,
|
|
82
|
+
skipValidation: true,
|
|
83
|
+
breadcrumbsPrefix: ["response"],
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (_response.error.reason === "status-code") {
|
|
87
|
+
switch (_response.error.statusCode) {
|
|
88
|
+
case 401:
|
|
89
|
+
throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
90
|
+
unrecognizedObjectKeys: "passthrough",
|
|
91
|
+
allowUnrecognizedUnionMembers: true,
|
|
92
|
+
allowUnrecognizedEnumValues: true,
|
|
93
|
+
skipValidation: true,
|
|
94
|
+
breadcrumbsPrefix: ["response"],
|
|
95
|
+
}));
|
|
96
|
+
case 403:
|
|
97
|
+
throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
98
|
+
unrecognizedObjectKeys: "passthrough",
|
|
99
|
+
allowUnrecognizedUnionMembers: true,
|
|
100
|
+
allowUnrecognizedEnumValues: true,
|
|
101
|
+
skipValidation: true,
|
|
102
|
+
breadcrumbsPrefix: ["response"],
|
|
103
|
+
}));
|
|
104
|
+
case 404:
|
|
105
|
+
throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
106
|
+
unrecognizedObjectKeys: "passthrough",
|
|
107
|
+
allowUnrecognizedUnionMembers: true,
|
|
108
|
+
allowUnrecognizedEnumValues: true,
|
|
109
|
+
skipValidation: true,
|
|
110
|
+
breadcrumbsPrefix: ["response"],
|
|
111
|
+
}));
|
|
112
|
+
case 422:
|
|
113
|
+
throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
114
|
+
unrecognizedObjectKeys: "passthrough",
|
|
115
|
+
allowUnrecognizedUnionMembers: true,
|
|
116
|
+
allowUnrecognizedEnumValues: true,
|
|
117
|
+
skipValidation: true,
|
|
118
|
+
breadcrumbsPrefix: ["response"],
|
|
119
|
+
}));
|
|
120
|
+
default:
|
|
121
|
+
throw new errors.ScorecardError({
|
|
122
|
+
statusCode: _response.error.statusCode,
|
|
123
|
+
body: _response.error.body,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
switch (_response.error.reason) {
|
|
128
|
+
case "non-json":
|
|
129
|
+
throw new errors.ScorecardError({
|
|
130
|
+
statusCode: _response.error.statusCode,
|
|
131
|
+
body: _response.error.rawBody,
|
|
132
|
+
});
|
|
133
|
+
case "timeout":
|
|
134
|
+
throw new errors.ScorecardTimeoutError();
|
|
135
|
+
case "unknown":
|
|
136
|
+
throw new errors.ScorecardError({
|
|
137
|
+
message: _response.error.errorMessage,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
_getCustomAuthorizationHeaders() {
|
|
143
|
+
var _a;
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
const apiKeyValue = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["SCORECARD_API_KEY"];
|
|
146
|
+
return { "X-API-Key": apiKeyValue };
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
exports.RunMetric = RunMetric;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client"), exports);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "../../../../environments";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
import * as Scorecard from "
|
|
6
|
+
import * as Scorecard from "../../../index";
|
|
7
7
|
export declare namespace Score {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ScorecardEnvironment | string>;
|
|
@@ -19,6 +19,12 @@ export declare class Score {
|
|
|
19
19
|
constructor(_options: Score.Options);
|
|
20
20
|
/**
|
|
21
21
|
* Create a score
|
|
22
|
+
*
|
|
23
|
+
* @param {number} runId
|
|
24
|
+
* @param {number} testrecordId
|
|
25
|
+
* @param {Scorecard.ScoreCreateParams} request
|
|
26
|
+
* @param {Score.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
22
28
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
23
29
|
* @throws {@link Scorecard.ForbiddenError}
|
|
24
30
|
* @throws {@link Scorecard.NotFoundError}
|
|
@@ -32,13 +38,23 @@ export declare class Score {
|
|
|
32
38
|
create(runId: number, testrecordId: number, request: Scorecard.ScoreCreateParams, requestOptions?: Score.RequestOptions): Promise<Scorecard.Grade>;
|
|
33
39
|
/**
|
|
34
40
|
* Update a score
|
|
41
|
+
*
|
|
42
|
+
* @param {number} runId
|
|
43
|
+
* @param {number} testrecordId
|
|
44
|
+
* @param {number} scoreId
|
|
45
|
+
* @param {Scorecard.ScoreUpdateParams} request
|
|
46
|
+
* @param {Score.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
|
+
*
|
|
35
48
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
36
49
|
* @throws {@link Scorecard.ForbiddenError}
|
|
37
50
|
* @throws {@link Scorecard.NotFoundError}
|
|
38
51
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
39
52
|
*
|
|
40
53
|
* @example
|
|
41
|
-
* await scorecard.score.update(1, 1, 1
|
|
54
|
+
* await scorecard.score.update(1, 1, 1)
|
|
42
55
|
*/
|
|
43
56
|
update(runId: number, testrecordId: number, scoreId: number, request?: Scorecard.ScoreUpdateParams, requestOptions?: Score.RequestOptions): Promise<Scorecard.Grade>;
|
|
57
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
58
|
+
"X-API-Key": string;
|
|
59
|
+
}>;
|
|
44
60
|
}
|