Annotation Queues
List Annotation Queues
Retrieves a paginated list of annotation queues for the current workspace. Results can be paginated using cursor-based pagination.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.list(limit=10)
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.list({});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"limit": Optional[int],
"starting_after": Optional[str],
"ending_before": Optional[str],
"search": Optional[str],
"updated_by": Optional[str],
}
{
limit?: number;
startingAfter?: string;
endingBefore?: string;
search?: string;
updatedBy?: string;
}
Show Response
Show Response
{
"object": Literal["list"],
"data": [{
"id": str,
"display_name": str,
"description": str,
"workspace_id": str,
"project_id": Optional[str],
"human_review_ids": List[str],
"metadata": {
"items_count": float,
},
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"created": str, # optional
"updated": str, # optional
}],
"has_more": bool,
}
{
object: "list";
data: {
id: string;
displayName: string;
description: string;
workspaceId: string;
projectId?: string;
humanReviewIds: string[];
metadata: {
itemsCount: number;
};
createdById?: string;
updatedById?: string;
created?: Date;
updated?: Date;
}[];
hasMore: boolean;
}
Create an Annotation Queue
Create a new annotation queue in the workspace.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.create()
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.create();
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"display_name": str, # required
"description": str, # required
"project_id": str, # required
}
{
displayName: string; // required
description: string; // required
projectId: string; // required
}
Show Response
Show Response
{
"id": str,
"display_name": str,
"description": str,
"workspace_id": str,
"project_id": Optional[str],
"human_review_ids": List[str],
"metadata": {
"items_count": float,
},
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"created": str, # optional
"updated": str, # optional
}
{
id: string;
displayName: string;
description: string;
workspaceId: string;
projectId?: string;
humanReviewIds: string[];
metadata: {
itemsCount: number;
};
createdById?: string;
updatedById?: string;
created?: Date;
updated?: Date;
}
Retrieve an Annotation Queue
Retrieves a specific annotation queue by its unique identifierfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.retrieve(annotation_queue_id="<id>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.retrieve({
annotationQueueId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
}
{
annotationQueueId: string; // required
}
Show Response
Show Response
{
"id": str,
"display_name": str,
"description": str,
"workspace_id": str,
"project_id": Optional[str],
"human_review_ids": List[str],
"metadata": {
"items_count": float,
},
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"created": str, # optional
"updated": str, # optional
}
{
id: string;
displayName: string;
description: string;
workspaceId: string;
projectId?: string;
humanReviewIds: string[];
metadata: {
itemsCount: number;
};
createdById?: string;
updatedById?: string;
created?: Date;
updated?: Date;
}
Update an Annotation Queue
Update an annotation queue by ID with the provided fields.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.update(annotation_queue_id="<id>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.update({
annotationQueueId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
"display_name": Optional[str],
"description": Optional[str],
"project_id": Optional[str],
"human_review_ids": List[str], # optional
}
{
annotationQueueId: string; // required
requestBody?: {
displayName?: string;
description?: string;
projectId?: string;
humanReviewIds?: string[];
};
}
Show Response
Show Response
{
"id": str,
"display_name": str,
"description": str,
"workspace_id": str,
"project_id": Optional[str],
"human_review_ids": List[str],
"metadata": {
"items_count": float,
},
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"created": str, # optional
"updated": str, # optional
}
{
id: string;
displayName: string;
description: string;
workspaceId: string;
projectId?: string;
humanReviewIds: string[];
metadata: {
itemsCount: number;
};
createdById?: string;
updatedById?: string;
created?: Date;
updated?: Date;
}
Delete an Annotation Queue
Delete an annotation queue and its items by ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.annotation_queues.delete(annotation_queue_id="<id>")
# Use the SDK ...
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
await orq.annotationQueues.delete({
annotationQueueId: "<id>",
});
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
}
{
annotationQueueId: string; // required
}
Clear an Annotation Queue
Delete all items from an annotation queue. This action is irreversible.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.annotation_queues.clear(annotation_queue_id="<id>")
# Use the SDK ...
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
await orq.annotationQueues.clear({
annotationQueueId: "<id>",
});
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
}
{
annotationQueueId: string; // required
}
List Annotation Queue Items
Queries items from the specified annotation queue.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.list_items(annotation_queue_id="<id>", limit=10)
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.listItems({
annotationQueueId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
"limit": Optional[int],
"starting_after": Optional[str],
"ending_before": Optional[str],
}
{
annotationQueueId: string; // required
limit?: number;
startingAfter?: string;
endingBefore?: string;
}
Show Response
Show Response
{
"object": Literal["list"],
"data": List[Union[ListAnnotationQueueItemsData1, ListAnnotationQueueItemsData2]],
"has_more": bool,
}
{
object: "list";
data: (ListAnnotationQueueItemsData1 | ListAnnotationQueueItemsData2)[];
hasMore: boolean;
}
Add Annotation Queue Items
Adds items to the specified annotation queue.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.add_items(annotation_queue_id="<id>", items=[
{
"span_id": "<id>",
"trace_id": "<id>",
},
])
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.addItems({
annotationQueueId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
"items": [{ # required
"span_id": str, # required
"trace_id": str, # required
}],
}
{
annotationQueueId: string; // required
requestBody?: {
items: { // required
spanId: string; // required
traceId: string; // required
}[];
};
}
Remove Annotation Queue Items
Removes items from the specified annotation queue.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.annotation_queues.remove_items(annotation_queue_id="<id>", span_ids=[
"<value 1>",
"<value 2>",
])
# Use the SDK ...
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
await orq.annotationQueues.removeItems({
annotationQueueId: "<id>",
});
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
"span_ids": List[str], # required
}
{
annotationQueueId: string; // required
requestBody?: {
spanIds: string[]; // required
};
}
Retrieve an Annotation Queue Item
Retrieve an annotation queue item. Each item is a pointer to a span with fully resolved span data.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.retrieve_item(annotation_queue_id="<id>", item_id="<id>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.annotationQueues.retrieveItem({
annotationQueueId: "<id>",
itemId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"annotation_queue_id": str, # required
"item_id": str, # required
}
{
annotationQueueId: string; // required
itemId: string; // required
}
Show Response
Show Response
{
"id": str,
"trace_id": str,
"type": str,
"span_id": Optional[str],
"parent_id": Optional[str],
"session_id": Optional[str],
"name": Optional[str],
"start_time": Optional[str],
"end_time": Optional[str],
"duration": Optional[float],
"total_tokens": Optional[float],
"total_cost": Optional[float],
"billable": Optional[bool],
"context": { # optional
"trace_id": str,
"span_id": str,
},
"events": List[Dict[str, Any]], # optional
"input": Optional[Any],
"output": Optional[Any],
"attributes": Dict[str, Any], # optional
}
{
id: string;
traceId: string;
type: string;
spanId?: string;
parentId?: string;
sessionId?: string;
name?: string;
startTime?: string;
endTime?: string;
duration?: number;
totalTokens?: number;
totalCost?: number;
billable?: boolean;
context?: {
traceId: string;
spanId: string;
};
events?: Record<string, any>[];
input?: any;
output?: any;
attributes?: Record<string, any>;
}