@toloka-platform/sdk 0.19.0 → 0.20.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/README.md +15 -13
- package/dist/cli/toloka.js +156 -152
- package/dist/cli/toloka.js.jsc +0 -0
- package/dist/cli/toloka.js.jsc.sha256 +1 -1
- package/dist/cli/toloka.js.sha256 +1 -1
- package/openapi/gen/api.schemas.ts +130 -0
- package/openapi/gen/api.ts +354 -0
- package/package.json +8 -7
- package/skills/catalog.json +6 -6
- package/skills/toloka-build/references/human-work.md +11 -0
- package/src/cli/commands/auth.ts +2 -2
- package/src/cli/commands/batch-inference.ts +5 -5
- package/src/cli/commands/config.ts +4 -3
- package/src/cli/commands/dataset.ts +2 -2
- package/src/cli/commands/expert-ban-list.ts +69 -0
- package/src/cli/commands/expert-list.ts +124 -0
- package/src/cli/commands/models.ts +1 -1
- package/src/cli/commands/pipeline.ts +1 -1
- package/src/cli/commands/report.ts +1 -1
- package/src/cli/commands/training.ts +16 -16
- package/src/cli/commands/ui.ts +1 -1
- package/src/cli/experts.ts +293 -0
- package/src/cli/program.ts +7 -3
- package/src/cli/project.ts +30 -1
- package/src/client.ts +43 -0
- package/src/pipeline-graph-v1.contract.json +64 -48
- package/src/transport.ts +18 -0
- package/docs/authoring.md +0 -320
- package/docs/cli-v2.md +0 -224
- package/docs/cli.md +0 -561
- package/docs/datasets.md +0 -213
- package/docs/getting-started.md +0 -147
- package/docs/limitations.md +0 -58
- package/docs/nodes.md +0 -104
- package/docs/testing-examples.md +0 -248
- package/docs/testing.md +0 -125
- package/docs/troubleshooting.md +0 -115
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toloka-platform/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Build, inspect, and operate Toloka pipeline projects as TypeScript source. The public API may change between minor versions before 1.0.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"README.md",
|
|
12
12
|
"bin",
|
|
13
|
-
"docs",
|
|
14
13
|
"dist",
|
|
15
14
|
"examples",
|
|
16
15
|
"openapi/gen",
|
|
@@ -34,6 +33,8 @@
|
|
|
34
33
|
"build": "bun ./scripts/build-cli.ts ./dist/cli",
|
|
35
34
|
"generate": "orval --config ./openapi/orval.config.js",
|
|
36
35
|
"generate:check": "bun ./scripts/check-generated-client.ts",
|
|
36
|
+
"docs:generate": "bun ./scripts/generate-docs-reference.ts",
|
|
37
|
+
"docs:check": "bun ./scripts/generate-docs-reference.ts --check",
|
|
37
38
|
"prepack": "bun run build",
|
|
38
39
|
"sync-skill-catalog": "bun ./scripts/sync-skill-catalog.ts",
|
|
39
40
|
"sync-task-ui-declarations": "bun ./scripts/sync-task-ui-declarations.ts",
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
},
|
|
44
45
|
"dependencies": {
|
|
45
46
|
"@inquirer/select": "5.2.1",
|
|
46
|
-
"@typescript/vfs": "1.6.
|
|
47
|
+
"@typescript/vfs": "1.6.5",
|
|
47
48
|
"ajv": "8.17.1",
|
|
48
49
|
"ajv-formats": "3.0.1",
|
|
49
50
|
"commander": "15.0.0",
|
|
@@ -56,13 +57,13 @@
|
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@types/node": "24.10.1",
|
|
58
59
|
"orval": "8.40.0",
|
|
59
|
-
"playwright": "1.
|
|
60
|
-
"typescript": "7.0
|
|
60
|
+
"playwright": "1.63.0",
|
|
61
|
+
"typescript": "7.1.0-beta",
|
|
61
62
|
"vitest": "4.1.0",
|
|
62
63
|
"yaml": "2.9.0"
|
|
63
64
|
},
|
|
64
65
|
"peerDependencies": {
|
|
65
|
-
"playwright": ">=1.
|
|
66
|
+
"playwright": ">=1.63.0 <2",
|
|
66
67
|
"vitest": ">=4.1.0 <5"
|
|
67
68
|
},
|
|
68
69
|
"peerDependenciesMeta": {
|
|
@@ -77,6 +78,6 @@
|
|
|
77
78
|
"bun": ">=1.4.0"
|
|
78
79
|
},
|
|
79
80
|
"tolokaBuild": {
|
|
80
|
-
"commit": "
|
|
81
|
+
"commit": "f0d62dc526a8897f20a7b3082b966ac1955897a5"
|
|
81
82
|
}
|
|
82
83
|
}
|
package/skills/catalog.json
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"testing",
|
|
12
12
|
"checks"
|
|
13
13
|
],
|
|
14
|
-
"version": "0.
|
|
15
|
-
"digest": "
|
|
14
|
+
"version": "0.20.0",
|
|
15
|
+
"digest": "f7d62bb54636b2653b9ee3afc4cad5c83440ebce712cf7296df314f27be2fbf3",
|
|
16
16
|
"files": [
|
|
17
17
|
"SKILL.md",
|
|
18
18
|
"references/human-work.md",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"bug",
|
|
34
34
|
"report"
|
|
35
35
|
],
|
|
36
|
-
"version": "0.
|
|
36
|
+
"version": "0.20.0",
|
|
37
37
|
"digest": "70f0bd2c80b32f87896aeb27c363b8a2d37f40e22424f57fe1aad142e125ad67",
|
|
38
38
|
"files": [
|
|
39
39
|
"SKILL.md",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"getting-started",
|
|
51
51
|
"agent"
|
|
52
52
|
],
|
|
53
|
-
"version": "0.
|
|
53
|
+
"version": "0.20.0",
|
|
54
54
|
"digest": "2278adeb46a792356579395fcf73c42322cb23bcd0c61e20856ccabdad6762d1",
|
|
55
55
|
"files": [
|
|
56
56
|
"SKILL.md"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"sft",
|
|
68
68
|
"models"
|
|
69
69
|
],
|
|
70
|
-
"version": "0.
|
|
70
|
+
"version": "0.20.0",
|
|
71
71
|
"digest": "3ce10dee5d3c283d8b5fdea15134a58fc738c7af2c1bb19eb5a0bf70ea0bca13",
|
|
72
72
|
"files": [
|
|
73
73
|
"SKILL.md"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"prompt",
|
|
85
85
|
"models"
|
|
86
86
|
],
|
|
87
|
-
"version": "0.
|
|
87
|
+
"version": "0.20.0",
|
|
88
88
|
"digest": "be8bce8d9cf7241ccb60d2b2a9b7cc07d7755a76e8ff8ec1b0847c49efbb3469",
|
|
89
89
|
"files": [
|
|
90
90
|
"SKILL.md"
|
|
@@ -63,6 +63,17 @@ You choose `pricePerTask`: apply accepts any value inside the audience's range a
|
|
|
63
63
|
|
|
64
64
|
Use `audienceType: 'synthetic'` only when the user explicitly asks for model-generated output instead of human work; otherwise the audience is human. Explain the quality and cost tradeoff when you set it up. Set the required `maxCostPerAttempt`, the per-attempt ceiling in charged US dollars across fresh input, cached input, and output together, and configure the optional `generationModelId`, `reasoningEffort`, and `llmInstruction`; do not include human pricing or audience fields. Pick the model, its reasoning effort and the budget from `toloka generation-model list`: copy `ID` into `generationModelId` (it must also be in the `generationModelId` union of the installed SDK; a newer model needs an SDK update), set `reasoningEffort` only for a model that lists reasoning efforts (apply rejects it on any other model), and keep `maxCostPerAttempt` between `MIN` and `MAX`, at or above `TYPICAL`. Use a model suited to the task when there is evidence for that choice, or omit `generationModelId` to use the default model the command names; do not guess IDs or capabilities. Synthetic generation is incompatible with `data_collection`, human QA, audience reuse, expert sourcing, and Training.
|
|
65
65
|
|
|
66
|
+
#### Expert lists and bans
|
|
67
|
+
|
|
68
|
+
Expert lists, expert bans, and the audience service are enabled for a team separately: `toloka expert-list` works only for teams with expert lists enabled, `toloka expert-ban-list` only for teams with expert bans enabled, and apply rejects `audienceMode: 'service'` unless the team also has the audience service enabled. Use them only when the user asks for a fixed set of experts or a ban.
|
|
69
|
+
|
|
70
|
+
- `audienceMode: 'service'` on a `generation` or `quorum` node switches it to the audience service; `'legacy'` (or omitting it on a new node) keeps audience filters and smart search. With the service, `audienceAndPricing.expertListId` takes the labeling experts from an expert list, and on `generation` `qualityAssurance.expertListId` does the same for human QA (`human_only` or `hybrid`). The audience filters then stop deciding who gets tasks; `pricePerTask`, `timeForTask`, and the per-expert cap still apply.
|
|
71
|
+
- Keep the settings `toloka import` wrote. Leaving a field out never detaches a list: plan shows no change for it, but apply rejects the whole graph while any node leaves out a setting the platform has, even when you only changed another node. Run `toloka import` to bring the settings into the source. To remove them, set `audienceMode: 'legacy'` and `expertListId: null` explicitly.
|
|
72
|
+
- Manage lists with `toloka expert-list`: `list`, `create <name>`, `add <list> --file ids.txt` (one expert ID per line), `remove`, `show <list>`, `experts <list>`, `rename`, `hide`, `unhide`. `<list>` is the `exl.` ID or the list name. Pass large ID sets with `--file`, never as thousands of arguments. Copy the `exl.` ID from `toloka expert-list list` into `expertListId`; an ID from another project is rejected.
|
|
73
|
+
- After adding experts, run `toloka expert-list show <list>` and report `AVAILABLE`. Availability is checked in the background, so `PENDING` drops over a few minutes. Apply rejects a node whose list has no available experts yet; wait until `AVAILABLE` is above 0, then apply. If few experts are available for the number of items, say so, and mention the per-expert cap when it is on. A hidden list keeps working in runs, but experts can't be added to or removed from it until it is unhidden.
|
|
74
|
+
- Don't use the same list for labeling and human QA: experts would review their own work, and validation warns about it.
|
|
75
|
+
- Ban experts from the project with `toloka expert-ban-list add <expertIds...> --reason <text>` (or `--file`), lift bans with `toloka expert-ban-list remove`, and see them with `toloka expert-ban-list show` and `toloka expert-ban-list experts`. Banned experts can't be invited and are removed from the work they are in, so confirm the expert IDs with the user before banning. Team-wide bans are managed in the platform UI only.
|
|
76
|
+
|
|
66
77
|
#### Training, Exam, UI, and advanced settings
|
|
67
78
|
|
|
68
79
|
Treat `onboarding` as the node's Training course. It has `enabled`, `steps`, and `info` (`estimatedTime`, `role`, `goal`, `successCriteria`). Give every new human node a real course built from the instruction, criteria, UI, edge cases, and verified examples; the constructor's placeholder, one text step without a quiz, is not one and fails the rules below. While it is enabled, validation requires non-empty `info.role`, `info.goal`, and `info.successCriteria`, three to six steps, and at least one quiz block; a course uses either a practice block or an examples block, not both, and an examples block needs a built UI. A practice block together with an enabled Exam draws a warning, because the Exam already tests experts on real tasks. Preserve an explicit `enabled: false`. Never invent golden answers or media URLs. Training teaches with retries; it is not an admission gate.
|
package/src/cli/commands/auth.ts
CHANGED
|
@@ -21,8 +21,8 @@ export const registerAuthCommands = (program: Command, host: CommandHost): void
|
|
|
21
21
|
program
|
|
22
22
|
.command("login")
|
|
23
23
|
.description("sign in through your browser, or store an API key, after verifying access")
|
|
24
|
-
.option("--browser", "sign in through your browser without asking;
|
|
25
|
-
.option("--no-browser", "
|
|
24
|
+
.option("--browser", "sign in through your browser without asking; choose a sign-in method on the page it opens")
|
|
25
|
+
.option("--no-browser", "print the browser sign-in link without asking or opening a browser")
|
|
26
26
|
.option("--api-key-stdin", "store an API key read from standard input instead", false)
|
|
27
27
|
.action(async (options: LoginCommandOptions) => {
|
|
28
28
|
const apiKey = options.apiKeyStdin ? (await context.io.readStdin()).trim() : globals().apiKey;
|
|
@@ -43,10 +43,10 @@ export const registerBatchInferenceCommands = (program: Command, host: CommandHo
|
|
|
43
43
|
"--split-column <name-or-id>",
|
|
44
44
|
"split column that --parts names, when the dataset has more than one",
|
|
45
45
|
)
|
|
46
|
-
.option("--base-model <id>", "catalog Base Model that answers", parseBaseModelId)
|
|
47
|
-
.option("--model-version <id>", "Model Version that answers: mdv.<id> or Model@name")
|
|
48
|
-
.option("--output-field <name>", "text
|
|
49
|
-
.option("--output-dataset <name>", "new dataset that receives the prompts and answers")
|
|
46
|
+
.option("--base-model <id>", "catalog Base Model that answers; pass exactly one of --base-model or --model-version", parseBaseModelId)
|
|
47
|
+
.option("--model-version <id>", "Model Version that answers: mdv.<id> or Model@name; pass exactly one of --base-model or --model-version")
|
|
48
|
+
.option("--output-field <name>", "text field on the dataset that receives the answers; pass exactly one of --output-field or --output-dataset")
|
|
49
|
+
.option("--output-dataset <name>", "new dataset that receives the prompts and answers; pass exactly one of --output-field or --output-dataset")
|
|
50
50
|
.requiredOption(
|
|
51
51
|
"--max-output-tokens <count>",
|
|
52
52
|
"token limit per answer, at most 8192",
|
|
@@ -78,7 +78,7 @@ export const registerBatchInferenceCommands = (program: Command, host: CommandHo
|
|
|
78
78
|
batchInference
|
|
79
79
|
.command("list")
|
|
80
80
|
.option("--json", "print JSON", false)
|
|
81
|
-
.description("list the selected project's Batch Inference Runs")
|
|
81
|
+
.description("list up to 100 of the selected project's Batch Inference Runs (first page only)")
|
|
82
82
|
.action(async (options: { json: boolean }) => {
|
|
83
83
|
const { client, projectId } = await resolveContext(globals(), context);
|
|
84
84
|
assertProjectSelected(projectId);
|
|
@@ -6,7 +6,7 @@ export const registerConfigCommands = (program: Command, host: CommandHost): voi
|
|
|
6
6
|
const config = program.command("config").description("read and write machine CLI settings");
|
|
7
7
|
config
|
|
8
8
|
.command("get")
|
|
9
|
-
.argument("[name]", "setting
|
|
9
|
+
.argument("[name]", "supported setting: auto-update (default true); omit to print every setting")
|
|
10
10
|
.description("print a CLI setting, or every setting")
|
|
11
11
|
.action(async (name?: string) => {
|
|
12
12
|
const settings = await readCliSettings(host.context.environment);
|
|
@@ -14,9 +14,10 @@ export const registerConfigCommands = (program: Command, host: CommandHost): voi
|
|
|
14
14
|
});
|
|
15
15
|
config
|
|
16
16
|
.command("set")
|
|
17
|
-
.argument("<name>", "setting
|
|
18
|
-
.argument("<value>", "
|
|
17
|
+
.argument("<name>", "supported setting: auto-update (default true)")
|
|
18
|
+
.argument("<value>", "enable with true/1/yes/on; disable with false/0/no/off (case-insensitive)")
|
|
19
19
|
.description("write a CLI setting for this machine")
|
|
20
|
+
.addHelpText("after", "\nExamples:\n toloka config set auto-update false")
|
|
20
21
|
.action(async (name: string, value: string) => {
|
|
21
22
|
const result = await setCliSetting(host.context.environment, name, value);
|
|
22
23
|
host.context.io.stdout(result.output);
|
|
@@ -71,7 +71,7 @@ export const registerDatasetCommands = (program: Command, host: CommandHost): vo
|
|
|
71
71
|
.option("--all", "add every top-level field of the uploaded rows that is not a dataset field yet", false)
|
|
72
72
|
.option("--no-wait", "return as soon as the fields are added, while their values are still being copied")
|
|
73
73
|
.option("--timeout <ms>", "how long to wait for the values to be copied", positiveInteger)
|
|
74
|
-
.option("--json", "print JSON", false)
|
|
74
|
+
.option("--json", "print added fields as JSON; when --all adds nothing, print a text message", false)
|
|
75
75
|
.description(
|
|
76
76
|
"add dataset fields from fields of the uploaded rows, so filters, --balance-by and split columns can use their values; uploads after this fill them too",
|
|
77
77
|
)
|
|
@@ -188,7 +188,7 @@ export const registerDatasetCommands = (program: Command, host: CommandHost): vo
|
|
|
188
188
|
slice
|
|
189
189
|
.command("list")
|
|
190
190
|
.argument("<name>", "dataset name or id")
|
|
191
|
-
.description("list
|
|
191
|
+
.description("list up to 100 slices of a dataset, newest first (first page only)")
|
|
192
192
|
.action(async (name: string) => {
|
|
193
193
|
const { sourceRoot, client, projectId } = await resolveContext(globals(), context);
|
|
194
194
|
const result = await listDatasetSlices(client, {
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import { assertCli } from "../cli-error";
|
|
3
|
+
import { positiveInteger, resolveContext, type CommandHost } from "../context";
|
|
4
|
+
import {
|
|
5
|
+
addExpertBanListExperts,
|
|
6
|
+
listExpertBanListExperts,
|
|
7
|
+
readExpertIds,
|
|
8
|
+
removeExpertBanListExperts,
|
|
9
|
+
showExpertBanList,
|
|
10
|
+
} from "../experts";
|
|
11
|
+
import { assertProjectSelected } from "../project-context";
|
|
12
|
+
|
|
13
|
+
export const registerExpertBanListCommands = (program: Command, host: CommandHost): void => {
|
|
14
|
+
const { context, globals } = host;
|
|
15
|
+
|
|
16
|
+
const expertBanList = program
|
|
17
|
+
.command("expert-ban-list")
|
|
18
|
+
.description("manage the project's expert ban list: banned experts can't work on the project");
|
|
19
|
+
|
|
20
|
+
expertBanList
|
|
21
|
+
.command("show")
|
|
22
|
+
.option("--json", "print JSON", false)
|
|
23
|
+
.description("show how many experts are banned and in which status")
|
|
24
|
+
.action(async (options: { json: boolean }) => {
|
|
25
|
+
const { client, projectId } = await resolveContext(globals(), context);
|
|
26
|
+
assertProjectSelected(projectId);
|
|
27
|
+
await showExpertBanList(client, { projectId, json: options.json }, context.io);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
expertBanList
|
|
31
|
+
.command("experts")
|
|
32
|
+
.option("--after <expertId>", "start after this expert id, from the previous page")
|
|
33
|
+
.option("--limit <count>", "experts per page, up to 1000", positiveInteger)
|
|
34
|
+
.option("--json", "print JSON", false)
|
|
35
|
+
.description("list a page of the banned experts with their status")
|
|
36
|
+
.action(async (options: { after?: string; limit?: number; json: boolean }) => {
|
|
37
|
+
const { client, projectId } = await resolveContext(globals(), context);
|
|
38
|
+
assertProjectSelected(projectId);
|
|
39
|
+
await listExpertBanListExperts(client, { projectId, ...options }, context.io);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
expertBanList
|
|
43
|
+
.command("add")
|
|
44
|
+
.argument("[expertIds...]", "expert ids to ban")
|
|
45
|
+
.option("--file <path>", "file with one expert id per line")
|
|
46
|
+
.requiredOption("--reason <text>", "why the experts are banned, applied to each of them")
|
|
47
|
+
.description("ban experts: they can't be invited and are removed from the work they're in")
|
|
48
|
+
.action(async (expertIds: string[], options: { file?: string; reason: string }) => {
|
|
49
|
+
assertCli(options.reason.trim().length > 0, "Missing --reason.", {
|
|
50
|
+
hint: { description: "Say why the experts are banned with --reason <text>." },
|
|
51
|
+
});
|
|
52
|
+
const { client, projectId } = await resolveContext(globals(), context);
|
|
53
|
+
assertProjectSelected(projectId);
|
|
54
|
+
const ids = await readExpertIds({ expertIds, ...(options.file === undefined ? {} : { file: options.file }) });
|
|
55
|
+
await addExpertBanListExperts(client, { projectId, expertIds: ids, reason: options.reason }, context.io);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
expertBanList
|
|
59
|
+
.command("remove")
|
|
60
|
+
.argument("[expertIds...]", "expert ids to unban")
|
|
61
|
+
.option("--file <path>", "file with one expert id per line")
|
|
62
|
+
.description("lift the bans of experts")
|
|
63
|
+
.action(async (expertIds: string[], options: { file?: string }) => {
|
|
64
|
+
const { client, projectId } = await resolveContext(globals(), context);
|
|
65
|
+
assertProjectSelected(projectId);
|
|
66
|
+
const ids = await readExpertIds({ expertIds, ...(options.file === undefined ? {} : { file: options.file }) });
|
|
67
|
+
await removeExpertBanListExperts(client, { projectId, expertIds: ids }, context.io);
|
|
68
|
+
});
|
|
69
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import { positiveInteger, resolveContext, type CommandHost } from "../context";
|
|
3
|
+
import {
|
|
4
|
+
createExpertList,
|
|
5
|
+
addExpertListExperts,
|
|
6
|
+
listExpertListExperts,
|
|
7
|
+
listExpertLists,
|
|
8
|
+
readExpertIds,
|
|
9
|
+
removeExpertListExperts,
|
|
10
|
+
resolveExpertListId,
|
|
11
|
+
showExpertList,
|
|
12
|
+
updateExpertList,
|
|
13
|
+
} from "../experts";
|
|
14
|
+
import { assertProjectSelected } from "../project-context";
|
|
15
|
+
|
|
16
|
+
export const registerExpertListCommands = (program: Command, host: CommandHost): void => {
|
|
17
|
+
const { context, globals } = host;
|
|
18
|
+
|
|
19
|
+
const resolveList = async (list: string) => {
|
|
20
|
+
const { client, projectId } = await resolveContext(globals(), context);
|
|
21
|
+
assertProjectSelected(projectId);
|
|
22
|
+
|
|
23
|
+
return { client, projectId, expertListId: await resolveExpertListId(client, { projectId, list }) };
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const expertList = program
|
|
27
|
+
.command("expert-list")
|
|
28
|
+
.description("manage the project's expert lists, which nodes with audienceMode service take experts from");
|
|
29
|
+
|
|
30
|
+
expertList
|
|
31
|
+
.command("list")
|
|
32
|
+
.option("--json", "print JSON", false)
|
|
33
|
+
.description("list the project's expert lists")
|
|
34
|
+
.action(async (options: { json: boolean }) => {
|
|
35
|
+
const { client, projectId } = await resolveContext(globals(), context);
|
|
36
|
+
assertProjectSelected(projectId);
|
|
37
|
+
await listExpertLists(client, { projectId, json: options.json }, context.io);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
expertList
|
|
41
|
+
.command("create")
|
|
42
|
+
.argument("<name>", "name of the new list")
|
|
43
|
+
.option("--json", "print JSON", false)
|
|
44
|
+
.description("create an empty expert list")
|
|
45
|
+
.action(async (name: string, options: { json: boolean }) => {
|
|
46
|
+
const { client, projectId } = await resolveContext(globals(), context);
|
|
47
|
+
assertProjectSelected(projectId);
|
|
48
|
+
await createExpertList(client, { projectId, name, json: options.json }, context.io);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
expertList
|
|
52
|
+
.command("show")
|
|
53
|
+
.argument("<list>", "list id (exl.…) or name")
|
|
54
|
+
.option("--json", "print JSON", false)
|
|
55
|
+
.description("show a list and how many of its experts are available")
|
|
56
|
+
.action(async (list: string, options: { json: boolean }) => {
|
|
57
|
+
const { client, expertListId } = await resolveList(list);
|
|
58
|
+
await showExpertList(client, { expertListId, json: options.json }, context.io);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
expertList
|
|
62
|
+
.command("rename")
|
|
63
|
+
.argument("<list>", "list id (exl.…) or name")
|
|
64
|
+
.argument("<name>", "new name")
|
|
65
|
+
.description("rename a list")
|
|
66
|
+
.action(async (list: string, name: string) => {
|
|
67
|
+
const { client, expertListId } = await resolveList(list);
|
|
68
|
+
await updateExpertList(client, { expertListId, name }, context.io);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
expertList
|
|
72
|
+
.command("hide")
|
|
73
|
+
.argument("<list>", "list id (exl.…) or name")
|
|
74
|
+
.description("hide a list: its experts can't be added or removed until it is shown again; nodes that use it keep working")
|
|
75
|
+
.action(async (list: string) => {
|
|
76
|
+
const { client, expertListId } = await resolveList(list);
|
|
77
|
+
await updateExpertList(client, { expertListId, hidden: true }, context.io);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
expertList
|
|
81
|
+
.command("unhide")
|
|
82
|
+
.argument("<list>", "list id (exl.…) or name")
|
|
83
|
+
.description("show a hidden list again")
|
|
84
|
+
.action(async (list: string) => {
|
|
85
|
+
const { client, expertListId } = await resolveList(list);
|
|
86
|
+
await updateExpertList(client, { expertListId, hidden: false }, context.io);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
expertList
|
|
90
|
+
.command("experts")
|
|
91
|
+
.argument("<list>", "list id (exl.…) or name")
|
|
92
|
+
.option("--after <expertId>", "start after this expert id, from the previous page")
|
|
93
|
+
.option("--limit <count>", "experts per page, up to 1000", positiveInteger)
|
|
94
|
+
.option("--json", "print JSON", false)
|
|
95
|
+
.description("list a page of the list's experts with their status")
|
|
96
|
+
.action(async (list: string, options: { after?: string; limit?: number; json: boolean }) => {
|
|
97
|
+
const { client, expertListId } = await resolveList(list);
|
|
98
|
+
await listExpertListExperts(client, { expertListId, ...options }, context.io);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
expertList
|
|
102
|
+
.command("add")
|
|
103
|
+
.argument("<list>", "list id (exl.…) or name")
|
|
104
|
+
.argument("[expertIds...]", "expert ids to add")
|
|
105
|
+
.option("--file <path>", "file with one expert id per line")
|
|
106
|
+
.description("add experts to a list, from arguments or a file")
|
|
107
|
+
.action(async (list: string, expertIds: string[], options: { file?: string }) => {
|
|
108
|
+
const { client, expertListId } = await resolveList(list);
|
|
109
|
+
const ids = await readExpertIds({ expertIds, ...(options.file === undefined ? {} : { file: options.file }) });
|
|
110
|
+
await addExpertListExperts(client, { expertListId, expertIds: ids }, context.io);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
expertList
|
|
114
|
+
.command("remove")
|
|
115
|
+
.argument("<list>", "list id (exl.…) or name")
|
|
116
|
+
.argument("[expertIds...]", "expert ids to remove")
|
|
117
|
+
.option("--file <path>", "file with one expert id per line")
|
|
118
|
+
.description("remove experts from a list")
|
|
119
|
+
.action(async (list: string, expertIds: string[], options: { file?: string }) => {
|
|
120
|
+
const { client, expertListId } = await resolveList(list);
|
|
121
|
+
const ids = await readExpertIds({ expertIds, ...(options.file === undefined ? {} : { file: options.file }) });
|
|
122
|
+
await removeExpertListExperts(client, { expertListId, expertIds: ids }, context.io);
|
|
123
|
+
});
|
|
124
|
+
};
|
|
@@ -43,7 +43,7 @@ export const registerModelCommands = (program: Command, host: CommandHost): void
|
|
|
43
43
|
model
|
|
44
44
|
.command("list")
|
|
45
45
|
.option("--json", "print JSON", false)
|
|
46
|
-
.description("list Models owned by the selected project")
|
|
46
|
+
.description("list up to 100 Models owned by the selected project (first page only)")
|
|
47
47
|
.action(async (options: { json: boolean }) => {
|
|
48
48
|
const { client, projectId } = await resolveContext(globals(), context);
|
|
49
49
|
assertProjectSelected(projectId);
|
|
@@ -148,7 +148,7 @@ export const registerPipelineCommands = (program: Command, host: CommandHost): v
|
|
|
148
148
|
pipeline
|
|
149
149
|
.command("results")
|
|
150
150
|
.argument("<runId>", "run to read")
|
|
151
|
-
.option("--limit <n>", "
|
|
151
|
+
.option("--limit <n>", "maximum matching items to return (default 20). With --failed, scans up to 500 items, or --limit if larger", positiveInteger)
|
|
152
152
|
.option("--failed", "only report failed items", false)
|
|
153
153
|
.description("report a run's items")
|
|
154
154
|
.action(async (runId: string, options: { limit?: number; failed: boolean }) => {
|
|
@@ -11,7 +11,7 @@ export const registerReportCommand = (program: Command, host: CommandHost): void
|
|
|
11
11
|
.argument("<markdownPath>", "path to a UTF-8 Markdown report")
|
|
12
12
|
.option("--authored-by <who>", "human or agent", authoredByOption, "human")
|
|
13
13
|
.option("--confirm", "confirm submission in a non-interactive environment", false)
|
|
14
|
-
.description("preview and send an issue report to Toloka
|
|
14
|
+
.description("preview and send an issue report to Toloka")
|
|
15
15
|
.action(
|
|
16
16
|
async (
|
|
17
17
|
markdownPath: string,
|
|
@@ -38,7 +38,7 @@ export const registerTrainingCommands = (program: Command, host: CommandHost): v
|
|
|
38
38
|
training
|
|
39
39
|
.command("list")
|
|
40
40
|
.option("--json", "print JSON", false)
|
|
41
|
-
.description("list active Trainings owned by the selected project")
|
|
41
|
+
.description("list up to 100 active Trainings owned by the selected project (first page only)")
|
|
42
42
|
.action(async (options: { json: boolean }) => {
|
|
43
43
|
const { client, projectId } = await resolveContext(globals(), context);
|
|
44
44
|
assertProjectSelected(projectId);
|
|
@@ -57,9 +57,9 @@ export const registerTrainingCommands = (program: Command, host: CommandHost): v
|
|
|
57
57
|
training
|
|
58
58
|
.command("create")
|
|
59
59
|
.argument("<name>", "new Training name")
|
|
60
|
-
.option("--method <method>", "Training method", trainingMethod, "sft")
|
|
61
|
-
.option("--base-model <id>", "catalog Base Model source", parseBaseModelId)
|
|
62
|
-
.option("--model-version <id>", "exact Model Version source")
|
|
60
|
+
.option("--method <method>", "Training method: sft or gisting", trainingMethod, "sft")
|
|
61
|
+
.option("--base-model <id>", "catalog Base Model source; pass exactly one of --base-model or --model-version", parseBaseModelId)
|
|
62
|
+
.option("--model-version <id>", "exact Model Version source; pass exactly one of --base-model or --model-version")
|
|
63
63
|
.option(
|
|
64
64
|
"--dataset <name-or-id>",
|
|
65
65
|
"Dataset to train on: fills the empty cells of its split column (a new split column, 80/10/10, when it has none) and freezes a slice named after the Training; pass --dataset or --slice",
|
|
@@ -89,9 +89,9 @@ export const registerTrainingCommands = (program: Command, host: CommandHost): v
|
|
|
89
89
|
"token budget per example, 64 through 16384 (default 12288 for SFT, 3072 for gisting)",
|
|
90
90
|
trainingMaxSequenceLength,
|
|
91
91
|
)
|
|
92
|
-
.option("--prompt-file <path>", "gisting prompt text file")
|
|
92
|
+
.option("--prompt-file <path>", "required for gisting: non-empty UTF-8 prompt text file, at most 256 KiB")
|
|
93
93
|
.option("--json", "print JSON", false)
|
|
94
|
-
.description("create a
|
|
94
|
+
.description("create a Training draft")
|
|
95
95
|
.action(async (name: string, options: RawTrainingDraftOptions & { json: boolean }) => {
|
|
96
96
|
const { sourceRoot, client, projectId } = await resolveContext(globals(), context);
|
|
97
97
|
assertProjectSelected(projectId);
|
|
@@ -118,32 +118,32 @@ export const registerTrainingCommands = (program: Command, host: CommandHost): v
|
|
|
118
118
|
)
|
|
119
119
|
.option("--slice <id>", "replacement ready Dataset Slice that freezes a split column")
|
|
120
120
|
.option("--split-column <name-or-id>", "split column to train with, when the slice freezes more than one")
|
|
121
|
-
.option("--parts <names>", "train parts to learn on, comma-separated
|
|
122
|
-
.option("--lora-rank <rank>", "SFT LoRA adapter rank: 8, 16, or 32
|
|
121
|
+
.option("--parts <names>", "train parts to learn on, comma-separated", partNames)
|
|
122
|
+
.option("--lora-rank <rank>", "SFT LoRA adapter rank: 8, 16, or 32", trainingLoraRank)
|
|
123
123
|
.option(
|
|
124
124
|
"--gist-tokens <count>",
|
|
125
|
-
'gisting soft tokens: 8, 32, or 64, or a fraction of the prompt "1/4", "1/8", "1/16", "1/32"
|
|
125
|
+
'gisting soft tokens: 8, 32, or 64, or a fraction of the prompt "1/4", "1/8", "1/16", "1/32"',
|
|
126
126
|
trainingGistTokens,
|
|
127
127
|
)
|
|
128
|
-
.option("--epochs <count>", "training epochs, 1 through 5
|
|
128
|
+
.option("--epochs <count>", "training epochs, 1 through 5", trainingEpochs)
|
|
129
129
|
.option(
|
|
130
130
|
"--learning-rate <rate>",
|
|
131
|
-
"optimizer learning rate
|
|
131
|
+
"optimizer learning rate",
|
|
132
132
|
trainingLearningRate,
|
|
133
133
|
)
|
|
134
134
|
.option(
|
|
135
135
|
"--batch-size <count>",
|
|
136
|
-
"sequences per optimizer step: 8, 16, 32, or 64
|
|
136
|
+
"sequences per optimizer step: 8, 16, 32, or 64",
|
|
137
137
|
trainingBatchSize,
|
|
138
138
|
)
|
|
139
139
|
.option(
|
|
140
140
|
"--max-sequence-length <tokens>",
|
|
141
|
-
"token budget per example, 64 through 16384
|
|
141
|
+
"token budget per example, 64 through 16384",
|
|
142
142
|
trainingMaxSequenceLength,
|
|
143
143
|
)
|
|
144
144
|
.option("--prompt-file <path>", "replacement gisting prompt text file")
|
|
145
145
|
.option("--json", "print JSON", false)
|
|
146
|
-
.description("
|
|
146
|
+
.description("update a Training draft. Omitted hyperparameters keep their current values.")
|
|
147
147
|
.action(async (nameOrId: string, options: RawTrainingDraftOptions & { json: boolean }) => {
|
|
148
148
|
const { sourceRoot, client, projectId } = await resolveContext(globals(), context);
|
|
149
149
|
assertProjectSelected(projectId);
|
|
@@ -201,7 +201,7 @@ export const registerTrainingCommands = (program: Command, host: CommandHost): v
|
|
|
201
201
|
.command("runs")
|
|
202
202
|
.argument("<name-or-id>", "Training name or ID")
|
|
203
203
|
.option("--json", "print JSON", false)
|
|
204
|
-
.description("list Training
|
|
204
|
+
.description("list up to 100 Training Runs (first page only)")
|
|
205
205
|
.action(async (nameOrId: string, options: { json: boolean }) => {
|
|
206
206
|
const { client, projectId } = await resolveContext(globals(), context);
|
|
207
207
|
assertProjectSelected(projectId);
|
|
@@ -229,7 +229,7 @@ export const registerTrainingCommands = (program: Command, host: CommandHost): v
|
|
|
229
229
|
.command("cancel")
|
|
230
230
|
.argument("<training-run-id>", "Training Run ID")
|
|
231
231
|
.option("--json", "print JSON", false)
|
|
232
|
-
.description("cancel a Training Run before
|
|
232
|
+
.description("cancel a Training Run before training completes")
|
|
233
233
|
.action(async (trainingRunId: string, options: { json: boolean }) => {
|
|
234
234
|
const { client } = await resolveContext(globals(), context);
|
|
235
235
|
await cancelTrainingRun(client, { trainingRunId, json: options.json }, context.io);
|
package/src/cli/commands/ui.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { uiComponentsCommand } from "../ui";
|
|
|
5
5
|
|
|
6
6
|
export const registerUiCommands = (program: Command, host: CommandHost): void => {
|
|
7
7
|
const { context, globals } = host;
|
|
8
|
-
const ui = program.command("ui").description("inspect
|
|
8
|
+
const ui = program.command("ui").description("inspect components available for labeling interfaces");
|
|
9
9
|
ui.command("components")
|
|
10
10
|
.argument("[names...]", "component names such as Field.RadioGroup; omit to list every component")
|
|
11
11
|
.option("--json", "print the component contracts as JSON", false)
|