Annotation Queues#
- class AnnotationQueuesClient(*, sdk_config: SDKConfiguration, generated_client: ApiClient)[source]#
Bases:
objectClient for managing annotation queues.
Supports creation, retrieval, update, deletion, and record management.
This class is primarily intended for internal use within the SDK. Users are highly encouraged to access resource-specific functionality via
arize.ArizeClient.The annotation queues client is a thin wrapper around the generated REST API client, using the shared generated API client owned by
arize.config.SDKConfiguration.- Parameters:
sdk_config (SDKConfiguration) – Resolved SDK configuration.
generated_client (ApiClient) – Shared generated API client instance.
- list(*, space: str | None = None, name: str | None = None, limit: int = 100, cursor: str | None = None) AnnotationQueueListResponse[source]#
List annotation queues the user has access to.
Annotation queues are returned in descending creation order (most recently created first).
- Parameters:
space (str | None) – Optional space filter. If the value is a base64-encoded resource ID it is treated as a space ID; otherwise it is used as a case-insensitive substring filter on the space name.
name (str | None) – Optional name substring to filter results.
limit (int) – Maximum number of annotation queues to return. The server enforces an upper bound.
cursor (str | None) – Opaque pagination cursor returned from a previous response.
- Returns:
A response object with the annotation queues and pagination information.
- Raises:
ApiException – If the REST API returns an error response (e.g. 400/401/403/429).
- Return type:
AnnotationQueueListResponse
- get(*, annotation_queue: str, space: str | None = None) AnnotationQueue[source]#
Get an annotation queue by ID or name.
- Parameters:
- Returns:
The annotation queue object.
- Raises:
NotFoundError – If the annotation queue name cannot be resolved.
ApiException – If the REST API returns an error response (e.g. 401/403/404/429).
- Return type:
- create(*, name: str, space: str, annotation_config_ids: builtins.list[str], annotator_emails: builtins.list[str], instructions: str | None = None, assignment_method: AssignmentMethod | None = None, record_sources: builtins.list[AnnotationQueueRecordInput | AnnotationQueueExampleRecordInput | AnnotationQueueSpanRecordInput | dict] | None = None) AnnotationQueue[source]#
Create an annotation queue.
- Parameters:
name (str) – Annotation queue name (must be unique within the target space, max 255 characters).
space (str) – Space ID or name to create the annotation queue in.
annotation_config_ids (builtins.list[str]) – IDs of annotation configs to associate with the queue (at least one required).
annotator_emails (builtins.list[str]) – Emails of users to assign as annotators (at least one required). All users must have active accounts with access to the space.
instructions (str | None) – Optional instructions for annotators (max 5000 characters).
assignment_method (AssignmentMethod | None) – How records are assigned to annotators. Defaults to
ALL(every annotator sees every record).record_sources (builtins.list[AnnotationQueueRecordInput | AnnotationQueueExampleRecordInput | AnnotationQueueSpanRecordInput | dict] | None) – Optional initial record sources to populate the queue (at most 2 sources per request).
- Returns:
The created annotation queue object as returned by the API.
- Raises:
NotFoundError – If the space name cannot be resolved to an ID.
ApiException – If the REST API returns an error response (e.g. 400/401/403/409/429).
- Return type:
- update(*, annotation_queue: str, space: str | None = None, name: str | None = None, instructions: str | None = None, annotation_config_ids: builtins.list[str] | None = None, annotator_emails: builtins.list[str] | None = None) AnnotationQueue[source]#
Update an annotation queue.
Only the fields passed are updated. At least one field must be provided. List fields (
annotation_config_ids,annotator_emails) fully replace the existing values when provided.- Parameters:
annotation_queue (str) – Annotation queue ID or name. If a name is provided, space is required for resolution.
space (str | None) – Space ID or name. Required when annotation_queue is a name so it can be resolved to an ID.
name (str | None) – New name for the queue (must remain unique within the space).
instructions (str | None) – New instructions for annotators. Pass an empty string to clear existing instructions.
annotation_config_ids (builtins.list[str] | None) – Full replacement list of annotation config IDs. Pass an empty list to clear.
annotator_emails (builtins.list[str] | None) – Full replacement list of annotator emails. Pass an empty list to clear.
- Returns:
The updated annotation queue object as returned by the API.
- Raises:
ValueError – If no fields to update are provided.
NotFoundError – If the annotation queue name cannot be resolved.
ApiException – If the REST API returns an error response (e.g. 400/401/403/404/409/429).
- Return type:
- delete(*, annotation_queue: str, space: str | None = None) None[source]#
Delete an annotation queue by ID or name.
This operation is irreversible.
- Parameters:
- Returns:
This method returns None on success (HTTP 204 No Content).
- Raises:
NotFoundError – If the annotation queue name cannot be resolved.
ApiException – If the REST API returns an error response (e.g. 401/403/404/429).
- Return type:
None
- list_records(*, annotation_queue: str, space: str | None = None, limit: int = 100, cursor: str | None = None) AnnotationQueueRecordListResponse[source]#
List records in an annotation queue.
Each record includes its data as flat key-value pairs, any annotations that have been added, and the users assigned to annotate it.
- Parameters:
annotation_queue (str) – Annotation queue ID or name. If a name is provided, space is required for resolution.
space (str | None) – Space ID or name. Required when annotation_queue is a name so it can be resolved to an ID.
limit (int) – Maximum number of records to return (server enforces an upper bound of 500).
cursor (str | None) – Opaque pagination cursor returned from a previous response.
- Returns:
A response object with the records and pagination information.
- Raises:
NotFoundError – If the annotation queue name cannot be resolved.
ApiException – If the REST API returns an error response (e.g. 401/403/404/429).
- Return type:
AnnotationQueueRecordListResponse
- add_records(*, annotation_queue: str, space: str | None = None, record_sources: builtins.list[AnnotationQueueRecordInput | AnnotationQueueExampleRecordInput | AnnotationQueueSpanRecordInput | dict]) AnnotationQueueRecordCreateResponse[source]#
Add records to an annotation queue.
Records may come from spans (a project time range) or dataset examples. At most 2 record sources and 500 total records may be added per request.
- Parameters:
annotation_queue (str) – Annotation queue ID or name. If a name is provided, space is required for resolution.
space (str | None) – Space ID or name. Required when annotation_queue is a name so it can be resolved to an ID.
record_sources (builtins.list[AnnotationQueueRecordInput | AnnotationQueueExampleRecordInput | AnnotationQueueSpanRecordInput | dict]) – List of record sources (1-2 sources). Each source is an
AnnotationQueueRecordInputwrapping either anAnnotationQueueSpanRecordInputorAnnotationQueueExampleRecordInput.
- Returns:
A response object containing the created record sources.
- Raises:
NotFoundError – If the annotation queue name cannot be resolved.
ApiException – If the REST API returns an error response (e.g. 400/401/403/404/429).
- Return type:
AnnotationQueueRecordCreateResponse
- delete_records(*, annotation_queue: str, space: str | None = None, record_ids: builtins.list[str]) None[source]#
Delete records from an annotation queue.
Record IDs that are not found or do not belong to the specified queue are silently ignored. A successful response does not guarantee all provided IDs were deleted.
- Parameters:
annotation_queue (str) – Annotation queue ID or name. If a name is provided, space is required for resolution.
space (str | None) – Space ID or name. Required when annotation_queue is a name so it can be resolved to an ID.
record_ids (builtins.list[str]) – IDs of records to delete (1-100 IDs per request).
- Returns:
This method returns None on success (HTTP 204 No Content).
- Raises:
NotFoundError – If the annotation queue name cannot be resolved.
ApiException – If the REST API returns an error response (e.g. 400/401/403/404/429).
- Return type:
None
- annotate_record(*, annotation_queue: str, space: str | None = None, record_id: str, annotations: builtins.list[AnnotationInput]) AnnotationQueueRecordAnnotateResult[source]#
Submit annotations for an annotation queue record.
Annotations are upserted by annotation config name; omitted configs are left unchanged.
- Parameters:
annotation_queue (str) – Annotation queue ID or name. If a name is provided, space is required for resolution.
space (str | None) – Space ID or name. Required when annotation_queue is a name so it can be resolved to an ID.
record_id (str) – ID of the record to annotate.
annotations (builtins.list[AnnotationInput]) – Annotation values to upsert. Each entry targets one annotation config by name and may set a
score,label, and/ortext.
- Returns:
A result object with the submitted annotation values.
- Raises:
NotFoundError – If the annotation queue name cannot be resolved.
ApiException – If the REST API returns an error response (e.g. 400/401/403/404/429).
- Return type:
- assign_record(*, annotation_queue: str, space: str | None = None, record_id: str, assigned_user_emails: builtins.list[str]) AnnotationQueueRecordAssignResult[source]#
Assign users to an annotation queue record.
Fully replaces the current record-level user assignment. Pass an empty list to remove all assignments.
- Parameters:
annotation_queue (str) – Annotation queue ID or name. If a name is provided, space is required for resolution.
space (str | None) – Space ID or name. Required when annotation_queue is a name so it can be resolved to an ID.
record_id (str) – ID of the record to assign users to.
assigned_user_emails (builtins.list[str]) – Emails of users to assign (at most 100). Replaces all existing record-level assignments.
- Returns:
A result object with the updated user assignments.
- Raises:
NotFoundError – If the annotation queue name cannot be resolved.
ApiException – If the REST API returns an error response (e.g. 400/401/403/404/429).
- Return type:
Response Types#
- class AnnotationInput(*, name: Annotated[str, Strict(strict=True)], score: Annotated[float, Strict(strict=True)] | Annotated[int, Strict(strict=True)] | None = None, label: Annotated[str, Strict(strict=True)] | None = None, text: Annotated[str, Strict(strict=True)] | None = None)[source]#
Bases:
BaseModelAn annotation value to set on a record, identified by its annotation config name. Omitting a field leaves the existing value unchanged.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- name: StrictStr#
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of AnnotationInput from a JSON string
- to_dict() Dict[str, Any][source]#
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True):
None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- class AnnotationQueue(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], space_id: Annotated[str, Strict(strict=True)], instructions: Annotated[str, Strict(strict=True)] | None = None, annotation_configs: List[AnnotationConfig] | None = None, annotators: List[AnnotatorUser], created_at: datetime, updated_at: datetime)[source]#
Bases:
BaseModelCreate a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
annotation_configs (List[AnnotationConfig] | None)
annotators (List[AnnotatorUser])
created_at (datetime)
updated_at (datetime)
- id: StrictStr#
- name: StrictStr#
- space_id: StrictStr#
- annotation_configs: List[AnnotationConfig] | None#
- annotators: List[AnnotatorUser]#
- created_at: datetime#
- updated_at: datetime#
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of AnnotationQueue from a JSON string
- to_dict() Dict[str, Any][source]#
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True):
None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- class AnnotationQueueExampleRecordInput(*, record_type: Annotated[str, Strict(strict=True)], dataset_id: Annotated[str, Strict(strict=True)], dataset_version_id: Annotated[str, Strict(strict=True)] | None = None, example_ids: List[Annotated[str, Strict(strict=True)]] | None = None)[source]#
Bases:
BaseModelCreate a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- record_type: StrictStr#
- dataset_id: StrictStr#
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of AnnotationQueueExampleRecordInput from a JSON string
- to_dict() Dict[str, Any][source]#
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True):
None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- class AnnotationQueueRecordAnnotateResult(*, id: Annotated[str, Strict(strict=True)], annotation_queue_id: Annotated[str, Strict(strict=True)], source_type: AnnotationQueueSourceType, annotations: List[Annotation])[source]#
Bases:
BaseModelA snapshot of the annotation queue record fields that were modified by an annotate operation. Only the record identity fields and the submitted annotations are returned. Evaluations and user assignments are not fetched and are not included in this response for performance reasons; use the list records endpoint to retrieve the full record state.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- id: StrictStr#
- annotation_queue_id: StrictStr#
- source_type: AnnotationQueueSourceType#
- annotations: List[Annotation]#
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of AnnotationQueueRecordAnnotateResult from a JSON string
- to_dict() Dict[str, Any][source]#
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True):
None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- class AnnotationQueueRecordAssignResult(*, id: Annotated[str, Strict(strict=True)], annotation_queue_id: Annotated[str, Strict(strict=True)], source_type: AnnotationQueueSourceType, assigned_users: List[AnnotationQueueAssignedUser])[source]#
Bases:
BaseModelA snapshot of the annotation queue record fields that were modified by an assign operation. Only the record identity fields and the resulting user assignments are returned. Annotations and evaluations are not fetched and are not included in this response for performance reasons; use the list records endpoint to retrieve the full record state.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- id: StrictStr#
- annotation_queue_id: StrictStr#
- source_type: AnnotationQueueSourceType#
- assigned_users: List[AnnotationQueueAssignedUser]#
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of AnnotationQueueRecordAssignResult from a JSON string
- to_dict() Dict[str, Any][source]#
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True):
None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- class AnnotationQueueRecordInput(*args, oneof_schema_1_validator: AnnotationQueueExampleRecordInput | None = None, oneof_schema_2_validator: AnnotationQueueSpanRecordInput | None = None, actual_instance: AnnotationQueueExampleRecordInput | AnnotationQueueSpanRecordInput | None = None, one_of_schemas: Set[str] = {'AnnotationQueueExampleRecordInput', 'AnnotationQueueSpanRecordInput'}, discriminator_value_class_map: Dict[str, str] = {})[source]#
Bases:
BaseModelCreate a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
oneof_schema_1_validator (AnnotationQueueExampleRecordInput | None)
oneof_schema_2_validator (AnnotationQueueSpanRecordInput | None)
actual_instance (AnnotationQueueExampleRecordInput | AnnotationQueueSpanRecordInput | None)
- oneof_schema_1_validator: AnnotationQueueExampleRecordInput | None#
- oneof_schema_2_validator: AnnotationQueueSpanRecordInput | None#
- actual_instance: AnnotationQueueExampleRecordInput | AnnotationQueueSpanRecordInput | None#
- model_config: ClassVar[ConfigDict] = {'protected_namespaces': (), 'validate_assignment': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str: str) Self[source]#
Returns the object represented by the json string
- to_dict() Dict[str, Any] | AnnotationQueueExampleRecordInput | AnnotationQueueSpanRecordInput | None[source]#
Returns the dict representation of the actual instance
- Return type:
Dict[str, Any] | AnnotationQueueExampleRecordInput | AnnotationQueueSpanRecordInput | None
- class AnnotationQueueSpanRecordInput(*, record_type: Annotated[str, Strict(strict=True)], project_id: Annotated[str, Strict(strict=True)], start_time: datetime, end_time: datetime, span_ids: Annotated[List[Annotated[str, Strict(strict=True)]], MinLen(min_length=1)])[source]#
Bases:
BaseModelCreate a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
- record_type: StrictStr#
- project_id: StrictStr#
- start_time: datetime#
- end_time: datetime#
- span_ids: Annotated[List[StrictStr], Field(min_length=1)]#
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str: str) Self | None[source]#
Create an instance of AnnotationQueueSpanRecordInput from a JSON string
- to_dict() Dict[str, Any][source]#
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True):
None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- class AssignmentMethod(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
How records are assigned to annotators. Defaults to “all”. - all: Every annotator is assigned to every record. - random: Each record is randomly assigned to one annotator.
- ALL = 'all'#
- RANDOM = 'random'#