Launch Week 3: Five days of launches

Queue Ingestion Tasks

Overview

The Confident AI SDK exposes every Queue Ingestion Task method on the platform. This page documents how to call these methods in all supported languages. See the introduction to install the SDK and set your API key.

Methods

List Queue Ingestion Tasks

Lists the ingestion tasks filling an annotation queue, newest first. Each task is returned as a summary; retrieve a task by id for its filters and reviewers.

from confident_ai import ConfidentAI
from confident_ai.common import IngestionDataModel

client = ConfidentAI()

result = client.annotation_queues.list_queue_ingestion_tasks(
    annotation_queue_id="<ANNOTATION-QUEUE-ID>",
    data_model=IngestionDataModel.TRACE,
)

For async mode, call a_list_queue_ingestion_tasks and await it as shown below:

result = await client.annotation_queues.a_list_queue_ingestion_tasks(...)

Parameters

ParameterTypeDescription
annotation_queue_idstrRequired. The id of the annotation queue.
data_modelOptional[IngestionDataModel]Returns only tasks harvesting this kind of production item. See IngestionDataModel.

Returns

This method returns an object of type QueueIngestionTaskList.

Create Queue Ingestion Task

Creates a rule that keeps an annotation queue filled from your production data, and returns its id. A task only harvests once enabled is true.

from confident_ai import ConfidentAI
from confident_ai.annotation_queues import AssignmentStrategy
from confident_ai.common import IngestionDataModel

client = ConfidentAI()

result = client.annotation_queues.create_queue_ingestion_task(
    annotation_queue_id="<ANNOTATION-QUEUE-ID>",
    name="Failed capital lookups",
    data_model=IngestionDataModel.TRACE,
    description="Traces where the assistant failed to name a capital.",
    enabled=True,
    sample_rate=0.1,
    filters={
        "operator": "AND",
        "groups": [
            {
                "operator": "AND",
                "filters": [
                    {
                        "category": "Name",
                        "condition": "Is",
                        "value": "capital-lookup"
                    }
                ]
            }
        ]
    },
    max_items=500,
    assignment_strategy=AssignmentStrategy.SINGLE_USER,
    reviewer_emails=["jane@acme.com"],
)

For async mode, call a_create_queue_ingestion_task and await it as shown below:

result = await client.annotation_queues.a_create_queue_ingestion_task(...)

Parameters

ParameterTypeDescription
annotation_queue_idstrRequired. The id of the annotation queue.
namestrRequired. The name of the task.
data_modelIngestionDataModelRequired. See IngestionDataModel.
descriptionOptional[str]A note about what the task harvests. Send null to clear it.
enabledOptional[bool]Whether the task runs. Disabling it stops new items arriving; items already queued are kept. Defaults to false.
sample_rateOptional[float]The fraction of matching items to queue, between 0 and 1. Defaults to 1, all of them.
filtersOptional[FilterSet]See FilterSet.
max_itemsOptional[int]The maximum number of items this task will ever queue. Send null to remove the cap.
assignment_strategyOptional[AssignmentStrategy]See AssignmentStrategy.
reviewer_emailsOptional[List[str]]The project members harvested items are assigned to, following assignmentStrategy.

Returns

This method returns an object of type QueueIngestionTaskRef.

Get Queue Ingestion Task

Retrieves one of the queue's ingestion tasks by id, with its full configuration.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.annotation_queues.get_queue_ingestion_task(
    annotation_queue_id="<ANNOTATION-QUEUE-ID>",
    queue_ingestion_task_id="<QUEUE-INGESTION-TASK-ID>",
)

For async mode, call a_get_queue_ingestion_task and await it as shown below:

result = await client.annotation_queues.a_get_queue_ingestion_task(...)

Parameters

ParameterTypeDescription
annotation_queue_idstrRequired. The id of the annotation queue the task fills.
queue_ingestion_task_idstrRequired. The id of the queue ingestion task.

Returns

This method returns an object of type QueueIngestionTask.

Update Queue Ingestion Task

Updates an ingestion task and returns it. A field you omit keeps its stored value; items already queued by the task are kept whatever you change.

from confident_ai import ConfidentAI
from confident_ai.annotation_queues import AssignmentStrategy
from confident_ai.common import IngestionDataModel

client = ConfidentAI()

result = client.annotation_queues.update_queue_ingestion_task(
    annotation_queue_id="<ANNOTATION-QUEUE-ID>",
    queue_ingestion_task_id="<QUEUE-INGESTION-TASK-ID>",
    name="Failed capital lookups",
    data_model=IngestionDataModel.TRACE,
    description="Traces where the assistant failed to name a capital.",
    enabled=True,
    sample_rate=0.1,
    filters={
        "operator": "AND",
        "groups": [
            {
                "operator": "AND",
                "filters": [
                    {
                        "category": "Name",
                        "condition": "Is",
                        "value": "capital-lookup"
                    }
                ]
            }
        ]
    },
    max_items=500,
    assignment_strategy=AssignmentStrategy.SINGLE_USER,
    reviewer_emails=["jane@acme.com"],
)

For async mode, call a_update_queue_ingestion_task and await it as shown below:

result = await client.annotation_queues.a_update_queue_ingestion_task(...)

Parameters

ParameterTypeDescription
annotation_queue_idstrRequired. The id of the annotation queue the task fills.
queue_ingestion_task_idstrRequired. The id of the queue ingestion task.
nameOptional[str]The name of the task.
data_modelOptional[IngestionDataModel]See IngestionDataModel.
descriptionOptional[str]A note about what the task harvests. Send null to clear it.
enabledOptional[bool]Whether the task runs. Disabling it stops new items arriving; items already queued are kept. Defaults to false.
sample_rateOptional[float]The fraction of matching items to queue, between 0 and 1. Defaults to 1, all of them.
filtersOptional[FilterSet]See FilterSet.
max_itemsOptional[int]The maximum number of items this task will ever queue. Send null to remove the cap.
assignment_strategyOptional[AssignmentStrategy]See AssignmentStrategy.
reviewer_emailsOptional[List[str]]The project members harvested items are assigned to, following assignmentStrategy.

Returns

This method returns an object of type QueueIngestionTask.

Delete Queue Ingestion Task

Permanently deletes an ingestion task, so it stops filling the queue. Items it already queued are kept.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.annotation_queues.delete_queue_ingestion_task(
    annotation_queue_id="<ANNOTATION-QUEUE-ID>",
    queue_ingestion_task_id="<QUEUE-INGESTION-TASK-ID>",
)

For async mode, call a_delete_queue_ingestion_task and await it as shown below:

result = await client.annotation_queues.a_delete_queue_ingestion_task(...)

Parameters

ParameterTypeDescription
annotation_queue_idstrRequired. The id of the annotation queue the task fills.
queue_ingestion_task_idstrRequired. The id of the queue ingestion task.

Returns

This method returns an object of type QueueIngestionTaskRef.

Types

AssignmentStrategy

How harvested items are shared out among the reviewers: SINGLE_USER gives every item to one reviewer, ROUND_ROBIN deals them out in turn, and RANDOM assigns each one at random.

class AssignmentStrategy(Enum):
    SINGLE_USER = "SINGLE_USER"
    ROUND_ROBIN = "ROUND_ROBIN"
    RANDOM = "RANDOM"

SINGLE_USER · ROUND_ROBIN · RANDOM

FilterSet

A set of filter groups combined by a top-level operator. Each group combines its filter rows by its own operator, and each row matches one property, such as Name or User Id, against a value with a condition such as Is or Contains.

class FilterSet:
    operator: Literal["AND", "OR"]
    groups: List[FilterSetGroup]

operatorLiteral["AND", "OR"]Required

groupsList[FilterSetGroup]Required

IngestionDataModel

What kind of production item an ingestion task harvests. THREAD tasks fill multi-turn datasets; TRACE and SPAN tasks fill single-turn ones.

class IngestionDataModel(Enum):
    TRACE = "TRACE"
    SPAN = "SPAN"
    THREAD = "THREAD"

TRACE · SPAN · THREAD

QueueIngestionTask

A rule that keeps an annotation queue filled from your production data.

class QueueIngestionTask:
    id: str
    name: str
    description: Optional[str]
    enabled: bool
    sample_rate: float = Field(alias="sampleRate")
    data_model: IngestionDataModel = Field(alias="dataModel")
    filters: Optional[FilterSet]
    max_items: Optional[int] = Field(alias="maxItems")
    assignment_strategy: AssignmentStrategy = Field(alias="assignmentStrategy")
    reviewers: List[UserReference]
    created_at: str = Field(alias="createdAt")
    updated_at: str = Field(alias="updatedAt")

idstrRequired

The id of the task, generated by Confident AI.

Example: "<QUEUE-INGESTION-TASK-ID>"

namestrRequired

The name of the task.

Example: "Failed capital lookups"

descriptionOptional[str]Required

A note about what the task harvests.

Example: "Traces where the assistant failed to name a capital."

enabledboolRequired

Whether the task is running.

Example: true

sample_ratefloatRequired

The fraction of matching items the task queues.

Example: 0.1

data_modelIngestionDataModelRequired

filtersOptional[FilterSet]Required

The filters an item must match to be queued, or null when every item of the data model qualifies.

See FilterSet.

max_itemsOptional[int]Required

The maximum number of items this task will queue, or null when it is uncapped.

Example: 500

assignment_strategyAssignmentStrategyRequired

reviewersList[UserReference]Required

The project members harvested items are assigned to, in the order the strategy deals them out.

See UserReference.

created_atstrRequired

When the task was created.

Example: "2025-01-15T10:30:00+00:00"

updated_atstrRequired

When the task was last changed.

Example: "2025-01-16T09:00:00+00:00"

QueueIngestionTaskList

The ingestion tasks filling an annotation queue.

class QueueIngestionTaskList:
    queue_ingestion_tasks: List[QueueIngestionTaskSummary] = Field(alias="queueIngestionTasks")

queue_ingestion_tasksList[QueueIngestionTaskSummary]Required

The tasks filling this queue, newest first.

See QueueIngestionTaskSummary.

QueueIngestionTaskRef

A reference to a queue ingestion task by its id.

class QueueIngestionTaskRef:
    id: str

idstrRequired

The id of the task, generated by Confident AI.

Example: "<QUEUE-INGESTION-TASK-ID>"

QueueIngestionTaskSummary

A task as it appears in a list: what it harvests and whether it is running, without its filters or reviewers.

class QueueIngestionTaskSummary:
    id: str
    name: str
    enabled: bool
    data_model: IngestionDataModel = Field(alias="dataModel")

idstrRequired

The id of the task, generated by Confident AI.

Example: "<QUEUE-INGESTION-TASK-ID>"

namestrRequired

The name of the task.

Example: "Failed capital lookups"

enabledboolRequired

Whether the task is running.

Example: true

data_modelIngestionDataModelRequired

UserReference

A Confident AI user, as referenced by the records they created.

class UserReference:
    id: str
    email: str
    name: Optional[str]
    image: Optional[str]

idstrRequired

This is the id of the user.

Example: "<USER-ID>"

emailstrRequired

This is the email address of the user.

Example: "jane@acme.com"

nameOptional[str]Required

This is the display name of the user, or null when they have not set one.

Example: "Jane Doe"

imageOptional[str]Required

This is the URL of the user's avatar, or null when they have none.

Building a production pipeline?Design a scalable API workflow for evals, datasets, traces, and promptsTalk to an engineer

Last updated on

Built byConfident AI