Annotations

Submit, import, and fetch annotations.

submit_annotations

Submits annotations for a queue item as the authenticated user.

def submit_annotations(
    self,
    queue_id: Optional[str] = None,
    item_id: Optional[str] = None,
    annotations: Optional[List[Dict[str, Any]]] = None,
    *,
    queue_name: Optional[str] = None,
    notes: Optional[str] = None,
    timeout: Optional[int] = None,
) -> Dict[str, Any]
  • Arguments:
    • queue_id (Optional[str]): UUID of the annotation queue.
    • item_id (str): UUID of the queue item.
    • annotations (List[Dict[str, Any]]): List of dicts, each with label_id and value.
    • queue_name (Optional[str]): Name of the annotation queue (alternative to queue_id).
    • notes (Optional[str]): Free-text notes.
    • timeout (Optional[int]): Request timeout in seconds.
  • Returns:
    • Dict[str, Any]

import_annotations

Imports annotations for a queue item programmatically. Use this when you want to bulk-import annotations from an external source or automated pipeline.

def import_annotations(
    self,
    queue_id: Optional[str] = None,
    item_id: Optional[str] = None,
    annotations: Optional[List[Dict[str, Any]]] = None,
    *,
    queue_name: Optional[str] = None,
    annotator_id: Optional[str] = None,
    timeout: Optional[int] = None,
) -> ImportAnnotationsResponse
  • Arguments:
    • queue_id (Optional[str]): UUID of the annotation queue.
    • item_id (str): UUID of the queue item.
    • annotations (List[Dict[str, Any]]): List of dicts, each with label_id and value. Optionally include score_source (default: "imported").
    • queue_name (Optional[str]): Name of the annotation queue (alternative to queue_id).
    • annotator_id (Optional[str]): User ID to attribute the annotations to.
    • timeout (Optional[int]): Request timeout in seconds.
  • Returns:
    • ImportAnnotationsResponse with imported count.

get_annotations

Gets all annotations for a queue item.

def get_annotations(
    self,
    queue_id: Optional[str] = None,
    item_id: Optional[str] = None,
    *,
    queue_name: Optional[str] = None,
    timeout: Optional[int] = None,
) -> List[Score]
  • Arguments:
    • queue_id (Optional[str]): UUID of the annotation queue.
    • item_id (str): UUID of the queue item.
    • queue_name (Optional[str]): Name of the annotation queue (alternative to queue_id).
    • timeout (Optional[int]): Request timeout in seconds.
  • Returns:
    • List[Score]

Was this page helpful?

Questions & Discussion