scorecard-ai 0.3.0 → 0.5.2
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 +2 -0
- package/api/resources/prompt/client/Client.d.ts +22 -40
- package/api/resources/prompt/client/Client.js +50 -205
- package/api/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -2
- package/api/resources/prompt/client/requests/PromptUpdateParams.d.ts +1 -2
- package/api/resources/run/client/Client.d.ts +5 -13
- package/api/resources/run/client/Client.js +18 -25
- package/api/resources/run/client/requests/RunCreateParams.d.ts +1 -9
- package/api/resources/run/client/requests/UpdateStatusParams.d.ts +2 -4
- package/api/resources/runMetric/client/Client.d.ts +2 -0
- package/api/resources/runMetric/client/Client.js +5 -4
- package/api/resources/score/client/Client.d.ts +7 -5
- package/api/resources/score/client/Client.js +15 -13
- package/api/resources/score/client/requests/ScoreCreateParams.d.ts +1 -0
- package/api/resources/testcase/client/Client.d.ts +10 -10
- package/api/resources/testcase/client/Client.js +29 -22
- package/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +3 -4
- 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 +3 -1
- package/api/resources/testrecord/client/Client.js +11 -9
- package/api/resources/testset/client/Client.d.ts +6 -4
- package/api/resources/testset/client/Client.js +29 -24
- package/api/resources/testset/client/requests/TestsetGetTestcasesRequest.d.ts +6 -0
- package/api/resources/traces/client/Client.d.ts +2 -0
- package/api/resources/traces/client/Client.js +5 -4
- package/api/types/Grade.d.ts +2 -0
- package/api/types/PaginatedTestcaseResponse.d.ts +1 -0
- package/api/types/TestCase.d.ts +2 -0
- package/api/types/TestCaseCustomInputsValue.d.ts +1 -1
- package/api/types/TestCaseCustomLabelsValue.d.ts +1 -1
- package/api/types/TestcaseDeletionResponse.d.ts +9 -0
- package/api/types/TestcaseDeletionResponse.js +5 -0
- package/api/types/Testrecord.d.ts +0 -1
- package/api/types/index.d.ts +1 -0
- package/api/types/index.js +1 -0
- package/core/fetcher/Fetcher.d.ts +1 -0
- package/core/fetcher/Fetcher.js +58 -7
- package/dist/Client.d.ts +2 -0
- package/dist/api/resources/prompt/client/Client.d.ts +22 -40
- package/dist/api/resources/prompt/client/Client.js +50 -205
- package/dist/api/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -2
- package/dist/api/resources/prompt/client/requests/PromptUpdateParams.d.ts +1 -2
- package/dist/api/resources/run/client/Client.d.ts +5 -13
- package/dist/api/resources/run/client/Client.js +18 -25
- package/dist/api/resources/run/client/requests/RunCreateParams.d.ts +1 -9
- package/dist/api/resources/run/client/requests/UpdateStatusParams.d.ts +2 -4
- package/dist/api/resources/runMetric/client/Client.d.ts +2 -0
- package/dist/api/resources/runMetric/client/Client.js +5 -4
- package/dist/api/resources/score/client/Client.d.ts +7 -5
- package/dist/api/resources/score/client/Client.js +15 -13
- package/dist/api/resources/score/client/requests/ScoreCreateParams.d.ts +1 -0
- package/dist/api/resources/testcase/client/Client.d.ts +10 -10
- package/dist/api/resources/testcase/client/Client.js +29 -22
- package/dist/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +3 -4
- 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 +3 -1
- package/dist/api/resources/testrecord/client/Client.js +11 -9
- package/dist/api/resources/testset/client/Client.d.ts +6 -4
- package/dist/api/resources/testset/client/Client.js +29 -24
- package/dist/api/resources/testset/client/requests/TestsetGetTestcasesRequest.d.ts +6 -0
- package/dist/api/resources/traces/client/Client.d.ts +2 -0
- package/dist/api/resources/traces/client/Client.js +5 -4
- package/dist/api/types/Grade.d.ts +2 -0
- package/dist/api/types/PaginatedTestcaseResponse.d.ts +1 -0
- package/dist/api/types/TestCase.d.ts +2 -0
- package/dist/api/types/TestCaseCustomInputsValue.d.ts +1 -1
- package/dist/api/types/TestCaseCustomLabelsValue.d.ts +1 -1
- package/dist/api/types/TestcaseDeletionResponse.d.ts +9 -0
- package/dist/api/types/TestcaseDeletionResponse.js +5 -0
- package/dist/api/types/Testrecord.d.ts +0 -1
- package/dist/api/types/index.d.ts +1 -0
- package/dist/api/types/index.js +1 -0
- package/dist/core/fetcher/Fetcher.d.ts +1 -0
- package/dist/core/fetcher/Fetcher.js +58 -7
- package/dist/serialization/resources/prompt/client/index.d.ts +0 -3
- package/dist/serialization/resources/prompt/client/index.js +0 -16
- package/dist/serialization/resources/prompt/client/requests/PromptUpdateParams.d.ts +0 -1
- package/dist/serialization/resources/prompt/client/requests/PromptUpdateParams.js +0 -1
- package/dist/serialization/resources/run/client/requests/UpdateStatusParams.d.ts +1 -1
- package/dist/serialization/resources/run/client/requests/UpdateStatusParams.js +1 -1
- package/dist/serialization/resources/testcase/client/requests/TestcaseCreateParams.d.ts +1 -1
- package/dist/serialization/resources/testcase/client/requests/TestcaseCreateParams.js +1 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +1 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +4 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +1 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +4 -1
- package/dist/serialization/types/TestCaseCustomInputsValue.d.ts +1 -1
- package/dist/serialization/types/TestCaseCustomInputsValue.js +4 -1
- package/dist/serialization/types/TestCaseCustomLabelsValue.d.ts +1 -1
- package/dist/serialization/types/TestCaseCustomLabelsValue.js +4 -1
- package/dist/serialization/types/TestcaseDeletionResponse.d.ts +13 -0
- package/dist/serialization/{resources/prompt/client/getRoots.js → types/TestcaseDeletionResponse.js} +6 -4
- package/dist/serialization/types/Testrecord.d.ts +0 -1
- package/dist/serialization/types/Testrecord.js +0 -1
- package/dist/serialization/types/index.d.ts +1 -0
- package/dist/serialization/types/index.js +1 -0
- package/dist/telemetry.d.ts +6 -0
- package/dist/telemetry.js +65 -0
- package/dist/wrapper/ScorecardClient.d.ts +4 -0
- package/dist/wrapper/ScorecardClient.js +4 -6
- package/package.json +56 -2
- package/reference.md +38 -189
- package/serialization/resources/prompt/client/index.d.ts +0 -3
- package/serialization/resources/prompt/client/index.js +0 -16
- package/serialization/resources/prompt/client/requests/PromptUpdateParams.d.ts +0 -1
- package/serialization/resources/prompt/client/requests/PromptUpdateParams.js +0 -1
- package/serialization/resources/run/client/requests/UpdateStatusParams.d.ts +1 -1
- package/serialization/resources/run/client/requests/UpdateStatusParams.js +1 -1
- package/serialization/resources/testcase/client/requests/TestcaseCreateParams.d.ts +1 -1
- package/serialization/resources/testcase/client/requests/TestcaseCreateParams.js +1 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +1 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +4 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +1 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +4 -1
- package/serialization/types/TestCaseCustomInputsValue.d.ts +1 -1
- package/serialization/types/TestCaseCustomInputsValue.js +4 -1
- package/serialization/types/TestCaseCustomLabelsValue.d.ts +1 -1
- package/serialization/types/TestCaseCustomLabelsValue.js +4 -1
- package/serialization/types/TestcaseDeletionResponse.d.ts +13 -0
- package/{dist/serialization/resources/prompt/client/getGraph.js → serialization/types/TestcaseDeletionResponse.js} +6 -4
- package/serialization/types/Testrecord.d.ts +0 -1
- package/serialization/types/Testrecord.js +0 -1
- package/serialization/types/index.d.ts +1 -0
- package/serialization/types/index.js +1 -0
- package/telemetry.d.ts +6 -0
- package/telemetry.js +65 -0
- package/wrapper/ScorecardClient.d.ts +4 -0
- package/wrapper/ScorecardClient.js +4 -6
- package/dist/serialization/resources/prompt/client/getGraph.d.ts +0 -11
- package/dist/serialization/resources/prompt/client/getProds.d.ts +0 -11
- package/dist/serialization/resources/prompt/client/getProds.js +0 -32
- package/dist/serialization/resources/prompt/client/getRoots.d.ts +0 -11
- package/serialization/resources/prompt/client/getGraph.d.ts +0 -11
- package/serialization/resources/prompt/client/getGraph.js +0 -32
- package/serialization/resources/prompt/client/getProds.d.ts +0 -11
- package/serialization/resources/prompt/client/getProds.js +0 -32
- package/serialization/resources/prompt/client/getRoots.d.ts +0 -11
- package/serialization/resources/prompt/client/getRoots.js +0 -32
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scorecard-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": "https://github.com/scorecard-ai/scorecard-node",
|
|
6
6
|
"license": "See LICENSE",
|
|
@@ -19,6 +19,50 @@
|
|
|
19
19
|
"node-fetch": "2.7.0",
|
|
20
20
|
"qs": "6.11.2"
|
|
21
21
|
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"@arizeai/openinference-instrumentation-langchain": "^0.0.5",
|
|
24
|
+
"@arizeai/openinference-instrumentation-openai": "^0.2.0",
|
|
25
|
+
"@langchain/core": "^0.1.63",
|
|
26
|
+
"@opentelemetry/api": "*",
|
|
27
|
+
"@opentelemetry/exporter-trace-otlp-http": "*",
|
|
28
|
+
"@opentelemetry/instrumentation": ">=0.40.0",
|
|
29
|
+
"@opentelemetry/resources": "*",
|
|
30
|
+
"@opentelemetry/sdk-trace-node": "*",
|
|
31
|
+
"@opentelemetry/semantic-conventions": "*",
|
|
32
|
+
"openai": "^4.47.1"
|
|
33
|
+
},
|
|
34
|
+
"peerDependenciesMeta": {
|
|
35
|
+
"@arizeai/openinference-instrumentation-langchain": {
|
|
36
|
+
"optional": false
|
|
37
|
+
},
|
|
38
|
+
"@arizeai/openinference-instrumentation-openai": {
|
|
39
|
+
"optional": false
|
|
40
|
+
},
|
|
41
|
+
"@langchain/core": {
|
|
42
|
+
"optional": true
|
|
43
|
+
},
|
|
44
|
+
"@opentelemetry/api": {
|
|
45
|
+
"optional": false
|
|
46
|
+
},
|
|
47
|
+
"@opentelemetry/exporter-trace-otlp-http": {
|
|
48
|
+
"optional": false
|
|
49
|
+
},
|
|
50
|
+
"@opentelemetry/instrumentation": {
|
|
51
|
+
"optional": false
|
|
52
|
+
},
|
|
53
|
+
"@opentelemetry/resources": {
|
|
54
|
+
"optional": false
|
|
55
|
+
},
|
|
56
|
+
"@opentelemetry/sdk-trace-node": {
|
|
57
|
+
"optional": false
|
|
58
|
+
},
|
|
59
|
+
"@opentelemetry/semantic-conventions": {
|
|
60
|
+
"optional": false
|
|
61
|
+
},
|
|
62
|
+
"openai": {
|
|
63
|
+
"optional": true
|
|
64
|
+
}
|
|
65
|
+
},
|
|
22
66
|
"devDependencies": {
|
|
23
67
|
"@types/url-join": "4.0.1",
|
|
24
68
|
"@types/qs": "6.9.8",
|
|
@@ -29,6 +73,16 @@
|
|
|
29
73
|
"jest-environment-jsdom": "29.7.0",
|
|
30
74
|
"@types/node": "17.0.33",
|
|
31
75
|
"prettier": "2.7.1",
|
|
32
|
-
"typescript": "4.6.4"
|
|
76
|
+
"typescript": "4.6.4",
|
|
77
|
+
"@arizeai/openinference-instrumentation-langchain": "^0.0.5",
|
|
78
|
+
"@arizeai/openinference-instrumentation-openai": "^0.2.0",
|
|
79
|
+
"@langchain/core": "^0.1.63",
|
|
80
|
+
"@opentelemetry/api": "latest",
|
|
81
|
+
"@opentelemetry/exporter-trace-otlp-http": "latest",
|
|
82
|
+
"@opentelemetry/instrumentation": "latest",
|
|
83
|
+
"@opentelemetry/resources": "latest",
|
|
84
|
+
"@opentelemetry/sdk-trace-node": "latest",
|
|
85
|
+
"@opentelemetry/semantic-conventions": "latest",
|
|
86
|
+
"openai": "^4.47.1"
|
|
33
87
|
}
|
|
34
88
|
}
|
package/reference.md
CHANGED
|
@@ -58,7 +58,7 @@ await scorecard.testset.get(1);
|
|
|
58
58
|
|
|
59
59
|
<dd>
|
|
60
60
|
|
|
61
|
-
**testsetId: `number`**
|
|
61
|
+
**testsetId: `number`** — The ID of the Testset to retrieve.
|
|
62
62
|
|
|
63
63
|
</dd>
|
|
64
64
|
|
|
@@ -141,7 +141,7 @@ await scorecard.testset.delete(1);
|
|
|
141
141
|
|
|
142
142
|
<dd>
|
|
143
143
|
|
|
144
|
-
**testsetId: `number`**
|
|
144
|
+
**testsetId: `number`** — The ID of the Testset to delete.
|
|
145
145
|
|
|
146
146
|
</dd>
|
|
147
147
|
|
|
@@ -309,7 +309,7 @@ await scorecard.testset.readSchema(1);
|
|
|
309
309
|
|
|
310
310
|
<dd>
|
|
311
311
|
|
|
312
|
-
**testsetId: `number`**
|
|
312
|
+
**testsetId: `number`** — The ID of the Testset to retrieve the schema from.
|
|
313
313
|
|
|
314
314
|
</dd>
|
|
315
315
|
|
|
@@ -392,7 +392,7 @@ await scorecard.testset.getTestcases(1);
|
|
|
392
392
|
|
|
393
393
|
<dd>
|
|
394
394
|
|
|
395
|
-
**testsetId: `number`**
|
|
395
|
+
**testsetId: `number`** — The Testset ID to retrieve testcases from.
|
|
396
396
|
|
|
397
397
|
</dd>
|
|
398
398
|
|
|
@@ -466,9 +466,7 @@ Create a new Testcase
|
|
|
466
466
|
<dd>
|
|
467
467
|
|
|
468
468
|
```ts
|
|
469
|
-
await scorecard.testcase.create(1
|
|
470
|
-
userQuery: "user_query",
|
|
471
|
-
});
|
|
469
|
+
await scorecard.testcase.create(1);
|
|
472
470
|
```
|
|
473
471
|
|
|
474
472
|
</dd>
|
|
@@ -489,7 +487,7 @@ await scorecard.testcase.create(1, {
|
|
|
489
487
|
|
|
490
488
|
<dd>
|
|
491
489
|
|
|
492
|
-
**testsetId: `number`**
|
|
490
|
+
**testsetId: `number`** — The ID of the Testset to create the Testcase in.
|
|
493
491
|
|
|
494
492
|
</dd>
|
|
495
493
|
|
|
@@ -582,7 +580,7 @@ await scorecard.testcase.get(1, 1);
|
|
|
582
580
|
|
|
583
581
|
<dd>
|
|
584
582
|
|
|
585
|
-
**testcaseId: `number`**
|
|
583
|
+
**testcaseId: `number`** — The ID of the Testcase to retrieve.
|
|
586
584
|
|
|
587
585
|
</dd>
|
|
588
586
|
|
|
@@ -592,7 +590,7 @@ await scorecard.testcase.get(1, 1);
|
|
|
592
590
|
|
|
593
591
|
<dd>
|
|
594
592
|
|
|
595
|
-
**testsetId: `number`**
|
|
593
|
+
**testsetId: `number`** — The ID of the Testset to retrieve the Testcase from.
|
|
596
594
|
|
|
597
595
|
</dd>
|
|
598
596
|
|
|
@@ -617,7 +615,7 @@ await scorecard.testcase.get(1, 1);
|
|
|
617
615
|
</dl>
|
|
618
616
|
</details>
|
|
619
617
|
|
|
620
|
-
<details><summary> <code>scorecard.testcase.<a href="./src/api/resources/testcase/client/Client.ts">delete</a>(testcaseId, testsetId) ->
|
|
618
|
+
<details><summary> <code>scorecard.testcase.<a href="./src/api/resources/testcase/client/Client.ts">delete</a>(testcaseId, testsetId) -> Scorecard.TestcaseDeletionResponse</code> </summary>
|
|
621
619
|
|
|
622
620
|
<dl>
|
|
623
621
|
|
|
@@ -675,7 +673,7 @@ await scorecard.testcase.delete(1, 1);
|
|
|
675
673
|
|
|
676
674
|
<dd>
|
|
677
675
|
|
|
678
|
-
**testcaseId: `number`**
|
|
676
|
+
**testcaseId: `number`** — The ID of the Testcase to delete.
|
|
679
677
|
|
|
680
678
|
</dd>
|
|
681
679
|
|
|
@@ -685,7 +683,7 @@ await scorecard.testcase.delete(1, 1);
|
|
|
685
683
|
|
|
686
684
|
<dd>
|
|
687
685
|
|
|
688
|
-
**testsetId: `number`**
|
|
686
|
+
**testsetId: `number`** — The ID of the Testset to delete the Testcase from.
|
|
689
687
|
|
|
690
688
|
</dd>
|
|
691
689
|
|
|
@@ -863,7 +861,7 @@ await scorecard.testrecord.create(1);
|
|
|
863
861
|
|
|
864
862
|
<dd>
|
|
865
863
|
|
|
866
|
-
**runId: `number`**
|
|
864
|
+
**runId: `number`** — The ID of the Run to create the Testrecord in.
|
|
867
865
|
|
|
868
866
|
</dd>
|
|
869
867
|
|
|
@@ -937,15 +935,7 @@ Create a new Run
|
|
|
937
935
|
<dd>
|
|
938
936
|
|
|
939
937
|
```ts
|
|
940
|
-
await scorecard.run.create(
|
|
941
|
-
testsetId: 1,
|
|
942
|
-
status: "RUNNING_EXECUTION",
|
|
943
|
-
modelParams: {
|
|
944
|
-
param1: "value1",
|
|
945
|
-
param2: "value2",
|
|
946
|
-
},
|
|
947
|
-
metrics: [1, 2],
|
|
948
|
-
});
|
|
938
|
+
await scorecard.run.create();
|
|
949
939
|
```
|
|
950
940
|
|
|
951
941
|
</dd>
|
|
@@ -1111,9 +1101,7 @@ Update the status of a run.
|
|
|
1111
1101
|
<dd>
|
|
1112
1102
|
|
|
1113
1103
|
```ts
|
|
1114
|
-
await scorecard.run.updateStatus(1
|
|
1115
|
-
status: Scorecard.RunStatus.Pending,
|
|
1116
|
-
});
|
|
1104
|
+
await scorecard.run.updateStatus(1);
|
|
1117
1105
|
```
|
|
1118
1106
|
|
|
1119
1107
|
</dd>
|
|
@@ -1231,7 +1219,7 @@ await scorecard.score.create(1, 1, {
|
|
|
1231
1219
|
|
|
1232
1220
|
<dd>
|
|
1233
1221
|
|
|
1234
|
-
**runId: `number`**
|
|
1222
|
+
**runId: `number`** — The ID of the run that created the testrecord to be scored.
|
|
1235
1223
|
|
|
1236
1224
|
</dd>
|
|
1237
1225
|
|
|
@@ -1241,7 +1229,7 @@ await scorecard.score.create(1, 1, {
|
|
|
1241
1229
|
|
|
1242
1230
|
<dd>
|
|
1243
1231
|
|
|
1244
|
-
**testrecordId: `number`**
|
|
1232
|
+
**testrecordId: `number`** — The ID of the testrecord to be scored.
|
|
1245
1233
|
|
|
1246
1234
|
</dd>
|
|
1247
1235
|
|
|
@@ -1334,7 +1322,7 @@ await scorecard.score.update(1, 1, 1);
|
|
|
1334
1322
|
|
|
1335
1323
|
<dd>
|
|
1336
1324
|
|
|
1337
|
-
**runId: `number`**
|
|
1325
|
+
**runId: `number`** — The run ID that created the test record to be scored.
|
|
1338
1326
|
|
|
1339
1327
|
</dd>
|
|
1340
1328
|
|
|
@@ -1344,7 +1332,7 @@ await scorecard.score.update(1, 1, 1);
|
|
|
1344
1332
|
|
|
1345
1333
|
<dd>
|
|
1346
1334
|
|
|
1347
|
-
**testrecordId: `number`**
|
|
1335
|
+
**testrecordId: `number`** — The ID of the testrecord whose score will be updated.
|
|
1348
1336
|
|
|
1349
1337
|
</dd>
|
|
1350
1338
|
|
|
@@ -1354,7 +1342,7 @@ await scorecard.score.update(1, 1, 1);
|
|
|
1354
1342
|
|
|
1355
1343
|
<dd>
|
|
1356
1344
|
|
|
1357
|
-
**scoreId: `number`**
|
|
1345
|
+
**scoreId: `number`** — The ID of the score to be updated.
|
|
1358
1346
|
|
|
1359
1347
|
</dd>
|
|
1360
1348
|
|
|
@@ -1577,7 +1565,11 @@ await scorecard.traces.get("trace_id");
|
|
|
1577
1565
|
|
|
1578
1566
|
<dd>
|
|
1579
1567
|
|
|
1580
|
-
|
|
1568
|
+
Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in app).
|
|
1569
|
+
|
|
1570
|
+
A root prompt can be created by providing the `name` param, and it will always be tagged as prod.
|
|
1571
|
+
|
|
1572
|
+
A child prompt can be created by providing the `parent_id` param. Note that the `name` param in this case will be ignored as all descendents from a root prompt would share the root's name. `is_prod` can also be provided to configure whether a child should be tagged as prod.
|
|
1581
1573
|
|
|
1582
1574
|
</dd>
|
|
1583
1575
|
|
|
@@ -1599,7 +1591,8 @@ Create a new prompt
|
|
|
1599
1591
|
|
|
1600
1592
|
```ts
|
|
1601
1593
|
await scorecard.prompt.create({
|
|
1602
|
-
promptTemplate:
|
|
1594
|
+
promptTemplate:
|
|
1595
|
+
"<system>\nYou are a helpful assistant. Use the provided context to answer the user's query.\n\nContext: {context}\n</system>\n\n<user>\n{user_query}\n</user>",
|
|
1603
1596
|
name: "Prompt Name",
|
|
1604
1597
|
description: "Description of the prompt",
|
|
1605
1598
|
modelParams: {
|
|
@@ -1654,7 +1647,7 @@ await scorecard.prompt.create({
|
|
|
1654
1647
|
</dl>
|
|
1655
1648
|
</details>
|
|
1656
1649
|
|
|
1657
|
-
<details><summary> <code>scorecard.prompt.<a href="./src/api/resources/prompt/client/Client.ts">
|
|
1650
|
+
<details><summary> <code>scorecard.prompt.<a href="./src/api/resources/prompt/client/Client.ts">get</a>(id) -> Scorecard.Prompt</code> </summary>
|
|
1658
1651
|
|
|
1659
1652
|
<dl>
|
|
1660
1653
|
|
|
@@ -1670,7 +1663,7 @@ await scorecard.prompt.create({
|
|
|
1670
1663
|
|
|
1671
1664
|
<dd>
|
|
1672
1665
|
|
|
1673
|
-
Retrieve
|
|
1666
|
+
Retrieve a prompt by id
|
|
1674
1667
|
|
|
1675
1668
|
</dd>
|
|
1676
1669
|
|
|
@@ -1691,7 +1684,7 @@ Retrieve active root prompts for the org
|
|
|
1691
1684
|
<dd>
|
|
1692
1685
|
|
|
1693
1686
|
```ts
|
|
1694
|
-
await scorecard.prompt.
|
|
1687
|
+
await scorecard.prompt.get("id");
|
|
1695
1688
|
```
|
|
1696
1689
|
|
|
1697
1690
|
</dd>
|
|
@@ -1712,75 +1705,12 @@ await scorecard.prompt.getRoots();
|
|
|
1712
1705
|
|
|
1713
1706
|
<dd>
|
|
1714
1707
|
|
|
1715
|
-
**
|
|
1716
|
-
|
|
1717
|
-
</dd>
|
|
1718
|
-
|
|
1719
|
-
</dl>
|
|
1720
|
-
|
|
1721
|
-
</dd>
|
|
1722
|
-
|
|
1723
|
-
</dl>
|
|
1724
|
-
|
|
1725
|
-
</dd>
|
|
1726
|
-
|
|
1727
|
-
</dl>
|
|
1728
|
-
</details>
|
|
1729
|
-
|
|
1730
|
-
<details><summary> <code>scorecard.prompt.<a href="./src/api/resources/prompt/client/Client.ts">getProds</a>() -> Scorecard.Prompt[]</code> </summary>
|
|
1731
|
-
|
|
1732
|
-
<dl>
|
|
1733
|
-
|
|
1734
|
-
<dd>
|
|
1735
|
-
|
|
1736
|
-
#### 📝 Description
|
|
1737
|
-
|
|
1738
|
-
<dl>
|
|
1739
|
-
|
|
1740
|
-
<dd>
|
|
1741
|
-
|
|
1742
|
-
<dl>
|
|
1743
|
-
|
|
1744
|
-
<dd>
|
|
1745
|
-
|
|
1746
|
-
Retrieve prod prompts for the org
|
|
1747
|
-
|
|
1748
|
-
</dd>
|
|
1749
|
-
|
|
1750
|
-
</dl>
|
|
1751
|
-
|
|
1752
|
-
</dd>
|
|
1753
|
-
|
|
1754
|
-
</dl>
|
|
1755
|
-
|
|
1756
|
-
#### 🔌 Usage
|
|
1757
|
-
|
|
1758
|
-
<dl>
|
|
1759
|
-
|
|
1760
|
-
<dd>
|
|
1761
|
-
|
|
1762
|
-
<dl>
|
|
1763
|
-
|
|
1764
|
-
<dd>
|
|
1765
|
-
|
|
1766
|
-
```ts
|
|
1767
|
-
await scorecard.prompt.getProds();
|
|
1768
|
-
```
|
|
1769
|
-
|
|
1770
|
-
</dd>
|
|
1771
|
-
|
|
1772
|
-
</dl>
|
|
1708
|
+
**id: `string`** — The id of the prompt to get.
|
|
1773
1709
|
|
|
1774
1710
|
</dd>
|
|
1775
1711
|
|
|
1776
1712
|
</dl>
|
|
1777
1713
|
|
|
1778
|
-
#### ⚙️ Parameters
|
|
1779
|
-
|
|
1780
|
-
<dl>
|
|
1781
|
-
|
|
1782
|
-
<dd>
|
|
1783
|
-
|
|
1784
1714
|
<dl>
|
|
1785
1715
|
|
|
1786
1716
|
<dd>
|
|
@@ -1800,7 +1730,7 @@ await scorecard.prompt.getProds();
|
|
|
1800
1730
|
</dl>
|
|
1801
1731
|
</details>
|
|
1802
1732
|
|
|
1803
|
-
<details><summary> <code>scorecard.prompt.<a href="./src/api/resources/prompt/client/Client.ts">
|
|
1733
|
+
<details><summary> <code>scorecard.prompt.<a href="./src/api/resources/prompt/client/Client.ts">delete</a>(id) -> unknown</code> </summary>
|
|
1804
1734
|
|
|
1805
1735
|
<dl>
|
|
1806
1736
|
|
|
@@ -1816,7 +1746,7 @@ await scorecard.prompt.getProds();
|
|
|
1816
1746
|
|
|
1817
1747
|
<dd>
|
|
1818
1748
|
|
|
1819
|
-
|
|
1749
|
+
Delete a root prompt and all of its children.
|
|
1820
1750
|
|
|
1821
1751
|
</dd>
|
|
1822
1752
|
|
|
@@ -1837,7 +1767,7 @@ Retrieve a prompt by id
|
|
|
1837
1767
|
<dd>
|
|
1838
1768
|
|
|
1839
1769
|
```ts
|
|
1840
|
-
await scorecard.prompt.
|
|
1770
|
+
await scorecard.prompt.delete("id");
|
|
1841
1771
|
```
|
|
1842
1772
|
|
|
1843
1773
|
</dd>
|
|
@@ -1858,7 +1788,7 @@ await scorecard.prompt.get("id");
|
|
|
1858
1788
|
|
|
1859
1789
|
<dd>
|
|
1860
1790
|
|
|
1861
|
-
**id: `string`** — The id of the prompt to
|
|
1791
|
+
**id: `string`** — The id of the root prompt to delete.
|
|
1862
1792
|
|
|
1863
1793
|
</dd>
|
|
1864
1794
|
|
|
@@ -1899,7 +1829,9 @@ await scorecard.prompt.get("id");
|
|
|
1899
1829
|
|
|
1900
1830
|
<dd>
|
|
1901
1831
|
|
|
1902
|
-
Update a prompt
|
|
1832
|
+
Update a prompt.
|
|
1833
|
+
|
|
1834
|
+
`is_prod` tags the provided prompt as the production prompt within the prompt graph.
|
|
1903
1835
|
|
|
1904
1836
|
</dd>
|
|
1905
1837
|
|
|
@@ -1921,7 +1853,7 @@ Update a prompt
|
|
|
1921
1853
|
|
|
1922
1854
|
```ts
|
|
1923
1855
|
await scorecard.prompt.update("id", {
|
|
1924
|
-
|
|
1856
|
+
isProd: true,
|
|
1925
1857
|
});
|
|
1926
1858
|
```
|
|
1927
1859
|
|
|
@@ -2060,86 +1992,3 @@ await scorecard.prompt.getByName("name");
|
|
|
2060
1992
|
|
|
2061
1993
|
</dl>
|
|
2062
1994
|
</details>
|
|
2063
|
-
|
|
2064
|
-
<details><summary> <code>scorecard.prompt.<a href="./src/api/resources/prompt/client/Client.ts">getGraph</a>(id) -> Scorecard.Prompt[]</code> </summary>
|
|
2065
|
-
|
|
2066
|
-
<dl>
|
|
2067
|
-
|
|
2068
|
-
<dd>
|
|
2069
|
-
|
|
2070
|
-
#### 📝 Description
|
|
2071
|
-
|
|
2072
|
-
<dl>
|
|
2073
|
-
|
|
2074
|
-
<dd>
|
|
2075
|
-
|
|
2076
|
-
<dl>
|
|
2077
|
-
|
|
2078
|
-
<dd>
|
|
2079
|
-
|
|
2080
|
-
Retrieve all nodes within the same graph as the prompt, sorted by created_at desc
|
|
2081
|
-
|
|
2082
|
-
</dd>
|
|
2083
|
-
|
|
2084
|
-
</dl>
|
|
2085
|
-
|
|
2086
|
-
</dd>
|
|
2087
|
-
|
|
2088
|
-
</dl>
|
|
2089
|
-
|
|
2090
|
-
#### 🔌 Usage
|
|
2091
|
-
|
|
2092
|
-
<dl>
|
|
2093
|
-
|
|
2094
|
-
<dd>
|
|
2095
|
-
|
|
2096
|
-
<dl>
|
|
2097
|
-
|
|
2098
|
-
<dd>
|
|
2099
|
-
|
|
2100
|
-
```ts
|
|
2101
|
-
await scorecard.prompt.getGraph("id");
|
|
2102
|
-
```
|
|
2103
|
-
|
|
2104
|
-
</dd>
|
|
2105
|
-
|
|
2106
|
-
</dl>
|
|
2107
|
-
|
|
2108
|
-
</dd>
|
|
2109
|
-
|
|
2110
|
-
</dl>
|
|
2111
|
-
|
|
2112
|
-
#### ⚙️ Parameters
|
|
2113
|
-
|
|
2114
|
-
<dl>
|
|
2115
|
-
|
|
2116
|
-
<dd>
|
|
2117
|
-
|
|
2118
|
-
<dl>
|
|
2119
|
-
|
|
2120
|
-
<dd>
|
|
2121
|
-
|
|
2122
|
-
**id: `string`** — The id of the prompt.
|
|
2123
|
-
|
|
2124
|
-
</dd>
|
|
2125
|
-
|
|
2126
|
-
</dl>
|
|
2127
|
-
|
|
2128
|
-
<dl>
|
|
2129
|
-
|
|
2130
|
-
<dd>
|
|
2131
|
-
|
|
2132
|
-
**requestOptions: `Prompt.RequestOptions`**
|
|
2133
|
-
|
|
2134
|
-
</dd>
|
|
2135
|
-
|
|
2136
|
-
</dl>
|
|
2137
|
-
|
|
2138
|
-
</dd>
|
|
2139
|
-
|
|
2140
|
-
</dl>
|
|
2141
|
-
|
|
2142
|
-
</dd>
|
|
2143
|
-
|
|
2144
|
-
</dl>
|
|
2145
|
-
</details>
|
|
@@ -10,24 +10,8 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
15
|
};
|
|
28
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.getGraph = exports.getProds = exports.getRoots = void 0;
|
|
30
|
-
exports.getRoots = __importStar(require("./getRoots"));
|
|
31
|
-
exports.getProds = __importStar(require("./getProds"));
|
|
32
|
-
exports.getGraph = __importStar(require("./getGraph"));
|
|
33
17
|
__exportStar(require("./requests"), exports);
|
|
@@ -7,7 +7,6 @@ import * as core from "../../../../../core";
|
|
|
7
7
|
export declare const PromptUpdateParams: core.serialization.Schema<serializers.PromptUpdateParams.Raw, Scorecard.PromptUpdateParams>;
|
|
8
8
|
export declare namespace PromptUpdateParams {
|
|
9
9
|
interface Raw {
|
|
10
|
-
is_archived?: boolean | null;
|
|
11
10
|
is_prod?: boolean | null;
|
|
12
11
|
}
|
|
13
12
|
}
|
|
@@ -29,6 +29,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.PromptUpdateParams = void 0;
|
|
30
30
|
const core = __importStar(require("../../../../../core"));
|
|
31
31
|
exports.PromptUpdateParams = core.serialization.object({
|
|
32
|
-
isArchived: core.serialization.property("is_archived", core.serialization.boolean().optional()),
|
|
33
32
|
isProd: core.serialization.property("is_prod", core.serialization.boolean().optional()),
|
|
34
33
|
});
|
|
@@ -8,6 +8,6 @@ import { RunStatus } from "../../../../types/RunStatus";
|
|
|
8
8
|
export declare const UpdateStatusParams: core.serialization.Schema<serializers.UpdateStatusParams.Raw, Scorecard.UpdateStatusParams>;
|
|
9
9
|
export declare namespace UpdateStatusParams {
|
|
10
10
|
interface Raw {
|
|
11
|
-
status
|
|
11
|
+
status?: RunStatus.Raw | null;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -30,5 +30,5 @@ exports.UpdateStatusParams = void 0;
|
|
|
30
30
|
const core = __importStar(require("../../../../../core"));
|
|
31
31
|
const RunStatus_1 = require("../../../../types/RunStatus");
|
|
32
32
|
exports.UpdateStatusParams = core.serialization.object({
|
|
33
|
-
status: RunStatus_1.RunStatus,
|
|
33
|
+
status: RunStatus_1.RunStatus.optional(),
|
|
34
34
|
});
|
|
@@ -9,7 +9,7 @@ import { TestcaseCreateParamsCustomLabelsValue } from "../../types/TestcaseCreat
|
|
|
9
9
|
export declare const TestcaseCreateParams: core.serialization.Schema<serializers.TestcaseCreateParams.Raw, Scorecard.TestcaseCreateParams>;
|
|
10
10
|
export declare namespace TestcaseCreateParams {
|
|
11
11
|
interface Raw {
|
|
12
|
-
user_query
|
|
12
|
+
user_query?: string | null;
|
|
13
13
|
context?: string | null;
|
|
14
14
|
ideal?: string | null;
|
|
15
15
|
custom_inputs?: Record<string, TestcaseCreateParamsCustomInputsValue.Raw | null | undefined> | null;
|
|
@@ -31,7 +31,7 @@ const core = __importStar(require("../../../../../core"));
|
|
|
31
31
|
const TestcaseCreateParamsCustomInputsValue_1 = require("../../types/TestcaseCreateParamsCustomInputsValue");
|
|
32
32
|
const TestcaseCreateParamsCustomLabelsValue_1 = require("../../types/TestcaseCreateParamsCustomLabelsValue");
|
|
33
33
|
exports.TestcaseCreateParams = core.serialization.object({
|
|
34
|
-
userQuery: core.serialization.property("user_query", core.serialization.string()),
|
|
34
|
+
userQuery: core.serialization.property("user_query", core.serialization.string().optional()),
|
|
35
35
|
context: core.serialization.string().optional(),
|
|
36
36
|
ideal: core.serialization.string().optional(),
|
|
37
37
|
customInputs: core.serialization.property("custom_inputs", core.serialization
|
|
@@ -7,5 +7,5 @@ import * as core from "../../../../core";
|
|
|
7
7
|
import { FileUrl } from "../../../types/FileUrl";
|
|
8
8
|
export declare const TestcaseCreateParamsCustomInputsValue: core.serialization.Schema<serializers.TestcaseCreateParamsCustomInputsValue.Raw, Scorecard.TestcaseCreateParamsCustomInputsValue>;
|
|
9
9
|
export declare namespace TestcaseCreateParamsCustomInputsValue {
|
|
10
|
-
type Raw =
|
|
10
|
+
type Raw = FileUrl.Raw | serializers.JsonObject.Raw | string | number | number | boolean;
|
|
11
11
|
}
|
|
@@ -39,7 +39,10 @@ exports.TestcaseCreateParamsCustomInputsValue = void 0;
|
|
|
39
39
|
const core = __importStar(require("../../../../core"));
|
|
40
40
|
const FileUrl_1 = require("../../../types/FileUrl");
|
|
41
41
|
exports.TestcaseCreateParamsCustomInputsValue = core.serialization.undiscriminatedUnion([
|
|
42
|
-
core.serialization.string(),
|
|
43
42
|
FileUrl_1.FileUrl,
|
|
44
43
|
core.serialization.lazyObject(() => __awaiter(void 0, void 0, void 0, function* () { return (yield Promise.resolve().then(() => __importStar(require("../../..")))).JsonObject; })),
|
|
44
|
+
core.serialization.string(),
|
|
45
|
+
core.serialization.number(),
|
|
46
|
+
core.serialization.number(),
|
|
47
|
+
core.serialization.boolean(),
|
|
45
48
|
]);
|
|
@@ -7,5 +7,5 @@ import * as core from "../../../../core";
|
|
|
7
7
|
import { FileUrl } from "../../../types/FileUrl";
|
|
8
8
|
export declare const TestcaseCreateParamsCustomLabelsValue: core.serialization.Schema<serializers.TestcaseCreateParamsCustomLabelsValue.Raw, Scorecard.TestcaseCreateParamsCustomLabelsValue>;
|
|
9
9
|
export declare namespace TestcaseCreateParamsCustomLabelsValue {
|
|
10
|
-
type Raw =
|
|
10
|
+
type Raw = FileUrl.Raw | serializers.JsonObject.Raw | string | number | number | boolean;
|
|
11
11
|
}
|
|
@@ -39,7 +39,10 @@ exports.TestcaseCreateParamsCustomLabelsValue = void 0;
|
|
|
39
39
|
const core = __importStar(require("../../../../core"));
|
|
40
40
|
const FileUrl_1 = require("../../../types/FileUrl");
|
|
41
41
|
exports.TestcaseCreateParamsCustomLabelsValue = core.serialization.undiscriminatedUnion([
|
|
42
|
-
core.serialization.string(),
|
|
43
42
|
FileUrl_1.FileUrl,
|
|
44
43
|
core.serialization.lazyObject(() => __awaiter(void 0, void 0, void 0, function* () { return (yield Promise.resolve().then(() => __importStar(require("../../..")))).JsonObject; })),
|
|
44
|
+
core.serialization.string(),
|
|
45
|
+
core.serialization.number(),
|
|
46
|
+
core.serialization.number(),
|
|
47
|
+
core.serialization.boolean(),
|
|
45
48
|
]);
|
|
@@ -7,5 +7,5 @@ import * as core from "../../core";
|
|
|
7
7
|
import { FileUrl } from "./FileUrl";
|
|
8
8
|
export declare const TestCaseCustomInputsValue: core.serialization.Schema<serializers.TestCaseCustomInputsValue.Raw, Scorecard.TestCaseCustomInputsValue>;
|
|
9
9
|
export declare namespace TestCaseCustomInputsValue {
|
|
10
|
-
type Raw =
|
|
10
|
+
type Raw = FileUrl.Raw | serializers.JsonObject.Raw | string | number | number | boolean;
|
|
11
11
|
}
|
|
@@ -39,7 +39,10 @@ exports.TestCaseCustomInputsValue = void 0;
|
|
|
39
39
|
const core = __importStar(require("../../core"));
|
|
40
40
|
const FileUrl_1 = require("./FileUrl");
|
|
41
41
|
exports.TestCaseCustomInputsValue = core.serialization.undiscriminatedUnion([
|
|
42
|
-
core.serialization.string(),
|
|
43
42
|
FileUrl_1.FileUrl,
|
|
44
43
|
core.serialization.lazyObject(() => __awaiter(void 0, void 0, void 0, function* () { return (yield Promise.resolve().then(() => __importStar(require("..")))).JsonObject; })),
|
|
44
|
+
core.serialization.string(),
|
|
45
|
+
core.serialization.number(),
|
|
46
|
+
core.serialization.number(),
|
|
47
|
+
core.serialization.boolean(),
|
|
45
48
|
]);
|
|
@@ -7,5 +7,5 @@ import * as core from "../../core";
|
|
|
7
7
|
import { FileUrl } from "./FileUrl";
|
|
8
8
|
export declare const TestCaseCustomLabelsValue: core.serialization.Schema<serializers.TestCaseCustomLabelsValue.Raw, Scorecard.TestCaseCustomLabelsValue>;
|
|
9
9
|
export declare namespace TestCaseCustomLabelsValue {
|
|
10
|
-
type Raw =
|
|
10
|
+
type Raw = FileUrl.Raw | serializers.JsonObject.Raw | string | number | number | boolean;
|
|
11
11
|
}
|