Annotation Configs#

class AnnotationConfigsClient(*, sdk_config: SDKConfiguration, generated_client: ApiClient)[source]#

Bases: object

Client for managing annotation configs including creation, retrieval, and deletion.

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 configs 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(*, name: str | None = None, space: str | None = None, limit: int = 100, cursor: str | None = None) AnnotationConfigsList200Response[source]#

List annotation configs the user has access to.

Annotation configs are returned in descending creation order (most recently created first).

Parameters:
  • name (str | None) – Optional case-insensitive substring filter on the annotation config name.

  • 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.

  • limit (int) – Maximum number of annotation configs 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 configs and pagination information.

Raises:

ApiException – If the REST API returns an error response (e.g. 401/403/429).

Return type:

AnnotationConfigsList200Response

create(*, name: str, space: str, config_type: AnnotationConfigType, minimum_score: float | int | None = None, maximum_score: float | int | None = None, values: builtins.list[CategoricalAnnotationValue] | None = None, optimization_direction: OptimizationDirection | None = None) CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig[source]#

Create an annotation config.

Supported config types:
  • continuous requires minimum_score and maximum_score

  • categorical requires values

  • freeform requires no additional fields

Parameters:
  • name (str) – Annotation config name (must be unique within the target space).

  • space (str) – Space ID or name to create the annotation config in.

  • config_type (AnnotationConfigType) – Type of annotation config to create.

  • minimum_score (float | int | None) – Minimum score for continuous configs.

  • maximum_score (float | int | None) – Maximum score for continuous configs.

  • values (builtins.list[CategoricalAnnotationValue] | None) – Categorical values for categorical configs.

  • optimization_direction (OptimizationDirection | None) – Optional optimization direction for continuous and categorical configs.

Returns:

The created annotation config object as returned by the API.

Raises:
  • ValueError – If required fields for the selected config type are missing.

  • ApiException – If the REST API returns an error response (e.g. 400/401/403/409/429).

Return type:

CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig

get(*, annotation_config: str, space: str | None = None) CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig[source]#

Get an annotation config by ID or name.

Parameters:
  • annotation_config (str) – Annotation config ID or name. If a name is provided, space is required for resolution.

  • space (str | None) – Space ID or name. Required when annotation_config is a name so it can be resolved to an ID.

Returns:

The annotation config object.

Raises:

ApiException – If the REST API returns an error response (e.g. 401/403/404/429).

Return type:

CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig

delete(*, annotation_config: str, space: str | None = None) None[source]#

Delete an annotation config by ID or name.

This operation is irreversible.

Parameters:
  • annotation_config (str) – Annotation config ID or name. If a name is provided, space is required for resolution.

  • space (str | None) – Space ID or name. Required when annotation_config is a name so it can be resolved to an ID.

Returns:

This method returns None on success (common empty 204 response).

Raises:

ApiException – If the REST API returns an error response (e.g. 401/403/404/429).

Return type:

None

Response Types#

class AnnotationConfigType(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

The type of annotation config: - continuous: a numeric score within a defined range - categorical: a set of labeled values each with an optional score - freeform: free-text annotation with no structured scoring

CONTINUOUS = 'continuous'#
CATEGORICAL = 'categorical'#
FREEFORM = 'freeform'#
classmethod from_json(json_str: str) Self[source]#

Create an instance of AnnotationConfigType from a JSON string

Parameters:

json_str (str)

Return type:

Self

class AnnotationConfig(*args, oneof_schema_1_validator: ContinuousAnnotationConfig | None = None, oneof_schema_2_validator: CategoricalAnnotationConfig | None = None, oneof_schema_3_validator: FreeformAnnotationConfig | None = None, actual_instance: CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig | None = None, one_of_schemas: Set[str] = {'CategoricalAnnotationConfig', 'ContinuousAnnotationConfig', 'FreeformAnnotationConfig'}, discriminator_value_class_map: Dict[str, str] = {})[source]#

Bases: BaseModel

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:
  • oneof_schema_1_validator (ContinuousAnnotationConfig | None)

  • oneof_schema_2_validator (CategoricalAnnotationConfig | None)

  • oneof_schema_3_validator (FreeformAnnotationConfig | None)

  • actual_instance (CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig | None)

  • one_of_schemas (Set[str])

  • discriminator_value_class_map (Dict[str, str])

oneof_schema_1_validator: ContinuousAnnotationConfig | None#
oneof_schema_2_validator: CategoricalAnnotationConfig | None#
oneof_schema_3_validator: FreeformAnnotationConfig | None#
actual_instance: CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig | None#
one_of_schemas: Set[str]#
model_config: ClassVar[ConfigDict] = {'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

discriminator_value_class_map: Dict[str, str]#
classmethod actual_instance_must_validate_oneof(v)[source]#
classmethod from_dict(obj: str | Dict[str, Any]) Self[source]#
Parameters:

obj (str | Dict[str, Any])

Return type:

Self

classmethod from_json(json_str: str) Self[source]#

Returns the object represented by the json string

Parameters:

json_str (str)

Return type:

Self

to_json() str[source]#

Returns the JSON representation of the actual instance

Return type:

str

to_dict() Dict[str, Any] | CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig | None[source]#

Returns the dict representation of the actual instance

Return type:

Dict[str, Any] | CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig | None

to_str() str[source]#

Returns the string representation of the actual instance

Return type:

str

class AnnotationConfigsList200Response(*, annotation_configs: list[CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig], pagination: PaginationMetadata)[source]#

Bases: BaseModel

SDK view of the generated list response with each AnnotationConfig unwrapped.

The annotation_configs field contains the concrete inner types (CategoricalAnnotationConfig, ContinuousAnnotationConfig, or FreeformAnnotationConfig) instead of the oneOf wrapper.

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:
  • annotation_configs (list[CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig])

  • pagination (PaginationMetadata)

annotation_configs: list[CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig]#
pagination: PaginationMetadata#
model_config: ClassVar[ConfigDict] = {'from_attributes': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_df(by_alias: bool = False, exclude_none: str | bool = True, json_normalize: bool = False, convert_dtypes: bool = True, expand_field: str = 'additional_properties', expand_prefix: str = '') pd.DataFrame#

Convert a list of objects to a pandas.DataFrame.

Behavior:
  • If an item is a Pydantic v2 model, use .model_dump(by_alias=…).

  • If an item is a mapping (dict-like), use it as-is.

  • Otherwise, raise a ValueError (unsupported row type).

Parameters:
  • self (object) – The object instance containing the field to convert.

  • by_alias (bool) – Use field aliases when dumping Pydantic models.

  • exclude_none (str | bool) – Control None/NaN column dropping. - False: keep Nones as-is - “all”: drop columns where all values are None/NaN - “any”: drop columns where any value is None/NaN - True: alias for “all”

  • json_normalize (bool) – If True, flatten nested dicts via pandas.json_normalize.

  • convert_dtypes (bool) – If True, call DataFrame.convert_dtypes() at the end.

  • expand_field (str) – If set, look for this field in each row and expand its keys into top-level columns.

  • expand_prefix (str) – If set, prefix expanded column names with this string.

Returns:

The converted DataFrame.

Return type:

pandas.DataFrame

class CategoricalAnnotationValue(*, label: Annotated[str, Strict(strict=True)], score: Annotated[float, Strict(strict=True)] | Annotated[int, Strict(strict=True)] | None = None)[source]#

Bases: BaseModel

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:
label: StrictStr#
score: StrictFloat | StrictInt | None#
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].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of CategoricalAnnotationValue from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

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.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of CategoricalAnnotationValue from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class OptimizationDirection(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

The direction for optimization. Defaults to none when omitted. - maximize: higher scores are better - minimize: lower scores are better - none: higher or lower scores are neither better nor worse

MAXIMIZE = 'maximize'#
MINIMIZE = 'minimize'#
NONE = 'none'#
classmethod from_json(json_str: str) Self[source]#

Create an instance of OptimizationDirection from a JSON string

Parameters:

json_str (str)

Return type:

Self