arize 8.0.0a21__py3-none-any.whl → 8.0.0a23__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 (166) hide show
  1. arize/__init__.py +17 -9
  2. arize/_exporter/client.py +55 -36
  3. arize/_exporter/parsers/tracing_data_parser.py +41 -30
  4. arize/_exporter/validation.py +3 -3
  5. arize/_flight/client.py +208 -77
  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 +269 -55
  65. arize/config.py +365 -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 +299 -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 +31 -12
  83. arize/embeddings/tabular_generators.py +32 -20
  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 +1 -0
  94. arize/experiments/client.py +390 -286
  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/models/__init__.py +1 -0
  107. arize/models/batch_validation/__init__.py +1 -0
  108. arize/models/batch_validation/errors.py +543 -65
  109. arize/models/batch_validation/validator.py +339 -300
  110. arize/models/bounded_executor.py +20 -7
  111. arize/models/casting.py +75 -29
  112. arize/models/client.py +326 -107
  113. arize/models/proto.py +95 -40
  114. arize/models/stream_validation.py +42 -14
  115. arize/models/surrogate_explainer/__init__.py +1 -0
  116. arize/models/surrogate_explainer/mimic.py +24 -13
  117. arize/pre_releases.py +43 -0
  118. arize/projects/__init__.py +1 -0
  119. arize/projects/client.py +129 -0
  120. arize/regions.py +40 -0
  121. arize/spans/__init__.py +1 -0
  122. arize/spans/client.py +130 -106
  123. arize/spans/columns.py +13 -0
  124. arize/spans/conversion.py +54 -38
  125. arize/spans/validation/__init__.py +1 -0
  126. arize/spans/validation/annotations/__init__.py +1 -0
  127. arize/spans/validation/annotations/annotations_validation.py +6 -4
  128. arize/spans/validation/annotations/dataframe_form_validation.py +13 -11
  129. arize/spans/validation/annotations/value_validation.py +35 -11
  130. arize/spans/validation/common/__init__.py +1 -0
  131. arize/spans/validation/common/argument_validation.py +33 -8
  132. arize/spans/validation/common/dataframe_form_validation.py +35 -9
  133. arize/spans/validation/common/errors.py +211 -11
  134. arize/spans/validation/common/value_validation.py +80 -13
  135. arize/spans/validation/evals/__init__.py +1 -0
  136. arize/spans/validation/evals/dataframe_form_validation.py +28 -8
  137. arize/spans/validation/evals/evals_validation.py +34 -4
  138. arize/spans/validation/evals/value_validation.py +26 -3
  139. arize/spans/validation/metadata/__init__.py +1 -1
  140. arize/spans/validation/metadata/argument_validation.py +14 -5
  141. arize/spans/validation/metadata/dataframe_form_validation.py +26 -10
  142. arize/spans/validation/metadata/value_validation.py +24 -10
  143. arize/spans/validation/spans/__init__.py +1 -0
  144. arize/spans/validation/spans/dataframe_form_validation.py +34 -13
  145. arize/spans/validation/spans/spans_validation.py +35 -4
  146. arize/spans/validation/spans/value_validation.py +76 -7
  147. arize/types.py +293 -157
  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 +19 -2
  152. arize/utils/online_tasks/__init__.py +2 -0
  153. arize/utils/online_tasks/dataframe_preprocessor.py +53 -41
  154. arize/utils/openinference_conversion.py +44 -5
  155. arize/utils/proto.py +10 -0
  156. arize/utils/size.py +5 -3
  157. arize/version.py +3 -1
  158. {arize-8.0.0a21.dist-info → arize-8.0.0a23.dist-info}/METADATA +4 -3
  159. arize-8.0.0a23.dist-info/RECORD +174 -0
  160. {arize-8.0.0a21.dist-info → arize-8.0.0a23.dist-info}/WHEEL +1 -1
  161. arize-8.0.0a23.dist-info/licenses/LICENSE +176 -0
  162. arize-8.0.0a23.dist-info/licenses/NOTICE +13 -0
  163. arize/_generated/protocol/flight/export_pb2.py +0 -61
  164. arize/_generated/protocol/flight/ingest_pb2.py +0 -365
  165. arize-8.0.0a21.dist-info/RECORD +0 -146
  166. arize-8.0.0a21.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.
@@ -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.
@@ -113,7 +113,7 @@ HTTPSignatureAuthSetting = TypedDict(
113
113
  AuthSettings = TypedDict(
114
114
  "AuthSettings",
115
115
  {
116
- "ApiKeyAuth": APIKeyAuthSetting,
116
+ "bearerAuth": BearerFormatAuthSetting,
117
117
  },
118
118
  total=False,
119
119
  )
@@ -163,27 +163,10 @@ class Configuration:
163
163
  :param retries: Number of retries for API requests.
164
164
  :param ca_cert_data: verify the peer using concatenated CA certificate data
165
165
  in PEM (str) or DER (bytes) format.
166
+ :param cert_file: the path to a client certificate file, for mTLS.
167
+ :param key_file: the path to a client key file, for mTLS.
166
168
 
167
169
  :Example:
168
-
169
- API Key Authentication Example.
170
- Given the following security scheme in the OpenAPI specification:
171
- components:
172
- securitySchemes:
173
- cookieAuth: # name for the security scheme
174
- type: apiKey
175
- in: cookie
176
- name: JSESSIONID # cookie name
177
-
178
- You can programmatically set the cookie:
179
-
180
- conf = arize._generated.api_client.Configuration(
181
- api_key={'cookieAuth': 'abc123'}
182
- api_key_prefix={'cookieAuth': 'JSESSIONID'}
183
- )
184
-
185
- The following cookie will be added to the HTTP request:
186
- Cookie: JSESSIONID abc123
187
170
  """
188
171
 
189
172
  _default: ClassVar[Optional[Self]] = None
@@ -204,12 +187,14 @@ conf = arize._generated.api_client.Configuration(
204
187
  ssl_ca_cert: Optional[str]=None,
205
188
  retries: Optional[int] = None,
206
189
  ca_cert_data: Optional[Union[str, bytes]] = None,
190
+ cert_file: Optional[str]=None,
191
+ key_file: Optional[str]=None,
207
192
  *,
208
193
  debug: Optional[bool] = None,
209
194
  ) -> None:
210
195
  """Constructor
211
196
  """
212
- self._base_path = "http://localhost" if host is None else host
197
+ self._base_path = "https://api.arize.com" if host is None else host
213
198
  """Default Base url
214
199
  """
215
200
  self.server_index = 0 if server_index is None and host is None else server_index
@@ -285,10 +270,10 @@ conf = arize._generated.api_client.Configuration(
285
270
  """Set this to verify the peer using PEM (str) or DER (bytes)
286
271
  certificate data.
287
272
  """
288
- self.cert_file = None
273
+ self.cert_file = cert_file
289
274
  """client certificate file
290
275
  """
291
- self.key_file = None
276
+ self.key_file = key_file
292
277
  """client key file
293
278
  """
294
279
  self.assert_hostname = None
@@ -511,14 +496,13 @@ conf = arize._generated.api_client.Configuration(
511
496
  :return: The Auth Settings information dict.
512
497
  """
513
498
  auth: AuthSettings = {}
514
- if 'ApiKeyAuth' in self.api_key:
515
- auth['ApiKeyAuth'] = {
516
- 'type': 'api_key',
499
+ if self.access_token is not None:
500
+ auth['bearerAuth'] = {
501
+ 'type': 'bearer',
517
502
  'in': 'header',
503
+ 'format': '<api-key>',
518
504
  'key': 'Authorization',
519
- 'value': self.get_api_key_with_prefix(
520
- 'ApiKeyAuth',
521
- ),
505
+ 'value': 'Bearer ' + self.access_token
522
506
  }
523
507
  return auth
524
508
 
@@ -530,7 +514,7 @@ conf = arize._generated.api_client.Configuration(
530
514
  return "Python SDK Debug Report:\n"\
531
515
  "OS: {env}\n"\
532
516
  "Python Version: {pyversion}\n"\
533
- "Version of the API: 0.0.1\n"\
517
+ "Version of the API: 2.0.0\n"\
534
518
  "SDK Package Version: 1.0.0".\
535
519
  format(env=sys.platform, pyversion=sys.version)
536
520
 
@@ -541,8 +525,32 @@ conf = arize._generated.api_client.Configuration(
541
525
  """
542
526
  return [
543
527
  {
544
- 'url': "",
545
- 'description': "No description provided",
528
+ 'url': "https://api.arize.com",
529
+ 'description': "Global",
530
+ },
531
+ {
532
+ 'url': "https://api.{region}.arize.com",
533
+ 'description': "Regional",
534
+ 'variables': {
535
+ 'region': {
536
+ 'description': "No description provided",
537
+ 'default_value': "eu-west-1a",
538
+ 'enum_values': [
539
+ "eu-west-1a",
540
+ "ca-central-1a"
541
+ ]
542
+ }
543
+ }
544
+ },
545
+ {
546
+ 'url': "https://{host}",
547
+ 'description': "Custom Host",
548
+ 'variables': {
549
+ 'host': {
550
+ 'description': "No description provided",
551
+ 'default_value': "api.arize.com",
552
+ }
553
+ }
546
554
  }
547
555
  ]
548
556
 
@@ -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.
@@ -4,9 +4,9 @@
4
4
  """
5
5
  Arize REST API
6
6
 
7
- 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
7
+ API specification for the backend data server. The API is hosted globally at https://api.arize.com/v2 or in your own environment.
8
8
 
9
- The version of the OpenAPI document: 0.0.1
9
+ The version of the OpenAPI document: 2.0.0
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
@@ -14,13 +14,24 @@
14
14
 
15
15
  # import models into model package
16
16
  from arize._generated.api_client.models.dataset import Dataset
17
+ from arize._generated.api_client.models.dataset_example import DatasetExample
18
+ from arize._generated.api_client.models.dataset_example_update import DatasetExampleUpdate
17
19
  from arize._generated.api_client.models.dataset_version import DatasetVersion
18
20
  from arize._generated.api_client.models.datasets_create_request import DatasetsCreateRequest
21
+ from arize._generated.api_client.models.datasets_examples_insert_request import DatasetsExamplesInsertRequest
22
+ from arize._generated.api_client.models.datasets_examples_list200_response import DatasetsExamplesList200Response
23
+ from arize._generated.api_client.models.datasets_examples_update_request import DatasetsExamplesUpdateRequest
19
24
  from arize._generated.api_client.models.datasets_list200_response import DatasetsList200Response
20
- from arize._generated.api_client.models.datasets_list_examples200_response import DatasetsListExamples200Response
21
- from arize._generated.api_client.models.error import Error
22
25
  from arize._generated.api_client.models.experiment import Experiment
26
+ from arize._generated.api_client.models.experiment_run import ExperimentRun
27
+ from arize._generated.api_client.models.experiment_run_create import ExperimentRunCreate
23
28
  from arize._generated.api_client.models.experiments_create_request import ExperimentsCreateRequest
24
29
  from arize._generated.api_client.models.experiments_list200_response import ExperimentsList200Response
25
30
  from arize._generated.api_client.models.experiments_runs_list200_response import ExperimentsRunsList200Response
31
+ from arize._generated.api_client.models.pagination_metadata import PaginationMetadata
32
+ from arize._generated.api_client.models.primitive_value import PrimitiveValue
33
+ from arize._generated.api_client.models.problem import Problem
34
+ from arize._generated.api_client.models.project import Project
35
+ from arize._generated.api_client.models.projects_create_request import ProjectsCreateRequest
36
+ from arize._generated.api_client.models.projects_list200_response import ProjectsList200Response
26
37
 
@@ -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.
@@ -26,15 +26,15 @@ from typing_extensions import Self
26
26
 
27
27
  class Dataset(BaseModel):
28
28
  """
29
- A dataset message
29
+ A dataset is a structured collection of examples used to test and evaluate LLM applications. Datasets allow you to test models consistently across any real-world scenarios and edge cases, quickly identify regressions, and track measurable improvements.
30
30
  """ # noqa: E501
31
31
  id: StrictStr = Field(description="Unique identifier for the dataset")
32
32
  name: StrictStr = Field(description="Name of the dataset")
33
- space_id: StrictStr = Field(description="Unique identifier for the space this dataset belongs to", alias="spaceId")
34
- created_at: Optional[datetime] = Field(default=None, description="Timestamp for when the dataset was created", alias="createdAt")
35
- updated_at: Optional[datetime] = Field(default=None, description="Timestamp for the last update of the dataset", alias="updatedAt")
33
+ space_id: StrictStr = Field(description="Unique identifier for the space this dataset belongs to")
34
+ created_at: datetime = Field(description="Timestamp for when the dataset was created")
35
+ updated_at: datetime = Field(description="Timestamp for the last update of the dataset")
36
36
  versions: Optional[List[DatasetVersion]] = Field(default=None, description="List of versions associated with this dataset")
37
- __properties: ClassVar[List[str]] = ["id", "name", "spaceId", "createdAt", "updatedAt", "versions"]
37
+ __properties: ClassVar[List[str]] = ["id", "name", "space_id", "created_at", "updated_at", "versions"]
38
38
 
39
39
  model_config = ConfigDict(
40
40
  populate_by_name=True,
@@ -101,9 +101,9 @@ class Dataset(BaseModel):
101
101
  _obj = cls.model_validate({
102
102
  "id": obj.get("id"),
103
103
  "name": obj.get("name"),
104
- "spaceId": obj.get("spaceId"),
105
- "createdAt": obj.get("createdAt"),
106
- "updatedAt": obj.get("updatedAt"),
104
+ "space_id": obj.get("space_id"),
105
+ "created_at": obj.get("created_at"),
106
+ "updated_at": obj.get("updated_at"),
107
107
  "versions": [DatasetVersion.from_dict(_item) for _item in obj["versions"]] if obj.get("versions") is not None else None
108
108
  })
109
109
  return _obj
@@ -0,0 +1,111 @@
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 DatasetExample(BaseModel):
27
+ """
28
+ A dataset example with arbitrary user-defined fields. System-managed fields are included as read-only for responses.
29
+ """ # noqa: E501
30
+ id: StrictStr = Field(description="System-assigned unique ID for the example")
31
+ created_at: datetime = Field(description="Timestamp for when the example was created")
32
+ updated_at: datetime = Field(description="Timestamp for the last update of the example")
33
+ additional_properties: Dict[str, Any] = {}
34
+ __properties: ClassVar[List[str]] = ["id", "created_at", "updated_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 DatasetExample 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
+ * OpenAPI `readOnly` fields are excluded.
67
+ * OpenAPI `readOnly` fields are excluded.
68
+ * OpenAPI `readOnly` fields are excluded.
69
+ * Fields in `self.additional_properties` are added to the output dict.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ "id",
73
+ "created_at",
74
+ "updated_at",
75
+ "additional_properties",
76
+ ])
77
+
78
+ _dict = self.model_dump(
79
+ by_alias=True,
80
+ exclude=excluded_fields,
81
+ exclude_none=True,
82
+ )
83
+ # puts key-value pairs in additional_properties in the top level
84
+ if self.additional_properties is not None:
85
+ for _key, _value in self.additional_properties.items():
86
+ _dict[_key] = _value
87
+
88
+ return _dict
89
+
90
+ @classmethod
91
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
92
+ """Create an instance of DatasetExample from a dict"""
93
+ if obj is None:
94
+ return None
95
+
96
+ if not isinstance(obj, dict):
97
+ return cls.model_validate(obj)
98
+
99
+ _obj = cls.model_validate({
100
+ "id": obj.get("id"),
101
+ "created_at": obj.get("created_at"),
102
+ "updated_at": obj.get("updated_at")
103
+ })
104
+ # store additional fields in additional_properties
105
+ for _key in obj.keys():
106
+ if _key not in cls.__properties:
107
+ _obj.additional_properties[_key] = obj.get(_key)
108
+
109
+ return _obj
110
+
111
+
@@ -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, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class DatasetExampleUpdate(BaseModel):
26
+ """
27
+ A dataset example with arbitrary user-defined fields. System-managed fields, except 'id', are excluded for update requests.
28
+ """ # noqa: E501
29
+ id: StrictStr = Field(description="System-assigned unique ID for the example")
30
+ additional_properties: Dict[str, Any] = {}
31
+ __properties: ClassVar[List[str]] = ["id"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of DatasetExampleUpdate from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ * Fields in `self.additional_properties` are added to the output dict.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ "additional_properties",
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # puts key-value pairs in additional_properties in the top level
75
+ if self.additional_properties is not None:
76
+ for _key, _value in self.additional_properties.items():
77
+ _dict[_key] = _value
78
+
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of DatasetExampleUpdate from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "id": obj.get("id")
92
+ })
93
+ # store additional fields in additional_properties
94
+ for _key in obj.keys():
95
+ if _key not in cls.__properties:
96
+ _obj.additional_properties[_key] = obj.get(_key)
97
+
98
+ return _obj
99
+
100
+
@@ -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,20 +19,20 @@ import json
19
19
 
20
20
  from datetime import datetime
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Any, ClassVar, Dict, List
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
26
  class DatasetVersion(BaseModel):
27
27
  """
28
- DatasetVersion
28
+ A dataset version is a saved snapshot of a dataset. Arize stores datasets as version-controlled collections of examples for experiments. When you update a dataset, you can do so inplace or create a new version while preserving access to previous versions.
29
29
  """ # noqa: E501
30
- id: Optional[StrictStr] = Field(default=None, description="Unique identifier for the dataset version")
31
- name: Optional[StrictStr] = Field(default=None, description="Name of the dataset version")
32
- dataset_id: Optional[StrictStr] = Field(default=None, description="Unique identifier for the dataset this version belongs to", alias="datasetId")
33
- created_at: Optional[datetime] = Field(default=None, description="Timestamp for when the dataset version was created", alias="createdAt")
34
- updated_at: Optional[datetime] = Field(default=None, description="Timestamp for the last update of the dataset version", alias="updatedAt")
35
- __properties: ClassVar[List[str]] = ["id", "name", "datasetId", "createdAt", "updatedAt"]
30
+ id: StrictStr = Field(description="Unique identifier for the dataset version")
31
+ name: StrictStr = Field(description="Name of the dataset version")
32
+ dataset_id: StrictStr = Field(description="Unique identifier for the dataset this version belongs to")
33
+ created_at: datetime = Field(description="Timestamp for when the dataset version was created")
34
+ updated_at: datetime = Field(description="Timestamp for the last update of the dataset version")
35
+ __properties: ClassVar[List[str]] = ["id", "name", "dataset_id", "created_at", "updated_at"]
36
36
 
37
37
  model_config = ConfigDict(
38
38
  populate_by_name=True,
@@ -92,9 +92,9 @@ class DatasetVersion(BaseModel):
92
92
  _obj = cls.model_validate({
93
93
  "id": obj.get("id"),
94
94
  "name": obj.get("name"),
95
- "datasetId": obj.get("datasetId"),
96
- "createdAt": obj.get("createdAt"),
97
- "updatedAt": obj.get("updatedAt")
95
+ "dataset_id": obj.get("dataset_id"),
96
+ "created_at": obj.get("created_at"),
97
+ "updated_at": obj.get("updated_at")
98
98
  })
99
99
  return _obj
100
100
 
@@ -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,7 @@ 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
22
23
  from typing import Optional, Set
23
24
  from typing_extensions import Self
24
25
 
@@ -26,10 +27,10 @@ class DatasetsCreateRequest(BaseModel):
26
27
  """
27
28
  DatasetsCreateRequest
28
29
  """ # noqa: E501
29
- name: StrictStr
30
- space_id: StrictStr = Field(alias="spaceId")
31
- examples: List[Dict[str, Any]]
32
- __properties: ClassVar[List[str]] = ["name", "spaceId", "examples"]
30
+ name: StrictStr = Field(description="Name of the new dataset")
31
+ space_id: StrictStr = Field(description="ID of the space the dataset will belong to")
32
+ examples: List[Dict[str, PrimitiveValue]] = Field(description="Array of examples for the new dataset")
33
+ __properties: ClassVar[List[str]] = ["name", "space_id", "examples"]
33
34
 
34
35
  model_config = ConfigDict(
35
36
  populate_by_name=True,
@@ -70,6 +71,13 @@ class DatasetsCreateRequest(BaseModel):
70
71
  exclude=excluded_fields,
71
72
  exclude_none=True,
72
73
  )
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
73
81
  return _dict
74
82
 
75
83
  @classmethod
@@ -88,8 +96,8 @@ class DatasetsCreateRequest(BaseModel):
88
96
 
89
97
  _obj = cls.model_validate({
90
98
  "name": obj.get("name"),
91
- "spaceId": obj.get("spaceId"),
92
- "examples": obj.get("examples")
99
+ "space_id": obj.get("space_id"),
100
+ "examples": [Dict[str, PrimitiveValue].from_dict(_item) for _item in obj["examples"]] if obj.get("examples") is not None else None
93
101
  })
94
102
  return _obj
95
103