scorecard-ai 0.1.10 → 0.1.12
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 +3 -0
- package/Client.js +5 -0
- package/README.md +1 -0
- package/api/resources/index.d.ts +2 -0
- package/api/resources/index.js +3 -1
- package/api/resources/run/client/Client.d.ts +12 -1
- package/api/resources/run/client/Client.js +15 -4
- package/api/resources/run/client/requests/RunCreateParams.d.ts +16 -1
- package/api/resources/score/client/Client.d.ts +44 -0
- package/api/resources/score/client/Client.js +239 -0
- package/api/resources/score/client/index.d.ts +1 -0
- package/api/resources/score/client/index.js +17 -0
- package/api/resources/score/client/requests/ScoreCreateParams.d.ts +15 -0
- package/api/resources/score/client/requests/ScoreUpdateParams.d.ts +12 -0
- package/api/resources/score/client/requests/index.d.ts +2 -0
- package/api/resources/score/client/requests/index.js +2 -0
- package/api/resources/score/index.d.ts +1 -0
- package/api/resources/score/index.js +17 -0
- package/api/resources/testcase/client/Client.d.ts +11 -0
- package/api/resources/testcase/client/Client.js +14 -3
- package/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +6 -0
- package/api/resources/testrecord/client/Client.d.ts +7 -1
- package/api/resources/testrecord/client/Client.js +9 -3
- package/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +10 -3
- package/api/resources/testrecord/types/TestrecordCreateParamsModelDebugInfoValue.d.ts +4 -0
- package/api/resources/testrecord/types/TestrecordCreateParamsModelParamsValue.d.ts +4 -0
- package/api/resources/testrecord/types/index.d.ts +2 -0
- package/api/resources/testrecord/types/index.js +2 -0
- package/api/resources/testset/client/Client.d.ts +12 -4
- package/api/resources/testset/client/Client.js +23 -15
- package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -2
- package/api/resources/testset/client/requests/TestsetGetTestcasesRequest.d.ts +6 -2
- package/api/types/{LibDtoTypesCreateRunParams.d.ts → CreateGithubWorkflowParams.d.ts} +1 -1
- package/api/types/CreateRunParams.d.ts +1 -6
- package/{dist/api/types/CustomSchemaInput.d.ts → api/types/CustomSchema.d.ts} +1 -1
- package/api/types/Grade.d.ts +14 -0
- package/api/types/RunStatus.d.ts +2 -1
- package/api/types/RunStatus.js +1 -0
- package/api/types/TestRecordCreate.d.ts +1 -13
- package/api/types/TestSetCreate.d.ts +1 -5
- package/api/types/Testrecord.d.ts +7 -2
- package/api/types/TestrecordModelDebugInfoValue.d.ts +4 -0
- package/api/types/TestrecordModelParamsValue.d.ts +4 -0
- package/api/types/Testset.d.ts +1 -1
- package/api/types/index.d.ts +5 -6
- package/api/types/index.js +5 -6
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +5 -0
- package/dist/api/resources/index.d.ts +2 -0
- package/dist/api/resources/index.js +3 -1
- package/dist/api/resources/run/client/Client.d.ts +12 -1
- package/dist/api/resources/run/client/Client.js +15 -4
- package/dist/api/resources/run/client/requests/RunCreateParams.d.ts +16 -1
- package/dist/api/resources/score/client/Client.d.ts +44 -0
- package/dist/api/resources/score/client/Client.js +239 -0
- package/dist/api/resources/score/client/index.d.ts +1 -0
- package/dist/api/resources/score/client/index.js +17 -0
- package/dist/api/resources/score/client/requests/ScoreCreateParams.d.ts +15 -0
- package/dist/api/resources/score/client/requests/ScoreUpdateParams.d.ts +12 -0
- package/dist/api/resources/score/client/requests/index.d.ts +2 -0
- package/dist/api/resources/score/client/requests/index.js +2 -0
- package/dist/api/resources/score/index.d.ts +1 -0
- package/dist/api/resources/score/index.js +17 -0
- package/dist/api/resources/testcase/client/Client.d.ts +11 -0
- package/dist/api/resources/testcase/client/Client.js +14 -3
- package/dist/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +6 -0
- package/dist/api/resources/testrecord/client/Client.d.ts +7 -1
- package/dist/api/resources/testrecord/client/Client.js +9 -3
- package/dist/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +10 -3
- package/dist/api/resources/testrecord/types/TestrecordCreateParamsModelDebugInfoValue.d.ts +4 -0
- package/dist/api/resources/testrecord/types/TestrecordCreateParamsModelParamsValue.d.ts +4 -0
- package/dist/api/resources/testrecord/types/TestrecordCreateParamsModelParamsValue.js +5 -0
- package/dist/api/resources/testrecord/types/index.d.ts +2 -0
- package/dist/api/resources/testrecord/types/index.js +2 -0
- package/dist/api/resources/testset/client/Client.d.ts +12 -4
- package/dist/api/resources/testset/client/Client.js +23 -15
- package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -2
- package/dist/api/resources/testset/client/requests/TestsetGetTestcasesRequest.d.ts +6 -2
- package/dist/api/types/{LibDtoTypesTestSetCreate.d.ts → CreateGithubWorkflowParams.d.ts} +1 -1
- package/dist/api/types/CreateGithubWorkflowParams.js +5 -0
- package/dist/api/types/CreateRunParams.d.ts +1 -6
- package/{api/types/CustomSchemaInput.d.ts → dist/api/types/CustomSchema.d.ts} +1 -1
- package/dist/api/types/CustomSchema.js +5 -0
- package/dist/api/types/Grade.d.ts +14 -0
- package/dist/api/types/Grade.js +5 -0
- package/dist/api/types/RunStatus.d.ts +2 -1
- package/dist/api/types/RunStatus.js +1 -0
- package/dist/api/types/TestRecordCreate.d.ts +1 -13
- package/dist/api/types/TestSetCreate.d.ts +1 -5
- package/dist/api/types/Testrecord.d.ts +7 -2
- package/dist/api/types/TestrecordModelDebugInfoValue.d.ts +4 -0
- package/dist/api/types/TestrecordModelDebugInfoValue.js +5 -0
- package/dist/api/types/TestrecordModelParamsValue.d.ts +4 -0
- package/dist/api/types/TestrecordModelParamsValue.js +5 -0
- package/dist/api/types/Testset.d.ts +1 -1
- package/dist/api/types/index.d.ts +5 -6
- package/dist/api/types/index.js +5 -6
- package/dist/serialization/resources/index.d.ts +2 -0
- package/dist/serialization/resources/index.js +3 -1
- package/dist/serialization/resources/run/client/requests/RunCreateParams.d.ts +4 -1
- package/dist/serialization/resources/run/client/requests/RunCreateParams.js +4 -1
- package/dist/serialization/resources/score/client/index.d.ts +1 -0
- package/dist/serialization/resources/score/client/index.js +17 -0
- package/dist/serialization/resources/score/client/requests/ScoreCreateParams.d.ts +15 -0
- package/dist/serialization/resources/score/client/requests/ScoreCreateParams.js +36 -0
- package/dist/serialization/resources/score/client/requests/ScoreUpdateParams.d.ts +14 -0
- package/dist/serialization/resources/score/client/requests/ScoreUpdateParams.js +35 -0
- package/dist/serialization/resources/score/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/score/client/requests/index.js +7 -0
- package/dist/serialization/resources/score/index.d.ts +1 -0
- package/dist/serialization/resources/score/index.js +17 -0
- package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +6 -3
- package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +14 -3
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsModelDebugInfoValue.d.ts +10 -0
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsModelDebugInfoValue.js +35 -0
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsModelParamsValue.d.ts +10 -0
- package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsModelParamsValue.js +35 -0
- package/dist/serialization/resources/testrecord/types/index.d.ts +2 -0
- package/dist/serialization/resources/testrecord/types/index.js +2 -0
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +2 -2
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +2 -2
- package/dist/serialization/types/CreateGithubWorkflowParams.d.ts +10 -0
- package/{serialization/types/LibDtoTypesCreateRunParams.js → dist/serialization/types/CreateGithubWorkflowParams.js} +2 -2
- package/dist/serialization/types/CreateRunParams.d.ts +2 -7
- package/dist/serialization/types/CreateRunParams.js +1 -6
- package/{serialization/types/CustomSchemaInput.d.ts → dist/serialization/types/CustomSchema.d.ts} +2 -2
- package/{serialization/types/CustomSchemaInput.js → dist/serialization/types/CustomSchema.js} +2 -2
- package/dist/serialization/types/Grade.d.ts +20 -0
- package/dist/serialization/types/Grade.js +41 -0
- package/dist/serialization/types/RunStatus.d.ts +1 -1
- package/dist/serialization/types/RunStatus.js +1 -0
- package/dist/serialization/types/TestRecordCreate.d.ts +2 -14
- package/dist/serialization/types/TestRecordCreate.js +1 -13
- package/dist/serialization/types/TestSetCreate.d.ts +2 -6
- package/dist/serialization/types/TestSetCreate.js +1 -5
- package/dist/serialization/types/Testrecord.d.ts +7 -2
- package/dist/serialization/types/Testrecord.js +11 -2
- package/dist/serialization/types/TestrecordModelDebugInfoValue.d.ts +10 -0
- package/dist/serialization/types/{LibDtoTypesTestRecordCreate.js → TestrecordModelDebugInfoValue.js} +6 -2
- package/dist/serialization/types/TestrecordModelParamsValue.d.ts +10 -0
- package/dist/serialization/types/{BodyStartGithubWorkflowStartGithubWorkflowPost.js → TestrecordModelParamsValue.js} +6 -2
- package/dist/serialization/types/Testset.d.ts +1 -1
- package/dist/serialization/types/Testset.js +1 -1
- package/dist/serialization/types/index.d.ts +5 -6
- package/dist/serialization/types/index.js +5 -6
- package/package.json +1 -1
- package/serialization/resources/index.d.ts +2 -0
- package/serialization/resources/index.js +3 -1
- package/serialization/resources/run/client/requests/RunCreateParams.d.ts +4 -1
- package/serialization/resources/run/client/requests/RunCreateParams.js +4 -1
- package/serialization/resources/score/client/index.d.ts +1 -0
- package/serialization/resources/score/client/index.js +17 -0
- package/serialization/resources/score/client/requests/ScoreCreateParams.d.ts +15 -0
- package/serialization/resources/score/client/requests/ScoreCreateParams.js +36 -0
- package/serialization/resources/score/client/requests/ScoreUpdateParams.d.ts +14 -0
- package/serialization/resources/score/client/requests/ScoreUpdateParams.js +35 -0
- package/serialization/resources/score/client/requests/index.d.ts +2 -0
- package/serialization/resources/score/client/requests/index.js +7 -0
- package/serialization/resources/score/index.d.ts +1 -0
- package/serialization/resources/score/index.js +17 -0
- package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +6 -3
- package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +14 -3
- package/serialization/resources/testrecord/types/TestrecordCreateParamsModelDebugInfoValue.d.ts +10 -0
- package/serialization/resources/testrecord/types/TestrecordCreateParamsModelDebugInfoValue.js +35 -0
- package/serialization/resources/testrecord/types/TestrecordCreateParamsModelParamsValue.d.ts +10 -0
- package/serialization/resources/testrecord/types/TestrecordCreateParamsModelParamsValue.js +35 -0
- package/serialization/resources/testrecord/types/index.d.ts +2 -0
- package/serialization/resources/testrecord/types/index.js +2 -0
- package/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +2 -2
- package/serialization/resources/testset/client/requests/TestsetCreateParams.js +2 -2
- package/serialization/types/CreateGithubWorkflowParams.d.ts +10 -0
- package/{dist/serialization/types/LibDtoTypesCreateRunParams.js → serialization/types/CreateGithubWorkflowParams.js} +2 -2
- package/serialization/types/CreateRunParams.d.ts +2 -7
- package/serialization/types/CreateRunParams.js +1 -6
- package/{dist/serialization/types/CustomSchemaInput.d.ts → serialization/types/CustomSchema.d.ts} +2 -2
- package/{dist/serialization/types/CustomSchemaInput.js → serialization/types/CustomSchema.js} +2 -2
- package/serialization/types/Grade.d.ts +20 -0
- package/serialization/types/Grade.js +41 -0
- package/serialization/types/RunStatus.d.ts +1 -1
- package/serialization/types/RunStatus.js +1 -0
- package/serialization/types/TestRecordCreate.d.ts +2 -14
- package/serialization/types/TestRecordCreate.js +1 -13
- package/serialization/types/TestSetCreate.d.ts +2 -6
- package/serialization/types/TestSetCreate.js +1 -5
- package/serialization/types/Testrecord.d.ts +7 -2
- package/serialization/types/Testrecord.js +11 -2
- package/serialization/types/TestrecordModelDebugInfoValue.d.ts +10 -0
- package/serialization/types/TestrecordModelDebugInfoValue.js +35 -0
- package/serialization/types/TestrecordModelParamsValue.d.ts +10 -0
- package/{dist/serialization/types/LibDtoTypesTestSetCreate.js → serialization/types/TestrecordModelParamsValue.js} +6 -2
- package/serialization/types/Testset.d.ts +1 -1
- package/serialization/types/Testset.js +1 -1
- package/serialization/types/index.d.ts +5 -6
- package/serialization/types/index.js +5 -6
- package/api/types/BodyStartGithubWorkflowStartGithubWorkflowPost.d.ts +0 -4
- package/api/types/CustomSchemaOutput.d.ts +0 -11
- package/api/types/LibDtoTypesTestRecordCreate.d.ts +0 -4
- package/api/types/LibDtoTypesTestSetCreate.d.ts +0 -4
- package/dist/api/types/BodyStartGithubWorkflowStartGithubWorkflowPost.d.ts +0 -4
- package/dist/api/types/CustomSchemaOutput.d.ts +0 -11
- package/dist/api/types/LibDtoTypesCreateRunParams.d.ts +0 -4
- package/dist/api/types/LibDtoTypesTestRecordCreate.d.ts +0 -4
- package/dist/serialization/types/BodyStartGithubWorkflowStartGithubWorkflowPost.d.ts +0 -10
- package/dist/serialization/types/CustomSchemaOutput.d.ts +0 -12
- package/dist/serialization/types/CustomSchemaOutput.js +0 -44
- package/dist/serialization/types/LibDtoTypesCreateRunParams.d.ts +0 -10
- package/dist/serialization/types/LibDtoTypesTestRecordCreate.d.ts +0 -10
- package/dist/serialization/types/LibDtoTypesTestSetCreate.d.ts +0 -10
- package/serialization/types/BodyStartGithubWorkflowStartGithubWorkflowPost.d.ts +0 -10
- package/serialization/types/BodyStartGithubWorkflowStartGithubWorkflowPost.js +0 -31
- package/serialization/types/CustomSchemaOutput.d.ts +0 -12
- package/serialization/types/CustomSchemaOutput.js +0 -44
- package/serialization/types/LibDtoTypesCreateRunParams.d.ts +0 -10
- package/serialization/types/LibDtoTypesTestRecordCreate.d.ts +0 -10
- package/serialization/types/LibDtoTypesTestRecordCreate.js +0 -31
- package/serialization/types/LibDtoTypesTestSetCreate.d.ts +0 -10
- package/serialization/types/LibDtoTypesTestSetCreate.js +0 -31
- /package/api/{types/BodyStartGithubWorkflowStartGithubWorkflowPost.js → resources/score/client/requests/ScoreCreateParams.js} +0 -0
- /package/api/{types/CustomSchemaInput.js → resources/score/client/requests/ScoreUpdateParams.js} +0 -0
- /package/api/{types/CustomSchemaOutput.js → resources/testrecord/types/TestrecordCreateParamsModelDebugInfoValue.js} +0 -0
- /package/api/{types/LibDtoTypesCreateRunParams.js → resources/testrecord/types/TestrecordCreateParamsModelParamsValue.js} +0 -0
- /package/api/types/{LibDtoTypesTestRecordCreate.js → CreateGithubWorkflowParams.js} +0 -0
- /package/api/types/{LibDtoTypesTestSetCreate.js → CustomSchema.js} +0 -0
- /package/{dist/api/types/BodyStartGithubWorkflowStartGithubWorkflowPost.js → api/types/Grade.js} +0 -0
- /package/{dist/api/types/CustomSchemaInput.js → api/types/TestrecordModelDebugInfoValue.js} +0 -0
- /package/{dist/api/types/CustomSchemaOutput.js → api/types/TestrecordModelParamsValue.js} +0 -0
- /package/dist/api/{types/LibDtoTypesCreateRunParams.js → resources/score/client/requests/ScoreCreateParams.js} +0 -0
- /package/dist/api/{types/LibDtoTypesTestRecordCreate.js → resources/score/client/requests/ScoreUpdateParams.js} +0 -0
- /package/dist/api/{types/LibDtoTypesTestSetCreate.js → resources/testrecord/types/TestrecordCreateParamsModelDebugInfoValue.js} +0 -0
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* testsetId: 1,
|
|
8
|
+
* scoringConfigId: 2,
|
|
9
|
+
* status: "RUNNING_EXECUTION",
|
|
10
|
+
* modelParams: {
|
|
11
|
+
* "param1": "value1",
|
|
12
|
+
* "param2": "value2"
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
4
16
|
export interface RunCreateParams {
|
|
5
|
-
testsetId
|
|
17
|
+
testsetId?: number;
|
|
6
18
|
scoringConfigId?: number;
|
|
7
19
|
status?: string;
|
|
8
20
|
modelParams?: Record<string, unknown>;
|
|
21
|
+
source?: string;
|
|
22
|
+
notes?: string;
|
|
23
|
+
promptTemplate?: string;
|
|
9
24
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 "../../..";
|
|
7
|
+
export declare namespace Score {
|
|
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 Score {
|
|
18
|
+
protected readonly _options: Score.Options;
|
|
19
|
+
constructor(_options: Score.Options);
|
|
20
|
+
/**
|
|
21
|
+
* Create a score
|
|
22
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
23
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
24
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
25
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* await scorecard.score.create(1, 1, {
|
|
29
|
+
* metricId: 1
|
|
30
|
+
* })
|
|
31
|
+
*/
|
|
32
|
+
create(runId: number, testrecordId: number, request: Scorecard.ScoreCreateParams, requestOptions?: Score.RequestOptions): Promise<Scorecard.Grade>;
|
|
33
|
+
/**
|
|
34
|
+
* Update a score
|
|
35
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
36
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
37
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
38
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* await scorecard.score.update(1, 1, 1, {})
|
|
42
|
+
*/
|
|
43
|
+
update(runId: number, testrecordId: number, scoreId: number, request?: Scorecard.ScoreUpdateParams, requestOptions?: Score.RequestOptions): Promise<Scorecard.Grade>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
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.Score = void 0;
|
|
42
|
+
const environments = __importStar(require("../../../../environments"));
|
|
43
|
+
const core = __importStar(require("../../../../core"));
|
|
44
|
+
const Scorecard = __importStar(require("../../.."));
|
|
45
|
+
const serializers = __importStar(require("../../../../serialization"));
|
|
46
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
47
|
+
const errors = __importStar(require("../../../../errors"));
|
|
48
|
+
class Score {
|
|
49
|
+
constructor(_options) {
|
|
50
|
+
this._options = _options;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Create a score
|
|
54
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
55
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
56
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
57
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await scorecard.score.create(1, 1, {
|
|
61
|
+
* metricId: 1
|
|
62
|
+
* })
|
|
63
|
+
*/
|
|
64
|
+
create(runId, testrecordId, request, requestOptions) {
|
|
65
|
+
var _a;
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const _response = yield core.fetcher({
|
|
68
|
+
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}/testrecord/${testrecordId}/score`),
|
|
69
|
+
method: "POST",
|
|
70
|
+
headers: {
|
|
71
|
+
"X-API-Key": yield core.Supplier.get(this._options.apiKey),
|
|
72
|
+
"X-Fern-Language": "JavaScript",
|
|
73
|
+
"X-Fern-SDK-Name": "scorecard-ai",
|
|
74
|
+
"X-Fern-SDK-Version": "0.1.12",
|
|
75
|
+
},
|
|
76
|
+
contentType: "application/json",
|
|
77
|
+
body: yield serializers.ScoreCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
78
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
79
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
80
|
+
});
|
|
81
|
+
if (_response.ok) {
|
|
82
|
+
return yield serializers.Grade.parseOrThrow(_response.body, {
|
|
83
|
+
unrecognizedObjectKeys: "passthrough",
|
|
84
|
+
allowUnrecognizedUnionMembers: true,
|
|
85
|
+
allowUnrecognizedEnumValues: true,
|
|
86
|
+
skipValidation: true,
|
|
87
|
+
breadcrumbsPrefix: ["response"],
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (_response.error.reason === "status-code") {
|
|
91
|
+
switch (_response.error.statusCode) {
|
|
92
|
+
case 401:
|
|
93
|
+
throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
94
|
+
unrecognizedObjectKeys: "passthrough",
|
|
95
|
+
allowUnrecognizedUnionMembers: true,
|
|
96
|
+
allowUnrecognizedEnumValues: true,
|
|
97
|
+
skipValidation: true,
|
|
98
|
+
breadcrumbsPrefix: ["response"],
|
|
99
|
+
}));
|
|
100
|
+
case 403:
|
|
101
|
+
throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
102
|
+
unrecognizedObjectKeys: "passthrough",
|
|
103
|
+
allowUnrecognizedUnionMembers: true,
|
|
104
|
+
allowUnrecognizedEnumValues: true,
|
|
105
|
+
skipValidation: true,
|
|
106
|
+
breadcrumbsPrefix: ["response"],
|
|
107
|
+
}));
|
|
108
|
+
case 404:
|
|
109
|
+
throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
110
|
+
unrecognizedObjectKeys: "passthrough",
|
|
111
|
+
allowUnrecognizedUnionMembers: true,
|
|
112
|
+
allowUnrecognizedEnumValues: true,
|
|
113
|
+
skipValidation: true,
|
|
114
|
+
breadcrumbsPrefix: ["response"],
|
|
115
|
+
}));
|
|
116
|
+
case 422:
|
|
117
|
+
throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
118
|
+
unrecognizedObjectKeys: "passthrough",
|
|
119
|
+
allowUnrecognizedUnionMembers: true,
|
|
120
|
+
allowUnrecognizedEnumValues: true,
|
|
121
|
+
skipValidation: true,
|
|
122
|
+
breadcrumbsPrefix: ["response"],
|
|
123
|
+
}));
|
|
124
|
+
default:
|
|
125
|
+
throw new errors.ScorecardError({
|
|
126
|
+
statusCode: _response.error.statusCode,
|
|
127
|
+
body: _response.error.body,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
switch (_response.error.reason) {
|
|
132
|
+
case "non-json":
|
|
133
|
+
throw new errors.ScorecardError({
|
|
134
|
+
statusCode: _response.error.statusCode,
|
|
135
|
+
body: _response.error.rawBody,
|
|
136
|
+
});
|
|
137
|
+
case "timeout":
|
|
138
|
+
throw new errors.ScorecardTimeoutError();
|
|
139
|
+
case "unknown":
|
|
140
|
+
throw new errors.ScorecardError({
|
|
141
|
+
message: _response.error.errorMessage,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Update a score
|
|
148
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
149
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
150
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
151
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* await scorecard.score.update(1, 1, 1, {})
|
|
155
|
+
*/
|
|
156
|
+
update(runId, testrecordId, scoreId, request = {}, requestOptions) {
|
|
157
|
+
var _a;
|
|
158
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
+
const _response = yield core.fetcher({
|
|
160
|
+
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}/testrecord/${testrecordId}/score/${scoreId}`),
|
|
161
|
+
method: "PATCH",
|
|
162
|
+
headers: {
|
|
163
|
+
"X-API-Key": yield core.Supplier.get(this._options.apiKey),
|
|
164
|
+
"X-Fern-Language": "JavaScript",
|
|
165
|
+
"X-Fern-SDK-Name": "scorecard-ai",
|
|
166
|
+
"X-Fern-SDK-Version": "0.1.12",
|
|
167
|
+
},
|
|
168
|
+
contentType: "application/json",
|
|
169
|
+
body: yield serializers.ScoreUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
170
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
171
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
172
|
+
});
|
|
173
|
+
if (_response.ok) {
|
|
174
|
+
return yield serializers.Grade.parseOrThrow(_response.body, {
|
|
175
|
+
unrecognizedObjectKeys: "passthrough",
|
|
176
|
+
allowUnrecognizedUnionMembers: true,
|
|
177
|
+
allowUnrecognizedEnumValues: true,
|
|
178
|
+
skipValidation: true,
|
|
179
|
+
breadcrumbsPrefix: ["response"],
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
if (_response.error.reason === "status-code") {
|
|
183
|
+
switch (_response.error.statusCode) {
|
|
184
|
+
case 401:
|
|
185
|
+
throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
186
|
+
unrecognizedObjectKeys: "passthrough",
|
|
187
|
+
allowUnrecognizedUnionMembers: true,
|
|
188
|
+
allowUnrecognizedEnumValues: true,
|
|
189
|
+
skipValidation: true,
|
|
190
|
+
breadcrumbsPrefix: ["response"],
|
|
191
|
+
}));
|
|
192
|
+
case 403:
|
|
193
|
+
throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
194
|
+
unrecognizedObjectKeys: "passthrough",
|
|
195
|
+
allowUnrecognizedUnionMembers: true,
|
|
196
|
+
allowUnrecognizedEnumValues: true,
|
|
197
|
+
skipValidation: true,
|
|
198
|
+
breadcrumbsPrefix: ["response"],
|
|
199
|
+
}));
|
|
200
|
+
case 404:
|
|
201
|
+
throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
202
|
+
unrecognizedObjectKeys: "passthrough",
|
|
203
|
+
allowUnrecognizedUnionMembers: true,
|
|
204
|
+
allowUnrecognizedEnumValues: true,
|
|
205
|
+
skipValidation: true,
|
|
206
|
+
breadcrumbsPrefix: ["response"],
|
|
207
|
+
}));
|
|
208
|
+
case 422:
|
|
209
|
+
throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
210
|
+
unrecognizedObjectKeys: "passthrough",
|
|
211
|
+
allowUnrecognizedUnionMembers: true,
|
|
212
|
+
allowUnrecognizedEnumValues: true,
|
|
213
|
+
skipValidation: true,
|
|
214
|
+
breadcrumbsPrefix: ["response"],
|
|
215
|
+
}));
|
|
216
|
+
default:
|
|
217
|
+
throw new errors.ScorecardError({
|
|
218
|
+
statusCode: _response.error.statusCode,
|
|
219
|
+
body: _response.error.body,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
switch (_response.error.reason) {
|
|
224
|
+
case "non-json":
|
|
225
|
+
throw new errors.ScorecardError({
|
|
226
|
+
statusCode: _response.error.statusCode,
|
|
227
|
+
body: _response.error.rawBody,
|
|
228
|
+
});
|
|
229
|
+
case "timeout":
|
|
230
|
+
throw new errors.ScorecardTimeoutError();
|
|
231
|
+
case "unknown":
|
|
232
|
+
throw new errors.ScorecardError({
|
|
233
|
+
message: _response.error.errorMessage,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
exports.Score = Score;
|
|
@@ -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,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* metricId: 1
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface ScoreCreateParams {
|
|
11
|
+
metricId: number;
|
|
12
|
+
intScore?: number;
|
|
13
|
+
binaryScore?: boolean;
|
|
14
|
+
reasoning?: string;
|
|
15
|
+
}
|
|
@@ -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);
|
|
@@ -23,6 +23,11 @@ export declare class Testcase {
|
|
|
23
23
|
* @throws {@link Scorecard.ForbiddenError}
|
|
24
24
|
* @throws {@link Scorecard.NotFoundError}
|
|
25
25
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* await scorecard.testcase.create(1, {
|
|
29
|
+
* userQuery: "user_query"
|
|
30
|
+
* })
|
|
26
31
|
*/
|
|
27
32
|
create(testsetId: number, request: Scorecard.TestcaseCreateParams, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestCase>;
|
|
28
33
|
/**
|
|
@@ -31,6 +36,9 @@ export declare class Testcase {
|
|
|
31
36
|
* @throws {@link Scorecard.ForbiddenError}
|
|
32
37
|
* @throws {@link Scorecard.NotFoundError}
|
|
33
38
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* await scorecard.testcase.get(1, 1)
|
|
34
42
|
*/
|
|
35
43
|
get(testcaseId: number, testsetId: number, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestCase>;
|
|
36
44
|
/**
|
|
@@ -39,6 +47,9 @@ export declare class Testcase {
|
|
|
39
47
|
* @throws {@link Scorecard.ForbiddenError}
|
|
40
48
|
* @throws {@link Scorecard.NotFoundError}
|
|
41
49
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* await scorecard.testcase.delete(1, 1)
|
|
42
53
|
*/
|
|
43
54
|
delete(testcaseId: number, testsetId: number, requestOptions?: Testcase.RequestOptions): Promise<unknown>;
|
|
44
55
|
}
|
|
@@ -55,6 +55,11 @@ class Testcase {
|
|
|
55
55
|
* @throws {@link Scorecard.ForbiddenError}
|
|
56
56
|
* @throws {@link Scorecard.NotFoundError}
|
|
57
57
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await scorecard.testcase.create(1, {
|
|
61
|
+
* userQuery: "user_query"
|
|
62
|
+
* })
|
|
58
63
|
*/
|
|
59
64
|
create(testsetId, request, requestOptions) {
|
|
60
65
|
var _a;
|
|
@@ -66,7 +71,7 @@ class Testcase {
|
|
|
66
71
|
"X-API-Key": yield core.Supplier.get(this._options.apiKey),
|
|
67
72
|
"X-Fern-Language": "JavaScript",
|
|
68
73
|
"X-Fern-SDK-Name": "scorecard-ai",
|
|
69
|
-
"X-Fern-SDK-Version": "0.1.
|
|
74
|
+
"X-Fern-SDK-Version": "0.1.12",
|
|
70
75
|
},
|
|
71
76
|
contentType: "application/json",
|
|
72
77
|
body: yield serializers.TestcaseCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -144,6 +149,9 @@ class Testcase {
|
|
|
144
149
|
* @throws {@link Scorecard.ForbiddenError}
|
|
145
150
|
* @throws {@link Scorecard.NotFoundError}
|
|
146
151
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* await scorecard.testcase.get(1, 1)
|
|
147
155
|
*/
|
|
148
156
|
get(testcaseId, testsetId, requestOptions) {
|
|
149
157
|
var _a;
|
|
@@ -155,7 +163,7 @@ class Testcase {
|
|
|
155
163
|
"X-API-Key": yield core.Supplier.get(this._options.apiKey),
|
|
156
164
|
"X-Fern-Language": "JavaScript",
|
|
157
165
|
"X-Fern-SDK-Name": "scorecard-ai",
|
|
158
|
-
"X-Fern-SDK-Version": "0.1.
|
|
166
|
+
"X-Fern-SDK-Version": "0.1.12",
|
|
159
167
|
},
|
|
160
168
|
contentType: "application/json",
|
|
161
169
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -232,6 +240,9 @@ class Testcase {
|
|
|
232
240
|
* @throws {@link Scorecard.ForbiddenError}
|
|
233
241
|
* @throws {@link Scorecard.NotFoundError}
|
|
234
242
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* await scorecard.testcase.delete(1, 1)
|
|
235
246
|
*/
|
|
236
247
|
delete(testcaseId, testsetId, requestOptions) {
|
|
237
248
|
var _a;
|
|
@@ -243,7 +254,7 @@ class Testcase {
|
|
|
243
254
|
"X-API-Key": yield core.Supplier.get(this._options.apiKey),
|
|
244
255
|
"X-Fern-Language": "JavaScript",
|
|
245
256
|
"X-Fern-SDK-Name": "scorecard-ai",
|
|
246
|
-
"X-Fern-SDK-Version": "0.1.
|
|
257
|
+
"X-Fern-SDK-Version": "0.1.12",
|
|
247
258
|
},
|
|
248
259
|
contentType: "application/json",
|
|
249
260
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Scorecard from "../../../..";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* userQuery: "user_query"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
5
11
|
export interface TestcaseCreateParams {
|
|
6
12
|
userQuery: string;
|
|
7
13
|
context?: string;
|
|
@@ -23,6 +23,9 @@ export declare class Testrecord {
|
|
|
23
23
|
* @throws {@link Scorecard.ForbiddenError}
|
|
24
24
|
* @throws {@link Scorecard.NotFoundError}
|
|
25
25
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* await scorecard.testrecord.get(1, 1)
|
|
26
29
|
*/
|
|
27
30
|
get(testrecordId: number, runId: number, requestOptions?: Testrecord.RequestOptions): Promise<Scorecard.Testrecord>;
|
|
28
31
|
/**
|
|
@@ -31,6 +34,9 @@ export declare class Testrecord {
|
|
|
31
34
|
* @throws {@link Scorecard.ForbiddenError}
|
|
32
35
|
* @throws {@link Scorecard.NotFoundError}
|
|
33
36
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await scorecard.testrecord.create(1, {})
|
|
34
40
|
*/
|
|
35
|
-
create(runId: number, request
|
|
41
|
+
create(runId: number, request?: Scorecard.TestrecordCreateParams, requestOptions?: Testrecord.RequestOptions): Promise<Scorecard.Testrecord>;
|
|
36
42
|
}
|
|
@@ -55,6 +55,9 @@ class Testrecord {
|
|
|
55
55
|
* @throws {@link Scorecard.ForbiddenError}
|
|
56
56
|
* @throws {@link Scorecard.NotFoundError}
|
|
57
57
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await scorecard.testrecord.get(1, 1)
|
|
58
61
|
*/
|
|
59
62
|
get(testrecordId, runId, requestOptions) {
|
|
60
63
|
var _a;
|
|
@@ -66,7 +69,7 @@ class Testrecord {
|
|
|
66
69
|
"X-API-Key": yield core.Supplier.get(this._options.apiKey),
|
|
67
70
|
"X-Fern-Language": "JavaScript",
|
|
68
71
|
"X-Fern-SDK-Name": "scorecard-ai",
|
|
69
|
-
"X-Fern-SDK-Version": "0.1.
|
|
72
|
+
"X-Fern-SDK-Version": "0.1.12",
|
|
70
73
|
},
|
|
71
74
|
contentType: "application/json",
|
|
72
75
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -143,8 +146,11 @@ class Testrecord {
|
|
|
143
146
|
* @throws {@link Scorecard.ForbiddenError}
|
|
144
147
|
* @throws {@link Scorecard.NotFoundError}
|
|
145
148
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* await scorecard.testrecord.create(1, {})
|
|
146
152
|
*/
|
|
147
|
-
create(runId, request, requestOptions) {
|
|
153
|
+
create(runId, request = {}, requestOptions) {
|
|
148
154
|
var _a;
|
|
149
155
|
return __awaiter(this, void 0, void 0, function* () {
|
|
150
156
|
const _response = yield core.fetcher({
|
|
@@ -154,7 +160,7 @@ class Testrecord {
|
|
|
154
160
|
"X-API-Key": yield core.Supplier.get(this._options.apiKey),
|
|
155
161
|
"X-Fern-Language": "JavaScript",
|
|
156
162
|
"X-Fern-SDK-Name": "scorecard-ai",
|
|
157
|
-
"X-Fern-SDK-Version": "0.1.
|
|
163
|
+
"X-Fern-SDK-Version": "0.1.12",
|
|
158
164
|
},
|
|
159
165
|
contentType: "application/json",
|
|
160
166
|
body: yield serializers.TestrecordCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Scorecard from "../../../..";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {}
|
|
8
|
+
*/
|
|
5
9
|
export interface TestrecordCreateParams {
|
|
6
|
-
testsetId
|
|
7
|
-
testcaseId
|
|
8
|
-
userQuery
|
|
10
|
+
testsetId?: number;
|
|
11
|
+
testcaseId?: number;
|
|
12
|
+
userQuery?: string;
|
|
9
13
|
context?: string;
|
|
10
14
|
response?: string;
|
|
11
15
|
ideal?: string;
|
|
12
16
|
customInputs?: Record<string, Scorecard.TestrecordCreateParamsCustomInputsValue | undefined>;
|
|
13
17
|
customOutputs?: Record<string, Scorecard.TestrecordCreateParamsCustomOutputsValue | undefined>;
|
|
14
18
|
customLabels?: Record<string, Scorecard.TestrecordCreateParamsCustomLabelsValue | undefined>;
|
|
19
|
+
prompt?: string;
|
|
20
|
+
modelParams?: Record<string, Scorecard.TestrecordCreateParamsModelParamsValue | undefined>;
|
|
21
|
+
modelDebugInfo?: Record<string, Scorecard.TestrecordCreateParamsModelDebugInfoValue | undefined>;
|
|
15
22
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export * from "./TestrecordCreateParamsCustomInputsValue";
|
|
2
2
|
export * from "./TestrecordCreateParamsCustomOutputsValue";
|
|
3
3
|
export * from "./TestrecordCreateParamsCustomLabelsValue";
|
|
4
|
+
export * from "./TestrecordCreateParamsModelParamsValue";
|
|
5
|
+
export * from "./TestrecordCreateParamsModelDebugInfoValue";
|
|
@@ -17,3 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./TestrecordCreateParamsCustomInputsValue"), exports);
|
|
18
18
|
__exportStar(require("./TestrecordCreateParamsCustomOutputsValue"), exports);
|
|
19
19
|
__exportStar(require("./TestrecordCreateParamsCustomLabelsValue"), exports);
|
|
20
|
+
__exportStar(require("./TestrecordCreateParamsModelParamsValue"), exports);
|
|
21
|
+
__exportStar(require("./TestrecordCreateParamsModelDebugInfoValue"), exports);
|