arize 8.0.0a3__py3-none-any.whl → 8.0.0a4__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/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "8.0.0a3"
1
+ __version__ = "8.0.0a4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arize
3
- Version: 8.0.0a3
3
+ Version: 8.0.0a4
4
4
  Summary: A helper library to interact with Arize AI APIs
5
5
  Project-URL: Homepage, https://arize.com
6
6
  Project-URL: Documentation, https://docs.arize.com/arize
@@ -120,13 +120,14 @@ tracer_provider = register(
120
120
  OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)
121
121
  ```
122
122
 
123
-
124
- ### Logging Spans, Evaluations, and Annotations
123
+ ### Operations on Spans
125
124
 
126
125
  Use `arize.spans` to interact with spans: log spans into Arize, update the span's evaluations, annotations and metadata in bulk.
127
126
 
128
127
  > **WARNING**: This is currently under an alpha release. Install with `pip install arize==8.0.0ax` where the `x` denotes the specific alpha version. Check the [pre-releases](https://pypi.org/project/arize/#history) page in PyPI.
129
128
 
129
+ #### Logging spans
130
+
130
131
  ```python
131
132
  from arize import ArizeClient
132
133
 
@@ -138,22 +139,169 @@ client.spans.log(
138
139
  space_id=SPACE_ID,
139
140
  project_name=PROJECT_NAME,
140
141
  dataframe=spans_df,
141
- evals_df=evals_df, # Optionally pass the evaluations together with the spans
142
+ # evals_df=evals_df, # Optionally pass the evaluations together with the spans
142
143
  )
144
+ ```
145
+
146
+ #### Update spans Evaluations, Annotations, and Metadata
147
+
148
+ ```python
149
+ from arize import ArizeClient
150
+
151
+ client = ArizeClient(api_key=API_KEY)
152
+ SPACE_ID = "<your-space-id>"
153
+ PROJECT_NAME = "<your-project-name>"
143
154
 
144
155
  client.spans.update_evaluations(
156
+ space_id=SPACE_ID,
157
+ project_name=PROJECT_NAME,
145
158
  dataframe=evals_df,
146
- project_name="your-llm-project",
159
+ # force_http=... # Optionally pass force_http to update evaluations via HTTP instead of gRPC, defaults to False
147
160
  )
148
161
 
149
162
  client.spans.update_annotations(
163
+ space_id=SPACE_ID,
164
+ project_name=PROJECT_NAME,
150
165
  dataframe=annotations_df,
151
- project_name="your-llm-project",
152
166
  )
153
167
 
154
168
  client.spans.update_metadata(
155
- dataframe=annotations_df,
156
- project_name="your-llm-project",
169
+ space_id=SPACE_ID,
170
+ project_name=PROJECT_NAME,
171
+ dataframe=metadata_df,
172
+ )
173
+ ```
174
+
175
+ #### Exporting spans
176
+
177
+ Use the `export_to_df` or `export_to_parquet` to export large amounts of spans from Arize.
178
+
179
+ ```python
180
+ from arize import ArizeClient
181
+ from datetime import datetime
182
+
183
+ FMT = "%Y-%m-%d"
184
+ start_time = datetime.strptime("2024-01-01",FMT)
185
+ end_time = datetime.strptime("2026-01-01",FMT)
186
+
187
+ client = ArizeClient(api_key=API_KEY)
188
+ SPACE_ID = "<your-space-id>"
189
+ PROJECT_NAME = "<your-project-name>"
190
+
191
+ df = client.spans.export_to_df(
192
+ space_id=SPACE_ID,
193
+ project_name=PROJECT_NAME,
194
+ start_time=start_time,
195
+ end_time=end_time,
196
+ )
197
+ ```
198
+
199
+ ### Operations on ML Models
200
+
201
+ Use `arize.models` to interact with ML models: log ML data (traininv, validation, production) into Arize, either streaming or in batches.
202
+
203
+ > **WARNING**: This is currently under an alpha release. Install with `pip install arize==8.0.0ax` where the `x` denotes the specific alpha version. Check the [pre-releases](https://pypi.org/project/arize/#history) page in PyPI.
204
+
205
+ #### Stream log ML Data for a Classification use-case
206
+
207
+ ```python
208
+ from arize import ArizeClient
209
+ from arize.types import ModelTypes, Environments
210
+
211
+ client = ArizeClient(api_key=API_KEY)
212
+ SPACE_ID = "<your-space-id>"
213
+ MODEL_NAME = "<your-model-name>"
214
+
215
+ features=...
216
+ embedding_features=...
217
+
218
+ response = client.models.log_stream(
219
+ space_id=SPACE_ID,
220
+ model_name=MODEL_NAME,
221
+ model_type=ModelTypes.SCORE_CATEGORICAL,
222
+ environment=Environments.PRODUCTION,
223
+ prediction_label=("not fraud",0.3),
224
+ actual_label=("fraud",1.0),
225
+ features=features,
226
+ embedding_features=embedding_features,
227
+ )
228
+ ```
229
+
230
+ #### Log a batch of ML Data for a Classification use-case
231
+
232
+ ```python
233
+ from arize import ArizeClient
234
+ from arize.types import ModelTypes, Environments
235
+
236
+ client = ArizeClient(api_key=API_KEY)
237
+ SPACE_ID = "<your-space-id>"
238
+ MODEL_NAME = "<your-model-name>"
239
+ MODEL_VERSION = "1.0"
240
+
241
+ from arize.types import Schema, EmbeddingColumnNames, ObjectDetectionColumnNames, ModelTypes, Environments
242
+
243
+ tags = ["drift_type"]
244
+ embedding_feature_column_names = {
245
+ "image_embedding": EmbeddingColumnNames(
246
+ vector_column_name="image_vector", link_to_data_column_name="url"
247
+ )
248
+ }
249
+ object_detection_prediction_column_names = ObjectDetectionColumnNames(
250
+ bounding_boxes_coordinates_column_name="prediction_bboxes",
251
+ categories_column_name="prediction_categories",
252
+ scores_column_name="prediction_scores",
253
+ )
254
+ object_detection_actual_column_names = ObjectDetectionColumnNames(
255
+ bounding_boxes_coordinates_column_name="actual_bboxes",
256
+ categories_column_name="actual_categories",
257
+ )
258
+
259
+ # Define a Schema() object for Arize to pick up data from the correct columns for logging
260
+ schema = Schema(
261
+ prediction_id_column_name="prediction_id",
262
+ timestamp_column_name="prediction_ts",
263
+ tag_column_names=tags,
264
+ embedding_feature_column_names=embedding_feature_column_names,
265
+ object_detection_prediction_column_names=object_detection_prediction_column_names,
266
+ object_detection_actual_column_names=object_detection_actual_column_names,
267
+ )
268
+
269
+ # Logging Production DataFrame
270
+ response = client.models.log_batch(
271
+ space_id=SPACE_ID,
272
+ model_name=MODEL_NAME,
273
+ model_type=ModelTypes.OBJECT_DETECTION,
274
+ dataframe=prod_df,
275
+ schema=schema,
276
+ environment=Environments.PRODUCTION,
277
+ model_version = MODEL_VERSION, # Optionally pass a model version
278
+ )
279
+ ```
280
+
281
+ #### Exporting ML Data
282
+
283
+ Use the `export_to_df` or `export_to_parquet` to export large amounts of spans from Arize.
284
+
285
+ ```python
286
+ from arize import ArizeClient
287
+ from datetime import datetime
288
+
289
+ FMT = "%Y-%m-%d"
290
+ start_time = datetime.strptime("2024-01-01",FMT)
291
+ end_time = datetime.strptime("2026-01-01",FMT)
292
+
293
+ client = ArizeClient(api_key=API_KEY)
294
+ SPACE_ID = "<your-space-id>"
295
+ MODEL_NAME = "<your-model-name>"
296
+ MODEL_VERSION = "1.0"
297
+
298
+ df = client.models.export_to_df(
299
+ space_id=SPACE_ID,
300
+ model_name=MODEL_NAME,
301
+ environment=Environments.TRAINING,
302
+ model_version=MODEL_VERSION,
303
+ start_time=start_time,
304
+ end_time=end_time,
157
305
  )
158
306
  ```
159
307
 
@@ -4,7 +4,7 @@ arize/client.py,sha256=ntSYQSzM6MrvcYDxV-lFF-yoxoPjjCvBHKoN-2k1BGg,5688
4
4
  arize/config.py,sha256=iynVEZhrOPdTNJTQ_KQmwKOPiwL0LfEP8AUIDYW86Xw,5801
5
5
  arize/logging.py,sha256=2vwdta2-kR78GeBFGK2vpk51rQ2d06HoKzuARI9qFQk,7317
6
6
  arize/types.py,sha256=z1yg5-brmTD4kVHDmmTVkYke53JpusXXeOOpdQw7rYg,69508
7
- arize/version.py,sha256=-2w1elCT-feW897Pe_qFisuliwiQu6Fye5bbjMWpdP0,24
7
+ arize/version.py,sha256=_tySepGbCqg_WMxEmmCuYp-OGXCcWr_Nn7pmjEpXZx8,24
8
8
  arize/_exporter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  arize/_exporter/client.py,sha256=eAxJX1sUfdpLrtaQ0ynMTd5jI37JOp9fbl3NWp4WFEA,15216
10
10
  arize/_exporter/validation.py,sha256=6ROu5p7uaolxQ93lO_Eiwv9NVw_uyi3E5T--C5Klo5Q,1021
@@ -107,7 +107,7 @@ arize/utils/arrow.py,sha256=J7uwMsVR9K85myWcnKHb_pUz2H8Timk56U9gV2t5XnA,5477
107
107
  arize/utils/casting.py,sha256=KUrPUQN6qJEVe39nxbr0T-0GjAJLHjf4xWuzV71QezI,12468
108
108
  arize/utils/dataframe.py,sha256=I0FloPgNiqlKga32tMOvTE70598QA8Hhrgf-6zjYMAM,1120
109
109
  arize/utils/proto.py,sha256=9vLo53INYjdF78ffjm3E48jFwK6LbPD2FfKei7VaDy8,35477
110
- arize-8.0.0a3.dist-info/METADATA,sha256=mF17NSwm6SVVwoZDXNphbIUK4iIwzZJmZHeH0P-EPqg,7265
111
- arize-8.0.0a3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
112
- arize-8.0.0a3.dist-info/licenses/LICENSE.md,sha256=8vLN8Gms62NCBorxIv9MUvuK7myueb6_-dhXHPmm4H0,1479
113
- arize-8.0.0a3.dist-info/RECORD,,
110
+ arize-8.0.0a4.dist-info/METADATA,sha256=KRy-y9Zf3bDwE_210OVOIBjJJnB1K59VdRwbHZUnq98,11573
111
+ arize-8.0.0a4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
112
+ arize-8.0.0a4.dist-info/licenses/LICENSE.md,sha256=8vLN8Gms62NCBorxIv9MUvuK7myueb6_-dhXHPmm4H0,1479
113
+ arize-8.0.0a4.dist-info/RECORD,,