- list - List annotation queues
- create - Create an annotation queue
- retrieve - Retrieve an annotation queue
- delete - Delete an annotation queue
- update - Update an annotation queue
- clear - Clear an annotation queue
- list_items - Query items from an annotation queue
- add_items - Add items to an annotation queue
- remove_items - Remove items from an annotation queue
- retrieve_item - Retrieve an annotation queue item
Returns annotation queues in the workspace, newest first.
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)
| Parameter |
Type |
Required |
Description |
limit |
Optional[int] |
➖ |
Optional. Number of annotation queues to return. Defaults to 10 and must be between 1 and 200. |
starting_after |
Optional[str] |
➖ |
Cursor for forward pagination. Set to the _id of the last item from the previous page. |
ending_before |
Optional[str] |
➖ |
Cursor for backward pagination. Set to the _id of the first item from the previous page. |
search |
Optional[str] |
➖ |
Optional. Case-insensitive substring match on the annotation queue display name. |
updated_by |
Optional[str] |
➖ |
Optional. Comma-separated account IDs; returns queues last updated by any of them. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListAnnotationQueuesResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Creates an annotation queue in a project.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.annotation_queues.create(display_name="Vernice_Fadel", description="categorise egg foolishly", project_id="<id>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
display_name |
str |
✔️ |
Required. The display name of the annotation queue. |
description |
str |
✔️ |
Required. The description of the annotation queue. |
project_id |
str |
✔️ |
Required. The project to link this annotation queue to. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.AnnotationQueue
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Retrieves an existing annotation queue by ID.
from 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)
| Parameter |
Type |
Required |
Description |
annotation_queue_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.AnnotationQueue
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Deletes an annotation queue, its items, and the queue references stored on the annotated spans.
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 ...
| Parameter |
Type |
Required |
Description |
annotation_queue_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Partially updates an existing annotation queue. Setting project_id clears the legacy human_review_ids selection.
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)
| Parameter |
Type |
Required |
Description |
annotation_queue_id |
str |
✔️ |
N/A |
display_name |
Optional[str] |
➖ |
Optional. New display name. |
description |
Optional[str] |
➖ |
Optional. New description. |
project_id |
Optional[str] |
➖ |
Optional. New project. Setting this clears the legacy human_review_ids selection. |
human_review_ids |
List[str] |
➖ |
Legacy: update manually selected human review IDs. Only applied when project_id is not set. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.AnnotationQueue
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Removes every item from the annotation queue without deleting the queue itself.
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 ...
| Parameter |
Type |
Required |
Description |
annotation_queue_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Queries items from the specified annotation queue. Items whose span no longer exists are skipped.
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)
| Parameter |
Type |
Required |
Description |
annotation_queue_id |
str |
✔️ |
N/A |
limit |
Optional[int] |
➖ |
Optional. Number of items to return. Defaults to 10 and must be between 1 and 200. |
starting_after |
Optional[str] |
➖ |
Cursor for forward pagination. Set to the _id of the last item from the previous page. |
ending_before |
Optional[str] |
➖ |
Cursor for backward pagination. Set to the _id of the first item from the previous page. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListAnnotationQueueItemsResponse
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Adds spans to the annotation queue. Spans already present are skipped; the response contains only the newly created items.
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)
List[models.AnnotationQueueItem]
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Removes the referenced spans from the 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 ...
| Parameter |
Type |
Required |
Description |
annotation_queue_id |
str |
✔️ |
N/A |
span_ids |
List[str] |
✔️ |
The unique identifiers of the spans to be removed from the annotation queue. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |
Retrieves an item from the specified annotation queue in its expanded form. An annotation queue item is a pointer to a span; this endpoint returns the fully resolved span the item references.
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)
| Parameter |
Type |
Required |
Description |
annotation_queue_id |
str |
✔️ |
N/A |
item_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.RetrieveAnnotationQueueItemResponseBody
| Error Type |
Status Code |
Content Type |
| models.APIDefaultError |
4XX, 5XX |
*/* |