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
| Parameter | Type | Description |
|---|---|---|
annotation_queue_id | str | Required. The id of the annotation queue. |
data_model | Optional[IngestionDataModel] | Returns only tasks harvesting this kind of production item. See IngestionDataModel. |
import { ConfidentAI } from "confident-ai";
import { IngestionDataModel } from "confident-ai/common";
const client = new ConfidentAI();
const result = await client.annotationQueues.listQueueIngestionTasks(
"<ANNOTATION-QUEUE-ID>",
{ dataModel: IngestionDataModel.TRACE },
);Parameters
| Parameter | Type | Description |
|---|---|---|
annotationQueueId | string | Required. The id of the annotation queue. |
dataModel | 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
| Parameter | Type | Description |
|---|---|---|
annotation_queue_id | str | Required. The id of the annotation queue. |
name | str | Required. The name of the task. |
data_model | IngestionDataModel | Required. See IngestionDataModel. |
description | Optional[str] | A note about what the task harvests. Send null to clear it. |
enabled | Optional[bool] | Whether the task runs. Disabling it stops new items arriving; items already queued are kept. Defaults to false. |
sample_rate | Optional[float] | The fraction of matching items to queue, between 0 and 1. Defaults to 1, all of them. |
filters | Optional[FilterSet] | See FilterSet. |
max_items | Optional[int] | The maximum number of items this task will ever queue. Send null to remove the cap. |
assignment_strategy | Optional[AssignmentStrategy] | See AssignmentStrategy. |
reviewer_emails | Optional[List[str]] | The project members harvested items are assigned to, following assignmentStrategy. |
import { ConfidentAI } from "confident-ai";
import { AssignmentStrategy } from "confident-ai/annotation-queues";
import { IngestionDataModel } from "confident-ai/common";
const client = new ConfidentAI();
const result = await client.annotationQueues.createQueueIngestionTask(
"<ANNOTATION-QUEUE-ID>",
"Failed capital lookups",
IngestionDataModel.TRACE,
{
description: "Traces where the assistant failed to name a capital.",
enabled: true,
sampleRate: 0.1,
filters: {
operator: "AND",
groups: [
{
operator: "AND",
filters: [{ category: "Name", condition: "Is", value: "capital-lookup" }]
}
]
},
maxItems: 500,
assignmentStrategy: AssignmentStrategy.SINGLE_USER,
reviewerEmails: ["jane@acme.com"]
},
);Parameters
| Parameter | Type | Description |
|---|---|---|
annotationQueueId | string | Required. The id of the annotation queue. |
name | string | Required. The name of the task. |
dataModel | IngestionDataModel | Required. See IngestionDataModel. |
description | string | null | A note about what the task harvests. Send null to clear it. |
enabled | boolean | Whether the task runs. Disabling it stops new items arriving; items already queued are kept. Defaults to false. |
sampleRate | number | The fraction of matching items to queue, between 0 and 1. Defaults to 1, all of them. |
filters | FilterSet | See FilterSet. |
maxItems | number | null | The maximum number of items this task will ever queue. Send null to remove the cap. |
assignmentStrategy | AssignmentStrategy | See AssignmentStrategy. |
reviewerEmails | string[] | 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
| Parameter | Type | Description |
|---|---|---|
annotation_queue_id | str | Required. The id of the annotation queue the task fills. |
queue_ingestion_task_id | str | Required. The id of the queue ingestion task. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.annotationQueues.getQueueIngestionTask(
"<ANNOTATION-QUEUE-ID>",
"<QUEUE-INGESTION-TASK-ID>",
);Parameters
| Parameter | Type | Description |
|---|---|---|
annotationQueueId | string | Required. The id of the annotation queue the task fills. |
queueIngestionTaskId | string | Required. 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
| Parameter | Type | Description |
|---|---|---|
annotation_queue_id | str | Required. The id of the annotation queue the task fills. |
queue_ingestion_task_id | str | Required. The id of the queue ingestion task. |
name | Optional[str] | The name of the task. |
data_model | Optional[IngestionDataModel] | See IngestionDataModel. |
description | Optional[str] | A note about what the task harvests. Send null to clear it. |
enabled | Optional[bool] | Whether the task runs. Disabling it stops new items arriving; items already queued are kept. Defaults to false. |
sample_rate | Optional[float] | The fraction of matching items to queue, between 0 and 1. Defaults to 1, all of them. |
filters | Optional[FilterSet] | See FilterSet. |
max_items | Optional[int] | The maximum number of items this task will ever queue. Send null to remove the cap. |
assignment_strategy | Optional[AssignmentStrategy] | See AssignmentStrategy. |
reviewer_emails | Optional[List[str]] | The project members harvested items are assigned to, following assignmentStrategy. |
import { ConfidentAI } from "confident-ai";
import { AssignmentStrategy } from "confident-ai/annotation-queues";
import { IngestionDataModel } from "confident-ai/common";
const client = new ConfidentAI();
const result = await client.annotationQueues.updateQueueIngestionTask(
"<ANNOTATION-QUEUE-ID>",
"<QUEUE-INGESTION-TASK-ID>",
{
name: "Failed capital lookups",
dataModel: IngestionDataModel.TRACE,
description: "Traces where the assistant failed to name a capital.",
enabled: true,
sampleRate: 0.1,
filters: {
operator: "AND",
groups: [
{
operator: "AND",
filters: [{ category: "Name", condition: "Is", value: "capital-lookup" }]
}
]
},
maxItems: 500,
assignmentStrategy: AssignmentStrategy.SINGLE_USER,
reviewerEmails: ["jane@acme.com"]
},
);Parameters
| Parameter | Type | Description |
|---|---|---|
annotationQueueId | string | Required. The id of the annotation queue the task fills. |
queueIngestionTaskId | string | Required. The id of the queue ingestion task. |
name | string | The name of the task. |
dataModel | IngestionDataModel | See IngestionDataModel. |
description | string | null | A note about what the task harvests. Send null to clear it. |
enabled | boolean | Whether the task runs. Disabling it stops new items arriving; items already queued are kept. Defaults to false. |
sampleRate | number | The fraction of matching items to queue, between 0 and 1. Defaults to 1, all of them. |
filters | FilterSet | See FilterSet. |
maxItems | number | null | The maximum number of items this task will ever queue. Send null to remove the cap. |
assignmentStrategy | AssignmentStrategy | See AssignmentStrategy. |
reviewerEmails | string[] | 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
| Parameter | Type | Description |
|---|---|---|
annotation_queue_id | str | Required. The id of the annotation queue the task fills. |
queue_ingestion_task_id | str | Required. The id of the queue ingestion task. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.annotationQueues.deleteQueueIngestionTask(
"<ANNOTATION-QUEUE-ID>",
"<QUEUE-INGESTION-TASK-ID>",
);Parameters
| Parameter | Type | Description |
|---|---|---|
annotationQueueId | string | Required. The id of the annotation queue the task fills. |
queueIngestionTaskId | string | Required. 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"enum AssignmentStrategy {
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
interface FilterSet {
operator: "AND" | "OR";
groups: FilterSetGroup[];
}operator"AND" | "OR"Required
groupsFilterSetGroup[]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"enum IngestionDataModel {
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
See IngestionDataModel.
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
See AssignmentStrategy.
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"
interface QueueIngestionTask {
id: string;
name: string;
description: string | null;
enabled: boolean;
sampleRate: number;
dataModel: IngestionDataModel;
filters: FilterSet | null;
maxItems: number | null;
assignmentStrategy: AssignmentStrategy;
reviewers: UserReference[];
createdAt: string;
updatedAt: string;
}idstringRequired
The id of the task, generated by Confident AI.
Example: "<QUEUE-INGESTION-TASK-ID>"
namestringRequired
The name of the task.
Example: "Failed capital lookups"
descriptionstring | nullRequired
A note about what the task harvests.
Example: "Traces where the assistant failed to name a capital."
enabledbooleanRequired
Whether the task is running.
Example: true
sampleRatenumberRequired
The fraction of matching items the task queues.
Example: 0.1
dataModelIngestionDataModelRequired
See IngestionDataModel.
filtersFilterSet | nullRequired
The filters an item must match to be queued, or null when every item of the data model qualifies.
See FilterSet.
maxItemsnumber | nullRequired
The maximum number of items this task will queue, or null when it is uncapped.
Example: 500
assignmentStrategyAssignmentStrategyRequired
See AssignmentStrategy.
reviewersUserReference[]Required
The project members harvested items are assigned to, in the order the strategy deals them out.
See UserReference.
createdAtstringRequired
When the task was created.
Example: "2025-01-15T10:30:00+00:00"
updatedAtstringRequired
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.
interface QueueIngestionTaskList {
queueIngestionTasks: QueueIngestionTaskSummary[];
}queueIngestionTasksQueueIngestionTaskSummary[]Required
The tasks filling this queue, newest first.
QueueIngestionTaskRef
A reference to a queue ingestion task by its id.
class QueueIngestionTaskRef:
id: stridstrRequired
The id of the task, generated by Confident AI.
Example: "<QUEUE-INGESTION-TASK-ID>"
interface QueueIngestionTaskRef {
id: string;
}idstringRequired
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
See IngestionDataModel.
interface QueueIngestionTaskSummary {
id: string;
name: string;
enabled: boolean;
dataModel: IngestionDataModel;
}idstringRequired
The id of the task, generated by Confident AI.
Example: "<QUEUE-INGESTION-TASK-ID>"
namestringRequired
The name of the task.
Example: "Failed capital lookups"
enabledbooleanRequired
Whether the task is running.
Example: true
dataModelIngestionDataModelRequired
See IngestionDataModel.
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.
interface UserReference {
id: string;
email: string;
name: string | null;
image: string | null;
}idstringRequired
This is the id of the user.
Example: "<USER-ID>"
emailstringRequired
This is the email address of the user.
Example: "jane@acme.com"
namestring | nullRequired
This is the display name of the user, or null when they have not set one.
Example: "Jane Doe"
imagestring | nullRequired
This is the URL of the user's avatar, or null when they have none.
Last updated on