@toloka-platform/sdk 0.1.0-preview.5 → 0.1.0-preview.6
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/dist/cli/toloka.js +121 -120
- 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/docs/cli.md +26 -1
- package/docs/datasets.md +8 -9
- package/docs/limitations.md +5 -8
- package/docs/troubleshooting.md +0 -11
- package/openapi/gen/api.ts +779 -895
- package/openapi/gen/models/baseModel.ts +9 -0
- package/openapi/gen/models/baseModelId.ts +2 -0
- package/openapi/gen/models/baseModelIdProperty.ts +2 -0
- package/openapi/gen/models/createProjectModelBody.ts +8 -0
- package/openapi/gen/models/createProjectModelBodyDescription.ts +2 -0
- package/openapi/gen/models/generationNodeSettingsAudienceAndPricingOneOfOneone.ts +1 -0
- package/openapi/gen/models/index.ts +16 -0
- package/openapi/gen/models/listBaseModels200.ts +5 -0
- package/openapi/gen/models/listModelVersions200.ts +7 -0
- package/openapi/gen/models/listModelVersionsParams.ts +5 -0
- package/openapi/gen/models/listProjectModels200.ts +7 -0
- package/openapi/gen/models/listProjectModelsParams.ts +5 -0
- package/openapi/gen/models/model.ts +16 -0
- package/openapi/gen/models/modelArchivedAt.ts +2 -0
- package/openapi/gen/models/modelDescription.ts +2 -0
- package/openapi/gen/models/modelId.ts +2 -0
- package/openapi/gen/models/modelVersion.ts +9 -0
- package/openapi/gen/models/modelVersionId.ts +2 -0
- package/openapi/gen/models/pipelineGraphSnapshotGraphNodesItemOneOfThreeoneSettingsAudienceAndPricingOneOfOneone.ts +1 -0
- package/openapi/gen/models/validatePipelineGraphBodyGraphNodesItemOneOfThreeoneSettingsAudienceAndPricingOneOfOneone.ts +1 -0
- package/package.json +1 -1
- package/skills/catalog.json +4 -4
- package/skills/toloka-build/SKILL.md +1 -1
- package/skills/toloka-build/references/workflow-and-cli.md +12 -1
- package/skills/toloka-report-issue/references/report-template.md +1 -1
- package/src/cli/data.ts +148 -25
- package/src/cli/models.ts +188 -0
- package/src/cli/program.ts +99 -1
- package/src/client.ts +109 -35
- package/src/errors.ts +25 -10
- package/src/transport.ts +16 -13
package/dist/cli/toloka.js.jsc
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2e4e22afc766a0a267262fe07718505b43f1cdf364e402a990279e224ad92923 toloka.js.jsc
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
842c3cdfb47d5a899375c288cefa8ba550c22301dbd47d99d224a8b34acd01a2 toloka.js
|
package/docs/cli.md
CHANGED
|
@@ -202,6 +202,31 @@ toloka pipeline results <runId> [--limit <n>] [--failed]
|
|
|
202
202
|
|
|
203
203
|
`pipeline status` reports the latest run of that pipeline. `pipeline runs` lists recent runs (default 10). `pipeline cost` forecasts what a run would bill. `pipeline cancel` and `pipeline results` take a run id.
|
|
204
204
|
|
|
205
|
+
## base-model
|
|
206
|
+
|
|
207
|
+
Inspect the global, read-only Base Model Catalog.
|
|
208
|
+
|
|
209
|
+
```sh
|
|
210
|
+
toloka base-model list [--json]
|
|
211
|
+
toloka base-model get <id> [--json]
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Human-readable output is the default. `base-model list` prints aligned ID, name, provider, and upstream-model columns; `base-model get` prints labeled fields including the pinned revision. Pass `--json` for machine-readable output.
|
|
215
|
+
|
|
216
|
+
## model
|
|
217
|
+
|
|
218
|
+
Manage Model metadata in the selected project.
|
|
219
|
+
|
|
220
|
+
```sh
|
|
221
|
+
toloka model list [--json]
|
|
222
|
+
toloka model get <name-or-id> [--json]
|
|
223
|
+
toloka model versions <name-or-id> [--json]
|
|
224
|
+
toloka model create <name> --base <base-model-id> [--description <text>] [--json]
|
|
225
|
+
toloka model archive <name-or-id> [--json]
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
`model create` creates project-owned Model metadata linked to one catalog Base Model; it does not create a Model Version. Human-readable output is the default for every command in this group. Pass `--json` for machine-readable objects or arrays. Weight upload, validation, download, and Model Version creation are deferred.
|
|
229
|
+
|
|
205
230
|
## dataset
|
|
206
231
|
|
|
207
232
|
Catalog and row commands for datasets in the selected project. Name or id is accepted; duplicate names must be addressed by id.
|
|
@@ -219,7 +244,7 @@ toloka dataset upload <name> <file>
|
|
|
219
244
|
|
|
220
245
|
`dataset load` starts a platform export, waits for it (default 60s; pass `--timeout`), downloads the JSON array, and writes JSONL to `--out`. `--limit` slices after download; it still waits for the full export. On timeout the message names the export id. Failed downloads and invalid payloads leave `--out` untouched.
|
|
221
246
|
|
|
222
|
-
`dataset upload`
|
|
247
|
+
`dataset upload` accepts `.json` arrays, `.jsonl` files with one object per line, and `.csv` files with a header row. The CLI infers the format from the extension and uploads the original bytes without conversion. If the blob transfer or finalization fails, the CLI cancels the started upload before returning the error, so another upload can start immediately and may reuse the same filename. Field schemas are immutable after the first successful upload: you can add columns, never alter or remove one. See [datasets](./datasets.md).
|
|
223
248
|
|
|
224
249
|
## report
|
|
225
250
|
|
package/docs/datasets.md
CHANGED
|
@@ -109,17 +109,16 @@ toloka dataset upload face-images data/face_images.jsonl
|
|
|
109
109
|
|
|
110
110
|
The command takes two positional arguments and has no flags:
|
|
111
111
|
|
|
112
|
-
| Argument | Description
|
|
113
|
-
| -------- |
|
|
114
|
-
| `<name>` | Dataset name or id
|
|
115
|
-
| `<file>` |
|
|
112
|
+
| Argument | Description |
|
|
113
|
+
| -------- | ------------------------------------------ |
|
|
114
|
+
| `<name>` | Dataset name or id |
|
|
115
|
+
| `<file>` | `.json`, `.jsonl`, or `.csv` file to append |
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
The CLI infers the format from the filename extension and uploads the original bytes without conversion:
|
|
118
118
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
```
|
|
119
|
+
- `.json` contains an array of row objects.
|
|
120
|
+
- `.jsonl` contains one row object per non-empty line and is validated locally before upload.
|
|
121
|
+
- `.csv` uses its header row for field names; every value is ingested as a string.
|
|
123
122
|
|
|
124
123
|
Upload is additive: it appends items and never rewrites existing ones. If the dataset does not exist yet and a pipeline in source declares it, `dataset upload` creates the dataset with the declared columns automatically. If no pipeline declares the dataset, upload stops and asks you to bind a pipeline to it in source so its columns are known, or to upload to an existing dataset. Duplicate live names must be addressed by id.
|
|
125
124
|
|
package/docs/limitations.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
What this Preview SDK does not do yet, stated plainly so you can decide what to depend on.
|
|
4
4
|
|
|
5
|
-
`@toloka-platform/sdk` is `0.1.0-preview.
|
|
5
|
+
`@toloka-platform/sdk` is `0.1.0-preview.6`. This is a Preview: the authoring API, the CLI surface, and the generated source layout can change without a major version bump. Pin an exact version. Do not depend on this in production yet.
|
|
6
6
|
|
|
7
7
|
## The SDK does not certify deployability
|
|
8
8
|
|
|
@@ -39,13 +39,10 @@ A `code` node carries its Python as an inline string in `code.code`. There is no
|
|
|
39
39
|
|
|
40
40
|
These are reproduced platform-side issues that affect the SDK path. They are not SDK bugs and cannot be fixed from this package.
|
|
41
41
|
|
|
42
|
-
| defect
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
| Finalizing a file upload can return a bodyless `500` | `toloka dataset upload` cannot complete on an affected environment | declare columns in source and load rows through a client call |
|
|
47
|
-
| Rows added through the items endpoint skip column inference | `toloka dataset fields` reports no columns for a dataset that holds rows | declare columns in source rather than inferring them |
|
|
48
|
-
| Starting a run intermittently returns a bodyless `500` | `toloka pipeline run` fails with nothing to act on | check `toloka pipeline runs <name>` for a created run, then retry |
|
|
42
|
+
| defect | effect on you | workaround |
|
|
43
|
+
| ----------------------------------------------------------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------- |
|
|
44
|
+
| Rows added through the items endpoint skip column inference | `toloka dataset fields` reports no columns for a dataset that holds rows | declare columns in source rather than inferring them |
|
|
45
|
+
| Starting a run intermittently returns a bodyless `500` | `toloka pipeline run` fails with nothing to act on | check `toloka pipeline runs <name>` for a created run, then retry |
|
|
49
46
|
|
|
50
47
|
## Not attempted yet
|
|
51
48
|
|
package/docs/troubleshooting.md
CHANGED
|
@@ -51,17 +51,6 @@ A resource exists on the platform but not in your source tree. `apply` reports i
|
|
|
51
51
|
|
|
52
52
|
Another writer changed the graph after your source was read. Do not retry blindly: `plan` again to re-read live state, review the new diff, carry any intentional remote change into source, then `apply`.
|
|
53
53
|
|
|
54
|
-
## Second upload of the same filename fails
|
|
55
|
-
|
|
56
|
-
Uploading a file whose basename already exists in that dataset fails with a bodyless `500`. `toloka dataset upload` sends the file's basename, so running the same documented command twice reproduces it:
|
|
57
|
-
|
|
58
|
-
```sh
|
|
59
|
-
toloka dataset upload cat-images ./data/rows.jsonl # first time: fine
|
|
60
|
-
toloka dataset upload cat-images ./data/rows.jsonl # second time: 500
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Until the platform returns a proper conflict, use a distinct filename per upload — for example `rows-2026-08-13.jsonl`. This is a platform defect, tracked; the SDK cannot detect it in advance.
|
|
64
|
-
|
|
65
54
|
## Another upload is already in progress
|
|
66
55
|
|
|
67
56
|
```
|