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.
Files changed (171) hide show
  1. arize/__init__.py +28 -19
  2. arize/_exporter/client.py +56 -37
  3. arize/_exporter/parsers/tracing_data_parser.py +41 -30
  4. arize/_exporter/validation.py +3 -3
  5. arize/_flight/client.py +207 -76
  6. arize/_generated/api_client/__init__.py +30 -6
  7. arize/_generated/api_client/api/__init__.py +1 -0
  8. arize/_generated/api_client/api/datasets_api.py +864 -190
  9. arize/_generated/api_client/api/experiments_api.py +167 -131
  10. arize/_generated/api_client/api/projects_api.py +1197 -0
  11. arize/_generated/api_client/api_client.py +2 -2
  12. arize/_generated/api_client/configuration.py +42 -34
  13. arize/_generated/api_client/exceptions.py +2 -2
  14. arize/_generated/api_client/models/__init__.py +15 -4
  15. arize/_generated/api_client/models/dataset.py +10 -10
  16. arize/_generated/api_client/models/dataset_example.py +111 -0
  17. arize/_generated/api_client/models/dataset_example_update.py +100 -0
  18. arize/_generated/api_client/models/dataset_version.py +13 -13
  19. arize/_generated/api_client/models/datasets_create_request.py +16 -8
  20. arize/_generated/api_client/models/datasets_examples_insert_request.py +100 -0
  21. arize/_generated/api_client/models/datasets_examples_list200_response.py +106 -0
  22. arize/_generated/api_client/models/datasets_examples_update_request.py +102 -0
  23. arize/_generated/api_client/models/datasets_list200_response.py +10 -4
  24. arize/_generated/api_client/models/experiment.py +14 -16
  25. arize/_generated/api_client/models/experiment_run.py +108 -0
  26. arize/_generated/api_client/models/experiment_run_create.py +102 -0
  27. arize/_generated/api_client/models/experiments_create_request.py +16 -10
  28. arize/_generated/api_client/models/experiments_list200_response.py +10 -4
  29. arize/_generated/api_client/models/experiments_runs_list200_response.py +19 -5
  30. arize/_generated/api_client/models/{error.py → pagination_metadata.py} +13 -11
  31. arize/_generated/api_client/models/primitive_value.py +172 -0
  32. arize/_generated/api_client/models/problem.py +100 -0
  33. arize/_generated/api_client/models/project.py +99 -0
  34. arize/_generated/api_client/models/{datasets_list_examples200_response.py → projects_create_request.py} +13 -11
  35. arize/_generated/api_client/models/projects_list200_response.py +106 -0
  36. arize/_generated/api_client/rest.py +2 -2
  37. arize/_generated/api_client/test/test_dataset.py +4 -2
  38. arize/_generated/api_client/test/test_dataset_example.py +56 -0
  39. arize/_generated/api_client/test/test_dataset_example_update.py +52 -0
  40. arize/_generated/api_client/test/test_dataset_version.py +7 -2
  41. arize/_generated/api_client/test/test_datasets_api.py +27 -13
  42. arize/_generated/api_client/test/test_datasets_create_request.py +8 -4
  43. arize/_generated/api_client/test/{test_datasets_list_examples200_response.py → test_datasets_examples_insert_request.py} +19 -15
  44. arize/_generated/api_client/test/test_datasets_examples_list200_response.py +66 -0
  45. arize/_generated/api_client/test/test_datasets_examples_update_request.py +61 -0
  46. arize/_generated/api_client/test/test_datasets_list200_response.py +9 -3
  47. arize/_generated/api_client/test/test_experiment.py +2 -4
  48. arize/_generated/api_client/test/test_experiment_run.py +56 -0
  49. arize/_generated/api_client/test/test_experiment_run_create.py +54 -0
  50. arize/_generated/api_client/test/test_experiments_api.py +6 -6
  51. arize/_generated/api_client/test/test_experiments_create_request.py +9 -6
  52. arize/_generated/api_client/test/test_experiments_list200_response.py +9 -5
  53. arize/_generated/api_client/test/test_experiments_runs_list200_response.py +15 -5
  54. arize/_generated/api_client/test/test_pagination_metadata.py +53 -0
  55. arize/_generated/api_client/test/{test_error.py → test_primitive_value.py} +13 -14
  56. arize/_generated/api_client/test/test_problem.py +57 -0
  57. arize/_generated/api_client/test/test_project.py +58 -0
  58. arize/_generated/api_client/test/test_projects_api.py +59 -0
  59. arize/_generated/api_client/test/test_projects_create_request.py +54 -0
  60. arize/_generated/api_client/test/test_projects_list200_response.py +70 -0
  61. arize/_generated/api_client_README.md +43 -29
  62. arize/_generated/protocol/flight/flight_pb2.py +400 -0
  63. arize/_lazy.py +27 -19
  64. arize/client.py +181 -58
  65. arize/config.py +324 -116
  66. arize/constants/__init__.py +1 -0
  67. arize/constants/config.py +11 -4
  68. arize/constants/ml.py +6 -4
  69. arize/constants/openinference.py +2 -0
  70. arize/constants/pyarrow.py +2 -0
  71. arize/constants/spans.py +3 -1
  72. arize/datasets/__init__.py +1 -0
  73. arize/datasets/client.py +304 -84
  74. arize/datasets/errors.py +32 -2
  75. arize/datasets/validation.py +18 -8
  76. arize/embeddings/__init__.py +2 -0
  77. arize/embeddings/auto_generator.py +23 -19
  78. arize/embeddings/base_generators.py +89 -36
  79. arize/embeddings/constants.py +2 -0
  80. arize/embeddings/cv_generators.py +26 -4
  81. arize/embeddings/errors.py +27 -5
  82. arize/embeddings/nlp_generators.py +43 -18
  83. arize/embeddings/tabular_generators.py +46 -31
  84. arize/embeddings/usecases.py +12 -2
  85. arize/exceptions/__init__.py +1 -0
  86. arize/exceptions/auth.py +11 -1
  87. arize/exceptions/base.py +29 -4
  88. arize/exceptions/models.py +21 -2
  89. arize/exceptions/parameters.py +31 -0
  90. arize/exceptions/spaces.py +12 -1
  91. arize/exceptions/types.py +86 -7
  92. arize/exceptions/values.py +220 -20
  93. arize/experiments/__init__.py +13 -0
  94. arize/experiments/client.py +394 -285
  95. arize/experiments/evaluators/__init__.py +1 -0
  96. arize/experiments/evaluators/base.py +74 -41
  97. arize/experiments/evaluators/exceptions.py +6 -3
  98. arize/experiments/evaluators/executors.py +121 -73
  99. arize/experiments/evaluators/rate_limiters.py +106 -57
  100. arize/experiments/evaluators/types.py +34 -7
  101. arize/experiments/evaluators/utils.py +65 -27
  102. arize/experiments/functions.py +103 -101
  103. arize/experiments/tracing.py +52 -44
  104. arize/experiments/types.py +56 -31
  105. arize/logging.py +54 -22
  106. arize/ml/__init__.py +1 -0
  107. arize/ml/batch_validation/__init__.py +1 -0
  108. arize/{models → ml}/batch_validation/errors.py +545 -67
  109. arize/{models → ml}/batch_validation/validator.py +344 -303
  110. arize/ml/bounded_executor.py +47 -0
  111. arize/{models → ml}/casting.py +118 -108
  112. arize/{models → ml}/client.py +339 -118
  113. arize/{models → ml}/proto.py +97 -42
  114. arize/{models → ml}/stream_validation.py +43 -15
  115. arize/ml/surrogate_explainer/__init__.py +1 -0
  116. arize/{models → ml}/surrogate_explainer/mimic.py +25 -10
  117. arize/{types.py → ml/types.py} +355 -354
  118. arize/pre_releases.py +44 -0
  119. arize/projects/__init__.py +1 -0
  120. arize/projects/client.py +134 -0
  121. arize/regions.py +40 -0
  122. arize/spans/__init__.py +1 -0
  123. arize/spans/client.py +204 -175
  124. arize/spans/columns.py +13 -0
  125. arize/spans/conversion.py +60 -37
  126. arize/spans/validation/__init__.py +1 -0
  127. arize/spans/validation/annotations/__init__.py +1 -0
  128. arize/spans/validation/annotations/annotations_validation.py +6 -4
  129. arize/spans/validation/annotations/dataframe_form_validation.py +13 -11
  130. arize/spans/validation/annotations/value_validation.py +35 -11
  131. arize/spans/validation/common/__init__.py +1 -0
  132. arize/spans/validation/common/argument_validation.py +33 -8
  133. arize/spans/validation/common/dataframe_form_validation.py +35 -9
  134. arize/spans/validation/common/errors.py +211 -11
  135. arize/spans/validation/common/value_validation.py +81 -14
  136. arize/spans/validation/evals/__init__.py +1 -0
  137. arize/spans/validation/evals/dataframe_form_validation.py +28 -8
  138. arize/spans/validation/evals/evals_validation.py +34 -4
  139. arize/spans/validation/evals/value_validation.py +26 -3
  140. arize/spans/validation/metadata/__init__.py +1 -1
  141. arize/spans/validation/metadata/argument_validation.py +14 -5
  142. arize/spans/validation/metadata/dataframe_form_validation.py +26 -10
  143. arize/spans/validation/metadata/value_validation.py +24 -10
  144. arize/spans/validation/spans/__init__.py +1 -0
  145. arize/spans/validation/spans/dataframe_form_validation.py +35 -14
  146. arize/spans/validation/spans/spans_validation.py +35 -4
  147. arize/spans/validation/spans/value_validation.py +78 -8
  148. arize/utils/__init__.py +1 -0
  149. arize/utils/arrow.py +31 -15
  150. arize/utils/cache.py +34 -6
  151. arize/utils/dataframe.py +20 -3
  152. arize/utils/online_tasks/__init__.py +2 -0
  153. arize/utils/online_tasks/dataframe_preprocessor.py +58 -47
  154. arize/utils/openinference_conversion.py +44 -5
  155. arize/utils/proto.py +10 -0
  156. arize/utils/size.py +5 -3
  157. arize/utils/types.py +105 -0
  158. arize/version.py +3 -1
  159. {arize-8.0.0a22.dist-info → arize-8.0.0b0.dist-info}/METADATA +13 -6
  160. arize-8.0.0b0.dist-info/RECORD +175 -0
  161. {arize-8.0.0a22.dist-info → arize-8.0.0b0.dist-info}/WHEEL +1 -1
  162. arize-8.0.0b0.dist-info/licenses/LICENSE +176 -0
  163. arize-8.0.0b0.dist-info/licenses/NOTICE +13 -0
  164. arize/_generated/protocol/flight/export_pb2.py +0 -61
  165. arize/_generated/protocol/flight/ingest_pb2.py +0 -365
  166. arize/models/__init__.py +0 -0
  167. arize/models/batch_validation/__init__.py +0 -0
  168. arize/models/bounded_executor.py +0 -34
  169. arize/models/surrogate_explainer/__init__.py +0 -0
  170. arize-8.0.0a22.dist-info/RECORD +0 -146
  171. arize-8.0.0a22.dist-info/licenses/LICENSE.md +0 -12
@@ -3,9 +3,9 @@
3
3
  """
4
4
  Arize REST API
5
5
 
6
- API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment. You can access the OpenAPI spec for this API at https://api.arize.com/v2/spec.yaml
6
+ API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment.
7
7
 
8
- The version of the OpenAPI document: 0.0.1
8
+ The version of the OpenAPI document: 2.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -18,7 +18,8 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
21
+ from typing import Any, ClassVar, Dict, List
22
+ from arize._generated.api_client.models.experiment_run_create import ExperimentRunCreate
22
23
  from typing import Optional, Set
23
24
  from typing_extensions import Self
24
25
 
@@ -27,10 +28,9 @@ class ExperimentsCreateRequest(BaseModel):
27
28
  ExperimentsCreateRequest
28
29
  """ # noqa: E501
29
30
  name: StrictStr = Field(description="Name of the experiment")
30
- dataset_id: StrictStr = Field(description="ID of the dataset to create the experiment for", alias="datasetId")
31
- experiment_runs: List[Dict[str, Any]] = Field(description="Array of experiment run data", alias="experimentRuns")
32
- dataset_version_id: Optional[StrictStr] = Field(default=None, description="Optional specific dataset version ID", alias="datasetVersionId")
33
- __properties: ClassVar[List[str]] = ["name", "datasetId", "experimentRuns", "datasetVersionId"]
31
+ dataset_id: StrictStr = Field(description="ID of the dataset to create the experiment for")
32
+ experiment_runs: List[ExperimentRunCreate] = Field(description="Array of experiment run data")
33
+ __properties: ClassVar[List[str]] = ["name", "dataset_id", "experiment_runs"]
34
34
 
35
35
  model_config = ConfigDict(
36
36
  populate_by_name=True,
@@ -71,6 +71,13 @@ class ExperimentsCreateRequest(BaseModel):
71
71
  exclude=excluded_fields,
72
72
  exclude_none=True,
73
73
  )
74
+ # override the default output from pydantic by calling `to_dict()` of each item in experiment_runs (list)
75
+ _items = []
76
+ if self.experiment_runs:
77
+ for _item_experiment_runs in self.experiment_runs:
78
+ if _item_experiment_runs:
79
+ _items.append(_item_experiment_runs.to_dict())
80
+ _dict['experiment_runs'] = _items
74
81
  return _dict
75
82
 
76
83
  @classmethod
@@ -89,9 +96,8 @@ class ExperimentsCreateRequest(BaseModel):
89
96
 
90
97
  _obj = cls.model_validate({
91
98
  "name": obj.get("name"),
92
- "datasetId": obj.get("datasetId"),
93
- "experimentRuns": obj.get("experimentRuns"),
94
- "datasetVersionId": obj.get("datasetVersionId")
99
+ "dataset_id": obj.get("dataset_id"),
100
+ "experiment_runs": [ExperimentRunCreate.from_dict(_item) for _item in obj["experiment_runs"]] if obj.get("experiment_runs") is not None else None
95
101
  })
96
102
  return _obj
97
103
 
@@ -3,9 +3,9 @@
3
3
  """
4
4
  Arize REST API
5
5
 
6
- API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment. You can access the OpenAPI spec for this API at https://api.arize.com/v2/spec.yaml
6
+ API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment.
7
7
 
8
- The version of the OpenAPI document: 0.0.1
8
+ The version of the OpenAPI document: 2.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -20,6 +20,7 @@ import json
20
20
  from pydantic import BaseModel, ConfigDict, Field
21
21
  from typing import Any, ClassVar, Dict, List
22
22
  from arize._generated.api_client.models.experiment import Experiment
23
+ from arize._generated.api_client.models.pagination_metadata import PaginationMetadata
23
24
  from typing import Optional, Set
24
25
  from typing_extensions import Self
25
26
 
@@ -28,7 +29,8 @@ class ExperimentsList200Response(BaseModel):
28
29
  ExperimentsList200Response
29
30
  """ # noqa: E501
30
31
  experiments: List[Experiment] = Field(description="A list of experiments")
31
- __properties: ClassVar[List[str]] = ["experiments"]
32
+ pagination: PaginationMetadata
33
+ __properties: ClassVar[List[str]] = ["experiments", "pagination"]
32
34
 
33
35
  model_config = ConfigDict(
34
36
  populate_by_name=True,
@@ -76,6 +78,9 @@ class ExperimentsList200Response(BaseModel):
76
78
  if _item_experiments:
77
79
  _items.append(_item_experiments.to_dict())
78
80
  _dict['experiments'] = _items
81
+ # override the default output from pydantic by calling `to_dict()` of pagination
82
+ if self.pagination:
83
+ _dict['pagination'] = self.pagination.to_dict()
79
84
  return _dict
80
85
 
81
86
  @classmethod
@@ -93,7 +98,8 @@ class ExperimentsList200Response(BaseModel):
93
98
  raise ValueError("Error due to additional fields (not defined in ExperimentsList200Response) in the input: " + _key)
94
99
 
95
100
  _obj = cls.model_validate({
96
- "experiments": [Experiment.from_dict(_item) for _item in obj["experiments"]] if obj.get("experiments") is not None else None
101
+ "experiments": [Experiment.from_dict(_item) for _item in obj["experiments"]] if obj.get("experiments") is not None else None,
102
+ "pagination": PaginationMetadata.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None
97
103
  })
98
104
  return _obj
99
105
 
@@ -3,9 +3,9 @@
3
3
  """
4
4
  Arize REST API
5
5
 
6
- API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment. You can access the OpenAPI spec for this API at https://api.arize.com/v2/spec.yaml
6
+ API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment.
7
7
 
8
- The version of the OpenAPI document: 0.0.1
8
+ The version of the OpenAPI document: 2.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -19,6 +19,8 @@ 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.experiment_run import ExperimentRun
23
+ from arize._generated.api_client.models.pagination_metadata import PaginationMetadata
22
24
  from typing import Optional, Set
23
25
  from typing_extensions import Self
24
26
 
@@ -26,8 +28,9 @@ class ExperimentsRunsList200Response(BaseModel):
26
28
  """
27
29
  ExperimentsRunsList200Response
28
30
  """ # noqa: E501
29
- experiment_runs: List[Dict[str, Any]] = Field(description="Array of experiment run objects containing experiment fields and evaluations", alias="experimentRuns")
30
- __properties: ClassVar[List[str]] = ["experimentRuns"]
31
+ experiment_runs: List[ExperimentRun] = Field(description="Array of experiment run objects containing experiment fields and evaluations")
32
+ pagination: PaginationMetadata
33
+ __properties: ClassVar[List[str]] = ["experiment_runs", "pagination"]
31
34
 
32
35
  model_config = ConfigDict(
33
36
  populate_by_name=True,
@@ -68,6 +71,16 @@ class ExperimentsRunsList200Response(BaseModel):
68
71
  exclude=excluded_fields,
69
72
  exclude_none=True,
70
73
  )
74
+ # override the default output from pydantic by calling `to_dict()` of each item in experiment_runs (list)
75
+ _items = []
76
+ if self.experiment_runs:
77
+ for _item_experiment_runs in self.experiment_runs:
78
+ if _item_experiment_runs:
79
+ _items.append(_item_experiment_runs.to_dict())
80
+ _dict['experiment_runs'] = _items
81
+ # override the default output from pydantic by calling `to_dict()` of pagination
82
+ if self.pagination:
83
+ _dict['pagination'] = self.pagination.to_dict()
71
84
  return _dict
72
85
 
73
86
  @classmethod
@@ -85,7 +98,8 @@ class ExperimentsRunsList200Response(BaseModel):
85
98
  raise ValueError("Error due to additional fields (not defined in ExperimentsRunsList200Response) in the input: " + _key)
86
99
 
87
100
  _obj = cls.model_validate({
88
- "experimentRuns": obj.get("experimentRuns")
101
+ "experiment_runs": [ExperimentRun.from_dict(_item) for _item in obj["experiment_runs"]] if obj.get("experiment_runs") is not None else None,
102
+ "pagination": PaginationMetadata.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None
89
103
  })
90
104
  return _obj
91
105
 
@@ -3,9 +3,9 @@
3
3
  """
4
4
  Arize REST API
5
5
 
6
- API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment. You can access the OpenAPI spec for this API at https://api.arize.com/v2/spec.yaml
6
+ API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment.
7
7
 
8
- The version of the OpenAPI document: 0.0.1
8
+ The version of the OpenAPI document: 2.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -17,17 +17,18 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, StrictStr
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
- class Error(BaseModel):
25
+ class PaginationMetadata(BaseModel):
26
26
  """
27
- Error
27
+ Cursor-based pagination metadata. Use `next_cursor` in the subsequent request's `cursor` query parameter.
28
28
  """ # noqa: E501
29
- message: Optional[StrictStr] = None
30
- __properties: ClassVar[List[str]] = ["message"]
29
+ next_cursor: Optional[StrictStr] = Field(default=None, description="Opaque cursor for fetching the next page. Treat as an unreadable token. Present when `has_more` is true; omitted when `hasMore` is false. ")
30
+ has_more: StrictBool = Field(description="True if another page of results is available.")
31
+ __properties: ClassVar[List[str]] = ["next_cursor", "has_more"]
31
32
 
32
33
  model_config = ConfigDict(
33
34
  populate_by_name=True,
@@ -47,7 +48,7 @@ class Error(BaseModel):
47
48
 
48
49
  @classmethod
49
50
  def from_json(cls, json_str: str) -> Optional[Self]:
50
- """Create an instance of Error from a JSON string"""
51
+ """Create an instance of PaginationMetadata from a JSON string"""
51
52
  return cls.from_dict(json.loads(json_str))
52
53
 
53
54
  def to_dict(self) -> Dict[str, Any]:
@@ -72,7 +73,7 @@ class Error(BaseModel):
72
73
 
73
74
  @classmethod
74
75
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
- """Create an instance of Error from a dict"""
76
+ """Create an instance of PaginationMetadata from a dict"""
76
77
  if obj is None:
77
78
  return None
78
79
 
@@ -82,10 +83,11 @@ class Error(BaseModel):
82
83
  # raise errors for additional fields in the input
83
84
  for _key in obj.keys():
84
85
  if _key not in cls.__properties:
85
- raise ValueError("Error due to additional fields (not defined in Error) in the input: " + _key)
86
+ raise ValueError("Error due to additional fields (not defined in PaginationMetadata) in the input: " + _key)
86
87
 
87
88
  _obj = cls.model_validate({
88
- "message": obj.get("message")
89
+ "next_cursor": obj.get("next_cursor"),
90
+ "has_more": obj.get("has_more")
89
91
  })
90
92
  return _obj
91
93
 
@@ -0,0 +1,172 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Arize REST API
5
+
6
+ API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment.
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ from inspect import getfullargspec
17
+ import json
18
+ import pprint
19
+ import re # noqa: F401
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator
21
+ from typing import Optional, Union
22
+ from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
23
+ from typing_extensions import Literal, Self
24
+ from pydantic import Field
25
+
26
+ PRIMITIVEVALUE_ANY_OF_SCHEMAS = ["bool", "float", "int", "str"]
27
+
28
+ class PrimitiveValue(BaseModel):
29
+ """
30
+ A JSON primitive value (string, number, integer, or boolean)
31
+ """
32
+
33
+ # data type: int
34
+ anyof_schema_1_validator: Optional[StrictInt] = None
35
+ # data type: float
36
+ anyof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None
37
+ # data type: str
38
+ anyof_schema_3_validator: Optional[StrictStr] = None
39
+ # data type: bool
40
+ anyof_schema_4_validator: Optional[StrictBool] = None
41
+ if TYPE_CHECKING:
42
+ actual_instance: Optional[Union[bool, float, int, str]] = None
43
+ else:
44
+ actual_instance: Any = None
45
+ any_of_schemas: Set[str] = { "bool", "float", "int", "str" }
46
+
47
+ model_config = {
48
+ "validate_assignment": True,
49
+ "protected_namespaces": (),
50
+ }
51
+
52
+ def __init__(self, *args, **kwargs) -> None:
53
+ if args:
54
+ if len(args) > 1:
55
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
56
+ if kwargs:
57
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
58
+ super().__init__(actual_instance=args[0])
59
+ else:
60
+ super().__init__(**kwargs)
61
+
62
+ @field_validator('actual_instance')
63
+ def actual_instance_must_validate_anyof(cls, v):
64
+ instance = PrimitiveValue.model_construct()
65
+ error_messages = []
66
+ # validate data type: int
67
+ try:
68
+ instance.anyof_schema_1_validator = v
69
+ return v
70
+ except (ValidationError, ValueError) as e:
71
+ error_messages.append(str(e))
72
+ # validate data type: float
73
+ try:
74
+ instance.anyof_schema_2_validator = v
75
+ return v
76
+ except (ValidationError, ValueError) as e:
77
+ error_messages.append(str(e))
78
+ # validate data type: str
79
+ try:
80
+ instance.anyof_schema_3_validator = v
81
+ return v
82
+ except (ValidationError, ValueError) as e:
83
+ error_messages.append(str(e))
84
+ # validate data type: bool
85
+ try:
86
+ instance.anyof_schema_4_validator = v
87
+ return v
88
+ except (ValidationError, ValueError) as e:
89
+ error_messages.append(str(e))
90
+ if error_messages:
91
+ # no match
92
+ raise ValueError("No match found when setting the actual_instance in PrimitiveValue with anyOf schemas: bool, float, int, str. Details: " + ", ".join(error_messages))
93
+ else:
94
+ return v
95
+
96
+ @classmethod
97
+ def from_dict(cls, obj: Dict[str, Any]) -> Self:
98
+ return cls.from_json(json.dumps(obj))
99
+
100
+ @classmethod
101
+ def from_json(cls, json_str: str) -> Self:
102
+ """Returns the object represented by the json string"""
103
+ instance = cls.model_construct()
104
+ error_messages = []
105
+ # deserialize data into int
106
+ try:
107
+ # validation
108
+ instance.anyof_schema_1_validator = json.loads(json_str)
109
+ # assign value to actual_instance
110
+ instance.actual_instance = instance.anyof_schema_1_validator
111
+ return instance
112
+ except (ValidationError, ValueError) as e:
113
+ error_messages.append(str(e))
114
+ # deserialize data into float
115
+ try:
116
+ # validation
117
+ instance.anyof_schema_2_validator = json.loads(json_str)
118
+ # assign value to actual_instance
119
+ instance.actual_instance = instance.anyof_schema_2_validator
120
+ return instance
121
+ except (ValidationError, ValueError) as e:
122
+ error_messages.append(str(e))
123
+ # deserialize data into str
124
+ try:
125
+ # validation
126
+ instance.anyof_schema_3_validator = json.loads(json_str)
127
+ # assign value to actual_instance
128
+ instance.actual_instance = instance.anyof_schema_3_validator
129
+ return instance
130
+ except (ValidationError, ValueError) as e:
131
+ error_messages.append(str(e))
132
+ # deserialize data into bool
133
+ try:
134
+ # validation
135
+ instance.anyof_schema_4_validator = json.loads(json_str)
136
+ # assign value to actual_instance
137
+ instance.actual_instance = instance.anyof_schema_4_validator
138
+ return instance
139
+ except (ValidationError, ValueError) as e:
140
+ error_messages.append(str(e))
141
+
142
+ if error_messages:
143
+ # no match
144
+ raise ValueError("No match found when deserializing the JSON string into PrimitiveValue with anyOf schemas: bool, float, int, str. Details: " + ", ".join(error_messages))
145
+ else:
146
+ return instance
147
+
148
+ def to_json(self) -> str:
149
+ """Returns the JSON representation of the actual instance"""
150
+ if self.actual_instance is None:
151
+ return "null"
152
+
153
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
154
+ return self.actual_instance.to_json()
155
+ else:
156
+ return json.dumps(self.actual_instance)
157
+
158
+ def to_dict(self) -> Optional[Union[Dict[str, Any], bool, float, int, str]]:
159
+ """Returns the dict representation of the actual instance"""
160
+ if self.actual_instance is None:
161
+ return None
162
+
163
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
164
+ return self.actual_instance.to_dict()
165
+ else:
166
+ return self.actual_instance
167
+
168
+ def to_str(self) -> str:
169
+ """Returns the string representation of the actual instance"""
170
+ return pprint.pformat(self.model_dump())
171
+
172
+
@@ -0,0 +1,100 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Arize REST API
5
+
6
+ API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment.
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class Problem(BaseModel):
26
+ """
27
+ RFC 9457 Problem Details
28
+ """ # noqa: E501
29
+ title: StrictStr = Field(description="A short, human-readable summary of the problem type")
30
+ status: StrictInt = Field(description="The HTTP status code generated by the origin server for this occurrence of the problem")
31
+ type: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the problem type")
32
+ detail: Optional[StrictStr] = Field(default=None, description="A human-readable explanation specific to this occurrence of the problem")
33
+ instance: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the specific occurrence of the problem")
34
+ __properties: ClassVar[List[str]] = ["title", "status", "type", "detail", "instance"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of Problem from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of Problem from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ # raise errors for additional fields in the input
87
+ for _key in obj.keys():
88
+ if _key not in cls.__properties:
89
+ raise ValueError("Error due to additional fields (not defined in Problem) in the input: " + _key)
90
+
91
+ _obj = cls.model_validate({
92
+ "title": obj.get("title"),
93
+ "status": obj.get("status"),
94
+ "type": obj.get("type"),
95
+ "detail": obj.get("detail"),
96
+ "instance": obj.get("instance")
97
+ })
98
+ return _obj
99
+
100
+
@@ -0,0 +1,99 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Arize REST API
5
+
6
+ API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment.
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class Project(BaseModel):
27
+ """
28
+ A project represents an LLM application and serves as the primary container for observability data. Each project collects traces and spans that capture the execution flow of your application, enabling you to debug issues, monitor latency, and analyze token usage. Projects belong to a space and provide a centralized view of your application's performance. Use projects to organize related traces, run experiments against datasets, and track improvements over time.
29
+ """ # noqa: E501
30
+ id: StrictStr = Field(description="The project ID")
31
+ name: StrictStr = Field(description="The project name")
32
+ space_id: StrictStr = Field(description="The space ID the project belongs to")
33
+ created_at: datetime = Field(description="When the project was created")
34
+ __properties: ClassVar[List[str]] = ["id", "name", "space_id", "created_at"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of Project from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of Project from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ # raise errors for additional fields in the input
87
+ for _key in obj.keys():
88
+ if _key not in cls.__properties:
89
+ raise ValueError("Error due to additional fields (not defined in Project) in the input: " + _key)
90
+
91
+ _obj = cls.model_validate({
92
+ "id": obj.get("id"),
93
+ "name": obj.get("name"),
94
+ "space_id": obj.get("space_id"),
95
+ "created_at": obj.get("created_at")
96
+ })
97
+ return _obj
98
+
99
+
@@ -3,9 +3,9 @@
3
3
  """
4
4
  Arize REST API
5
5
 
6
- API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment. You can access the OpenAPI spec for this API at https://api.arize.com/v2/spec.yaml
6
+ API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment.
7
7
 
8
- The version of the OpenAPI document: 0.0.1
8
+ The version of the OpenAPI document: 2.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -17,17 +17,18 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
- class DatasetsListExamples200Response(BaseModel):
25
+ class ProjectsCreateRequest(BaseModel):
26
26
  """
27
- DatasetsListExamples200Response
27
+ ProjectsCreateRequest
28
28
  """ # noqa: E501
29
- examples: List[Dict[str, Any]] = Field(description="Array of example objects from the dataset")
30
- __properties: ClassVar[List[str]] = ["examples"]
29
+ name: StrictStr = Field(description="Name of the project (must be unique within the space)")
30
+ space_id: StrictStr = Field(description="ID of the space to create the project in")
31
+ __properties: ClassVar[List[str]] = ["name", "space_id"]
31
32
 
32
33
  model_config = ConfigDict(
33
34
  populate_by_name=True,
@@ -47,7 +48,7 @@ class DatasetsListExamples200Response(BaseModel):
47
48
 
48
49
  @classmethod
49
50
  def from_json(cls, json_str: str) -> Optional[Self]:
50
- """Create an instance of DatasetsListExamples200Response from a JSON string"""
51
+ """Create an instance of ProjectsCreateRequest from a JSON string"""
51
52
  return cls.from_dict(json.loads(json_str))
52
53
 
53
54
  def to_dict(self) -> Dict[str, Any]:
@@ -72,7 +73,7 @@ class DatasetsListExamples200Response(BaseModel):
72
73
 
73
74
  @classmethod
74
75
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
- """Create an instance of DatasetsListExamples200Response from a dict"""
76
+ """Create an instance of ProjectsCreateRequest from a dict"""
76
77
  if obj is None:
77
78
  return None
78
79
 
@@ -82,10 +83,11 @@ class DatasetsListExamples200Response(BaseModel):
82
83
  # raise errors for additional fields in the input
83
84
  for _key in obj.keys():
84
85
  if _key not in cls.__properties:
85
- raise ValueError("Error due to additional fields (not defined in DatasetsListExamples200Response) in the input: " + _key)
86
+ raise ValueError("Error due to additional fields (not defined in ProjectsCreateRequest) in the input: " + _key)
86
87
 
87
88
  _obj = cls.model_validate({
88
- "examples": obj.get("examples")
89
+ "name": obj.get("name"),
90
+ "space_id": obj.get("space_id")
89
91
  })
90
92
  return _obj
91
93