Annotation Configs#
- class AnnotationConfigsClient(*, sdk_config: SDKConfiguration, generated_client: ApiClient)[source]#
Bases:
objectClient 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:
- 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:
- 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:
- 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]#
-
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'#
- 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:
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 (ContinuousAnnotationConfig | None)
oneof_schema_2_validator (CategoricalAnnotationConfig | None)
oneof_schema_3_validator (FreeformAnnotationConfig | None)
actual_instance (CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig | None)
- actual_instance: CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig | 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
- class AnnotationConfigsList200Response(*, annotation_configs: list[CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig], pagination: PaginationMetadata)[source]#
Bases:
BaseModelSDK view of the generated list response with each
AnnotationConfigunwrapped.The
annotation_configsfield contains the concrete inner types (CategoricalAnnotationConfig,ContinuousAnnotationConfig, orFreeformAnnotationConfig) 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:
- class CategoricalAnnotationValue(*, label: Annotated[str, Strict(strict=True)], score: Annotated[float, Strict(strict=True)] | Annotated[int, 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:
- label: 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 CategoricalAnnotationValue 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 OptimizationDirection(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
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'#