@toloka-platform/sdk 0.27.0 → 0.28.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 +5 -3
- package/dist/cli/toloka.js +179 -190
- 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/examples/video-pair-rating/nodes/adjudicate/node.ts +1 -1
- package/examples/video-pair-rating/nodes/adjudicate_op/node.ts +1 -1
- package/examples/video-pair-rating/nodes/overall_preference_pick/node.ts +5 -1
- package/examples/video-pair-rating/nodes/rate_pair/node.ts +5 -1
- package/openapi/gen/api.schemas.ts +51 -758
- package/openapi/gen/api.ts +0 -860
- package/package.json +2 -2
- package/skills/catalog.json +6 -40
- package/skills/toloka-build/references/human-work.md +15 -6
- package/skills/toloka-build/references/local-setup.md +2 -2
- package/skills/toloka-build/references/workflow-and-cli.md +3 -22
- package/skills/toloka-get-started/SKILL.md +9 -13
- package/src/cli/analytics.ts +0 -31
- package/src/cli/auth.ts +15 -7
- package/src/cli/config.ts +67 -3
- package/src/cli/context.ts +3 -124
- package/src/cli/credentials.ts +11 -10
- package/src/cli/init.ts +1 -1
- package/src/cli/program.ts +0 -6
- package/src/cli/project.ts +9 -1
- package/src/client.ts +3 -261
- package/src/importer.ts +12 -2
- package/src/index.ts +0 -2
- package/src/pipeline-graph-v1.contract.json +130 -128
- package/skills/toloka-fine-tuning/SKILL.md +0 -177
- package/skills/toloka-gisting/SKILL.md +0 -186
- package/src/cli/batch-inference.ts +0 -267
- package/src/cli/commands/batch-inference.ts +0 -116
- package/src/cli/commands/models.ts +0 -121
- package/src/cli/commands/training.ts +0 -275
- package/src/cli/models.ts +0 -304
- package/src/cli/trainings.ts +0 -880
package/README.md
CHANGED
|
@@ -58,9 +58,9 @@ The installer uses compatible Bun when available, otherwise installs a standalon
|
|
|
58
58
|
bun add @toloka-platform/sdk@latest
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
For an existing project, run `bun i` to install its dependencies.
|
|
61
|
+
For an existing project, run `bun i` to install its dependencies. See [Pipelines as code](https://platform.toloka.ai/docs/sdk/pipelines) for the full authoring workflow.
|
|
62
62
|
|
|
63
|
-
For a guided first run, start a fresh coding-agent session and ask it to follow the [Toloka agent bootstrap](https://platform.toloka.ai/agents/SKILL.md). It
|
|
63
|
+
For a guided first run, start a fresh coding-agent session and ask it to follow the [Toloka agent bootstrap](https://platform.toloka.ai/agents/SKILL.md). It points to the Data Labeling runbook and the `toloka-build` skill.
|
|
64
64
|
|
|
65
65
|
## Documentation
|
|
66
66
|
|
|
@@ -99,7 +99,9 @@ Two rules the platform enforces and the SDK will not paper over:
|
|
|
99
99
|
|
|
100
100
|
## Authenticate the client from code
|
|
101
101
|
|
|
102
|
-
`createClient`
|
|
102
|
+
`createClient()` without arguments uses the sign-in `toloka login` saved on this machine, or `TOLOKA_API_KEY` for a script that runs without a person; see [client and credentials](https://platform.toloka.ai/docs/sdk/client).
|
|
103
|
+
|
|
104
|
+
To choose the credential in code, `createClient` takes the platform URL and one credential. `{ baseUrl, apiKey }` sends the key with the `ApiKey` authorization scheme on every request; the key does not expire until it is deleted in the Business Console. `{ baseUrl, scopedToken }` always sends the credential in `X-Scoped-Token`, including placeholders such as `dtn_secret_…` whose value is supplied by a trusted egress proxy. `{ baseUrl, accessToken }` calls the `accessToken` function before every request and sends its result as a Bearer token, so a renewable session can back the client. The three forms are exclusive. The CLI uses the last form for its browser sign-in.
|
|
103
105
|
|
|
104
106
|
`baseUrl` may carry a path, for a gateway that serves the platform under a prefix: every request keeps that path, so `https://gateway.example/ss/pp.1` sends `GET /api/v2-beta/projects/pp.1` to `https://gateway.example/ss/pp.1/api/v2-beta/projects/pp.1`. A trailing slash makes no difference. A plain origin such as `https://platform.toloka.ai` behaves as it always has.
|
|
105
107
|
|