Skip to main content
The tasks client methods are currently in BETA. The API may change without notice. A one-time warning is emitted on first use.
Create evaluation tasks that continuously or on-demand score spans in a project, or evaluate examples in a dataset using your LLM-as-judge evaluators.

Key Capabilities

  • Create project-based tasks that run continuously against live spans
  • Create dataset-based tasks that evaluate experiment results
  • Create run_experiment tasks 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.
Filter by task type:
Valid values for 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. Set is_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 one experiment_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.
Parameter reference:

Create a Run-Experiment Task

A run_experiment task drives all LLM calls on the server using the AI integration specified in run_configuration — no local callable is required.
The method also accepts a 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, provide space to disambiguate.

Update a Task

Update mutable fields on an existing task. At least one update field must be provided. Pass query_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.
Filter to only completed runs:
Valid 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 currently PENDING or RUNNING.

Wait for a Run

Poll a run until it reaches a terminal state (COMPLETED, FAILED, or CANCELLED).
Raises TimeoutError if the run does not complete within timeout seconds.

End-to-End: Trigger and Wait

Learn more: Online Evaluations Documentation