arize-phoenix 1.7.2rc1__py3-none-any.whl → 1.8.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.1
2
2
  Name: arize-phoenix
3
- Version: 1.7.2rc1
3
+ Version: 1.8.0
4
4
  Summary: ML Observability in your notebook
5
5
  Project-URL: Documentation, https://docs.arize.com/phoenix/
6
6
  Project-URL: Issues, https://github.com/Arize-ai/phoenix/issues
@@ -24,6 +24,7 @@ Requires-Dist: pandas
24
24
  Requires-Dist: protobuf<5.0,>=3.20
25
25
  Requires-Dist: psutil
26
26
  Requires-Dist: pyarrow
27
+ Requires-Dist: requests
27
28
  Requires-Dist: scikit-learn<1.3.0
28
29
  Requires-Dist: scipy
29
30
  Requires-Dist: sortedcontainers
@@ -1,4 +1,4 @@
1
- phoenix/__init__.py,sha256=7wCb9CWfYgHJVjnWyu1HIS7RZ06EQa52qZ0UqKfx_f8,1376
1
+ phoenix/__init__.py,sha256=T3vO25loGIGQ0kFhzRWyVCyEbl8FeyP2nMzpKy6Jhag,1373
2
2
  phoenix/config.py,sha256=ErvGg22SSiuqPJtIX1WZE5KcM2lt6XOGZ__HwRg3JqA,2390
3
3
  phoenix/datetime_utils.py,sha256=D955QLrkgrrSdUM6NyqbCeAu2SMsjhR5rHVQEsVUdng,2773
4
4
  phoenix/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
@@ -119,7 +119,7 @@ phoenix/server/static/apple-touch-icon-76x76.png,sha256=CT_xT12I0u2i0WU8JzBZBuOQ
119
119
  phoenix/server/static/apple-touch-icon.png,sha256=fOfpjqGpWYbJ0eAurKsyoZP1EAs6ZVooBJ_SGk2ZkDs,3801
120
120
  phoenix/server/static/favicon.ico,sha256=bY0vvCKRftemZfPShwZtE93DiiQdaYaozkPGwNFr6H8,34494
121
121
  phoenix/server/static/index.css,sha256=KKGpx4iwF91VGRm0YN-4cn8oC-oIqC6HecoPf0x3ZM8,1885
122
- phoenix/server/static/index.js,sha256=gPXFTSjGXpgh9XZ7wEPjjQZYSz6lo7TnOkh7qIkBLXo,3195528
122
+ phoenix/server/static/index.js,sha256=Nu1C2387r6Blm7YF85K8BzSWegC5v5e0A7duOIsup78,3195596
123
123
  phoenix/server/static/modernizr.js,sha256=mvK-XtkNqjOral-QvzoqsyOMECXIMu5BQwSVN_wcU9c,2564
124
124
  phoenix/server/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
125
125
  phoenix/server/templates/index.html,sha256=UKAw1N5ysyOYiFgP5Hfd4oaSqc_Y7quEtC9FGvtsIBA,1425
@@ -151,7 +151,7 @@ phoenix/trace/llama_index/callback.py,sha256=y3s2BdF9UPdSmbdpqEoDMrWSlvKEK0nct5P
151
151
  phoenix/trace/llama_index/debug_callback.py,sha256=SKToD9q_QADSGTJ5lhilqRVKaUnUSRXUvURCzN4by2U,1367
152
152
  phoenix/trace/llama_index/streaming.py,sha256=5cTtr8evvcEAB88Xb4ih3WEw0xAF4x5W9PehUX9l5_0,3258
153
153
  phoenix/trace/openai/__init__.py,sha256=J3G0uqCxGdksUpaQVHds_Egv2drvh8UEqoLjiQAOveg,79
154
- phoenix/trace/openai/instrumentor.py,sha256=WcsSA-QjqCaD2BnwaNBgc3qoUTd8lQHjKcTug7s6uQo,22373
154
+ phoenix/trace/openai/instrumentor.py,sha256=dGGcLP6tz515Lg6QBkB-s_bV3MaMcnxazNpuH9dp2mY,23367
155
155
  phoenix/trace/v1/__init__.py,sha256=gzPW6vBuE_Z1bymL935cuiFBty1Tl9v2RCgAKY6vfPM,200
156
156
  phoenix/trace/v1/evaluation_pb2.py,sha256=8sXvv2BW_vqD30MOMbmkeE2zpmm7ncik21kl3e-HzeQ,2254
157
157
  phoenix/trace/v1/evaluation_pb2.pyi,sha256=cCbbx06gwQmaH14s3J1X25TtaARh-k1abbxQdQCXGm8,4500
@@ -161,8 +161,8 @@ phoenix/trace/v1/utils.py,sha256=zvzH3RqDjvLrC73DxAF1V156PHmA8Oa6Kzna2EqCtdw,178
161
161
  phoenix/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
162
162
  phoenix/utilities/error_handling.py,sha256=7b5rpGFj9EWZ8yrZK1IHvxB89suWk3lggDayUQcvZds,1946
163
163
  phoenix/utilities/logging.py,sha256=lDXd6EGaamBNcQxL4vP1au9-i_SXe0OraUDiJOcszSw,222
164
- arize_phoenix-1.7.2rc1.dist-info/METADATA,sha256=Q8ToPUDItD1zhRm5arrRNamvDuC9UzkzwataeIu8NjQ,26287
165
- arize_phoenix-1.7.2rc1.dist-info/WHEEL,sha256=9QBuHhg6FNW7lppboF2vKVbCGTVzsFykgRQjjlajrhA,87
166
- arize_phoenix-1.7.2rc1.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
167
- arize_phoenix-1.7.2rc1.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
168
- arize_phoenix-1.7.2rc1.dist-info/RECORD,,
164
+ arize_phoenix-1.8.0.dist-info/METADATA,sha256=PiQRBcaRf1cM4cpq8pqUyRMRUHooxEcOqCxED4Ck1SE,26308
165
+ arize_phoenix-1.8.0.dist-info/WHEEL,sha256=9QBuHhg6FNW7lppboF2vKVbCGTVzsFykgRQjjlajrhA,87
166
+ arize_phoenix-1.8.0.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
167
+ arize_phoenix-1.8.0.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
168
+ arize_phoenix-1.8.0.dist-info/RECORD,,
phoenix/__init__.py CHANGED
@@ -6,7 +6,7 @@ from .session.session import NotebookEnvironment, Session, active_session, close
6
6
  from .trace.fixtures import load_example_traces
7
7
  from .trace.trace_dataset import TraceDataset
8
8
 
9
- __version__ = "1.7.2rc1"
9
+ __version__ = "1.8.0"
10
10
 
11
11
  # module level doc-string
12
12
  __doc__ = """
@@ -5165,7 +5165,7 @@ fragment MetricSelector_dimensions on Model {
5165
5165
  object-fit: contain;
5166
5166
  transition: background-color 0.2s ease-in-out;
5167
5167
  background-color: ${UU(.85,t.color)};
5168
- `})}function ken(t){return W("audio",{src:t.linkToData||"[error] unexpected missing url"})}function jen(t){return _("div",{"data-size":t.size,css:ee`
5168
+ `})}function ken(t){return W("audio",{src:t.linkToData||"[error] unexpected missing url",autoPlay:t.autoPlay,controls:!0})}function jen(t){return _("div",{"data-size":t.size,css:ee`
5169
5169
  --prompt-response-preview-background-color: var(
5170
5170
  --ac-global-color-grey-200
5171
5171
  );
@@ -5306,7 +5306,7 @@ fragment MetricSelector_dimensions on Model {
5306
5306
  height: ${hw}px;
5307
5307
  background-color: var(--ac-global-background-color-dark);
5308
5308
  border-radius: var(--ac-global-rounding-medium);
5309
- `,children:W(rV,{rawData:o.embeddingMetadata.rawData,linkToData:o.embeddingMetadata.linkToData,predictionLabel:o.eventMetadata.predictionLabel,actualLabel:o.eventMetadata.actualLabel,promptAndResponse:l.promptAndResponse,documentText:l.documentText,datasetName:g,group:s,color:c,size:"medium"})})})};var Qen=300,Ken=3,qen=.2,$en=function(){let{selectedTimestamp:e}=pI(),n=ze(s=>s.points),i=ze(s=>s.hdbscanParameters),r=ze(s=>s.umapParameters),[a,o,l]=(0,qo.useMemo)(()=>{let{primaryEventIds:s,referenceEventIds:c,corpusEventIds:u}=FL(n.map(g=>g.eventId));return[s.length,c.length,u.length]},[n]);return e?_("section",{css:ee`
5309
+ `,children:W(rV,{rawData:o.embeddingMetadata.rawData,linkToData:o.embeddingMetadata.linkToData,predictionLabel:o.eventMetadata.predictionLabel,actualLabel:o.eventMetadata.actualLabel,promptAndResponse:l.promptAndResponse,documentText:l.documentText,datasetName:g,group:s,color:c,size:"medium",autoPlay:!0})})})};var Qen=300,Ken=3,qen=.2,$en=function(){let{selectedTimestamp:e}=pI(),n=ze(s=>s.points),i=ze(s=>s.hdbscanParameters),r=ze(s=>s.umapParameters),[a,o,l]=(0,qo.useMemo)(()=>{let{primaryEventIds:s,referenceEventIds:c,corpusEventIds:u}=FL(n.map(g=>g.eventId));return[s.length,c.length,u.length]},[n]);return e?_("section",{css:ee`
5310
5310
  width: 300px;
5311
5311
  padding: var(--px-spacing-med);
5312
5312
  `,children:[_("dl",{css:pie,children:[_("div",{children:[W("dt",{children:"Timestamp"}),W("dd",{children:ya(e)})]}),_("div",{children:[W("dt",{children:"primary points"}),W("dd",{children:a})]}),o>0?_("div",{children:[W("dt",{children:"reference points"}),W("dd",{children:o})]}):null,l>0?_("div",{children:[W("dt",{children:"corpus points"}),W("dd",{children:l})]}):null]}),W("br",{}),W(wn,{level:4,weight:"heavy",children:"Clustering Parameters"}),_("dl",{css:pie,children:[_("div",{children:[W("dt",{children:"min cluster size"}),W("dd",{children:i.minClusterSize})]}),_("div",{children:[W("dt",{children:"cluster min samples"}),W("dd",{children:i.clusterMinSamples})]}),_("div",{children:[W("dt",{children:"cluster selection epsilon"}),W("dd",{children:i.clusterSelectionEpsilon})]})]}),W("br",{}),W(wn,{level:4,weight:"heavy",children:"UMAP Parameters"}),_("dl",{css:pie,children:[_("div",{children:[W("dt",{children:"min distance"}),W("dd",{children:r.minDist})]}),_("div",{children:[W("dt",{children:"n neighbors"}),W("dd",{children:r.nNeighbors})]}),_("div",{children:[W("dt",{children:"n samples per dataset"}),W("dd",{children:r.nSamples})]})]})]}):null},pie=ee`
@@ -5886,7 +5886,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
5886
5886
  width: 100%;
5887
5887
  height: 500px;
5888
5888
  background-color: black;
5889
- `}):n?W("audio",{src:t,controls:!0}):W("img",{src:t,alt:"event image",width:"100%",height:"200px",css:ee`
5889
+ `}):n?W("audio",{src:t,controls:!0,autoPlay:!0}):W("img",{src:t,alt:"event image",width:"100%",height:"200px",css:ee`
5890
5890
  object-fit: contain;
5891
5891
  background-color: black;
5892
5892
  `})}function Uyn({event:t}){let e=t.linkToData||void 0,n=t.rawData,i=t.prompt||t.response?{prompt:t.prompt,response:t.response}:null,r=t.documentText,a=null;return e?a=_(qe,{direction:"column",children:[W(Pyn,{dataUrl:e}),n&&W(xh,{children:W(Is,{id:"raw",title:"Raw Data",children:W(nS,{children:n})})})]}):r?a=W(xh,{children:W(Is,{id:"document",title:"Document",children:W(nS,{children:r})})}):i?a=_(xh,{children:[W(Is,{id:"prompt",title:"Prompt",children:W(nS,{children:i.prompt})}),W(Is,{id:"response",title:"Response",children:W(nS,{children:i.response})})]}):t.rawData&&t.rawData&&t.rawData,a}function Qyn(){return W("tbody",{className:"is-empty",children:W("tr",{children:W("td",{colSpan:100,css:t=>ee`
@@ -5951,7 +5951,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
5951
5951
  min-width: var(--grid-item-min-width);
5952
5952
  height: var(--grid-item-height);
5953
5953
  }
5954
- `,children:n.map((s,c)=>{let u=r.get(s.id),{rawData:g=null,linkToData:d=null}=u?.embeddingMetadata??{},{predictionLabel:I=null,actualLabel:p=null}=u?.eventMetadata??{},h=OL(s.id),m=e(h),b=a[s.id],y=o[b];return W("li",{children:W(rV,{rawData:g,linkToData:d,datasetName:m,group:b,onClick:()=>{i(s.id)},color:y,size:l,predictionLabel:I,actualLabel:p,promptAndResponse:s.promptAndResponse,documentText:s.documentText})},c)})})})}var Zk=K(Ie());function HKe({data:t,onPointSelected:e}){let{primaryDataset:n,referenceDataset:i}=Ci(),r=ze(u=>u.metric),[a,o]=(0,Zk.useState)([]),{columns:l,tableData:s}=(0,Zk.useMemo)(()=>{let u=t.filter(C=>C.id.includes("CORPUS")===!1),g=!1,d=!1,I=!1,p=!1,h=!1;t.forEach(C=>{C.linkToData&&(g=!0),C.rawData&&(d=!0),(C.prompt||C.response)&&(I=!0),C.predictionLabel&&(p=!0),C.actualLabel&&(h=!0)});let m=[];i&&m.push({header:"Dataset",accessorKey:"id",size:50,cell:({getValue:C})=>W(qyn,{id:C(),primaryDatasetName:n.name,referenceDatasetName:i?.name??"reference"})}),g&&m.push({header:"Link",accessorKey:"linkToData",cell:({getValue:C})=>{let v=C();if(typeof v=="string"){let x=v.split("/").pop();return W(Ko,{href:v,children:x})}return null}}),I?(m.push({header:"Prompt",accessorKey:"prompt",cell:Ng,size:200}),m.push({header:"Response",accessorKey:"response",cell:Ng,size:200})):d&&m.push({header:"Raw Data",accessorKey:"rawData"}),p&&m.push({header:"Prediction Label",accessorKey:"predictionLabel",size:50}),h&&m.push({header:"Actual Label",accessorKey:"actualLabel",size:50});let b=[];if(r&&r.type==="dataQuality"){let C=r.dimension.name;b.push({header:r.dimension.name,accessorKey:"metric",cell:sp,sortingFn:"basic"}),u.forEach(v=>{let x=v.dimensions.find(G=>G.dimension.name===C)?.value;v.metric=x!=null?Number(x):null})}return{columns:[...m,...b,{header:"",id:"view-details",size:50,cell:({row:C})=>W(pze,{"aria-label":"view point details",onClick:()=>{e(C.original.id)},children:"view details"})}],tableData:u}},[t,e,n,i,r]),c=mu({columns:l,data:s,state:{sorting:a},getCoreRowModel:pu(),onSortingChange:o,getSortedRowModel:xb()});return _("table",{css:ep,children:[W("thead",{children:c.getHeaderGroups().map(u=>W("tr",{children:u.headers.map(g=>_("th",{children:[g.isPlaceholder?null:_("div",{className:g.column.getCanSort()?"cursor-pointer":"",onClick:g.column.getToggleSortingHandler(),children:[za(g.column.columnDef.header,g.getContext()),g.column.getIsSorted()?W(ft,{className:"sort-icon",svg:g.column.getIsSorted()==="asc"?W(zt.ArrowDownFilled,{}):W(zt.ArrowUpFilled,{})}):null]}),W("div",{onMouseDown:g.getResizeHandler(),onTouchStart:g.getResizeHandler(),className:`resizer ${g.column.getIsResizing()?"isResizing":""}`,style:{transform:g.column.getIsResizing()?`translateX(${c.getState().columnSizingInfo.deltaOffset}px)`:""}})]},g.id))},u.id))}),W("tbody",{children:c.getRowModel().rows.map(u=>W("tr",{children:u.getVisibleCells().map(g=>W("td",{style:{width:g.column.getSize()},children:za(g.column.columnDef.cell,g.getContext())},g.id))},u.id))})]})}function qyn({id:t,primaryDatasetName:e,referenceDatasetName:n}){let i=t.includes("PRIMARY"),r=oV();return _(qe,{direction:"row",gap:"size-100",alignItems:"center",children:[W(o2,{shape:"circle",color:r[i?0:1]}),i?e:n]})}var $yn=ee`
5954
+ `,children:n.map((s,c)=>{let u=r.get(s.id),{rawData:g=null,linkToData:d=null}=u?.embeddingMetadata??{},{predictionLabel:I=null,actualLabel:p=null}=u?.eventMetadata??{},h=OL(s.id),m=e(h),b=a[s.id],y=o[b];return W("li",{children:W(rV,{rawData:g,linkToData:d,datasetName:m,group:b,onClick:()=>{i(s.id)},color:y,size:l,predictionLabel:I,actualLabel:p,promptAndResponse:s.promptAndResponse,documentText:s.documentText,autoPlay:!1})},c)})})})}var Zk=K(Ie());function HKe({data:t,onPointSelected:e}){let{primaryDataset:n,referenceDataset:i}=Ci(),r=ze(u=>u.metric),[a,o]=(0,Zk.useState)([]),{columns:l,tableData:s}=(0,Zk.useMemo)(()=>{let u=t.filter(C=>C.id.includes("CORPUS")===!1),g=!1,d=!1,I=!1,p=!1,h=!1;t.forEach(C=>{C.linkToData&&(g=!0),C.rawData&&(d=!0),(C.prompt||C.response)&&(I=!0),C.predictionLabel&&(p=!0),C.actualLabel&&(h=!0)});let m=[];i&&m.push({header:"Dataset",accessorKey:"id",size:50,cell:({getValue:C})=>W(qyn,{id:C(),primaryDatasetName:n.name,referenceDatasetName:i?.name??"reference"})}),g&&m.push({header:"Link",accessorKey:"linkToData",cell:({getValue:C})=>{let v=C();if(typeof v=="string"){let x=v.split("/").pop();return W(Ko,{href:v,children:x})}return null}}),I?(m.push({header:"Prompt",accessorKey:"prompt",cell:Ng,size:200}),m.push({header:"Response",accessorKey:"response",cell:Ng,size:200})):d&&m.push({header:"Raw Data",accessorKey:"rawData"}),p&&m.push({header:"Prediction Label",accessorKey:"predictionLabel",size:50}),h&&m.push({header:"Actual Label",accessorKey:"actualLabel",size:50});let b=[];if(r&&r.type==="dataQuality"){let C=r.dimension.name;b.push({header:r.dimension.name,accessorKey:"metric",cell:sp,sortingFn:"basic"}),u.forEach(v=>{let x=v.dimensions.find(G=>G.dimension.name===C)?.value;v.metric=x!=null?Number(x):null})}return{columns:[...m,...b,{header:"",id:"view-details",size:50,cell:({row:C})=>W(pze,{"aria-label":"view point details",onClick:()=>{e(C.original.id)},children:"view details"})}],tableData:u}},[t,e,n,i,r]),c=mu({columns:l,data:s,state:{sorting:a},getCoreRowModel:pu(),onSortingChange:o,getSortedRowModel:xb()});return _("table",{css:ep,children:[W("thead",{children:c.getHeaderGroups().map(u=>W("tr",{children:u.headers.map(g=>_("th",{children:[g.isPlaceholder?null:_("div",{className:g.column.getCanSort()?"cursor-pointer":"",onClick:g.column.getToggleSortingHandler(),children:[za(g.column.columnDef.header,g.getContext()),g.column.getIsSorted()?W(ft,{className:"sort-icon",svg:g.column.getIsSorted()==="asc"?W(zt.ArrowDownFilled,{}):W(zt.ArrowUpFilled,{})}):null]}),W("div",{onMouseDown:g.getResizeHandler(),onTouchStart:g.getResizeHandler(),className:`resizer ${g.column.getIsResizing()?"isResizing":""}`,style:{transform:g.column.getIsResizing()?`translateX(${c.getState().columnSizingInfo.deltaOffset}px)`:""}})]},g.id))},u.id))}),W("tbody",{children:c.getRowModel().rows.map(u=>W("tr",{children:u.getVisibleCells().map(g=>W("td",{style:{width:g.column.getSize()},children:za(g.column.columnDef.cell,g.getContext())},g.id))},u.id))})]})}function qyn({id:t,primaryDatasetName:e,referenceDatasetName:n}){let i=t.includes("PRIMARY"),r=oV();return _(qe,{direction:"row",gap:"size-100",alignItems:"center",children:[W(o2,{shape:"circle",color:r[i?0:1]}),i?e:n]})}var $yn=ee`
5955
5955
  width: 100%;
5956
5956
  height: 100%;
5957
5957
  position: relative;
@@ -615,17 +615,32 @@ def _accumulate_messages(
615
615
  """
616
616
  if not chunks:
617
617
  return []
618
- tokens: DefaultDict[int, List[str]] = defaultdict(list)
619
- roles: DefaultDict[int, str] = defaultdict()
618
+ content_token_lists: DefaultDict[int, List[str]] = defaultdict(list)
619
+ function_argument_token_lists: DefaultDict[int, List[str]] = defaultdict(list)
620
+ function_names: Dict[int, str] = {}
621
+ roles: Dict[int, str] = {}
620
622
  for chunk in chunks:
621
623
  for choice in chunk.choices:
622
624
  choice_index = choice.index
623
- if content := choice.delta.content:
624
- tokens[choice_index].append(content)
625
+ if content_token := choice.delta.content:
626
+ content_token_lists[choice_index].append(content_token)
627
+ if function_call := choice.delta.function_call:
628
+ if function_name := function_call.name:
629
+ function_names[choice_index] = function_name
630
+ if (function_argument_token := function_call.arguments) is not None:
631
+ function_argument_token_lists[choice_index].append(function_argument_token)
625
632
  if role := choice.delta.role:
626
633
  roles[choice_index] = role
627
634
  messages: List[OpenInferenceMessage] = [{} for _ in range(num_choices)]
628
- for choice_index in range(len(tokens)):
629
- messages[choice_index][MESSAGE_CONTENT] = "".join(tokens.get(choice_index, []))
630
- messages[choice_index][MESSAGE_ROLE] = roles.get(choice_index, "")
635
+ for choice_index in range(num_choices):
636
+ if (role_ := roles.get(choice_index)) is not None:
637
+ messages[choice_index][MESSAGE_ROLE] = role_
638
+ if content_token_list := content_token_lists[choice_index]:
639
+ messages[choice_index][MESSAGE_CONTENT] = "".join(content_token_list)
640
+ if (function_name := function_names.get(choice_index)) is not None:
641
+ messages[choice_index][MESSAGE_FUNCTION_CALL_NAME] = function_name
642
+ if function_argument_token_list := function_argument_token_lists[choice_index]:
643
+ messages[choice_index][MESSAGE_FUNCTION_CALL_ARGUMENTS_JSON] = "".join(
644
+ function_argument_token_list
645
+ )
631
646
  return messages