The
tasks client methods are currently in BETA. The API may change without notice. A one-time warning is emitted on first use.Key Capabilities
- Create project-based tasks that run continuously against live spans
- Create dataset-based tasks that evaluate experiment results
- Create
run_experimenttasks that drive LLM calls on the server - Trigger on-demand task runs with custom data windows
- Poll task runs until completion with configurable timeout
- Cancel in-progress runs
- List and filter task runs by status
List Tasks
List tasks you have access to, with optional filtering by space, project, dataset, or type.task_type are TaskType.TEMPLATE_EVALUATION, TaskType.CODE_EVALUATION, and TaskType.RUN_EXPERIMENT.
For details on pagination, field introspection, and data conversion (to dict/JSON/DataFrame), see Response Objects.
Create an Evaluation Task
Create a new evaluation task. Evaluation tasks can target either a project (live spans) or a dataset (experiment results).Project-Based Task
A project-based task continuously evaluates incoming spans. Setis_continuous=True to run the task on every new span, or False to run it only on demand.
Dataset-Based Task
A dataset-based task evaluates examples from one or more experiments. At least oneexperiment_ids entry is required.
Column Mappings and Filters
Each evaluator in the task can have its own column mappings (to map template variables to span attribute names) and a per-evaluator query filter.Create a Run-Experiment Task
Arun_experiment task drives all LLM calls on the server using the AI integration specified in run_configuration — no local callable is required.
TemplateEvaluationRunConfig instance or a plain dict matching one of those schemas; the SDK wraps it for you.
Get a Task
Retrieve a task by name or ID. When using a name, providespace to disambiguate.
Update a Task
Update mutable fields on an existing task. At least one update field must be provided. Passquery_filter=None to clear the existing filter; omit any other argument to leave it unchanged.
Delete a Task
Delete a task and its associated configuration. This operation is irreversible.Task Runs
Trigger a Run
Trigger an on-demand run for a task. The run starts in"pending" status. The accepted parameters depend on the task’s type.
Evaluation tasks (template_evaluation / code_evaluation):
run_experiment tasks:
List Runs
List runs for a task with optional status filtering.status values: RunStatus.PENDING, RunStatus.RUNNING, RunStatus.COMPLETED, RunStatus.FAILED, RunStatus.CANCELLED.
Get a Run
Retrieve a specific run by its ID.Cancel a Run
Cancel a run that is currentlyPENDING or RUNNING.
Wait for a Run
Poll a run until it reaches a terminal state (COMPLETED, FAILED, or CANCELLED).
TimeoutError if the run does not complete within timeout seconds.