arize 8.0.0a23__py3-none-any.whl → 8.0.0b1__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 +11 -10
- arize/_exporter/client.py +1 -1
- arize/_generated/api_client/__init__.py +0 -2
- arize/_generated/api_client/models/__init__.py +0 -1
- arize/_generated/api_client/models/datasets_create_request.py +2 -10
- arize/_generated/api_client/models/datasets_examples_insert_request.py +2 -10
- arize/_generated/api_client/test/test_datasets_create_request.py +2 -6
- arize/_generated/api_client/test/test_datasets_examples_insert_request.py +2 -6
- arize/_generated/api_client/test/test_datasets_examples_list200_response.py +2 -6
- arize/_generated/api_client/test/test_datasets_examples_update_request.py +2 -6
- arize/_generated/api_client/test/test_experiments_create_request.py +2 -6
- arize/_generated/api_client/test/test_experiments_runs_list200_response.py +2 -6
- arize/_generated/api_client_README.md +0 -1
- arize/client.py +47 -163
- arize/config.py +59 -100
- arize/datasets/client.py +11 -6
- arize/embeddings/nlp_generators.py +12 -6
- arize/embeddings/tabular_generators.py +14 -11
- arize/experiments/__init__.py +12 -0
- arize/experiments/client.py +13 -9
- arize/experiments/functions.py +6 -6
- arize/experiments/types.py +3 -3
- arize/{models → ml}/batch_validation/errors.py +2 -2
- arize/{models → ml}/batch_validation/validator.py +5 -3
- arize/{models → ml}/casting.py +42 -78
- arize/{models → ml}/client.py +19 -17
- arize/{models → ml}/proto.py +2 -2
- arize/{models → ml}/stream_validation.py +1 -1
- arize/{models → ml}/surrogate_explainer/mimic.py +6 -2
- arize/{types.py → ml/types.py} +99 -234
- arize/pre_releases.py +2 -1
- arize/projects/client.py +11 -6
- arize/spans/client.py +91 -86
- arize/spans/conversion.py +11 -4
- arize/spans/validation/common/value_validation.py +1 -1
- arize/spans/validation/spans/dataframe_form_validation.py +1 -1
- arize/spans/validation/spans/value_validation.py +2 -1
- arize/utils/dataframe.py +1 -1
- arize/utils/online_tasks/dataframe_preprocessor.py +5 -6
- arize/utils/types.py +105 -0
- arize/version.py +1 -1
- {arize-8.0.0a23.dist-info → arize-8.0.0b1.dist-info}/METADATA +56 -59
- {arize-8.0.0a23.dist-info → arize-8.0.0b1.dist-info}/RECORD +50 -51
- arize/_generated/api_client/models/primitive_value.py +0 -172
- arize/_generated/api_client/test/test_primitive_value.py +0 -50
- /arize/{models → ml}/__init__.py +0 -0
- /arize/{models → ml}/batch_validation/__init__.py +0 -0
- /arize/{models → ml}/bounded_executor.py +0 -0
- /arize/{models → ml}/surrogate_explainer/__init__.py +0 -0
- {arize-8.0.0a23.dist-info → arize-8.0.0b1.dist-info}/WHEEL +0 -0
- {arize-8.0.0a23.dist-info → arize-8.0.0b1.dist-info}/licenses/LICENSE +0 -0
- {arize-8.0.0a23.dist-info → arize-8.0.0b1.dist-info}/licenses/NOTICE +0 -0
arize/__init__.py
CHANGED
|
@@ -44,18 +44,19 @@ def make_to_df(field_name: str) -> object:
|
|
|
44
44
|
- If an item is a mapping (dict-like), use it as-is.
|
|
45
45
|
- Otherwise, raise a ValueError (unsupported row type).
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
Args:
|
|
48
|
+
self (object): The object instance containing the field to convert.
|
|
49
|
+
by_alias (bool): Use field aliases when dumping Pydantic models.
|
|
50
|
+
exclude_none (str | bool): Control None/NaN column dropping.
|
|
51
|
+
- False: keep Nones as-is
|
|
52
|
+
- "all": drop columns where all values are None/NaN
|
|
53
|
+
- "any": drop columns where any value is None/NaN
|
|
54
|
+
- True: alias for "all"
|
|
55
|
+
json_normalize (bool): If True, flatten nested dicts via `pandas.json_normalize`.
|
|
56
|
+
convert_dtypes (bool): If True, call `DataFrame.convert_dtypes()` at the end.
|
|
56
57
|
|
|
57
58
|
Returns:
|
|
58
|
-
|
|
59
|
+
pandas.DataFrame: The converted DataFrame.
|
|
59
60
|
"""
|
|
60
61
|
import pandas as pd
|
|
61
62
|
|
arize/_exporter/client.py
CHANGED
|
@@ -17,7 +17,7 @@ from arize._exporter.validation import (
|
|
|
17
17
|
)
|
|
18
18
|
from arize._generated.protocol.flight import flight_pb2
|
|
19
19
|
from arize.logging import CtxAdapter
|
|
20
|
-
from arize.types import Environments, SimilaritySearchParams
|
|
20
|
+
from arize.ml.types import Environments, SimilaritySearchParams
|
|
21
21
|
from arize.utils.dataframe import reset_dataframe_index
|
|
22
22
|
|
|
23
23
|
logger = logging.getLogger(__name__)
|
|
@@ -46,7 +46,6 @@ __all__ = [
|
|
|
46
46
|
"ExperimentsList200Response",
|
|
47
47
|
"ExperimentsRunsList200Response",
|
|
48
48
|
"PaginationMetadata",
|
|
49
|
-
"PrimitiveValue",
|
|
50
49
|
"Problem",
|
|
51
50
|
"Project",
|
|
52
51
|
"ProjectsCreateRequest",
|
|
@@ -86,7 +85,6 @@ from arize._generated.api_client.models.experiments_create_request import Experi
|
|
|
86
85
|
from arize._generated.api_client.models.experiments_list200_response import ExperimentsList200Response as ExperimentsList200Response
|
|
87
86
|
from arize._generated.api_client.models.experiments_runs_list200_response import ExperimentsRunsList200Response as ExperimentsRunsList200Response
|
|
88
87
|
from arize._generated.api_client.models.pagination_metadata import PaginationMetadata as PaginationMetadata
|
|
89
|
-
from arize._generated.api_client.models.primitive_value import PrimitiveValue as PrimitiveValue
|
|
90
88
|
from arize._generated.api_client.models.problem import Problem as Problem
|
|
91
89
|
from arize._generated.api_client.models.project import Project as Project
|
|
92
90
|
from arize._generated.api_client.models.projects_create_request import ProjectsCreateRequest as ProjectsCreateRequest
|
|
@@ -29,7 +29,6 @@ from arize._generated.api_client.models.experiments_create_request import Experi
|
|
|
29
29
|
from arize._generated.api_client.models.experiments_list200_response import ExperimentsList200Response
|
|
30
30
|
from arize._generated.api_client.models.experiments_runs_list200_response import ExperimentsRunsList200Response
|
|
31
31
|
from arize._generated.api_client.models.pagination_metadata import PaginationMetadata
|
|
32
|
-
from arize._generated.api_client.models.primitive_value import PrimitiveValue
|
|
33
32
|
from arize._generated.api_client.models.problem import Problem
|
|
34
33
|
from arize._generated.api_client.models.project import Project
|
|
35
34
|
from arize._generated.api_client.models.projects_create_request import ProjectsCreateRequest
|
|
@@ -19,7 +19,6 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from arize._generated.api_client.models.primitive_value import PrimitiveValue
|
|
23
22
|
from typing import Optional, Set
|
|
24
23
|
from typing_extensions import Self
|
|
25
24
|
|
|
@@ -29,7 +28,7 @@ class DatasetsCreateRequest(BaseModel):
|
|
|
29
28
|
""" # noqa: E501
|
|
30
29
|
name: StrictStr = Field(description="Name of the new dataset")
|
|
31
30
|
space_id: StrictStr = Field(description="ID of the space the dataset will belong to")
|
|
32
|
-
examples: List[Dict[str,
|
|
31
|
+
examples: List[Dict[str, Any]] = Field(description="Array of examples for the new dataset")
|
|
33
32
|
__properties: ClassVar[List[str]] = ["name", "space_id", "examples"]
|
|
34
33
|
|
|
35
34
|
model_config = ConfigDict(
|
|
@@ -71,13 +70,6 @@ class DatasetsCreateRequest(BaseModel):
|
|
|
71
70
|
exclude=excluded_fields,
|
|
72
71
|
exclude_none=True,
|
|
73
72
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of each item in examples (list)
|
|
75
|
-
_items = []
|
|
76
|
-
if self.examples:
|
|
77
|
-
for _item_examples in self.examples:
|
|
78
|
-
if _item_examples:
|
|
79
|
-
_items.append(_item_examples.to_dict())
|
|
80
|
-
_dict['examples'] = _items
|
|
81
73
|
return _dict
|
|
82
74
|
|
|
83
75
|
@classmethod
|
|
@@ -97,7 +89,7 @@ class DatasetsCreateRequest(BaseModel):
|
|
|
97
89
|
_obj = cls.model_validate({
|
|
98
90
|
"name": obj.get("name"),
|
|
99
91
|
"space_id": obj.get("space_id"),
|
|
100
|
-
"examples":
|
|
92
|
+
"examples": obj.get("examples")
|
|
101
93
|
})
|
|
102
94
|
return _obj
|
|
103
95
|
|
|
@@ -19,7 +19,6 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from arize._generated.api_client.models.primitive_value import PrimitiveValue
|
|
23
22
|
from typing import Optional, Set
|
|
24
23
|
from typing_extensions import Self
|
|
25
24
|
|
|
@@ -27,7 +26,7 @@ class DatasetsExamplesInsertRequest(BaseModel):
|
|
|
27
26
|
"""
|
|
28
27
|
DatasetsExamplesInsertRequest
|
|
29
28
|
""" # noqa: E501
|
|
30
|
-
examples: List[Dict[str,
|
|
29
|
+
examples: List[Dict[str, Any]] = Field(description="Array of examples to append to the dataset version")
|
|
31
30
|
__properties: ClassVar[List[str]] = ["examples"]
|
|
32
31
|
|
|
33
32
|
model_config = ConfigDict(
|
|
@@ -69,13 +68,6 @@ class DatasetsExamplesInsertRequest(BaseModel):
|
|
|
69
68
|
exclude=excluded_fields,
|
|
70
69
|
exclude_none=True,
|
|
71
70
|
)
|
|
72
|
-
# override the default output from pydantic by calling `to_dict()` of each item in examples (list)
|
|
73
|
-
_items = []
|
|
74
|
-
if self.examples:
|
|
75
|
-
for _item_examples in self.examples:
|
|
76
|
-
if _item_examples:
|
|
77
|
-
_items.append(_item_examples.to_dict())
|
|
78
|
-
_dict['examples'] = _items
|
|
79
71
|
return _dict
|
|
80
72
|
|
|
81
73
|
@classmethod
|
|
@@ -93,7 +85,7 @@ class DatasetsExamplesInsertRequest(BaseModel):
|
|
|
93
85
|
raise ValueError("Error due to additional fields (not defined in DatasetsExamplesInsertRequest) in the input: " + _key)
|
|
94
86
|
|
|
95
87
|
_obj = cls.model_validate({
|
|
96
|
-
"examples":
|
|
88
|
+
"examples": obj.get("examples")
|
|
97
89
|
})
|
|
98
90
|
return _obj
|
|
99
91
|
|
|
@@ -38,9 +38,7 @@ class TestDatasetsCreateRequest(unittest.TestCase):
|
|
|
38
38
|
name = '',
|
|
39
39
|
space_id = '',
|
|
40
40
|
examples = [
|
|
41
|
-
{
|
|
42
|
-
'key' : null
|
|
43
|
-
}
|
|
41
|
+
{ }
|
|
44
42
|
]
|
|
45
43
|
)
|
|
46
44
|
else:
|
|
@@ -48,9 +46,7 @@ class TestDatasetsCreateRequest(unittest.TestCase):
|
|
|
48
46
|
name = '',
|
|
49
47
|
space_id = '',
|
|
50
48
|
examples = [
|
|
51
|
-
{
|
|
52
|
-
'key' : null
|
|
53
|
-
}
|
|
49
|
+
{ }
|
|
54
50
|
],
|
|
55
51
|
)
|
|
56
52
|
"""
|
|
@@ -36,17 +36,13 @@ class TestDatasetsExamplesInsertRequest(unittest.TestCase):
|
|
|
36
36
|
if include_optional:
|
|
37
37
|
return DatasetsExamplesInsertRequest(
|
|
38
38
|
examples = [
|
|
39
|
-
{
|
|
40
|
-
'key' : null
|
|
41
|
-
}
|
|
39
|
+
{ }
|
|
42
40
|
]
|
|
43
41
|
)
|
|
44
42
|
else:
|
|
45
43
|
return DatasetsExamplesInsertRequest(
|
|
46
44
|
examples = [
|
|
47
|
-
{
|
|
48
|
-
'key' : null
|
|
49
|
-
}
|
|
45
|
+
{ }
|
|
50
46
|
],
|
|
51
47
|
)
|
|
52
48
|
"""
|
|
@@ -36,9 +36,7 @@ class TestDatasetsExamplesList200Response(unittest.TestCase):
|
|
|
36
36
|
if include_optional:
|
|
37
37
|
return DatasetsExamplesList200Response(
|
|
38
38
|
examples = [
|
|
39
|
-
{
|
|
40
|
-
'key' : null
|
|
41
|
-
}
|
|
39
|
+
{ }
|
|
42
40
|
],
|
|
43
41
|
pagination = arize._generated.api_client.models.pagination_metadata.PaginationMetadata(
|
|
44
42
|
next_cursor = '',
|
|
@@ -47,9 +45,7 @@ class TestDatasetsExamplesList200Response(unittest.TestCase):
|
|
|
47
45
|
else:
|
|
48
46
|
return DatasetsExamplesList200Response(
|
|
49
47
|
examples = [
|
|
50
|
-
{
|
|
51
|
-
'key' : null
|
|
52
|
-
}
|
|
48
|
+
{ }
|
|
53
49
|
],
|
|
54
50
|
pagination = arize._generated.api_client.models.pagination_metadata.PaginationMetadata(
|
|
55
51
|
next_cursor = '',
|
|
@@ -36,18 +36,14 @@ class TestDatasetsExamplesUpdateRequest(unittest.TestCase):
|
|
|
36
36
|
if include_optional:
|
|
37
37
|
return DatasetsExamplesUpdateRequest(
|
|
38
38
|
examples = [
|
|
39
|
-
{
|
|
40
|
-
'key' : null
|
|
41
|
-
}
|
|
39
|
+
{ }
|
|
42
40
|
],
|
|
43
41
|
new_version = ''
|
|
44
42
|
)
|
|
45
43
|
else:
|
|
46
44
|
return DatasetsExamplesUpdateRequest(
|
|
47
45
|
examples = [
|
|
48
|
-
{
|
|
49
|
-
'key' : null
|
|
50
|
-
}
|
|
46
|
+
{ }
|
|
51
47
|
],
|
|
52
48
|
)
|
|
53
49
|
"""
|
|
@@ -38,9 +38,7 @@ class TestExperimentsCreateRequest(unittest.TestCase):
|
|
|
38
38
|
name = '',
|
|
39
39
|
dataset_id = '',
|
|
40
40
|
experiment_runs = [
|
|
41
|
-
{
|
|
42
|
-
'key' : null
|
|
43
|
-
}
|
|
41
|
+
{ }
|
|
44
42
|
]
|
|
45
43
|
)
|
|
46
44
|
else:
|
|
@@ -48,9 +46,7 @@ class TestExperimentsCreateRequest(unittest.TestCase):
|
|
|
48
46
|
name = '',
|
|
49
47
|
dataset_id = '',
|
|
50
48
|
experiment_runs = [
|
|
51
|
-
{
|
|
52
|
-
'key' : null
|
|
53
|
-
}
|
|
49
|
+
{ }
|
|
54
50
|
],
|
|
55
51
|
)
|
|
56
52
|
"""
|
|
@@ -36,9 +36,7 @@ class TestExperimentsRunsList200Response(unittest.TestCase):
|
|
|
36
36
|
if include_optional:
|
|
37
37
|
return ExperimentsRunsList200Response(
|
|
38
38
|
experiment_runs = [
|
|
39
|
-
{
|
|
40
|
-
'key' : null
|
|
41
|
-
}
|
|
39
|
+
{ }
|
|
42
40
|
],
|
|
43
41
|
pagination = arize._generated.api_client.models.pagination_metadata.PaginationMetadata(
|
|
44
42
|
next_cursor = '',
|
|
@@ -47,9 +45,7 @@ class TestExperimentsRunsList200Response(unittest.TestCase):
|
|
|
47
45
|
else:
|
|
48
46
|
return ExperimentsRunsList200Response(
|
|
49
47
|
experiment_runs = [
|
|
50
|
-
{
|
|
51
|
-
'key' : null
|
|
52
|
-
}
|
|
48
|
+
{ }
|
|
53
49
|
],
|
|
54
50
|
pagination = arize._generated.api_client.models.pagination_metadata.PaginationMetadata(
|
|
55
51
|
next_cursor = '',
|
|
@@ -109,7 +109,6 @@ Class | Method | HTTP request | Description
|
|
|
109
109
|
- [ExperimentsList200Response](arize/_generated/api_client/docs/ExperimentsList200Response.md)
|
|
110
110
|
- [ExperimentsRunsList200Response](arize/_generated/api_client/docs/ExperimentsRunsList200Response.md)
|
|
111
111
|
- [PaginationMetadata](arize/_generated/api_client/docs/PaginationMetadata.md)
|
|
112
|
-
- [PrimitiveValue](arize/_generated/api_client/docs/PrimitiveValue.md)
|
|
113
112
|
- [Problem](arize/_generated/api_client/docs/Problem.md)
|
|
114
113
|
- [Project](arize/_generated/api_client/docs/Project.md)
|
|
115
114
|
- [ProjectsCreateRequest](arize/_generated/api_client/docs/ProjectsCreateRequest.md)
|
arize/client.py
CHANGED
|
@@ -13,13 +13,23 @@ from arize.config import SDKConfiguration
|
|
|
13
13
|
if TYPE_CHECKING:
|
|
14
14
|
from arize.datasets.client import DatasetsClient
|
|
15
15
|
from arize.experiments.client import ExperimentsClient
|
|
16
|
-
from arize.
|
|
16
|
+
from arize.ml.client import MLModelsClient
|
|
17
17
|
from arize.projects.client import ProjectsClient
|
|
18
18
|
from arize.regions import Region
|
|
19
19
|
from arize.spans.client import SpansClient
|
|
20
20
|
|
|
21
21
|
logger = logging.getLogger(__name__)
|
|
22
22
|
|
|
23
|
+
# TODO(Kiko): InvalidAdditionalHeadersError is unused. Have we handled extra headers?
|
|
24
|
+
|
|
25
|
+
# TODO(Kiko): Clean commented lines over the SDK
|
|
26
|
+
# TODO(Kiko): Implement https://github.com/Arize-ai/arize/pull/59917
|
|
27
|
+
|
|
28
|
+
# TODO(Kiko): Go private connect. Need a `base_domain`, such that we get:
|
|
29
|
+
# - api.<base_domain>
|
|
30
|
+
# - app.<base_domain>
|
|
31
|
+
# - flight.<base_domain>
|
|
32
|
+
# - otlp.<base_domain>
|
|
23
33
|
|
|
24
34
|
# TODO(Kiko): Enforce type checking, remove all type ignores
|
|
25
35
|
|
|
@@ -44,133 +54,35 @@ class ArizeClient(LazySubclientsMixin):
|
|
|
44
54
|
"""Root client for the Arize SDK.
|
|
45
55
|
|
|
46
56
|
The ArizeClient provides access to all Arize platform services including datasets,
|
|
47
|
-
experiments, models, projects, and spans. It uses SDKConfiguration internally to
|
|
57
|
+
experiments, ML models, projects, and spans. It uses SDKConfiguration internally to
|
|
48
58
|
manage configuration settings.
|
|
49
59
|
|
|
50
|
-
Configuration Precedence
|
|
51
|
-
------------------------
|
|
52
60
|
All parameters are optional (except api_key which must be provided via argument
|
|
53
61
|
or environment variable). For each parameter, values are resolved in this order:
|
|
54
|
-
1. Explicit value passed to constructor (highest priority)
|
|
55
|
-
2. Environment variable value (see SDKConfiguration for variable names)
|
|
56
|
-
3. Built-in default value (lowest priority)
|
|
57
|
-
|
|
58
|
-
Parameters
|
|
59
|
-
----------
|
|
60
|
-
api_key : str
|
|
61
|
-
Arize API key for authentication. Required - must be provided via this parameter
|
|
62
|
-
or the ARIZE_API_KEY environment variable.
|
|
63
|
-
Environment variable: ARIZE_API_KEY
|
|
64
|
-
Default: None (raises MissingAPIKeyError if not provided)
|
|
65
|
-
|
|
66
|
-
region : Region, optional
|
|
67
|
-
Arize region (e.g., Region.US_CENTRAL, Region.EU_WEST). When specified,
|
|
68
|
-
overrides individual host/port settings with region-specific endpoints.
|
|
69
|
-
Environment variable: ARIZE_REGION
|
|
70
|
-
Default: Region.UNSPECIFIED
|
|
71
|
-
|
|
72
|
-
api_host : str, optional
|
|
73
|
-
Custom API endpoint host override.
|
|
74
|
-
Environment variable: ARIZE_API_HOST
|
|
75
|
-
Default: "api.arize.com"
|
|
76
|
-
|
|
77
|
-
api_scheme : str, optional
|
|
78
|
-
API endpoint scheme (http/https).
|
|
79
|
-
Environment variable: ARIZE_API_SCHEME
|
|
80
|
-
Default: "https"
|
|
81
|
-
|
|
82
|
-
otlp_host : str, optional
|
|
83
|
-
OTLP (OpenTelemetry Protocol) endpoint host override.
|
|
84
|
-
Environment variable: ARIZE_OTLP_HOST
|
|
85
|
-
Default: "otlp.arize.com"
|
|
86
|
-
|
|
87
|
-
otlp_scheme : str, optional
|
|
88
|
-
OTLP endpoint scheme (http/https).
|
|
89
|
-
Environment variable: ARIZE_OTLP_SCHEME
|
|
90
|
-
Default: "https"
|
|
91
|
-
|
|
92
|
-
flight_host : str, optional
|
|
93
|
-
Apache Arrow Flight endpoint host override.
|
|
94
|
-
Environment variable: ARIZE_FLIGHT_HOST
|
|
95
|
-
Default: "flight.arize.com"
|
|
96
|
-
|
|
97
|
-
flight_port : int, optional
|
|
98
|
-
Apache Arrow Flight endpoint port (1-65535).
|
|
99
|
-
Environment variable: ARIZE_FLIGHT_PORT
|
|
100
|
-
Default: 443
|
|
101
|
-
|
|
102
|
-
flight_scheme : str, optional
|
|
103
|
-
Apache Arrow Flight endpoint scheme.
|
|
104
|
-
Environment variable: ARIZE_FLIGHT_SCHEME
|
|
105
|
-
Default: "grpc+tls"
|
|
106
|
-
|
|
107
|
-
pyarrow_max_chunksize : int, optional
|
|
108
|
-
Maximum chunk size for PyArrow operations (1 to MAX_CHUNKSIZE).
|
|
109
|
-
Environment variable: ARIZE_MAX_CHUNKSIZE
|
|
110
|
-
Default: 10_000
|
|
111
|
-
|
|
112
|
-
request_verify : bool, optional
|
|
113
|
-
Whether to verify SSL certificates for HTTP requests.
|
|
114
|
-
Environment variable: ARIZE_REQUEST_VERIFY
|
|
115
|
-
Default: True
|
|
116
|
-
|
|
117
|
-
stream_max_workers : int, optional
|
|
118
|
-
Maximum number of worker threads for streaming operations (minimum: 1).
|
|
119
|
-
Environment variable: ARIZE_STREAM_MAX_WORKERS
|
|
120
|
-
Default: 8
|
|
121
|
-
|
|
122
|
-
stream_max_queue_bound : int, optional
|
|
123
|
-
Maximum queue size for streaming operations (minimum: 1).
|
|
124
|
-
Environment variable: ARIZE_STREAM_MAX_QUEUE_BOUND
|
|
125
|
-
Default: 5000
|
|
126
|
-
|
|
127
|
-
max_http_payload_size_mb : float, optional
|
|
128
|
-
Maximum HTTP payload size in megabytes (minimum: 1).
|
|
129
|
-
Environment variable: ARIZE_MAX_HTTP_PAYLOAD_SIZE_MB
|
|
130
|
-
Default: 100
|
|
131
|
-
|
|
132
|
-
arize_directory : str, optional
|
|
133
|
-
Directory for Arize SDK files (cache, logs, etc.).
|
|
134
|
-
Environment variable: ARIZE_DIRECTORY
|
|
135
|
-
Default: "~/.arize"
|
|
136
|
-
|
|
137
|
-
enable_caching : bool, optional
|
|
138
|
-
Whether to enable local caching.
|
|
139
|
-
Environment variable: ARIZE_ENABLE_CACHING
|
|
140
|
-
Default: True
|
|
141
|
-
|
|
142
|
-
single_host : str, optional
|
|
143
|
-
Single host to use for all endpoints. Overrides individual host settings.
|
|
144
|
-
Environment variable: ARIZE_SINGLE_HOST
|
|
145
|
-
Default: None (not set)
|
|
146
|
-
|
|
147
|
-
single_port : int, optional
|
|
148
|
-
Single port to use for all endpoints. Overrides individual port settings (0-65535).
|
|
149
|
-
Environment variable: ARIZE_SINGLE_PORT
|
|
150
|
-
Default: 0 (not set)
|
|
151
62
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
63
|
+
1. Explicit value passed to constructor (highest priority)
|
|
64
|
+
2. Environment variable value (see SDKConfiguration for variable names)
|
|
65
|
+
3. Built-in default value (lowest priority)
|
|
155
66
|
|
|
156
|
-
|
|
67
|
+
Examples:
|
|
68
|
+
Initialize with API key only (other settings use defaults):
|
|
157
69
|
|
|
158
|
-
|
|
70
|
+
>>> client = ArizeClient(api_key="your-api-key")
|
|
159
71
|
|
|
160
|
-
|
|
161
|
-
... api_key="your-api-key",
|
|
162
|
-
... api_host="custom.api.com",
|
|
163
|
-
... flight_port=8443,
|
|
164
|
-
... )
|
|
72
|
+
Initialize with custom endpoints:
|
|
165
73
|
|
|
166
|
-
|
|
74
|
+
>>> client = ArizeClient(
|
|
75
|
+
... api_key="your-api-key",
|
|
76
|
+
... api_host="custom.api.com",
|
|
77
|
+
... flight_port=8443,
|
|
78
|
+
... )
|
|
167
79
|
|
|
168
|
-
|
|
169
|
-
>>> client = ArizeClient(api_key="your-api-key", region=Region.EU_WEST)
|
|
80
|
+
Initialize with region (overrides host/port settings):
|
|
170
81
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
82
|
+
>>> from arize.regions import Region
|
|
83
|
+
>>> client = ArizeClient(
|
|
84
|
+
... api_key="your-api-key", region=Region.EU_WEST
|
|
85
|
+
... )
|
|
174
86
|
"""
|
|
175
87
|
|
|
176
88
|
_SUBCLIENTS: ClassVar[dict[str, tuple[str, str]]] = {
|
|
@@ -186,8 +98,8 @@ class ArizeClient(LazySubclientsMixin):
|
|
|
186
98
|
"arize.projects.client",
|
|
187
99
|
"ProjectsClient",
|
|
188
100
|
),
|
|
189
|
-
"
|
|
190
|
-
"arize.
|
|
101
|
+
"ml": (
|
|
102
|
+
"arize.ml.client",
|
|
191
103
|
"MLModelsClient",
|
|
192
104
|
),
|
|
193
105
|
"spans": (
|
|
@@ -195,44 +107,16 @@ class ArizeClient(LazySubclientsMixin):
|
|
|
195
107
|
"SpansClient",
|
|
196
108
|
),
|
|
197
109
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
"datasets-experiments",
|
|
209
|
-
(
|
|
210
|
-
"pydantic",
|
|
211
|
-
"wrapt",
|
|
212
|
-
# "numpy",
|
|
213
|
-
# "openinference.semconv",
|
|
214
|
-
# "opentelemetry.sdk",
|
|
215
|
-
# "opentelemetry.exporter.otlp.proto.grpc.trace_exporter",
|
|
216
|
-
),
|
|
217
|
-
),
|
|
218
|
-
"spans": (
|
|
219
|
-
"spans",
|
|
220
|
-
(
|
|
221
|
-
"google.protobuf",
|
|
222
|
-
"numpy",
|
|
223
|
-
"openinference.semconv",
|
|
224
|
-
"opentelemetry",
|
|
225
|
-
"pandas",
|
|
226
|
-
"pyarrow",
|
|
227
|
-
"requests",
|
|
228
|
-
"tqdm",
|
|
229
|
-
),
|
|
230
|
-
),
|
|
231
|
-
# Imports are gated in each method of the models client
|
|
232
|
-
# This is to allow for very lean package install if people only
|
|
233
|
-
# want to stream ML records
|
|
234
|
-
"models": (None, ()),
|
|
235
|
-
}
|
|
110
|
+
# DISABLED: Optional dependency gating system
|
|
111
|
+
# This dict would map subclients to their optional dependencies and extra names.
|
|
112
|
+
# When enabled, it prevents loading subclients if dependencies aren't installed,
|
|
113
|
+
# showing: "Install via: pip install arize[extra-name]"
|
|
114
|
+
#
|
|
115
|
+
# To re-enable, populate with entries like:
|
|
116
|
+
# "subclient_name": ("extra-name", ("package1", "package2", "package3")),
|
|
117
|
+
# "another_subclient": (None, ()), # No requirements
|
|
118
|
+
#
|
|
119
|
+
_EXTRAS: ClassVar[dict[str, tuple[str | None, tuple[str, ...]]]] = {}
|
|
236
120
|
|
|
237
121
|
def __init__(
|
|
238
122
|
self,
|
|
@@ -299,8 +183,8 @@ class ArizeClient(LazySubclientsMixin):
|
|
|
299
183
|
MissingAPIKeyError: If api_key is not provided via argument or environment variable.
|
|
300
184
|
|
|
301
185
|
Notes:
|
|
302
|
-
Values provided
|
|
303
|
-
default values. See SDKConfiguration for detailed parameter documentation.
|
|
186
|
+
Values provided to this class override environment variables, which in turn
|
|
187
|
+
override default values. See SDKConfiguration for detailed parameter documentation.
|
|
304
188
|
"""
|
|
305
189
|
cfg_kwargs: dict = {}
|
|
306
190
|
if api_key is not None:
|
|
@@ -356,9 +240,9 @@ class ArizeClient(LazySubclientsMixin):
|
|
|
356
240
|
return self.__getattr__("experiments")
|
|
357
241
|
|
|
358
242
|
@property
|
|
359
|
-
def
|
|
360
|
-
"""Access the models client for ML model operations (lazy-loaded)."""
|
|
361
|
-
return self.__getattr__("
|
|
243
|
+
def ml(self) -> MLModelsClient:
|
|
244
|
+
"""Access the ML models client for ML model operations (lazy-loaded)."""
|
|
245
|
+
return self.__getattr__("ml")
|
|
362
246
|
|
|
363
247
|
@property
|
|
364
248
|
def projects(self) -> ProjectsClient:
|
|
@@ -385,7 +269,7 @@ class ArizeClient(LazySubclientsMixin):
|
|
|
385
269
|
# 'datasets': lazy,
|
|
386
270
|
# 'experiments': lazy,
|
|
387
271
|
# 'spans': lazy,
|
|
388
|
-
# '
|
|
272
|
+
# 'ml': lazy,
|
|
389
273
|
# }
|
|
390
274
|
# )
|
|
391
275
|
lines = [f"{self.__class__.__name__}("]
|