Jobs
Choisissez votre langage :
Long-running operations return a job. Use client.jobs to inspect or wait for those operations.
client.jobs.get(jobId)
Read a public async job by id or task id.
| SDK | client.jobs.get(job_id) |
|---|---|
| Retourne | JobRef |
Parameters:
| Emplacement | Paramètre | Type | Requis | Description |
|---|---|---|---|---|
| Path | job_id | string | Requis | Job id or task id returned by an async operation. |
Return fields:
| Field | Type | Description |
|---|---|---|
id | string | Job id. |
type | string | Job type, for example test_plan_generation, evaluation or agent_run. |
status | string | Current job status. |
resource | object | Related ids such as system_id, evaluation_id, agent_id or run_id. |
task_id | string | Background task id when available. |
result | any | Job result when available. |
error | string | Error message when available. |
client.jobs.wait(jobId, options)
SDK helper that polls client.jobs.get(...) until the job reaches a terminal state.
| SDK | client.jobs.wait(job_id, timeout_ms=..., interval_ms=..., on_poll=None) |
|---|---|
| Retourne | job.result when present, otherwise JobRef |
Parameters:
| Emplacement | Paramètre | Type | Requis | Défaut | Description |
|---|---|---|---|---|---|
| SDK | job_id | string | Requis | — | Job id or task id. |
| SDK | timeout_ms | integer | Optionnel | 900000 | Maximum wait time in milliseconds. |
| SDK | interval_ms | integer | Optionnel | 5000 | Poll interval in milliseconds. |
| SDK | on_poll | callable | Optionnel | — | Callback called with each job payload. |
Raises PollTimeoutError on timeout and JobFailedError if the terminal job status is failed, canceled or timed out.
Cette page vous a été utile ?