arize-phoenix 4.8.1__py3-none-any.whl → 4.9.0__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.

Potentially problematic release.


This version of arize-phoenix might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: arize-phoenix
3
- Version: 4.8.1
3
+ Version: 4.9.0
4
4
  Summary: AI Observability and Evaluation
5
5
  Project-URL: Documentation, https://docs.arize.com/phoenix/
6
6
  Project-URL: Issues, https://github.com/Arize-ai/phoenix/issues
@@ -5,7 +5,7 @@ phoenix/exceptions.py,sha256=n2L2KKuecrdflB9MsCdAYCiSEvGJptIsfRkXMoJle7A,169
5
5
  phoenix/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
6
6
  phoenix/services.py,sha256=aTxhcOA1pZHB6U-B3TEcp6fqDF5oT0xCUvEUNMZVTUQ,5175
7
7
  phoenix/settings.py,sha256=cO-qgis_S27nHirTobYI9hHPfZH18R--WMmxNdsVUwc,273
8
- phoenix/version.py,sha256=5LMFXHH6L0xgmxA0DlLrNZtG0vHgJ8uHcls9atNfDqI,22
8
+ phoenix/version.py,sha256=E0Y9rD8RWyBe6e34I0525HrRS_vGhPvve493oPOdtXw,22
9
9
  phoenix/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  phoenix/core/embedding_dimension.py,sha256=zKGbcvwOXgLf-yrJBpQyKtd-LEOPRKHnUToyAU8Owis,87
11
11
  phoenix/core/model.py,sha256=km_a--PBHOuA337ClRw9xqhOHhrUT6Rl9pz_zV0JYkQ,4843
@@ -43,7 +43,7 @@ phoenix/experiments/evaluators/utils.py,sha256=SroMoxmPZIFCi2MbEOvXlBAFJbEZY2IWg
43
43
  phoenix/inferences/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
44
  phoenix/inferences/errors.py,sha256=cGp9vxnw4SewFoWBV3ZGMkhE0Kh73lPIv3Ppz_H_RoA,8261
45
45
  phoenix/inferences/fixtures.py,sha256=FC2eRL4dpobKQHYOilFtDexUWFkMZ_w6jun_4WkbMk0,20792
46
- phoenix/inferences/inferences.py,sha256=YVZ56vZXgV0gVrDhFxcaPlawoDm5cFm2GQpaPkbZE-4,30718
46
+ phoenix/inferences/inferences.py,sha256=aH2uHRJR4_W7CVy3EMEioaEBM8cTRYBUyVuDDVjwVXw,31106
47
47
  phoenix/inferences/schema.py,sha256=UYej9IJ6pFeNW3fq721kJy16ONso_xVDm78Q68G4hl4,6643
48
48
  phoenix/inferences/validation.py,sha256=fdmbsjUBwtacRiVFdh9aem-QrgPfq_OlEmPdascWluc,8297
49
49
  phoenix/metrics/README.md,sha256=5gekqTU-5gGdMwvcfNp2Wlu8p1ul9kGY_jq0XXQusoI,1964
@@ -125,7 +125,7 @@ phoenix/server/api/mutations/auth.py,sha256=vPRFoj7J6PV6QeODewG4K0PhoOebS5AfMRpb
125
125
  phoenix/server/api/mutations/dataset_mutations.py,sha256=CuKhxsYfvwVcdN_9EXhKxB6444BQfObzKzzyfAeg-n8,23199
126
126
  phoenix/server/api/mutations/experiment_mutations.py,sha256=vV2lbJ7ccXZqe-LY7nXx6QxWqhKQE4UNZAFcML-KQ8I,3011
127
127
  phoenix/server/api/mutations/export_events_mutations.py,sha256=t_wYBxaqvBJYRoHslh3Bmoxmwlzoy0u8SsBKWIKN5hE,4028
128
- phoenix/server/api/mutations/project_mutations.py,sha256=3SVDCZqxB0Iv60cOwBL8c-rY3QUUPs8PXbp-C_K1mWY,2267
128
+ phoenix/server/api/mutations/project_mutations.py,sha256=d_xtYkYfZ5flpVgEkGknKB8rsEux-zZraczzqAs4e8A,2255
129
129
  phoenix/server/api/openapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
130
130
  phoenix/server/api/openapi/main.py,sha256=WY0pj3B7siQyyYqKyhqnzWC7P8MtEtiukOBUjGwLXfw,153
131
131
  phoenix/server/api/openapi/schema.py,sha256=uuSYe1Ecu72aXRgTNjyMu-9ZPE13DAHJPKtedS-MsSs,451
@@ -203,12 +203,12 @@ phoenix/server/static/apple-touch-icon-76x76.png,sha256=CT_xT12I0u2i0WU8JzBZBuOQ
203
203
  phoenix/server/static/apple-touch-icon.png,sha256=fOfpjqGpWYbJ0eAurKsyoZP1EAs6ZVooBJ_SGk2ZkDs,3801
204
204
  phoenix/server/static/favicon.ico,sha256=bY0vvCKRftemZfPShwZtE93DiiQdaYaozkPGwNFr6H8,34494
205
205
  phoenix/server/static/index.css,sha256=KKGpx4iwF91VGRm0YN-4cn8oC-oIqC6HecoPf0x3ZM8,1885
206
- phoenix/server/static/index.js,sha256=sUkm_imwx5uXpCQxQEPmX-axDr094HE1wGdBznF8J_E,3524949
206
+ phoenix/server/static/index.js,sha256=fo34I1yr65xkACAvw2LCNTDFMTpTQjKV3C1_oL1mWYg,3524937
207
207
  phoenix/server/static/modernizr.js,sha256=mvK-XtkNqjOral-QvzoqsyOMECXIMu5BQwSVN_wcU9c,2564
208
208
  phoenix/server/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
209
209
  phoenix/server/templates/index.html,sha256=S4z7qSoNSwnKFAH9r96AR-YJEyoKMd-VMWVlJ_IdzME,2039
210
210
  phoenix/session/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
211
- phoenix/session/client.py,sha256=43MmopBHxPq2MprbSXixAzQyGr0VRhHEYZZ6WvITq1I,32343
211
+ phoenix/session/client.py,sha256=8dWs_-boxhrqJ-MQMkhXYYL_1YBDccz83nwirJdtBp0,32400
212
212
  phoenix/session/data_extractor.py,sha256=dwhiDu-ISaXr8UI9I-CszZhB5BlUNmdDopjFZvMIXMw,2101
213
213
  phoenix/session/evaluation.py,sha256=aKeV8UVOyq3b7CYOwt3cWuLz0xzvMjX7vlEPILJ_fcs,5311
214
214
  phoenix/session/session.py,sha256=rjIuSSK2gAYIUPQTJc4E2ebew5o6I070FWRoFn4W3EI,26620
@@ -224,7 +224,7 @@ phoenix/trace/schemas.py,sha256=Mjc6fD9OyeMnEk5wPPSbveqnNUYWK3p3BxpOvSGanHU,5950
224
224
  phoenix/trace/span_evaluations.py,sha256=GaADtJLi2njra4aYaie0BIwkSgdxPB_SNseglI4ykZA,13104
225
225
  phoenix/trace/span_json_decoder.py,sha256=W6T1U0xndE2a-85O1QalJmStJK1zF1IoSU97h1RoWeY,3231
226
226
  phoenix/trace/span_json_encoder.py,sha256=tzSCIQJbeFBm33K68G8A5M12n_86tCDyuU0WAobxEz4,2010
227
- phoenix/trace/trace_dataset.py,sha256=9qDs8T3QQOTN9fHZzyeJlAvR-yW7tkq1OvV0xWILgzA,13917
227
+ phoenix/trace/trace_dataset.py,sha256=Wq89jJ4hYQ1Qt-Uj11ZNzKQYQeKmGY6NqWStQiiTlMw,14351
228
228
  phoenix/trace/utils.py,sha256=7LurVGXn245cjj4MJsc7v6jq4DSJkpK6YGBfIaSywuw,1307
229
229
  phoenix/trace/dsl/README.md,sha256=ihmP9zGUC5V-TDbzKla76LuyDqPDQIBUH2BORwxNI68,2902
230
230
  phoenix/trace/dsl/__init__.py,sha256=WIQIjJg362XD3s50OsPJJ0xbDsGp41bSv7vDllLrPuA,144
@@ -248,8 +248,8 @@ phoenix/utilities/logging.py,sha256=lDXd6EGaamBNcQxL4vP1au9-i_SXe0OraUDiJOcszSw,
248
248
  phoenix/utilities/project.py,sha256=qWsvKnG1oKhOFUowXf9qiOL2ia7jaFe_ijFFHEt8GJo,431
249
249
  phoenix/utilities/re.py,sha256=PDve_OLjRTM8yQQJHC8-n3HdIONi7aNils3ZKRZ5uBM,2045
250
250
  phoenix/utilities/span_store.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
251
- arize_phoenix-4.8.1.dist-info/METADATA,sha256=cr_RMue_eqzBxlqGELzqha7zvv0EF_J9qfc7grNpekg,11451
252
- arize_phoenix-4.8.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
253
- arize_phoenix-4.8.1.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
254
- arize_phoenix-4.8.1.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
255
- arize_phoenix-4.8.1.dist-info/RECORD,,
251
+ arize_phoenix-4.9.0.dist-info/METADATA,sha256=yF2f3TQt507o3KgtWsjLWsM4XtMtm0HSus54sjWZo_0,11451
252
+ arize_phoenix-4.9.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
253
+ arize_phoenix-4.9.0.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
254
+ arize_phoenix-4.9.0.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
255
+ arize_phoenix-4.9.0.dist-info/RECORD,,
@@ -42,7 +42,13 @@ SchemaLike: TypeAlias = Any
42
42
  class Inferences:
43
43
  """
44
44
  A dataset to use for analysis using phoenix.
45
- Used to construct a phoenix session via px.launch_app
45
+ Used to construct a phoenix session via px.launch_app.
46
+
47
+ Typical usage example::
48
+
49
+ primary_inferences = px.Inferences(
50
+ dataframe=production_dataframe, schema=schema, name="primary"
51
+ )
46
52
 
47
53
  Parameters
48
54
  ----------
@@ -62,9 +68,15 @@ class Inferences:
62
68
 
63
69
  Examples
64
70
  --------
65
- >>> primary_inferences = px.Inferences(
66
- >>> dataframe=production_dataframe, schema=schema, name="primary"
67
- >>> )
71
+ Define inferences ds from a pandas dataframe df and a schema object schema by running::
72
+
73
+ ds = px.Inferences(df, schema)
74
+
75
+ Alternatively, provide a name for the inferences that will appear in the application::
76
+
77
+ ds = px.Inferences(df, schema, name="training")
78
+
79
+ ds is then passed as the primary or reference argument to launch_app.
68
80
  """
69
81
 
70
82
  _data_file_name: str = "data.parquet"
@@ -38,7 +38,7 @@ class ProjectMutationMixin:
38
38
  global_id=input.id, expected_type_name="Project"
39
39
  )
40
40
  delete_statement = delete(models.Trace).where(models.Trace.project_rowid == project_id)
41
- if input.end_time is not None:
41
+ if input.end_time:
42
42
  delete_statement = delete_statement.where(models.Trace.start_time < input.end_time)
43
43
  async with info.context.db() as session:
44
44
  await session.execute(delete_statement)
@@ -7844,7 +7844,7 @@ fragment DatasetHistoryTable_versions on Dataset {
7844
7844
  height: 500px;
7845
7845
  `,children:h(Vat,{dataset:n.dataset})})})}function Hat(t){let{datasetId:e}=t,[n,i]=(0,WH.useState)(null);return B($t,{children:[B(Vn,{children:[h(At,{variant:"default",icon:h(ke,{svg:h(Pe.ClockOutline,{})}),"aria-label":"Version History",onClick:()=>{i(h(Jat,{datasetId:e}))}}),h(fr,{children:"Dataset Version History"})]}),h(WH.Suspense,{fallback:null,children:h(Fn,{type:"modal",isDismissable:!0,onDismiss:()=>{i(null)},children:n})})]})}var bY=P(ie());var IGn=`pip install arize-phoenix>=${window.Config.platformVersion}`,pGn=`import os
7846
7846
  # Set the phoenix collector endpoint. Commonly http://localhost:6060
7847
- os.environ["PHOENIX_COLLECTOR_ENDPOINT"] = "<your-phoenix-url>"`,hGn=`from phoenix.datasets.types import Example
7847
+ os.environ["PHOENIX_COLLECTOR_ENDPOINT"] = "<your-phoenix-url>"`,hGn=`from phoenix.experiments import Example
7848
7848
  # Define your task
7849
7849
  # Typically should be an LLM call or a call to your application
7850
7850
  def my_task(example: Example) -> str:
@@ -7855,7 +7855,7 @@ def exact_match(input, output) -> float:
7855
7855
 
7856
7856
  # Store the evaluators for later use
7857
7857
  evaluators = [exact_match]`,CGn=`# Run an experiment
7858
- from phoenix.datasets.experiments import run_experiment
7858
+ from phoenix.experiments import run_experiment
7859
7859
 
7860
7860
  experiment = run_experiment(dataset, my_task, evaluators=evaluators)`;function GH(){let[t,e]=(0,bY.useState)(null),n=(0,bY.useCallback)(()=>{e(h(Mn,{title:"Run Experiment",size:"XL",children:h(AGn,{})}))},[]);return B($t,{children:[h(At,{size:"compact",variant:"default",icon:h(ke,{svg:h(Pe.ExperimentOutline,{})}),onClick:n,children:"Run Experiment"}),h(Fn,{isDismissable:!0,type:"slideOver",onDismiss:()=>{e(null)},children:t})]})}function AGn(){let t=ud(i=>i.datasetName),e=ud(i=>i.latestVersion),n=(0,bY.useMemo)(()=>`import phoenix as px
7861
7861
  # Initialize a phoenix client
phoenix/session/client.py CHANGED
@@ -68,12 +68,12 @@ class Client(TraceDataExtractor):
68
68
 
69
69
  Args:
70
70
  endpoint (str, optional): Phoenix server endpoint, e.g.
71
- http://localhost:6006. If not provided, the endpoint will be
72
- inferred from the environment variables.
71
+ http://localhost:6006. If not provided, the endpoint will be
72
+ inferred from the environment variables.
73
73
 
74
74
  headers (Mapping[str, str], optional): Headers to include in each
75
- network request. If not provided, the headers will be inferred from
76
- the environment variables (if present).
75
+ network request. If not provided, the headers will be inferred from
76
+ the environment variables (if present).
77
77
  """
78
78
  if kwargs.pop("use_active_session_if_available", None) is not None:
79
79
  print(
@@ -133,7 +133,8 @@ class Client(TraceDataExtractor):
133
133
  using environment variables. If not provided, falls back to the default project.
134
134
 
135
135
  Returns:
136
- Union[pd.DataFrame, List[pd.DataFrame]]: A pandas DataFrame or a list of pandas
136
+ Union[pd.DataFrame, List[pd.DataFrame]]:
137
+ A pandas DataFrame or a list of pandas.
137
138
  DataFrames containing the queried span data, or None if no spans are found.
138
139
  """
139
140
  project_name = project_name or get_env_project_name()
@@ -191,7 +192,8 @@ class Client(TraceDataExtractor):
191
192
  default project.
192
193
 
193
194
  Returns:
194
- List[Evaluations]: A list of Evaluations objects containing evaluation data. Returns an
195
+ List[Evaluations]:
196
+ A list of Evaluations objects containing evaluation data. Returns an
195
197
  empty list if no evaluations are found.
196
198
  """
197
199
  project_name = project_name or get_env_project_name()
@@ -341,10 +343,10 @@ class Client(TraceDataExtractor):
341
343
  id (Optional[str]): An ID for the dataset.
342
344
 
343
345
  name (Optional[str]): the name for the dataset. If provided, the ID
344
- is ignored and the dataset is retrieved by name.
346
+ is ignored and the dataset is retrieved by name.
345
347
 
346
348
  version_id (Optional[str]): An ID for the version of the dataset, or
347
- None.
349
+ None.
348
350
 
349
351
  Returns:
350
352
  A dataset object.
@@ -101,6 +101,14 @@ class TraceDataset:
101
101
  """
102
102
  A TraceDataset is a wrapper around a dataframe which is a flattened representation
103
103
  of Spans. The collection of spans trace the LLM application's execution.
104
+
105
+ Typical usage example::
106
+
107
+ from phoenix.trace.utils import json_lines_to_df
108
+
109
+ with open("trace.jsonl", "r") as f:
110
+ trace_ds = TraceDataset(json_lines_to_df(f.readlines()))
111
+ px.launch_app(trace=trace_ds)
104
112
  """
105
113
 
106
114
  name: str
@@ -122,15 +130,15 @@ class TraceDataset:
122
130
  Constructs a TraceDataset from a dataframe of spans. Optionally takes in
123
131
  evaluations for the spans in the dataset.
124
132
 
125
- Parameters
126
- __________
127
- dataframe: pandas.DataFrame
128
- the pandas dataframe containing the tracing data. Each row
129
- represents a span.
130
- evaluations: Optional[Iterable[SpanEvaluations]]
131
- an optional list of evaluations for the spans in the dataset. If
132
- provided, the evaluations can be materialized into a unified
133
- dataframe as annotations.
133
+ Args:
134
+ dataframe (pandas.DataFrame): The pandas dataframe containing the
135
+ tracing data. Each row of which is a flattened representation
136
+ of a span.
137
+ name (str): The name used to identify the dataset in the application.
138
+ If not provided, a random name will be generated.
139
+ evaluations (Optional[Iterable[SpanEvaluations]]): An optional list of
140
+ evaluations for the spans in the dataset. If provided, the evaluations
141
+ can be materialized into a unified dataframe as annotations.
134
142
  """
135
143
  # Validate the the dataframe has required fields
136
144
  if missing_columns := set(REQUIRED_COLUMNS) - set(dataframe.columns):
@@ -225,12 +233,12 @@ class TraceDataset:
225
233
 
226
234
  Args:
227
235
  directory (Optional[Union[str, Path]], optional): An optional path
228
- to a directory where the data will be written. If not provided, the
229
- data will be written to a default location.
236
+ to a directory where the data will be written. If not provided, the
237
+ data will be written to a default location.
230
238
 
231
239
  Returns:
232
240
  UUID: The id of the trace dataset, which can be used as key to load
233
- the dataset from disk using `load`.
241
+ the dataset from disk using `load`.
234
242
  """
235
243
  directory = Path(directory or TRACE_DATASETS_DIR)
236
244
  for evals in self.evaluations:
@@ -273,9 +281,9 @@ class TraceDataset:
273
281
  id (Union[str, UUID]): The ID of the trace dataset to be loaded.
274
282
 
275
283
  directory (Optional[Union[str, Path]], optional): The path to the
276
- directory containing the persisted trace dataset parquet file. If
277
- not provided, the parquet file will be loaded from the same default
278
- location used by `save`.
284
+ directory containing the persisted trace dataset parquet file. If
285
+ not provided, the parquet file will be loaded from the same default
286
+ location used by `save`.
279
287
 
280
288
  Returns:
281
289
  TraceDataset: The loaded trace dataset.
phoenix/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "4.8.1"
1
+ __version__ = "4.9.0"