arize 8.0.0a22__py3-none-any.whl → 8.0.0b0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arize/__init__.py +28 -19
- arize/_exporter/client.py +56 -37
- arize/_exporter/parsers/tracing_data_parser.py +41 -30
- arize/_exporter/validation.py +3 -3
- arize/_flight/client.py +207 -76
- arize/_generated/api_client/__init__.py +30 -6
- arize/_generated/api_client/api/__init__.py +1 -0
- arize/_generated/api_client/api/datasets_api.py +864 -190
- arize/_generated/api_client/api/experiments_api.py +167 -131
- arize/_generated/api_client/api/projects_api.py +1197 -0
- arize/_generated/api_client/api_client.py +2 -2
- arize/_generated/api_client/configuration.py +42 -34
- arize/_generated/api_client/exceptions.py +2 -2
- arize/_generated/api_client/models/__init__.py +15 -4
- arize/_generated/api_client/models/dataset.py +10 -10
- arize/_generated/api_client/models/dataset_example.py +111 -0
- arize/_generated/api_client/models/dataset_example_update.py +100 -0
- arize/_generated/api_client/models/dataset_version.py +13 -13
- arize/_generated/api_client/models/datasets_create_request.py +16 -8
- arize/_generated/api_client/models/datasets_examples_insert_request.py +100 -0
- arize/_generated/api_client/models/datasets_examples_list200_response.py +106 -0
- arize/_generated/api_client/models/datasets_examples_update_request.py +102 -0
- arize/_generated/api_client/models/datasets_list200_response.py +10 -4
- arize/_generated/api_client/models/experiment.py +14 -16
- arize/_generated/api_client/models/experiment_run.py +108 -0
- arize/_generated/api_client/models/experiment_run_create.py +102 -0
- arize/_generated/api_client/models/experiments_create_request.py +16 -10
- arize/_generated/api_client/models/experiments_list200_response.py +10 -4
- arize/_generated/api_client/models/experiments_runs_list200_response.py +19 -5
- arize/_generated/api_client/models/{error.py → pagination_metadata.py} +13 -11
- arize/_generated/api_client/models/primitive_value.py +172 -0
- arize/_generated/api_client/models/problem.py +100 -0
- arize/_generated/api_client/models/project.py +99 -0
- arize/_generated/api_client/models/{datasets_list_examples200_response.py → projects_create_request.py} +13 -11
- arize/_generated/api_client/models/projects_list200_response.py +106 -0
- arize/_generated/api_client/rest.py +2 -2
- arize/_generated/api_client/test/test_dataset.py +4 -2
- arize/_generated/api_client/test/test_dataset_example.py +56 -0
- arize/_generated/api_client/test/test_dataset_example_update.py +52 -0
- arize/_generated/api_client/test/test_dataset_version.py +7 -2
- arize/_generated/api_client/test/test_datasets_api.py +27 -13
- arize/_generated/api_client/test/test_datasets_create_request.py +8 -4
- arize/_generated/api_client/test/{test_datasets_list_examples200_response.py → test_datasets_examples_insert_request.py} +19 -15
- arize/_generated/api_client/test/test_datasets_examples_list200_response.py +66 -0
- arize/_generated/api_client/test/test_datasets_examples_update_request.py +61 -0
- arize/_generated/api_client/test/test_datasets_list200_response.py +9 -3
- arize/_generated/api_client/test/test_experiment.py +2 -4
- arize/_generated/api_client/test/test_experiment_run.py +56 -0
- arize/_generated/api_client/test/test_experiment_run_create.py +54 -0
- arize/_generated/api_client/test/test_experiments_api.py +6 -6
- arize/_generated/api_client/test/test_experiments_create_request.py +9 -6
- arize/_generated/api_client/test/test_experiments_list200_response.py +9 -5
- arize/_generated/api_client/test/test_experiments_runs_list200_response.py +15 -5
- arize/_generated/api_client/test/test_pagination_metadata.py +53 -0
- arize/_generated/api_client/test/{test_error.py → test_primitive_value.py} +13 -14
- arize/_generated/api_client/test/test_problem.py +57 -0
- arize/_generated/api_client/test/test_project.py +58 -0
- arize/_generated/api_client/test/test_projects_api.py +59 -0
- arize/_generated/api_client/test/test_projects_create_request.py +54 -0
- arize/_generated/api_client/test/test_projects_list200_response.py +70 -0
- arize/_generated/api_client_README.md +43 -29
- arize/_generated/protocol/flight/flight_pb2.py +400 -0
- arize/_lazy.py +27 -19
- arize/client.py +181 -58
- arize/config.py +324 -116
- arize/constants/__init__.py +1 -0
- arize/constants/config.py +11 -4
- arize/constants/ml.py +6 -4
- arize/constants/openinference.py +2 -0
- arize/constants/pyarrow.py +2 -0
- arize/constants/spans.py +3 -1
- arize/datasets/__init__.py +1 -0
- arize/datasets/client.py +304 -84
- arize/datasets/errors.py +32 -2
- arize/datasets/validation.py +18 -8
- arize/embeddings/__init__.py +2 -0
- arize/embeddings/auto_generator.py +23 -19
- arize/embeddings/base_generators.py +89 -36
- arize/embeddings/constants.py +2 -0
- arize/embeddings/cv_generators.py +26 -4
- arize/embeddings/errors.py +27 -5
- arize/embeddings/nlp_generators.py +43 -18
- arize/embeddings/tabular_generators.py +46 -31
- arize/embeddings/usecases.py +12 -2
- arize/exceptions/__init__.py +1 -0
- arize/exceptions/auth.py +11 -1
- arize/exceptions/base.py +29 -4
- arize/exceptions/models.py +21 -2
- arize/exceptions/parameters.py +31 -0
- arize/exceptions/spaces.py +12 -1
- arize/exceptions/types.py +86 -7
- arize/exceptions/values.py +220 -20
- arize/experiments/__init__.py +13 -0
- arize/experiments/client.py +394 -285
- arize/experiments/evaluators/__init__.py +1 -0
- arize/experiments/evaluators/base.py +74 -41
- arize/experiments/evaluators/exceptions.py +6 -3
- arize/experiments/evaluators/executors.py +121 -73
- arize/experiments/evaluators/rate_limiters.py +106 -57
- arize/experiments/evaluators/types.py +34 -7
- arize/experiments/evaluators/utils.py +65 -27
- arize/experiments/functions.py +103 -101
- arize/experiments/tracing.py +52 -44
- arize/experiments/types.py +56 -31
- arize/logging.py +54 -22
- arize/ml/__init__.py +1 -0
- arize/ml/batch_validation/__init__.py +1 -0
- arize/{models → ml}/batch_validation/errors.py +545 -67
- arize/{models → ml}/batch_validation/validator.py +344 -303
- arize/ml/bounded_executor.py +47 -0
- arize/{models → ml}/casting.py +118 -108
- arize/{models → ml}/client.py +339 -118
- arize/{models → ml}/proto.py +97 -42
- arize/{models → ml}/stream_validation.py +43 -15
- arize/ml/surrogate_explainer/__init__.py +1 -0
- arize/{models → ml}/surrogate_explainer/mimic.py +25 -10
- arize/{types.py → ml/types.py} +355 -354
- arize/pre_releases.py +44 -0
- arize/projects/__init__.py +1 -0
- arize/projects/client.py +134 -0
- arize/regions.py +40 -0
- arize/spans/__init__.py +1 -0
- arize/spans/client.py +204 -175
- arize/spans/columns.py +13 -0
- arize/spans/conversion.py +60 -37
- arize/spans/validation/__init__.py +1 -0
- arize/spans/validation/annotations/__init__.py +1 -0
- arize/spans/validation/annotations/annotations_validation.py +6 -4
- arize/spans/validation/annotations/dataframe_form_validation.py +13 -11
- arize/spans/validation/annotations/value_validation.py +35 -11
- arize/spans/validation/common/__init__.py +1 -0
- arize/spans/validation/common/argument_validation.py +33 -8
- arize/spans/validation/common/dataframe_form_validation.py +35 -9
- arize/spans/validation/common/errors.py +211 -11
- arize/spans/validation/common/value_validation.py +81 -14
- arize/spans/validation/evals/__init__.py +1 -0
- arize/spans/validation/evals/dataframe_form_validation.py +28 -8
- arize/spans/validation/evals/evals_validation.py +34 -4
- arize/spans/validation/evals/value_validation.py +26 -3
- arize/spans/validation/metadata/__init__.py +1 -1
- arize/spans/validation/metadata/argument_validation.py +14 -5
- arize/spans/validation/metadata/dataframe_form_validation.py +26 -10
- arize/spans/validation/metadata/value_validation.py +24 -10
- arize/spans/validation/spans/__init__.py +1 -0
- arize/spans/validation/spans/dataframe_form_validation.py +35 -14
- arize/spans/validation/spans/spans_validation.py +35 -4
- arize/spans/validation/spans/value_validation.py +78 -8
- arize/utils/__init__.py +1 -0
- arize/utils/arrow.py +31 -15
- arize/utils/cache.py +34 -6
- arize/utils/dataframe.py +20 -3
- arize/utils/online_tasks/__init__.py +2 -0
- arize/utils/online_tasks/dataframe_preprocessor.py +58 -47
- arize/utils/openinference_conversion.py +44 -5
- arize/utils/proto.py +10 -0
- arize/utils/size.py +5 -3
- arize/utils/types.py +105 -0
- arize/version.py +3 -1
- {arize-8.0.0a22.dist-info → arize-8.0.0b0.dist-info}/METADATA +13 -6
- arize-8.0.0b0.dist-info/RECORD +175 -0
- {arize-8.0.0a22.dist-info → arize-8.0.0b0.dist-info}/WHEEL +1 -1
- arize-8.0.0b0.dist-info/licenses/LICENSE +176 -0
- arize-8.0.0b0.dist-info/licenses/NOTICE +13 -0
- arize/_generated/protocol/flight/export_pb2.py +0 -61
- arize/_generated/protocol/flight/ingest_pb2.py +0 -365
- arize/models/__init__.py +0 -0
- arize/models/batch_validation/__init__.py +0 -0
- arize/models/bounded_executor.py +0 -34
- arize/models/surrogate_explainer/__init__.py +0 -0
- arize-8.0.0a22.dist-info/RECORD +0 -146
- arize-8.0.0a22.dist-info/licenses/LICENSE.md +0 -12
arize/pre_releases.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""Pre-release feature management and gating for the Arize SDK."""
|
|
2
|
+
|
|
3
|
+
import functools
|
|
4
|
+
import logging
|
|
5
|
+
from collections.abc import Callable
|
|
6
|
+
from enum import StrEnum
|
|
7
|
+
|
|
8
|
+
from arize.version import __version__
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ReleaseStage(StrEnum):
|
|
14
|
+
"""Enum representing the release stage of API features."""
|
|
15
|
+
|
|
16
|
+
ALPHA = "alpha"
|
|
17
|
+
BETA = "beta"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
_WARNED: set[str] = set()
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _format_prerelease_message(*, key: str, stage: ReleaseStage) -> str:
|
|
24
|
+
article = "an" if stage is ReleaseStage.ALPHA else "a"
|
|
25
|
+
return (
|
|
26
|
+
f"[{stage.upper()}] {key} is {article} {stage} API "
|
|
27
|
+
f"in Arize SDK v{__version__} and may change without notice."
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def prerelease_endpoint(*, stage: ReleaseStage, key: str) -> object:
|
|
32
|
+
"""Decorate a method to emit a prerelease warning via logging once per process."""
|
|
33
|
+
|
|
34
|
+
def deco(fn: Callable[..., object]) -> object:
|
|
35
|
+
@functools.wraps(fn)
|
|
36
|
+
def wrapper(*args: object, **kwargs: object) -> object:
|
|
37
|
+
if key not in _WARNED:
|
|
38
|
+
_WARNED.add(key)
|
|
39
|
+
logger.warning(_format_prerelease_message(key=key, stage=stage))
|
|
40
|
+
return fn(*args, **kwargs)
|
|
41
|
+
|
|
42
|
+
return wrapper
|
|
43
|
+
|
|
44
|
+
return deco
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Project management and operations for the Arize platform."""
|
arize/projects/client.py
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"""Client implementation for managing projects in the Arize platform."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
from arize.pre_releases import ReleaseStage, prerelease_endpoint
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from arize._generated.api_client import models
|
|
12
|
+
from arize.config import SDKConfiguration
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ProjectsClient:
|
|
18
|
+
"""Client for managing Arize projects and project-level operations.
|
|
19
|
+
|
|
20
|
+
This class is primarily intended for internal use within the SDK. Users are
|
|
21
|
+
highly encouraged to access resource-specific functionality via
|
|
22
|
+
:class:`arize.ArizeClient`.
|
|
23
|
+
|
|
24
|
+
The projects client is a thin wrapper around the generated REST API client,
|
|
25
|
+
using the shared generated API client owned by
|
|
26
|
+
:class:`arize.config.SDKConfiguration`.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
def __init__(self, *, sdk_config: SDKConfiguration) -> None:
|
|
30
|
+
"""
|
|
31
|
+
Args:
|
|
32
|
+
sdk_config: Resolved SDK configuration.
|
|
33
|
+
""" # noqa: D205, D212
|
|
34
|
+
self._sdk_config = sdk_config
|
|
35
|
+
|
|
36
|
+
# Import at runtime so it's still lazy and extras-gated by the parent
|
|
37
|
+
from arize._generated import api_client as gen
|
|
38
|
+
|
|
39
|
+
# Use the shared generated client from the config
|
|
40
|
+
self._api = gen.ProjectsApi(self._sdk_config.get_generated_client())
|
|
41
|
+
|
|
42
|
+
@prerelease_endpoint(key="projects.list", stage=ReleaseStage.BETA)
|
|
43
|
+
def list(
|
|
44
|
+
self,
|
|
45
|
+
*,
|
|
46
|
+
space_id: str | None = None,
|
|
47
|
+
limit: int = 100,
|
|
48
|
+
cursor: str | None = None,
|
|
49
|
+
) -> models.ProjectsList200Response:
|
|
50
|
+
"""List projects the user has access to.
|
|
51
|
+
|
|
52
|
+
This endpoint supports cursor-based pagination. When provided, `space_id`
|
|
53
|
+
filters results to a particular space.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
space_id: Optional space ID to filter results.
|
|
57
|
+
limit: Maximum number of projects to return. The server may enforce
|
|
58
|
+
an upper bound.
|
|
59
|
+
cursor: Opaque pagination cursor from a previous response.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
A paginated project list response from the Arize REST API.
|
|
63
|
+
|
|
64
|
+
Raises:
|
|
65
|
+
arize._generated.api_client.exceptions.ApiException: If the API request fails.
|
|
66
|
+
"""
|
|
67
|
+
return self._api.projects_list(
|
|
68
|
+
space_id=space_id,
|
|
69
|
+
limit=limit,
|
|
70
|
+
cursor=cursor,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
@prerelease_endpoint(key="projects.create", stage=ReleaseStage.BETA)
|
|
74
|
+
def create(
|
|
75
|
+
self,
|
|
76
|
+
*,
|
|
77
|
+
name: str,
|
|
78
|
+
space_id: str,
|
|
79
|
+
) -> models.Project:
|
|
80
|
+
"""Create a new project.
|
|
81
|
+
|
|
82
|
+
Project names must be unique within the target space.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
name: Project name (must be unique within `space_id`).
|
|
86
|
+
space_id: Space ID to create the project in.
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
The created project object.
|
|
90
|
+
|
|
91
|
+
Raises:
|
|
92
|
+
arize._generated.api_client.exceptions.ApiException: If the API request fails
|
|
93
|
+
(for example, due to invalid input or a uniqueness conflict).
|
|
94
|
+
"""
|
|
95
|
+
from arize._generated import api_client as gen
|
|
96
|
+
|
|
97
|
+
body = gen.ProjectsCreateRequest(
|
|
98
|
+
name=name,
|
|
99
|
+
space_id=space_id,
|
|
100
|
+
)
|
|
101
|
+
return self._api.projects_create(projects_create_request=body)
|
|
102
|
+
|
|
103
|
+
@prerelease_endpoint(key="projects.get", stage=ReleaseStage.BETA)
|
|
104
|
+
def get(self, *, project_id: str) -> models.Project:
|
|
105
|
+
"""Get a project by ID.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
project_id: Project ID.
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
The project object.
|
|
112
|
+
|
|
113
|
+
Raises:
|
|
114
|
+
arize._generated.api_client.exceptions.ApiException: If the API request fails
|
|
115
|
+
(for example, project not found).
|
|
116
|
+
"""
|
|
117
|
+
return self._api.projects_get(project_id=project_id)
|
|
118
|
+
|
|
119
|
+
@prerelease_endpoint(key="projects.delete", stage=ReleaseStage.BETA)
|
|
120
|
+
def delete(self, *, project_id: str) -> None:
|
|
121
|
+
"""Delete a project by ID.
|
|
122
|
+
|
|
123
|
+
This operation is irreversible.
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
project_id: Project ID.
|
|
127
|
+
|
|
128
|
+
Returns: This method returns None on success (common empty 204 response)
|
|
129
|
+
|
|
130
|
+
Raises:
|
|
131
|
+
arize._generated.api_client.exceptions.ApiException: If the API request fails
|
|
132
|
+
(for example, project not found or insufficient permissions).
|
|
133
|
+
"""
|
|
134
|
+
return self._api.projects_delete(project_id=project_id)
|
arize/regions.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Region definitions and configuration for Arize deployment zones."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from enum import StrEnum
|
|
5
|
+
|
|
6
|
+
from arize.constants.config import DEFAULT_FLIGHT_PORT
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Region(StrEnum):
|
|
10
|
+
"""Enum representing available Arize deployment regions."""
|
|
11
|
+
|
|
12
|
+
US_CENTRAL_1 = "us-central-1a"
|
|
13
|
+
EU_WEST_1 = "eu-west-1a"
|
|
14
|
+
CA_CENTRAL_1 = "ca-central-1a"
|
|
15
|
+
US_EAST_1 = "us-east-1b"
|
|
16
|
+
UNSPECIFIED = ""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@dataclass(frozen=True)
|
|
20
|
+
class RegionEndpoints:
|
|
21
|
+
"""Container for region-specific API endpoint hostnames and ports."""
|
|
22
|
+
|
|
23
|
+
api_host: str
|
|
24
|
+
otlp_host: str
|
|
25
|
+
flight_host: str
|
|
26
|
+
flight_port: int
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _get_region_endpoints(region: Region) -> RegionEndpoints:
|
|
30
|
+
return RegionEndpoints(
|
|
31
|
+
api_host=f"api.{region}.arize.com",
|
|
32
|
+
otlp_host=f"otlp.{region}.arize.com",
|
|
33
|
+
flight_host=f"flight.{region}.arize.com",
|
|
34
|
+
flight_port=DEFAULT_FLIGHT_PORT,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
REGION_ENDPOINTS: dict[Region, RegionEndpoints] = {
|
|
39
|
+
r: _get_region_endpoints(r) for r in Region if r != Region.UNSPECIFIED
|
|
40
|
+
}
|
arize/spans/__init__.py
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""LLM tracing spans functionality for the Arize SDK."""
|