arize-phoenix 7.5.1__py3-none-any.whl → 7.5.2__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.4
2
2
  Name: arize-phoenix
3
- Version: 7.5.1
3
+ Version: 7.5.2
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
@@ -6,7 +6,7 @@ phoenix/exceptions.py,sha256=n2L2KKuecrdflB9MsCdAYCiSEvGJptIsfRkXMoJle7A,169
6
6
  phoenix/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
7
7
  phoenix/services.py,sha256=kpW1WL0kiB8XJsO6XycvZVJ-lBkNoenhQ7atCvBoSe8,5365
8
8
  phoenix/settings.py,sha256=ht-0oN-sMV6SPXrk7Tu1EZlngpAYkGNLYPhO8DyrdQI,661
9
- phoenix/version.py,sha256=7vQ6Qcfa2cKVApeGf8DgZrqPj1SIk9k4gQziWrjB-ug,22
9
+ phoenix/version.py,sha256=zJHI_1BT5Zg6AK8VlyV3hf6_XhYzkbqK6kEhdCIDxeI,22
10
10
  phoenix/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  phoenix/core/embedding_dimension.py,sha256=zKGbcvwOXgLf-yrJBpQyKtd-LEOPRKHnUToyAU8Owis,87
12
12
  phoenix/core/model.py,sha256=qBFraOtmwCCnWJltKNP18DDG0mULXigytlFsa6YOz6k,4837
@@ -286,10 +286,10 @@ phoenix/server/static/apple-touch-icon-76x76.png,sha256=CT_xT12I0u2i0WU8JzBZBuOQ
286
286
  phoenix/server/static/apple-touch-icon.png,sha256=fOfpjqGpWYbJ0eAurKsyoZP1EAs6ZVooBJ_SGk2ZkDs,3801
287
287
  phoenix/server/static/favicon.ico,sha256=bY0vvCKRftemZfPShwZtE93DiiQdaYaozkPGwNFr6H8,34494
288
288
  phoenix/server/static/modernizr.js,sha256=mvK-XtkNqjOral-QvzoqsyOMECXIMu5BQwSVN_wcU9c,2564
289
- phoenix/server/static/.vite/manifest.json,sha256=8JbblTxve59umlPxvGh30CiKoW6sj8siYCgOTOjy9qA,2163
290
- phoenix/server/static/assets/components-CZ-NZ1o9.js,sha256=saUrZEBKTXxcSzGkb32BEGWoY5kAr8idEMOVqtd8m0E,389350
291
- phoenix/server/static/assets/index-BO-WhoEn.js,sha256=ICC9cN73qNidIPWr4ANGJLeDC6SU146zC5OqKeqcLek,8711
292
- phoenix/server/static/assets/pages-BYLjwaR_.js,sha256=5uuJkYU46XxkMT813ookr4V9IRr-O-SX8p_eL3lUods,671745
289
+ phoenix/server/static/.vite/manifest.json,sha256=k4PwzDoxgD3wRk6-5XQKcX5r7RnUKz1B4DVC3JU_9ms,2163
290
+ phoenix/server/static/assets/components-CFq5ktuL.js,sha256=7qxBJUu5CEORlmvi5KT3qpxdX7Zc2xJNtzpivOsTMzw,389385
291
+ phoenix/server/static/assets/index-BeD0_8JQ.js,sha256=7A7q8o8kw2bW4P8QsanqYSA2KIv1nCYZ0wUPHxsx3Wc,8711
292
+ phoenix/server/static/assets/pages-DOPDiVdj.js,sha256=gJaI9zxRxl0fo5b2RTabhMDZpp7qbce099wusAALUVw,671916
293
293
  phoenix/server/static/assets/vendor-DvC8cT4X.js,sha256=-EzJrg6BeYa58JPfaZC6KS5gvkJ8gC1n-Sb7lP-pOkw,2159677
294
294
  phoenix/server/static/assets/vendor-DxkFTwjz.css,sha256=nZrkr0u6NNElFGvpWHk9GTHeGoibCXCli1bE7mXZGZg,1816
295
295
  phoenix/server/static/assets/vendor-arizeai-Do1793cv.js,sha256=IFADVVEZ8VY9o4iqYighRedZTXSyi1uZMTFFsBeIYis,305184
@@ -336,9 +336,9 @@ phoenix/utilities/project.py,sha256=auVpARXkDb-JgeX5f2aStyFIkeKvGwN9l7qrFeJMVxI,
336
336
  phoenix/utilities/re.py,sha256=x8Xbk-Wa6qDMAtUd_7JtZvKtrYEuMY-bchB0n163_5c,2006
337
337
  phoenix/utilities/span_store.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
338
338
  phoenix/utilities/template_formatters.py,sha256=gh9PJD6WEGw7TEYXfSst1UR4pWWwmjxMLrDVQ_CkpkQ,2779
339
- arize_phoenix-7.5.1.dist-info/METADATA,sha256=AOo3TW_Jl_LKCGynIN-7NCP0R0afQMup2OGAGC8mFYM,23052
340
- arize_phoenix-7.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
341
- arize_phoenix-7.5.1.dist-info/entry_points.txt,sha256=Pgpn8Upxx9P8z8joPXZWl2LlnAlGc3gcQoVchb06X1Q,94
342
- arize_phoenix-7.5.1.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
343
- arize_phoenix-7.5.1.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
344
- arize_phoenix-7.5.1.dist-info/RECORD,,
339
+ arize_phoenix-7.5.2.dist-info/METADATA,sha256=r7PGyit5C4jhBGe0mGBDcFYc8usP80cH7u_tqkX_LdY,23052
340
+ arize_phoenix-7.5.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
341
+ arize_phoenix-7.5.2.dist-info/entry_points.txt,sha256=Pgpn8Upxx9P8z8joPXZWl2LlnAlGc3gcQoVchb06X1Q,94
342
+ arize_phoenix-7.5.2.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
343
+ arize_phoenix-7.5.2.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
344
+ arize_phoenix-7.5.2.dist-info/RECORD,,
@@ -1,22 +1,22 @@
1
1
  {
2
- "_components-CZ-NZ1o9.js": {
3
- "file": "assets/components-CZ-NZ1o9.js",
2
+ "_components-CFq5ktuL.js": {
3
+ "file": "assets/components-CFq5ktuL.js",
4
4
  "name": "components",
5
5
  "imports": [
6
6
  "_vendor-DvC8cT4X.js",
7
- "_pages-BYLjwaR_.js",
7
+ "_pages-DOPDiVdj.js",
8
8
  "_vendor-arizeai-Do1793cv.js",
9
9
  "_vendor-codemirror-BzwZPyJM.js",
10
10
  "_vendor-three-DwGkEfCM.js"
11
11
  ]
12
12
  },
13
- "_pages-BYLjwaR_.js": {
14
- "file": "assets/pages-BYLjwaR_.js",
13
+ "_pages-DOPDiVdj.js": {
14
+ "file": "assets/pages-DOPDiVdj.js",
15
15
  "name": "pages",
16
16
  "imports": [
17
17
  "_vendor-DvC8cT4X.js",
18
18
  "_vendor-arizeai-Do1793cv.js",
19
- "_components-CZ-NZ1o9.js",
19
+ "_components-CFq5ktuL.js",
20
20
  "_vendor-codemirror-BzwZPyJM.js",
21
21
  "_vendor-recharts-_Jb7JjhG.js"
22
22
  ]
@@ -69,15 +69,15 @@
69
69
  "name": "vendor-three"
70
70
  },
71
71
  "index.tsx": {
72
- "file": "assets/index-BO-WhoEn.js",
72
+ "file": "assets/index-BeD0_8JQ.js",
73
73
  "name": "index",
74
74
  "src": "index.tsx",
75
75
  "isEntry": true,
76
76
  "imports": [
77
77
  "_vendor-DvC8cT4X.js",
78
78
  "_vendor-arizeai-Do1793cv.js",
79
- "_pages-BYLjwaR_.js",
80
- "_components-CZ-NZ1o9.js",
79
+ "_pages-DOPDiVdj.js",
80
+ "_components-CFq5ktuL.js",
81
81
  "_vendor-three-DwGkEfCM.js",
82
82
  "_vendor-codemirror-BzwZPyJM.js",
83
83
  "_vendor-shiki-Cl9QBraO.js",
@@ -1,4 +1,4 @@
1
- import{r as h,R as G,j as e,n as Gn,a as we,e as Xe,s as T1,b as e1,c as ke,d as N1,f as Vt,g as ge,h as Dt,i as Pt,k as R1,l,m as Ot,o as Se,C as a1,p as Be,q as $e,t as N,u as _t,v as Ft,L as Wn,w as Un,x as jn,y as oe,z as k,A as u1,B as Qn,D as m,E as qn,F as Xn,G as Ze,$ as Nt,H as Rt,I as Ht,J as Z1,K as Yn,M as t1,N as i1,O as Jn,P as r1,Q as Kt,S as Bt,T as $t,U,V as Zt,W as Gt,X as Wt,Y as ea,Z as Ut,_ as jt,a0 as na,a1 as Qt,a2 as V,a3 as aa,a4 as Te,a5 as m1,a6 as Ee,a7 as F,a8 as qt,a9 as Xt,aa as Yt,ab as Jt,ac as pn,ad as ei,ae as ni,af as ai,ag as gn,ah as ti,ai as ii,aj as ri,ak as I1,al as G1,am as oi,an as li,ao as si,ap as ci,aq as di,ar as ui,as as mi,at as hi,au as pi,av as gi,aw as fi,ax as Ci,ay as bi,az as Li,aA as vi,aB as yi,aC as wi}from"./vendor-DvC8cT4X.js";import{m as ki,T as Si,a as fn,u as xi}from"./pages-BYLjwaR_.js";import{u as Mi,_ as ta,a as ae,T as j,b as Ti,c as Ii,R as J,d as Ge,e as ne,f as Ai,E as ia,g as B,h as W1,i as Ve,j as ra,k as ve,D as h1,l as o1,I as U1,m as j1,n as oa,P as Q1,C as p1,o as g1,A as We,L as Ce,p as zi,q as ye,F as la,r as Ei,s as Vi,t as Di,v as ce,w as de,x as Pi,y as Oi,z as Cn,B as _i}from"./vendor-arizeai-Do1793cv.js";import{L as sa,a as ca,l as H1,j as da,h as Fi,b as Ni,c as Ri,d as Hi,e as Ki,f as Bi,s as $i,R as Ue,g as ua,n as je,i as ma,E as q1,p as Zi,k as Gi}from"./vendor-codemirror-BzwZPyJM.js";import{V as Wi}from"./vendor-three-DwGkEfCM.js";const ha=function(){var n={defaultValue:null,kind:"LocalArgument",name:"clusters"},a={defaultValue:null,kind:"LocalArgument",name:"dataQualityMetricColumnName"},t={defaultValue:null,kind:"LocalArgument",name:"fetchDataQualityMetric"},i={defaultValue:null,kind:"LocalArgument",name:"fetchPerformanceMetric"},r={defaultValue:null,kind:"LocalArgument",name:"performanceMetric"},o=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"referenceValue",storageKey:null}],s=[{alias:null,args:[{kind:"Variable",name:"clusters",variableName:"clusters"}],concreteType:"Cluster",kind:"LinkedField",name:"clusters",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"eventIds",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"driftRatio",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"primaryToCorpusRatio",storageKey:null},{condition:"fetchDataQualityMetric",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"columnName",variableName:"dataQualityMetricColumnName"},{kind:"Literal",name:"metric",value:"mean"}],kind:"ObjectValue",name:"metric"}],concreteType:"DatasetValues",kind:"LinkedField",name:"dataQualityMetric",plural:!1,selections:o,storageKey:null}]},{condition:"fetchPerformanceMetric",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"metric",variableName:"performanceMetric"}],kind:"ObjectValue",name:"metric"}],concreteType:"DatasetValues",kind:"LinkedField",name:"performanceMetric",plural:!1,selections:o,storageKey:null}]}],storageKey:null}];return{fragment:{argumentDefinitions:[n,a,t,i,r],kind:"Fragment",metadata:null,name:"pointCloudStore_clusterMetricsQuery",selections:s,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,t,a,i,r],kind:"Operation",name:"pointCloudStore_clusterMetricsQuery",selections:s},params:{cacheID:"86666967012812887ac0a0149d2d2535",id:null,metadata:{},name:"pointCloudStore_clusterMetricsQuery",operationKind:"query",text:`query pointCloudStore_clusterMetricsQuery(
1
+ import{r as h,R as G,j as e,n as Gn,a as we,e as Xe,s as T1,b as e1,c as ke,d as N1,f as Vt,g as ge,h as Dt,i as Pt,k as R1,l,m as Ot,o as Se,C as a1,p as Be,q as $e,t as N,u as _t,v as Ft,L as Wn,w as Un,x as jn,y as oe,z as k,A as u1,B as Qn,D as m,E as qn,F as Xn,G as Ze,$ as Nt,H as Rt,I as Ht,J as Z1,K as Yn,M as t1,N as i1,O as Jn,P as r1,Q as Kt,S as Bt,T as $t,U,V as Zt,W as Gt,X as Wt,Y as ea,Z as Ut,_ as jt,a0 as na,a1 as Qt,a2 as V,a3 as aa,a4 as Te,a5 as m1,a6 as Ee,a7 as F,a8 as qt,a9 as Xt,aa as Yt,ab as Jt,ac as pn,ad as ei,ae as ni,af as ai,ag as gn,ah as ti,ai as ii,aj as ri,ak as I1,al as G1,am as oi,an as li,ao as si,ap as ci,aq as di,ar as ui,as as mi,at as hi,au as pi,av as gi,aw as fi,ax as Ci,ay as bi,az as Li,aA as vi,aB as yi,aC as wi}from"./vendor-DvC8cT4X.js";import{m as ki,T as Si,a as fn,u as xi}from"./pages-DOPDiVdj.js";import{u as Mi,_ as ta,a as ae,T as j,b as Ti,c as Ii,R as J,d as Ge,e as ne,f as Ai,E as ia,g as B,h as W1,i as Ve,j as ra,k as ve,D as h1,l as o1,I as U1,m as j1,n as oa,P as Q1,C as p1,o as g1,A as We,L as Ce,p as zi,q as ye,F as la,r as Ei,s as Vi,t as Di,v as ce,w as de,x as Pi,y as Oi,z as Cn,B as _i}from"./vendor-arizeai-Do1793cv.js";import{L as sa,a as ca,l as H1,j as da,h as Fi,b as Ni,c as Ri,d as Hi,e as Ki,f as Bi,s as $i,R as Ue,g as ua,n as je,i as ma,E as q1,p as Zi,k as Gi}from"./vendor-codemirror-BzwZPyJM.js";import{V as Wi}from"./vendor-three-DwGkEfCM.js";const ha=function(){var n={defaultValue:null,kind:"LocalArgument",name:"clusters"},a={defaultValue:null,kind:"LocalArgument",name:"dataQualityMetricColumnName"},t={defaultValue:null,kind:"LocalArgument",name:"fetchDataQualityMetric"},i={defaultValue:null,kind:"LocalArgument",name:"fetchPerformanceMetric"},r={defaultValue:null,kind:"LocalArgument",name:"performanceMetric"},o=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"referenceValue",storageKey:null}],s=[{alias:null,args:[{kind:"Variable",name:"clusters",variableName:"clusters"}],concreteType:"Cluster",kind:"LinkedField",name:"clusters",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"eventIds",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"driftRatio",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"primaryToCorpusRatio",storageKey:null},{condition:"fetchDataQualityMetric",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"columnName",variableName:"dataQualityMetricColumnName"},{kind:"Literal",name:"metric",value:"mean"}],kind:"ObjectValue",name:"metric"}],concreteType:"DatasetValues",kind:"LinkedField",name:"dataQualityMetric",plural:!1,selections:o,storageKey:null}]},{condition:"fetchPerformanceMetric",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"metric",variableName:"performanceMetric"}],kind:"ObjectValue",name:"metric"}],concreteType:"DatasetValues",kind:"LinkedField",name:"performanceMetric",plural:!1,selections:o,storageKey:null}]}],storageKey:null}];return{fragment:{argumentDefinitions:[n,a,t,i,r],kind:"Fragment",metadata:null,name:"pointCloudStore_clusterMetricsQuery",selections:s,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,t,a,i,r],kind:"Operation",name:"pointCloudStore_clusterMetricsQuery",selections:s},params:{cacheID:"86666967012812887ac0a0149d2d2535",id:null,metadata:{},name:"pointCloudStore_clusterMetricsQuery",operationKind:"query",text:`query pointCloudStore_clusterMetricsQuery(
2
2
  $clusters: [ClusterInput!]!
3
3
  $fetchDataQualityMetric: Boolean!
4
4
  $dataQualityMetricColumnName: String
@@ -1847,6 +1847,7 @@ fragment ModelEmbeddingsTable_embeddingDimensions_4sIU9C on Query {
1847
1847
  `;function U0({isCollapsed:n,onClick:a}){return e("button",{onClick:t=>{t.stopPropagation(),t.preventDefault(),a()},className:Ze("button--reset",{"is-collapsed":n}),css:W0,children:e(T,{svg:e(_a,{})})})}function j0(n){return h.useMemo(()=>{try{const a=JSON.parse(n);return{text:JSON.stringify(a,null,2),textType:"json"}}catch{return{text:n,textType:"string"}}},[n])}function Q0({children:n}){const{text:a,textType:t}=j0(n);if(t==="string")return e("pre",{css:m`
1848
1848
  white-space: pre-wrap;
1849
1849
  text-wrap: wrap;
1850
+ overflow-wrap: anywhere;
1850
1851
  margin: 0;
1851
1852
  `,children:a});if(t==="json")return e($a,{value:a});D()}const pt=h.createContext(null);function gt(){let n=h.useContext(pt);return n===null&&(console.warn("useMarkdownMode must be used within a MarkdownDisplayProvider"),n={mode:"text",setMode:()=>{}}),n}function w5(n){const a=be(r=>r.markdownDisplayMode),t=be(r=>r.setMarkdownDisplayMode),i=h.useCallback(r=>{h.startTransition(()=>{t(r)})},[t]);return e(pt.Provider,{value:{mode:a,setMode:i},children:n.children})}const q0=m`
1852
1853
  a {
@@ -1,4 +1,4 @@
1
- import{r as c,j as e,dL as v,l as n,U as F,R as w,D as E,bq as L,dM as S,dN as R,dO as a,dP as k,t as I,dQ as A}from"./vendor-DvC8cT4X.js";import{k as C,Q as _,D as j,Y as z}from"./vendor-arizeai-Do1793cv.js";import{E as O,L as T,R as D,r as N,b as G,F as M,A as U,c as q,d as B,P as J,h as K,M as Q,e as m,D as V,f as W,g as H,i as Y,j as $,k as X,l as Z,p as ee,n as h,o as ae,S as re,s as te,q as oe,t as g,v as ne,w as u,x as b,y as se,z as le,B as ie,C as de,G as ce,H as x,I as pe,J as me,K as he,N as ge,O as ue,Q as be,U as xe,V as fe}from"./pages-BYLjwaR_.js";import{V as Pe,d0 as ye,at as ve,ab as Fe,d1 as we,d2 as Ee}from"./components-CZ-NZ1o9.js";import"./vendor-three-DwGkEfCM.js";import"./vendor-codemirror-BzwZPyJM.js";import"./vendor-shiki-Cl9QBraO.js";import"./vendor-recharts-_Jb7JjhG.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))d(t);new MutationObserver(t=>{for(const o of t)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&d(l)}).observe(document,{childList:!0,subtree:!0});function i(t){const o={};return t.integrity&&(o.integrity=t.integrity),t.referrerPolicy&&(o.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?o.credentials="include":t.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function d(t){if(t.ep)return;t.ep=!0;const o=i(t);fetch(t.href,o)}})();const f="arize-phoenix-feature-flags",p={__RESET__:!1};function Le(){const r=localStorage.getItem(f);if(!r)return p;try{const s=JSON.parse(r);return Object.assign({},p,s)}catch{return p}}const P=c.createContext(null);function Se(){const r=w.useContext(P);if(r===null)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return r}function Re(r){const[s,i]=c.useState(Le()),d=t=>{localStorage.setItem(f,JSON.stringify(t)),i(t)};return e(P.Provider,{value:{featureFlags:s,setFeatureFlags:d},children:e(ke,{children:r.children})})}function ke(r){const{children:s}=r,{featureFlags:i,setFeatureFlags:d}=Se(),[t,o]=c.useState(!1);return v("ctrl+shift+f",()=>o(!0)),n(F,{children:[s,e(j,{type:"modal",isDismissable:!0,onDismiss:()=>o(!1),children:t&&e(C,{title:"Feature Flags",children:e(Pe,{height:"size-1000",padding:"size-100",children:Object.keys(i).map(l=>e(_,{isSelected:i[l],onChange:y=>d({...i,[l]:y}),children:l},l))})})})]})}function Ie(){return e(L,{styles:E`
1
+ import{r as c,j as e,dL as v,l as n,U as F,R as w,D as E,bq as L,dM as S,dN as R,dO as a,dP as k,t as I,dQ as A}from"./vendor-DvC8cT4X.js";import{k as C,Q as _,D as j,Y as z}from"./vendor-arizeai-Do1793cv.js";import{E as O,L as T,R as D,r as N,b as G,F as M,A as U,c as q,d as B,P as J,h as K,M as Q,e as m,D as V,f as W,g as H,i as Y,j as $,k as X,l as Z,p as ee,n as h,o as ae,S as re,s as te,q as oe,t as g,v as ne,w as u,x as b,y as se,z as le,B as ie,C as de,G as ce,H as x,I as pe,J as me,K as he,N as ge,O as ue,Q as be,U as xe,V as fe}from"./pages-DOPDiVdj.js";import{V as Pe,d0 as ye,at as ve,ab as Fe,d1 as we,d2 as Ee}from"./components-CFq5ktuL.js";import"./vendor-three-DwGkEfCM.js";import"./vendor-codemirror-BzwZPyJM.js";import"./vendor-shiki-Cl9QBraO.js";import"./vendor-recharts-_Jb7JjhG.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))d(t);new MutationObserver(t=>{for(const o of t)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&d(l)}).observe(document,{childList:!0,subtree:!0});function i(t){const o={};return t.integrity&&(o.integrity=t.integrity),t.referrerPolicy&&(o.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?o.credentials="include":t.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function d(t){if(t.ep)return;t.ep=!0;const o=i(t);fetch(t.href,o)}})();const f="arize-phoenix-feature-flags",p={__RESET__:!1};function Le(){const r=localStorage.getItem(f);if(!r)return p;try{const s=JSON.parse(r);return Object.assign({},p,s)}catch{return p}}const P=c.createContext(null);function Se(){const r=w.useContext(P);if(r===null)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return r}function Re(r){const[s,i]=c.useState(Le()),d=t=>{localStorage.setItem(f,JSON.stringify(t)),i(t)};return e(P.Provider,{value:{featureFlags:s,setFeatureFlags:d},children:e(ke,{children:r.children})})}function ke(r){const{children:s}=r,{featureFlags:i,setFeatureFlags:d}=Se(),[t,o]=c.useState(!1);return v("ctrl+shift+f",()=>o(!0)),n(F,{children:[s,e(j,{type:"modal",isDismissable:!0,onDismiss:()=>o(!1),children:t&&e(C,{title:"Feature Flags",children:e(Pe,{height:"size-1000",padding:"size-100",children:Object.keys(i).map(l=>e(_,{isSelected:i[l],onChange:y=>d({...i,[l]:y}),children:l},l))})})})]})}function Ie(){return e(L,{styles:E`
2
2
  body {
3
3
  background-color: var(--ac-global-color-grey-75);
4
4
  color: var(--ac-global-text-color-900);
@@ -1,4 +1,4 @@
1
- import{z as R,aD as de,aE as Pe,aF as Le,aG as za,A as Kd,r as u,j as e,R as ve,n as Pa,D as C,l as s,aH as Qe,a0 as Z,U as B,t as D,a6 as Ue,a7 as H,a8 as Ke,a9 as Te,ac as G,aI as he,aJ as cn,aK as un,aL as $e,aM as Td,aN as xt,aO as Kn,aP as Ua,a2 as ie,aQ as Aa,ab as Qn,g as Wl,aR as xd,a4 as _t,G as Id,aS as Dd,aT as gt,aU as pt,aV as ya,aW as La,aX as Jl,o as wt,aY as Pd,ay as Ld,az as Ed,aZ as _d,p as Zl,q as wd,a_ as Rd,ah as Md,a$ as Ad,b0 as gl,b1 as Nd,b2 as zd,b3 as Vd,b4 as $d,b5 as Od,b6 as Qd,b7 as jd,b8 as qd,b9 as Ud}from"./vendor-DvC8cT4X.js";import{A as ce,C as j,h as Rt,k as W,D as X,B as Mt,y as je,z as ee,G as Bd,s as Wa,p as Ja,P as ta,j as jn,q as Za,v as qn,w as la,H as Ze,L as Va,J as Xl,K as Hd,M as Yl,N as Gd,O as Wd,Q as ia,e as ze,f as ra,T as me,S as At,i as Me,g as ne,E as Xa,a as De,U as ei,V as Nt,c as Un,o as pl,W as Jd,n as Zd,I as Xd,m as yl,l as Yd,u as ec,X as nc,r as ac,R as Fa,d as ni}from"./vendor-arizeai-Do1793cv.js";import{s as zt,a as ue,l as tc,j as ai,b as we,i as ti,c as li,d as vn,e as ii,f as lc,g as Ta,D as ic,h as $a,k as rc,T as Mn,m as sc,n as fl,o as oc,p as dc,q as hl,r as cc,t as uc,N as mc,u as gc,L as ye,v as Ce,w as Ea,B as pc,_ as h,x as bn,I,C as yc,G as ri,y as Vt,P as sa,z as Ya,S as fc,A as hc,E as kc,F as bc,H as Sc,J as vc,K as Cc,M as Fc,O as dn,Q as N,R as Be,U as si,V as K,W as Re,X as $t,Y as Bn,Z as _e,$ as T,a0 as pe,a1 as Fe,a2 as oa,a3 as mn,a4 as fn,a5 as et,a6 as xe,a7 as re,a8 as Je,a9 as Tn,aa as se,ab as Ae,ac as oi,ad as Ge,ae as di,af as Xe,ag as xn,ah as Ot,ai as nn,aj as hn,ak as Qt,al as ci,am as ui,an as gn,ao as ke,ap as be,aq as Se,ar as kl,as as bl,at as Hn,au as Kc,av as Tc,aw as U,ax as mi,ay as jt,az as nt,aA as da,aB as gi,aC as ca,aD as ua,aE as pi,aF as kn,aG as Ee,aH as at,aI as In,aJ as yi,aK as qt,aL as an,aM as fi,aN as xc,aO as Ic,aP as Dc,aQ as Pc,aR as Lc,aS as tn,aT as ln,aU as Ec,aV as He,aW as _c,aX as wc,aY as hi,aZ as Rc,a_ as Mc,a$ as Sl,b0 as Ac,b1 as Nc,b2 as zc,b3 as Vc,b4 as $c,b5 as Oc,b6 as ki,b7 as Qc,b8 as jc,b9 as qc,ba as Uc,bb as Bc,bc as zn,bd as Ut,be as bi,bf as ea,bg as It,bh as Rn,bi as Sn,bj as Hc,bk as Gc,bl as Si,bm as tt,bn as vi,bo as rn,bp as Wc,bq as Jc,br as xa,bs as Oa,bt as Ci,bu as Zc,bv as Ve,bw as Bt,bx as Xc,by as Yc,bz as eu,bA as nu,bB as Ht,bC as qe,bD as Ye,bE as ma,bF as au,bG as lt,bH as Fi,bI as Ki,bJ as yt,bK as tu,bL as Gt,bM as Wt,bN as We,bO as Ne,bP as lu,bQ as Jt,bR as Ti,bS as xi,bT as Ii,bU as iu,bV as Dn,bW as Di,bX as Cn,bY as ru,bZ as vl,b_ as Pi,b$ as su,c0 as ou,c1 as du,c2 as cu,c3 as Li,c4 as sn,c5 as uu,c6 as na,c7 as Dt,c8 as mu,c9 as Ei,ca as _i,cb as gu,cc as pu,cd as yu,ce as it,cf as wi,cg as _a,ch as Cl,ci as Ri,cj as Zt,ck as fu,cl as hu,cm as Xt,cn as Mi,co as Ai,cp as ku,cq as Pt,cr as Ni,cs as bu,ct as Su,cu as Na,cv as vu,cw as Cu,cx as zi,cy as Vi,cz as Fu,cA as Ku,cB as Tu,cC as xu,cD as Yt,cE as $i,cF as Iu,cG as Du,cH as Lt,cI as Pu,cJ as Lu,cK as Eu,cL as _u,cM as wu,cN as Ru,cO as Oi,cP as Mu,cQ as Au,cR as Nu,cS as zu,cT as Vu,cU as $u,cV as Ou,cW as Qu,cX as ju,cY as qu,cZ as Uu,c_ as Fl,c$ as Kl}from"./components-CZ-NZ1o9.js";import{p as el,R as ga,n as pa,i as Bu,E as Qi,m as Hu,o as Gu,g as Wu}from"./vendor-codemirror-BzwZPyJM.js";import{R as Pn,C as wa,X as Ln,Y as en,a as En,T as _n,B as aa,A as Ia,b as ji,c as nl,L as qi,d as Ju,P as Zu,e as Xu,f as Yu}from"./vendor-recharts-_Jb7JjhG.js";const em=4,nm={user:["user","human"],ai:["assistant","bot","ai"],system:["system"],tool:["tool"]},am="Unable to parse span input messages, expected messages which include a role and content.",tm="Unable to parse span output messages, expected messages which include a role and content.",lm="Unable to parse span output expected output.value to be present.",im="Unable to parse span attributes, attributes must be valid JSON.",rm="Unable to parse model config, expected llm.model_name to be present.",sm="Unable to parse model config, expected llm.invocation_parameters JSON string to be present.",om="Unable to parse invocation parameters response_format, expected llm.invocation_parameters.response_format to be a well formed json object or undefined.",dm="Unable to parse tools, expected tools to be an array of valid tools.",cm="Unable to parse prompt template variables, expected prompt template variables to be a valid JSON object string.",Tl={AZURE_OPENAI:[],ANTHROPIC:["claude"],OPENAI:["gpt","o1"],GEMINI:["gemini"]},Ka="TOOL_CHOICE",Qa="tool_choice",Vn="RESPONSE_FORMAT",An="response_format",um=[Ka,Vn],al=zt()(R.union([R.literal("auto"),R.literal("none"),R.literal("required"),R.object({type:R.literal("function"),function:R.object({name:R.string()})})])),tl=R.object({type:R.union([R.literal("auto"),R.literal("any"),R.literal("tool")]),disable_parallel_tool_use:R.boolean().optional(),name:R.string().optional()}),mm=tl.transform(n=>{switch(n.type){case"any":case"auto":return"auto";case"tool":return n.name?{type:"function",function:{name:n.name}}:"auto";default:return"auto"}}),gm=al.transform(n=>typeof n=="string"?{type:"auto"}:{type:"tool",name:n.function.name});R.union([al,tl]);const pm=n=>{const{success:a,data:t}=al.safeParse(n);if(a)return{provider:"OPENAI",toolChoice:t};const{success:l,data:i}=tl.safeParse(n);return l?{provider:"ANTHROPIC",toolChoice:i}:{provider:null,toolChoice:null}},ym=n=>{const{provider:a,toolChoice:t}=pm(n);if(a==null||t==null)throw new Error("Could not detect provider of tool choice");switch(a){case"AZURE_OPENAI":case"OPENAI":return t;case"ANTHROPIC":return mm.parse(t);default:ue()}},fm=({toolChoice:n,targetProvider:a})=>{switch(a){case"AZURE_OPENAI":case"OPENAI":return n;case"ANTHROPIC":return gm.parse(n);case"GEMINI":return n;default:ue()}},hm=({toolChoice:n,targetProvider:a})=>{try{const t=ym(n);return fm({toolChoice:t,targetProvider:a})}catch{return null}},km=R.object({tool_call:R.object({id:R.string().optional(),function:R.object({name:R.string(),arguments:R.string()}).partial()}).partial()}).partial(),Ui=R.object({[de.message]:R.object({[Pe.role]:R.string(),[Pe.content]:R.union([R.string(),R.array(R.record(R.string(),R.unknown()))]).default(""),[Pe.tool_calls]:R.array(km).optional(),[Pe.tool_call_id]:R.string().optional()})}),bm=R.object({[de.llm]:R.object({[Le.input_messages]:R.array(Ui)})}),Sm=R.object({[de.llm]:R.object({[Le.output_messages]:R.array(Ui)})}),vm=R.object({[de.output]:R.object({value:R.string()})}),Bi=zt()(R.enum(["user","ai","system","tool"])),Cm=zt()(R.object({id:R.number(),role:Bi,content:R.string().optional(),toolCallId:R.string().optional(),toolCalls:R.array(tc).optional()})),Fm=R.array(Cm),ll=R.lazy(()=>R.record(ai)),Km=ll,Hi=R.string().transform((n,a)=>{const{json:t}=we(n);if(!ti(t))return a.addIssue({code:R.ZodIssueCode.custom,message:"The invocation parameters must be a valid JSON object"}),R.NEVER;const{success:l,data:i}=Km.safeParse(t);return l?i:(a.addIssue({code:R.ZodIssueCode.custom,message:"The invocation parameters must be a valid JSON object"}),R.NEVER)}).default("{}"),Tm=R.object({[de.llm]:R.object({[Le.provider]:R.string().optional(),[Le.model_name]:R.string()})}),Gi=R.object({[de.llm]:R.object({[Le.invocation_parameters]:Hi})}),xm=R.object({[de.llm]:R.object({[Le.invocation_parameters]:Hi.pipe(R.object({response_format:ll.optional()}))})}),Im=R.string().transform((n,a)=>{const{json:t}=we(n);return t==null||!ti(t)?(a.addIssue({code:R.ZodIssueCode.custom,message:"The tool JSON schema must be a valid JSON object"}),R.NEVER):t}).transform((n,a)=>{const{data:t,success:l}=li.safeParse(n);return l?t:(a.addIssue({code:R.ZodIssueCode.custom,message:"The tool JSON schema must be a valid tool schema"}),R.NEVER)}),Dm=R.object({[de.llm]:R.object({[Le.tools]:R.array(R.object({[de.tool]:R.object({[za.json_schema]:Im})}).optional()).optional()}).optional()}).optional(),Pm=R.lazy(()=>R.object({type:R.literal("json_schema"),json_schema:R.object({name:R.string().describe("The name of the schema"),schema:ai.describe("The schema itself in JSON format"),strict:R.literal(!0).describe("The schema must be strict")})})),Lm=Kd(Pm,{removeAdditionalStrategy:"passthrough"}),Em=R.string().transform((n,a)=>{const{json:t}=we(n);return vn(t)?Object.entries(t).reduce((i,[r,o])=>{if(typeof o=="string")i[r]=o;else{const{json:c}=ii(o);c!=null&&(i[r]=c)}return i},{}):(a.addIssue({code:R.ZodIssueCode.custom,message:"The prompt template variables must be a valid JSON object"}),R.NEVER)}),_m=R.object({[de.llm]:R.object({[Le.prompt_template]:R.object({variables:Em}).optional()}).optional()}).optional();function Wi(n){return Bi.safeParse(n).success}function Ba(n){if(Wi(n))return n;for(const[a,t]of Object.entries(nm))if(t.includes(n))return a;return rc}function wm({toolCalls:n,provider:a}){if(n!=null)return n.map(({tool_call:t})=>{var i,r,o,c;if(t==null)return null;let l={};if(((i=t.function)==null?void 0:i.arguments)!=null){const{json:d}=we(t.function.arguments);vn(d)&&(l=d)}switch(a){case"OPENAI":case"AZURE_OPENAI":return{id:t.id??"",function:{name:((r=t.function)==null?void 0:r.name)??"",arguments:l}};case"ANTHROPIC":return{id:t.id??"",type:"tool_use",name:((o=t.function)==null?void 0:o.name)??"",input:l};case"GEMINI":return{id:t.id??"",function:{name:((c=t.function)==null?void 0:c.name)??"",arguments:l}};default:ue()}}).filter(t=>t!=null)}function Ji({messages:n,provider:a}){return n.map(({message:t})=>({id:Ta(),role:t.tool_call_id!=null?Ba("tool"):Ba(t.role),content:typeof t.content=="string"?t.content:void 0,toolCalls:wm({provider:a,toolCalls:t.tool_calls}),toolCallId:t.tool_call_id}))}function Rm({provider:n,parsedAttributes:a}){var l;const t=bm.safeParse(a);if(!t.success)return{messageParsingErrors:[am],messages:null};if(n==="ANTHROPIC"){const{success:i,data:r}=Gi.safeParse(a);if(i){const o=t.data.llm.input_messages,c=(l=r.llm.invocation_parameters)==null?void 0:l.system;typeof c=="string"&&c&&(!o||o[0].message.role!=="system")&&t.data.llm.input_messages.unshift({message:{role:"system",content:c}})}}return{messageParsingErrors:[],messages:Ji({provider:n,messages:t.data.llm.input_messages})}}function Mm({provider:n,parsedAttributes:a}){const t=[],l=Sm.safeParse(a);if(l.success)return{output:Ji({provider:n,messages:l.data.llm.output_messages}),outputParsingErrors:t};t.push(tm);const i=vm.safeParse(a);return i.success?{output:i.data.output.value,outputParsingErrors:t}:(t.push(lm),{output:void 0,outputParsingErrors:t})}function Am(n){if(n==null)return null;switch(n.toLowerCase()){case"openai":return"OPENAI";case"anthropic":return"ANTHROPIC";case"google":return"GEMINI";case"azure":return"AZURE_OPENAI";default:return null}}function Nm(n){for(const a of Object.keys(Tl))if(Tl[a].some(l=>n.includes(l)))return a;return ic}function zm(n){const{success:a,data:t}=Tm.safeParse(n);if(a){const l=Am(t.llm.provider)||Nm(t.llm.model_name);return{modelConfig:{modelName:t.llm.model_name,provider:l,invocationParameters:[],supportedInvocationParameters:[]},parsingErrors:[]}}return{modelConfig:null,parsingErrors:[rm]}}function Vm(n,a=[]){const{success:t,data:l}=Gi.safeParse(n),i=[];return t||i.push(sm),{invocationParameters:Gm((l==null?void 0:l.llm.invocation_parameters)??{},a),parsingErrors:i}}function $m(n){const{success:a,data:t}=xm.safeParse(n);return a?{responseFormat:t.llm.invocation_parameters.response_format,parsingErrors:[]}:{responseFormat:void 0,parsingErrors:[om]}}function Om(n){var a;return(((a=n==null?void 0:n.llm)==null?void 0:a.tools)??[]).map(t=>(t==null?void 0:t.tool)==null?null:{id:$a(),definition:t.tool.json_schema}).filter(t=>t!=null)}function Qm(n){var l;const{data:a,success:t}=Dm.safeParse(n);return t?((l=a==null?void 0:a.llm)==null?void 0:l.tools)==null?{tools:null,parsingErrors:[]}:{tools:Om(a),parsingErrors:[]}:{tools:null,parsingErrors:[dm]}}function jm(n){var l;const{success:a,data:t}=_m.safeParse(n);return a?((l=t==null?void 0:t.llm)==null?void 0:l.prompt_template)==null?{variables:null,parsingErrors:[]}:{variables:t.llm.prompt_template.variables,parsingErrors:[]}:{variables:null,parsingErrors:[cm]}}function qm(n){const a=lc(),{json:t,parseError:l}=we(n.attributes);if(l)return{playgroundInstance:{...a,spanId:(n==null?void 0:n.id)??null},parsingErrors:[im]};const i=n.invocationParameters,r=zm(t);let{modelConfig:o}=r;const{parsingErrors:c}=r,{messages:d,messageParsingErrors:m}=Rm({provider:(o==null?void 0:o.provider)??a.model.provider,parsedAttributes:t}),{output:f,outputParsingErrors:g}=Mm({provider:(o==null?void 0:o.provider)??a.model.provider,parsedAttributes:t}),{invocationParameters:p,parsingErrors:y}=Vm(t,i),{variables:k,parsingErrors:b}=jm(t),{parsingErrors:S}=$m(t);o=o!=null?{...o,invocationParameters:S.length>0?p.filter(E=>E.invocationName!==An&&E.canonicalName!==Vn):p}:null;const{tools:v,parsingErrors:P}=Qm(t);return{playgroundInstance:{...a,model:o??a.model,template:d!=null?{__type:"chat",messages:d}:a.template,output:f,spanId:n.id,tools:v??a.tools},playgroundInput:k!=null?{variablesValueCache:k}:void 0,parsingErrors:[...m,...g,...c,...P,...y,...S,...b]}}const Um=n=>Fm.safeParse(n).success,Zi=({instance:n,templateLanguage:a})=>{if(a==Mn.NONE)return[];const t=new Set,l=n.template.__type,i=sc(a);switch(l){case"chat":{n.template.messages.forEach(r=>{(r.content==null?[]:i.extractVariables(r.content)).forEach(c=>{t.add(c)})});break}case"text_completion":{i.extractVariables(n.template.prompt).forEach(o=>{t.add(o)});break}default:ue()}return Array.from(t)},Bm=({instances:n,templateLanguage:a})=>a==Mn.NONE?[]:Array.from(new Set(n.flatMap(t=>Zi({instance:t,templateLanguage:a})))),Xi=({instances:n,templateLanguage:a,input:t})=>{if(a==Mn.NONE)return{variablesMap:{},variableKeys:[]};const l=Bm({instances:n,templateLanguage:a}),i=t.variablesValueCache??{};return{variablesMap:l.reduce((o,c)=>(o[c]=i[c]||"",o),{}),variableKeys:l}};function $n(n,a){return n.invocationName===a.invocationName||n.canonicalName!=null&&a.canonicalName!=null&&n.canonicalName===a.canonicalName}const Hm=(n,a)=>n.filter(t=>a.some(l=>$n(l,t))).map(t=>{var l;return{...t,invocationName:((l=a.find(i=>$n(i,t)))==null?void 0:l.invocationName)??t.invocationName}}),rt=n=>n.replace(/_([a-z])/g,(a,t)=>t.toUpperCase()),Gm=(n,a)=>Object.entries(n).map(([t,l])=>{const i=a.find(r=>r.canonicalName&&r.canonicalName.toLowerCase()===t.toLowerCase()||r.invocationName&&r.invocationName.toLowerCase()===t.toLowerCase());return i==null||i.invocationInputField==null||i.invocationName==null?null:{canonicalName:i.canonicalName,invocationName:i.invocationName,[rt(i.invocationInputField)]:l}}).filter(t=>t!=null),ja=n=>{const{provider:a,validatedToolDefinition:t}=dc(n.definition);switch(a){case"OPENAI":case"AZURE_OPENAI":return t.function.name;case"ANTHROPIC":return t.name;case"UNKNOWN":return null;default:ue()}},xl=({provider:n,toolNumber:a})=>{switch(n){case"OPENAI":case"AZURE_OPENAI":return{id:$a(),definition:hl(a)};case"ANTHROPIC":return{id:$a(),definition:cc(a)};case"GEMINI":return{id:$a(),definition:hl(a)};default:ue()}},Wm=n=>{switch(n){case"OPENAI":case"AZURE_OPENAI":return fl();case"ANTHROPIC":return oc();case"GEMINI":return fl();default:ue()}};function Jm(n){return{content:n.content,role:Zm(n.role),toolCalls:n.toolCalls,toolCallId:n.toolCallId}}function Zm(n){switch(n){case"system":return"SYSTEM";case"user":return"USER";case"tool":return"TOOL";case"ai":return"AI";default:ue()}}const Yi=({playgroundStore:n,instanceId:a,credentials:t})=>{const{instances:l}=n.getState(),i=l.find(m=>m.id===a);if(!i)throw new Error(`No instance found for id ${a}`);if(i.template.__type!=="chat")throw new Error("We only support chat templates for now");const r=i.model.supportedInvocationParameters;let o=[...i.model.invocationParameters];const c=hm({toolChoice:i.toolChoice,targetProvider:i.model.provider});i.tools.length>0?(o=o.filter(m=>m.invocationName!==Qa&&m.canonicalName!==Ka),o.push({canonicalName:Ka,invocationName:Qa,valueJson:c})):o=o.filter(m=>m.invocationName!==Qa&&m.canonicalName!==Ka),o=r.length?Hm(o,r):o;const d=i.model.provider==="AZURE_OPENAI"?{endpoint:i.model.endpoint,apiVersion:i.model.apiVersion}:{};return{messages:i.template.messages.map(Jm),model:{providerKey:i.model.provider,name:i.model.modelName||"",...d},invocationParameters:o,tools:i.tools.length?i.tools.map(m=>m.definition):void 0,apiKey:t[i.model.provider]||null}},Xm=({playgroundStore:n,instanceId:a,credentials:t})=>{const l=Yi({playgroundStore:n,instanceId:a,credentials:t}),{instances:i,templateLanguage:r,input:o}=n.getState(),{variablesMap:c}=Xi({instances:i,input:o,templateLanguage:r});return{...l,template:{variables:c,language:r}}},Il=({playgroundStore:n,instanceId:a,credentials:t,datasetId:l})=>({...Yi({playgroundStore:n,instanceId:a,credentials:t}),templateLanguage:n.getState().templateLanguage,datasetId:l});function er(n){return n==null||n===""?"{}":typeof n=="string"?n:JSON.stringify(n,null,2)}function nr(n,a){return a.filter(t=>t.required).every(t=>n.some(l=>$n(l,t)))}const Ym=n=>{for(const[a,t]of Object.entries(n))if(a.endsWith("DefaultValue")&&t!=null)return n[a]};function D1(n,a){const t=new Map(n.map(l=>[l.canonicalName||l.invocationName,l]));return a.forEach(l=>{var d;const i=l.canonicalName||l.invocationName,r=Ym(l),o=rt(l.invocationInputField||"");if(!l.invocationName||!l.invocationInputField||!i||r==null||((d=t.get(i))==null?void 0:d[o])!=null)return;const c={canonicalName:l.canonicalName,invocationName:l.invocationName,[o]:r};t.set(i,c)}),Array.from(t.values())}const ar=u.createContext(null);function P1({children:n,...a}){const[t]=u.useState(()=>uc(a));return e(ar.Provider,{value:t,children:n})}function Ha(n,a){const t=ve.useContext(ar);if(!t)throw new Error("Missing CredentialsContext.Provider in the tree");return Pa(t,n,a)}const tr=u.createContext(null);function eg(){const n=u.useContext(tr);if(n===null)throw new Error("useFunctionality must be used within a FunctionalityProvider");return n}function L1(n){return e(tr.Provider,{value:{authenticationEnabled:window.Config.authenticationEnabled},children:n.children})}const ng=C`
1
+ import{z as R,aD as de,aE as Pe,aF as Le,aG as za,A as Kd,r as u,j as e,R as ve,n as Pa,D as C,l as s,aH as Qe,a0 as Z,U as B,t as D,a6 as Ue,a7 as H,a8 as Ke,a9 as Te,ac as G,aI as he,aJ as cn,aK as un,aL as $e,aM as Td,aN as xt,aO as Kn,aP as Ua,a2 as ie,aQ as Aa,ab as Qn,g as Wl,aR as xd,a4 as _t,G as Id,aS as Dd,aT as gt,aU as pt,aV as ya,aW as La,aX as Jl,o as wt,aY as Pd,ay as Ld,az as Ed,aZ as _d,p as Zl,q as wd,a_ as Rd,ah as Md,a$ as Ad,b0 as gl,b1 as Nd,b2 as zd,b3 as Vd,b4 as $d,b5 as Od,b6 as Qd,b7 as jd,b8 as qd,b9 as Ud}from"./vendor-DvC8cT4X.js";import{A as ce,C as j,h as Rt,k as W,D as X,B as Mt,y as je,z as ee,G as Bd,s as Wa,p as Ja,P as ta,j as jn,q as Za,v as qn,w as la,H as Ze,L as Va,J as Xl,K as Hd,M as Yl,N as Gd,O as Wd,Q as ia,e as ze,f as ra,T as me,S as At,i as Me,g as ne,E as Xa,a as De,U as ei,V as Nt,c as Un,o as pl,W as Jd,n as Zd,I as Xd,m as yl,l as Yd,u as ec,X as nc,r as ac,R as Fa,d as ni}from"./vendor-arizeai-Do1793cv.js";import{s as zt,a as ue,l as tc,j as ai,b as we,i as ti,c as li,d as vn,e as ii,f as lc,g as Ta,D as ic,h as $a,k as rc,T as Mn,m as sc,n as fl,o as oc,p as dc,q as hl,r as cc,t as uc,N as mc,u as gc,L as ye,v as Ce,w as Ea,B as pc,_ as h,x as bn,I,C as yc,G as ri,y as Vt,P as sa,z as Ya,S as fc,A as hc,E as kc,F as bc,H as Sc,J as vc,K as Cc,M as Fc,O as dn,Q as N,R as Be,U as si,V as K,W as Re,X as $t,Y as Bn,Z as _e,$ as T,a0 as pe,a1 as Fe,a2 as oa,a3 as mn,a4 as fn,a5 as et,a6 as xe,a7 as re,a8 as Je,a9 as Tn,aa as se,ab as Ae,ac as oi,ad as Ge,ae as di,af as Xe,ag as xn,ah as Ot,ai as nn,aj as hn,ak as Qt,al as ci,am as ui,an as gn,ao as ke,ap as be,aq as Se,ar as kl,as as bl,at as Hn,au as Kc,av as Tc,aw as U,ax as mi,ay as jt,az as nt,aA as da,aB as gi,aC as ca,aD as ua,aE as pi,aF as kn,aG as Ee,aH as at,aI as In,aJ as yi,aK as qt,aL as an,aM as fi,aN as xc,aO as Ic,aP as Dc,aQ as Pc,aR as Lc,aS as tn,aT as ln,aU as Ec,aV as He,aW as _c,aX as wc,aY as hi,aZ as Rc,a_ as Mc,a$ as Sl,b0 as Ac,b1 as Nc,b2 as zc,b3 as Vc,b4 as $c,b5 as Oc,b6 as ki,b7 as Qc,b8 as jc,b9 as qc,ba as Uc,bb as Bc,bc as zn,bd as Ut,be as bi,bf as ea,bg as It,bh as Rn,bi as Sn,bj as Hc,bk as Gc,bl as Si,bm as tt,bn as vi,bo as rn,bp as Wc,bq as Jc,br as xa,bs as Oa,bt as Ci,bu as Zc,bv as Ve,bw as Bt,bx as Xc,by as Yc,bz as eu,bA as nu,bB as Ht,bC as qe,bD as Ye,bE as ma,bF as au,bG as lt,bH as Fi,bI as Ki,bJ as yt,bK as tu,bL as Gt,bM as Wt,bN as We,bO as Ne,bP as lu,bQ as Jt,bR as Ti,bS as xi,bT as Ii,bU as iu,bV as Dn,bW as Di,bX as Cn,bY as ru,bZ as vl,b_ as Pi,b$ as su,c0 as ou,c1 as du,c2 as cu,c3 as Li,c4 as sn,c5 as uu,c6 as na,c7 as Dt,c8 as mu,c9 as Ei,ca as _i,cb as gu,cc as pu,cd as yu,ce as it,cf as wi,cg as _a,ch as Cl,ci as Ri,cj as Zt,ck as fu,cl as hu,cm as Xt,cn as Mi,co as Ai,cp as ku,cq as Pt,cr as Ni,cs as bu,ct as Su,cu as Na,cv as vu,cw as Cu,cx as zi,cy as Vi,cz as Fu,cA as Ku,cB as Tu,cC as xu,cD as Yt,cE as $i,cF as Iu,cG as Du,cH as Lt,cI as Pu,cJ as Lu,cK as Eu,cL as _u,cM as wu,cN as Ru,cO as Oi,cP as Mu,cQ as Au,cR as Nu,cS as zu,cT as Vu,cU as $u,cV as Ou,cW as Qu,cX as ju,cY as qu,cZ as Uu,c_ as Fl,c$ as Kl}from"./components-CFq5ktuL.js";import{p as el,R as ga,n as pa,i as Bu,E as Qi,m as Hu,o as Gu,g as Wu}from"./vendor-codemirror-BzwZPyJM.js";import{R as Pn,C as wa,X as Ln,Y as en,a as En,T as _n,B as aa,A as Ia,b as ji,c as nl,L as qi,d as Ju,P as Zu,e as Xu,f as Yu}from"./vendor-recharts-_Jb7JjhG.js";const em=4,nm={user:["user","human"],ai:["assistant","bot","ai"],system:["system"],tool:["tool"]},am="Unable to parse span input messages, expected messages which include a role and content.",tm="Unable to parse span output messages, expected messages which include a role and content.",lm="Unable to parse span output expected output.value to be present.",im="Unable to parse span attributes, attributes must be valid JSON.",rm="Unable to parse model config, expected llm.model_name to be present.",sm="Unable to parse model config, expected llm.invocation_parameters JSON string to be present.",om="Unable to parse invocation parameters response_format, expected llm.invocation_parameters.response_format to be a well formed json object or undefined.",dm="Unable to parse tools, expected tools to be an array of valid tools.",cm="Unable to parse prompt template variables, expected prompt template variables to be a valid JSON object string.",Tl={AZURE_OPENAI:[],ANTHROPIC:["claude"],OPENAI:["gpt","o1"],GEMINI:["gemini"]},Ka="TOOL_CHOICE",Qa="tool_choice",Vn="RESPONSE_FORMAT",An="response_format",um=[Ka,Vn],al=zt()(R.union([R.literal("auto"),R.literal("none"),R.literal("required"),R.object({type:R.literal("function"),function:R.object({name:R.string()})})])),tl=R.object({type:R.union([R.literal("auto"),R.literal("any"),R.literal("tool")]),disable_parallel_tool_use:R.boolean().optional(),name:R.string().optional()}),mm=tl.transform(n=>{switch(n.type){case"any":case"auto":return"auto";case"tool":return n.name?{type:"function",function:{name:n.name}}:"auto";default:return"auto"}}),gm=al.transform(n=>typeof n=="string"?{type:"auto"}:{type:"tool",name:n.function.name});R.union([al,tl]);const pm=n=>{const{success:a,data:t}=al.safeParse(n);if(a)return{provider:"OPENAI",toolChoice:t};const{success:l,data:i}=tl.safeParse(n);return l?{provider:"ANTHROPIC",toolChoice:i}:{provider:null,toolChoice:null}},ym=n=>{const{provider:a,toolChoice:t}=pm(n);if(a==null||t==null)throw new Error("Could not detect provider of tool choice");switch(a){case"AZURE_OPENAI":case"OPENAI":return t;case"ANTHROPIC":return mm.parse(t);default:ue()}},fm=({toolChoice:n,targetProvider:a})=>{switch(a){case"AZURE_OPENAI":case"OPENAI":return n;case"ANTHROPIC":return gm.parse(n);case"GEMINI":return n;default:ue()}},hm=({toolChoice:n,targetProvider:a})=>{try{const t=ym(n);return fm({toolChoice:t,targetProvider:a})}catch{return null}},km=R.object({tool_call:R.object({id:R.string().optional(),function:R.object({name:R.string(),arguments:R.string()}).partial()}).partial()}).partial(),Ui=R.object({[de.message]:R.object({[Pe.role]:R.string(),[Pe.content]:R.union([R.string(),R.array(R.record(R.string(),R.unknown()))]).default(""),[Pe.tool_calls]:R.array(km).optional(),[Pe.tool_call_id]:R.string().optional()})}),bm=R.object({[de.llm]:R.object({[Le.input_messages]:R.array(Ui)})}),Sm=R.object({[de.llm]:R.object({[Le.output_messages]:R.array(Ui)})}),vm=R.object({[de.output]:R.object({value:R.string()})}),Bi=zt()(R.enum(["user","ai","system","tool"])),Cm=zt()(R.object({id:R.number(),role:Bi,content:R.string().optional(),toolCallId:R.string().optional(),toolCalls:R.array(tc).optional()})),Fm=R.array(Cm),ll=R.lazy(()=>R.record(ai)),Km=ll,Hi=R.string().transform((n,a)=>{const{json:t}=we(n);if(!ti(t))return a.addIssue({code:R.ZodIssueCode.custom,message:"The invocation parameters must be a valid JSON object"}),R.NEVER;const{success:l,data:i}=Km.safeParse(t);return l?i:(a.addIssue({code:R.ZodIssueCode.custom,message:"The invocation parameters must be a valid JSON object"}),R.NEVER)}).default("{}"),Tm=R.object({[de.llm]:R.object({[Le.provider]:R.string().optional(),[Le.model_name]:R.string()})}),Gi=R.object({[de.llm]:R.object({[Le.invocation_parameters]:Hi})}),xm=R.object({[de.llm]:R.object({[Le.invocation_parameters]:Hi.pipe(R.object({response_format:ll.optional()}))})}),Im=R.string().transform((n,a)=>{const{json:t}=we(n);return t==null||!ti(t)?(a.addIssue({code:R.ZodIssueCode.custom,message:"The tool JSON schema must be a valid JSON object"}),R.NEVER):t}).transform((n,a)=>{const{data:t,success:l}=li.safeParse(n);return l?t:(a.addIssue({code:R.ZodIssueCode.custom,message:"The tool JSON schema must be a valid tool schema"}),R.NEVER)}),Dm=R.object({[de.llm]:R.object({[Le.tools]:R.array(R.object({[de.tool]:R.object({[za.json_schema]:Im})}).optional()).optional()}).optional()}).optional(),Pm=R.lazy(()=>R.object({type:R.literal("json_schema"),json_schema:R.object({name:R.string().describe("The name of the schema"),schema:ai.describe("The schema itself in JSON format"),strict:R.literal(!0).describe("The schema must be strict")})})),Lm=Kd(Pm,{removeAdditionalStrategy:"passthrough"}),Em=R.string().transform((n,a)=>{const{json:t}=we(n);return vn(t)?Object.entries(t).reduce((i,[r,o])=>{if(typeof o=="string")i[r]=o;else{const{json:c}=ii(o);c!=null&&(i[r]=c)}return i},{}):(a.addIssue({code:R.ZodIssueCode.custom,message:"The prompt template variables must be a valid JSON object"}),R.NEVER)}),_m=R.object({[de.llm]:R.object({[Le.prompt_template]:R.object({variables:Em}).optional()}).optional()}).optional();function Wi(n){return Bi.safeParse(n).success}function Ba(n){if(Wi(n))return n;for(const[a,t]of Object.entries(nm))if(t.includes(n))return a;return rc}function wm({toolCalls:n,provider:a}){if(n!=null)return n.map(({tool_call:t})=>{var i,r,o,c;if(t==null)return null;let l={};if(((i=t.function)==null?void 0:i.arguments)!=null){const{json:d}=we(t.function.arguments);vn(d)&&(l=d)}switch(a){case"OPENAI":case"AZURE_OPENAI":return{id:t.id??"",function:{name:((r=t.function)==null?void 0:r.name)??"",arguments:l}};case"ANTHROPIC":return{id:t.id??"",type:"tool_use",name:((o=t.function)==null?void 0:o.name)??"",input:l};case"GEMINI":return{id:t.id??"",function:{name:((c=t.function)==null?void 0:c.name)??"",arguments:l}};default:ue()}}).filter(t=>t!=null)}function Ji({messages:n,provider:a}){return n.map(({message:t})=>({id:Ta(),role:t.tool_call_id!=null?Ba("tool"):Ba(t.role),content:typeof t.content=="string"?t.content:void 0,toolCalls:wm({provider:a,toolCalls:t.tool_calls}),toolCallId:t.tool_call_id}))}function Rm({provider:n,parsedAttributes:a}){var l;const t=bm.safeParse(a);if(!t.success)return{messageParsingErrors:[am],messages:null};if(n==="ANTHROPIC"){const{success:i,data:r}=Gi.safeParse(a);if(i){const o=t.data.llm.input_messages,c=(l=r.llm.invocation_parameters)==null?void 0:l.system;typeof c=="string"&&c&&(!o||o[0].message.role!=="system")&&t.data.llm.input_messages.unshift({message:{role:"system",content:c}})}}return{messageParsingErrors:[],messages:Ji({provider:n,messages:t.data.llm.input_messages})}}function Mm({provider:n,parsedAttributes:a}){const t=[],l=Sm.safeParse(a);if(l.success)return{output:Ji({provider:n,messages:l.data.llm.output_messages}),outputParsingErrors:t};t.push(tm);const i=vm.safeParse(a);return i.success?{output:i.data.output.value,outputParsingErrors:t}:(t.push(lm),{output:void 0,outputParsingErrors:t})}function Am(n){if(n==null)return null;switch(n.toLowerCase()){case"openai":return"OPENAI";case"anthropic":return"ANTHROPIC";case"google":return"GEMINI";case"azure":return"AZURE_OPENAI";default:return null}}function Nm(n){for(const a of Object.keys(Tl))if(Tl[a].some(l=>n.includes(l)))return a;return ic}function zm(n){const{success:a,data:t}=Tm.safeParse(n);if(a){const l=Am(t.llm.provider)||Nm(t.llm.model_name);return{modelConfig:{modelName:t.llm.model_name,provider:l,invocationParameters:[],supportedInvocationParameters:[]},parsingErrors:[]}}return{modelConfig:null,parsingErrors:[rm]}}function Vm(n,a=[]){const{success:t,data:l}=Gi.safeParse(n),i=[];return t||i.push(sm),{invocationParameters:Gm((l==null?void 0:l.llm.invocation_parameters)??{},a),parsingErrors:i}}function $m(n){const{success:a,data:t}=xm.safeParse(n);return a?{responseFormat:t.llm.invocation_parameters.response_format,parsingErrors:[]}:{responseFormat:void 0,parsingErrors:[om]}}function Om(n){var a;return(((a=n==null?void 0:n.llm)==null?void 0:a.tools)??[]).map(t=>(t==null?void 0:t.tool)==null?null:{id:$a(),definition:t.tool.json_schema}).filter(t=>t!=null)}function Qm(n){var l;const{data:a,success:t}=Dm.safeParse(n);return t?((l=a==null?void 0:a.llm)==null?void 0:l.tools)==null?{tools:null,parsingErrors:[]}:{tools:Om(a),parsingErrors:[]}:{tools:null,parsingErrors:[dm]}}function jm(n){var l;const{success:a,data:t}=_m.safeParse(n);return a?((l=t==null?void 0:t.llm)==null?void 0:l.prompt_template)==null?{variables:null,parsingErrors:[]}:{variables:t.llm.prompt_template.variables,parsingErrors:[]}:{variables:null,parsingErrors:[cm]}}function qm(n){const a=lc(),{json:t,parseError:l}=we(n.attributes);if(l)return{playgroundInstance:{...a,spanId:(n==null?void 0:n.id)??null},parsingErrors:[im]};const i=n.invocationParameters,r=zm(t);let{modelConfig:o}=r;const{parsingErrors:c}=r,{messages:d,messageParsingErrors:m}=Rm({provider:(o==null?void 0:o.provider)??a.model.provider,parsedAttributes:t}),{output:f,outputParsingErrors:g}=Mm({provider:(o==null?void 0:o.provider)??a.model.provider,parsedAttributes:t}),{invocationParameters:p,parsingErrors:y}=Vm(t,i),{variables:k,parsingErrors:b}=jm(t),{parsingErrors:S}=$m(t);o=o!=null?{...o,invocationParameters:S.length>0?p.filter(E=>E.invocationName!==An&&E.canonicalName!==Vn):p}:null;const{tools:v,parsingErrors:P}=Qm(t);return{playgroundInstance:{...a,model:o??a.model,template:d!=null?{__type:"chat",messages:d}:a.template,output:f,spanId:n.id,tools:v??a.tools},playgroundInput:k!=null?{variablesValueCache:k}:void 0,parsingErrors:[...m,...g,...c,...P,...y,...S,...b]}}const Um=n=>Fm.safeParse(n).success,Zi=({instance:n,templateLanguage:a})=>{if(a==Mn.NONE)return[];const t=new Set,l=n.template.__type,i=sc(a);switch(l){case"chat":{n.template.messages.forEach(r=>{(r.content==null?[]:i.extractVariables(r.content)).forEach(c=>{t.add(c)})});break}case"text_completion":{i.extractVariables(n.template.prompt).forEach(o=>{t.add(o)});break}default:ue()}return Array.from(t)},Bm=({instances:n,templateLanguage:a})=>a==Mn.NONE?[]:Array.from(new Set(n.flatMap(t=>Zi({instance:t,templateLanguage:a})))),Xi=({instances:n,templateLanguage:a,input:t})=>{if(a==Mn.NONE)return{variablesMap:{},variableKeys:[]};const l=Bm({instances:n,templateLanguage:a}),i=t.variablesValueCache??{};return{variablesMap:l.reduce((o,c)=>(o[c]=i[c]||"",o),{}),variableKeys:l}};function $n(n,a){return n.invocationName===a.invocationName||n.canonicalName!=null&&a.canonicalName!=null&&n.canonicalName===a.canonicalName}const Hm=(n,a)=>n.filter(t=>a.some(l=>$n(l,t))).map(t=>{var l;return{...t,invocationName:((l=a.find(i=>$n(i,t)))==null?void 0:l.invocationName)??t.invocationName}}),rt=n=>n.replace(/_([a-z])/g,(a,t)=>t.toUpperCase()),Gm=(n,a)=>Object.entries(n).map(([t,l])=>{const i=a.find(r=>r.canonicalName&&r.canonicalName.toLowerCase()===t.toLowerCase()||r.invocationName&&r.invocationName.toLowerCase()===t.toLowerCase());return i==null||i.invocationInputField==null||i.invocationName==null?null:{canonicalName:i.canonicalName,invocationName:i.invocationName,[rt(i.invocationInputField)]:l}}).filter(t=>t!=null),ja=n=>{const{provider:a,validatedToolDefinition:t}=dc(n.definition);switch(a){case"OPENAI":case"AZURE_OPENAI":return t.function.name;case"ANTHROPIC":return t.name;case"UNKNOWN":return null;default:ue()}},xl=({provider:n,toolNumber:a})=>{switch(n){case"OPENAI":case"AZURE_OPENAI":return{id:$a(),definition:hl(a)};case"ANTHROPIC":return{id:$a(),definition:cc(a)};case"GEMINI":return{id:$a(),definition:hl(a)};default:ue()}},Wm=n=>{switch(n){case"OPENAI":case"AZURE_OPENAI":return fl();case"ANTHROPIC":return oc();case"GEMINI":return fl();default:ue()}};function Jm(n){return{content:n.content,role:Zm(n.role),toolCalls:n.toolCalls,toolCallId:n.toolCallId}}function Zm(n){switch(n){case"system":return"SYSTEM";case"user":return"USER";case"tool":return"TOOL";case"ai":return"AI";default:ue()}}const Yi=({playgroundStore:n,instanceId:a,credentials:t})=>{const{instances:l}=n.getState(),i=l.find(m=>m.id===a);if(!i)throw new Error(`No instance found for id ${a}`);if(i.template.__type!=="chat")throw new Error("We only support chat templates for now");const r=i.model.supportedInvocationParameters;let o=[...i.model.invocationParameters];const c=hm({toolChoice:i.toolChoice,targetProvider:i.model.provider});i.tools.length>0?(o=o.filter(m=>m.invocationName!==Qa&&m.canonicalName!==Ka),o.push({canonicalName:Ka,invocationName:Qa,valueJson:c})):o=o.filter(m=>m.invocationName!==Qa&&m.canonicalName!==Ka),o=r.length?Hm(o,r):o;const d=i.model.provider==="AZURE_OPENAI"?{endpoint:i.model.endpoint,apiVersion:i.model.apiVersion}:{};return{messages:i.template.messages.map(Jm),model:{providerKey:i.model.provider,name:i.model.modelName||"",...d},invocationParameters:o,tools:i.tools.length?i.tools.map(m=>m.definition):void 0,apiKey:t[i.model.provider]||null}},Xm=({playgroundStore:n,instanceId:a,credentials:t})=>{const l=Yi({playgroundStore:n,instanceId:a,credentials:t}),{instances:i,templateLanguage:r,input:o}=n.getState(),{variablesMap:c}=Xi({instances:i,input:o,templateLanguage:r});return{...l,template:{variables:c,language:r}}},Il=({playgroundStore:n,instanceId:a,credentials:t,datasetId:l})=>({...Yi({playgroundStore:n,instanceId:a,credentials:t}),templateLanguage:n.getState().templateLanguage,datasetId:l});function er(n){return n==null||n===""?"{}":typeof n=="string"?n:JSON.stringify(n,null,2)}function nr(n,a){return a.filter(t=>t.required).every(t=>n.some(l=>$n(l,t)))}const Ym=n=>{for(const[a,t]of Object.entries(n))if(a.endsWith("DefaultValue")&&t!=null)return n[a]};function D1(n,a){const t=new Map(n.map(l=>[l.canonicalName||l.invocationName,l]));return a.forEach(l=>{var d;const i=l.canonicalName||l.invocationName,r=Ym(l),o=rt(l.invocationInputField||"");if(!l.invocationName||!l.invocationInputField||!i||r==null||((d=t.get(i))==null?void 0:d[o])!=null)return;const c={canonicalName:l.canonicalName,invocationName:l.invocationName,[o]:r};t.set(i,c)}),Array.from(t.values())}const ar=u.createContext(null);function P1({children:n,...a}){const[t]=u.useState(()=>uc(a));return e(ar.Provider,{value:t,children:n})}function Ha(n,a){const t=ve.useContext(ar);if(!t)throw new Error("Missing CredentialsContext.Provider in the tree");return Pa(t,n,a)}const tr=u.createContext(null);function eg(){const n=u.useContext(tr);if(n===null)throw new Error("useFunctionality must be used within a FunctionalityProvider");return n}function L1(n){return e(tr.Provider,{value:{authenticationEnabled:window.Config.authenticationEnabled},children:n.children})}const ng=C`
2
2
  display: flex;
3
3
  direction: row;
4
4
  height: 100vh;
@@ -1189,7 +1189,7 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
1189
1189
  id
1190
1190
  }
1191
1191
  }
1192
- `}}}();Br.hash="5a662d77e69d2e9bb4eb2af4cad6b722";async function $1(n){const{dimensionId:a}=n.params;return D.fetchQuery(Ae,Br,{id:a}).toPromise()}const Hr=function(){var n={defaultValue:null,kind:"LocalArgument",name:"id"},a={defaultValue:null,kind:"LocalArgument",name:"traceId"},t=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},o={kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Variable",name:"traceId",variableName:"traceId"}],concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"projectSessionId",storageKey:null},{alias:null,args:[{kind:"Literal",name:"first",value:1e3}],concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"span",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},{alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},r,{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:"spans(first:1000)"},r],storageKey:null}],type:"Project",abstractKey:null};return{fragment:{argumentDefinitions:[n,a],kind:"Fragment",metadata:null,name:"TraceDetailsQuery",selections:[{alias:"project",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[o],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,n],kind:"Operation",name:"TraceDetailsQuery",selections:[{alias:"project",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},o,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l],storageKey:null}]},params:{cacheID:"7d3725cc8aaa73d8aace29a3c6bba171",id:null,metadata:{},name:"TraceDetailsQuery",operationKind:"query",text:`query TraceDetailsQuery(
1192
+ `}}}();Br.hash="5a662d77e69d2e9bb4eb2af4cad6b722";async function $1(n){const{dimensionId:a}=n.params;return D.fetchQuery(Ae,Br,{id:a}).toPromise()}const Hr=function(){var n={defaultValue:null,kind:"LocalArgument",name:"id"},a={defaultValue:null,kind:"LocalArgument",name:"traceId"},t=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},o={kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Variable",name:"traceId",variableName:"traceId"}],concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"projectSessionId",storageKey:null},{alias:null,args:[{kind:"Literal",name:"first",value:1e3}],concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"span",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},{alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},r,{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[l,i,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:"spans(first:1000)"},r],storageKey:null}],type:"Project",abstractKey:null};return{fragment:{argumentDefinitions:[n,a],kind:"Fragment",metadata:null,name:"TraceDetailsQuery",selections:[{alias:"project",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[o],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,n],kind:"Operation",name:"TraceDetailsQuery",selections:[{alias:"project",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},o,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l],storageKey:null}]},params:{cacheID:"e49f79cc2ed4e3975425c66bfa0c9952",id:null,metadata:{},name:"TraceDetailsQuery",operationKind:"query",text:`query TraceDetailsQuery(
1193
1193
  $traceId: ID!
1194
1194
  $id: GlobalID!
1195
1195
  ) {
@@ -1216,6 +1216,7 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
1216
1216
  tokenCountPrompt
1217
1217
  tokenCountCompletion
1218
1218
  spanAnnotations {
1219
+ id
1219
1220
  name
1220
1221
  label
1221
1222
  score
@@ -1231,7 +1232,7 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
1231
1232
  id
1232
1233
  }
1233
1234
  }
1234
- `}}}();Hr.hash="540621a43dd4aa451855cb81219f0fdf";const Gr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{kind:"Variable",name:"id",variableName:"spanId"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},c={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"statusMessage",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},y={alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},b=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"mimeType",storageKey:null}],S={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:b,storageKey:null},v={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:b,storageKey:null},P={alias:null,args:null,kind:"ScalarField",name:"attributes",storageKey:null},E={alias:null,args:null,concreteType:"SpanEvent",kind:"LinkedField",name:"events",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"message",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null}],storageKey:null},w={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null},F={alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},x={alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},L={alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},_={alias:null,args:null,concreteType:"DocumentEvaluation",kind:"LinkedField",name:"documentEvaluations",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"documentPosition",storageKey:null},r,F,x,L],storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanDetailsQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"InlineFragment",selections:[l,i,r,o,c,d,m,f,g,p,y,k,S,v,P,{kind:"RequiredField",field:E,action:"THROW",path:"span.events"},w,_,{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[r],storageKey:null},{args:null,kind:"FragmentSpread",name:"SpanFeedback_annotations"},{args:null,kind:"FragmentSpread",name:"SpanAside_span"}],type:"Span",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanDetailsQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[i,r,o,c,d,m,f,g,p,y,k,S,v,P,E,w,_,{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[r,F,x,L,{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},l],storageKey:null},{alias:"code",args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null}],type:"Span",abstractKey:null}],storageKey:null}]},params:{cacheID:"b1a80a0108c40baebf6e64b811ca0202",id:null,metadata:{},name:"SpanDetailsQuery",operationKind:"query",text:`query SpanDetailsQuery(
1235
+ `}}}();Hr.hash="5fb4b5eb8dbfa378e4e293ec414bb1aa";const Gr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{kind:"Variable",name:"id",variableName:"spanId"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},c={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"statusMessage",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},y={alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},b=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"mimeType",storageKey:null}],S={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:b,storageKey:null},v={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:b,storageKey:null},P={alias:null,args:null,kind:"ScalarField",name:"attributes",storageKey:null},E={alias:null,args:null,concreteType:"SpanEvent",kind:"LinkedField",name:"events",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"message",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null}],storageKey:null},w={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null},F={alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},x={alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},L={alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},_={alias:null,args:null,concreteType:"DocumentEvaluation",kind:"LinkedField",name:"documentEvaluations",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"documentPosition",storageKey:null},r,F,x,L],storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanDetailsQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"InlineFragment",selections:[l,i,r,o,c,d,m,f,g,p,y,k,S,v,P,{kind:"RequiredField",field:E,action:"THROW",path:"span.events"},w,_,{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[l,r],storageKey:null},{args:null,kind:"FragmentSpread",name:"SpanFeedback_annotations"},{args:null,kind:"FragmentSpread",name:"SpanAside_span"}],type:"Span",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanDetailsQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[i,r,o,c,d,m,f,g,p,y,k,S,v,P,E,w,_,{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[l,r,F,x,L,{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},{alias:"code",args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null}],type:"Span",abstractKey:null}],storageKey:null}]},params:{cacheID:"479a50647c756ee04606202151df1785",id:null,metadata:{},name:"SpanDetailsQuery",operationKind:"query",text:`query SpanDetailsQuery(
1235
1236
  $spanId: GlobalID!
1236
1237
  ) {
1237
1238
  span: node(id: $spanId) {
@@ -1280,6 +1281,7 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
1280
1281
  explanation
1281
1282
  }
1282
1283
  spanAnnotations {
1284
+ id
1283
1285
  name
1284
1286
  }
1285
1287
  ...SpanFeedback_annotations
@@ -1309,6 +1311,7 @@ fragment SpanAside_span on Span {
1309
1311
 
1310
1312
  fragment SpanFeedback_annotations on Span {
1311
1313
  spanAnnotations {
1314
+ id
1312
1315
  name
1313
1316
  label
1314
1317
  score
@@ -1316,7 +1319,7 @@ fragment SpanFeedback_annotations on Span {
1316
1319
  annotatorKind
1317
1320
  }
1318
1321
  }
1319
- `}}}();Gr.hash="eaf52d9b37b1f5a29cae360a05b7c975";function _l(n){return Array.isArray(n)&&n.every(a=>typeof a=="object"&&de.message in a&&wp(a[de.message]))}function wp(n){return typeof n=="object"&&n!==null&&Pe.role in n}const bt=C`
1322
+ `}}}();Gr.hash="61b3b53936cae27a4193ff07fac1cc9f";function _l(n){return Array.isArray(n)&&n.every(a=>typeof a=="object"&&de.message in a&&wp(a[de.message]))}function wp(n){return typeof n=="object"&&n!==null&&Pe.role in n}const bt=C`
1320
1323
  display: flex;
1321
1324
  align-items: center;
1322
1325
  .ac-text {
@@ -1366,7 +1369,7 @@ fragment SpanAside_span on Span {
1366
1369
  padding-right: 10px;
1367
1370
  }
1368
1371
  }
1369
- `,children:s(ta,{placement:"bottom right",children:[e(At,{addonBefore:e(I,{svg:e(Ya,{})}),children:"Code"}),e(Wa,{children:e(K,{padding:"size-200",children:s(Me,{children:[s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(ne,{label:"Span ID",isReadOnly:!0,value:a}),e(re,{text:a,size:"M"})]}),s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(ne,{label:"Trace ID",isReadOnly:!0,value:t}),e(re,{text:t,size:"M"})]})]})})})]})})}const Zr={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"SpanFeedback_annotations",selections:[{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null};Zr.hash="6199ecd4f0143cffbaa2fe5e19a8739c";function Np(){const[n,a]=u.useState(null);return s(K,{padding:"size-200",children:[s(h,{direction:"column",gap:"size-100",alignItems:"center",children:[e(Xa,{graphicKey:"documents"}),e(T,{children:"No annotations for this span"}),e(N,{variant:"default",size:"S",onPress:()=>{a(e(W,{title:"Span Annotations",isDismissable:!0,children:s(K,{padding:"size-200",children:[e("p",{css:C`
1372
+ `,children:s(ta,{placement:"bottom right",children:[e(At,{addonBefore:e(I,{svg:e(Ya,{})}),children:"Code"}),e(Wa,{children:e(K,{padding:"size-200",children:s(Me,{children:[s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(ne,{label:"Span ID",isReadOnly:!0,value:a}),e(re,{text:a,size:"M"})]}),s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(ne,{label:"Trace ID",isReadOnly:!0,value:t}),e(re,{text:t,size:"M"})]})]})})})]})})}const Zr={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"SpanFeedback_annotations",selections:[{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null};Zr.hash="6cde9ca22bfc99084304e3e817be01dc";function Np(){const[n,a]=u.useState(null);return s(K,{padding:"size-200",children:[s(h,{direction:"column",gap:"size-100",alignItems:"center",children:[e(Xa,{graphicKey:"documents"}),e(T,{children:"No annotations for this span"}),e(N,{variant:"default",size:"S",onPress:()=>{a(e(W,{title:"Span Annotations",isDismissable:!0,children:s(K,{padding:"size-200",children:[e("p",{css:C`
1370
1373
  margin: 0 0 var(--ac-global-dimension-size-100) 0;
1371
1374
  `,children:"Annotations are pivotal for tracking and improving the performance of your application. Phoenix allows for both LLM and HUMAN annotations."}),e(He,{href:"https://docs.arize.com/phoenix/tracing/concepts-tracing/how-to-evaluate-traces",children:"View annotation documentation"})]})}))},icon:e(I,{svg:e(vi,{})}),children:"How to Annotate"})]}),e(X,{onDismiss:()=>a(null),isDismissable:!0,children:n})]})}const zp=[{header:"name",accessorKey:"name",size:100},{header:"label",accessorKey:"label",size:100},{header:"score",accessorKey:"score",size:100},{header:"explanation",accessorKey:"explanation",cell:Wc,size:400}];function wl({annotations:n}){const a=u.useMemo(()=>[...n],[n]),t=Ke({columns:zp,data:a,getCoreRowModel:Te()}),i=t.getRowModel().rows.length===0;return s("table",{css:an,children:[e("thead",{children:t.getHeaderGroups().map(r=>e("tr",{children:r.headers.map(o=>e("th",{colSpan:o.colSpan,children:o.isPlaceholder?null:e(B,{children:G(o.column.columnDef.header,o.getContext())})},o.id))},r.id))}),i?e(rn,{}):e("tbody",{children:t.getRowModel().rows.map(r=>e("tr",{children:r.getVisibleCells().map(o=>e("td",{style:{width:o.column.getSize()},children:G(o.column.columnDef.cell,o.getContext())},o.id))},r.id))})]})}function Vp({span:n}){const a=D.useFragment(Zr,n),t=u.useMemo(()=>a.spanAnnotations.filter(r=>r.annotatorKind==="HUMAN"),[a.spanAnnotations]),l=u.useMemo(()=>a.spanAnnotations.filter(r=>r.annotatorKind==="LLM"),[a.spanAnnotations]);return a.spanAnnotations.length>0?s(gn,{defaultExpandedKeys:["evaluations","human"],children:[s(ke,{id:"evaluations",children:[e(be,{children:"Evaluations"}),e(Se,{children:e(wl,{annotations:l})})]}),s(ke,{id:"human",children:[e(be,{children:"Human Annotations"}),e(Se,{children:e(wl,{annotations:t})})]})]}):e(Np,{})}function $p(n){return n==="__REDACTED__"}const Op=C`
1372
1375
  position: relative;
@@ -1571,7 +1574,7 @@ fragment SpanAside_span on Span {
1571
1574
  `,children:n})}function ky({children:n}){return e("div",{"data-testid":"scrolling-panel-content",css:C`
1572
1575
  height: 100%;
1573
1576
  overflow-y: auto;
1574
- `,children:n})}function O1(){const{traceId:n,projectId:a}=$e(),t=Z();return e(X,{type:"slideOver",isDismissable:!0,onDismiss:()=>t(`/projects/${a}`),children:e(W,{size:"fullscreen",title:"Trace Details",children:e(rl,{traceId:n,projectId:a})})})}const ts=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r={kind:"Variable",name:"timeRange",variableName:"timeRange"},o=[{kind:"Literal",name:"first",value:50},{kind:"Literal",name:"rootSpansOnly",value:!0},{kind:"Literal",name:"sort",value:{col:"startTime",dir:"desc"}},r],c={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},d={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},p=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],y={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:p,storageKey:null},k={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:p,storageKey:null},b={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},S={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},v={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null},P=[r];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectPageQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"TracesTable_spans"},{args:null,kind:"FragmentSpread",name:"ProjectPageHeader_stats"},{args:null,kind:"FragmentSpread",name:"StreamToggle_data"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectPageQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[i,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:"rootSpans",args:o,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l,c,i,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},d,m,f,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},g,y,k,b,S,v,{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"descendants",plural:!0,selections:[l,c,i,d,m,f,g,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},y,k,b,S,v],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:"rootSpans",args:o,filters:["sort","rootSpansOnly","filterCondition","timeRange"],handle:"connection",key:"TracesTable_rootSpans",kind:"LinkedHandle",name:"spans"},{alias:null,args:P,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:P,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:P,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:P,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},r],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:"latencyMsP99",args:[{kind:"Literal",name:"probability",value:.99},r],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"documentEvaluationNames",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"streamingLastUpdatedAt",storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"6cc5e26d63252f86d25c9365c15f55ec",id:null,metadata:{},name:"ProjectPageQuery",operationKind:"query",text:`query ProjectPageQuery(
1577
+ `,children:n})}function O1(){const{traceId:n,projectId:a}=$e(),t=Z();return e(X,{type:"slideOver",isDismissable:!0,onDismiss:()=>t(`/projects/${a}`),children:e(W,{size:"fullscreen",title:"Trace Details",children:e(rl,{traceId:n,projectId:a})})})}const ts=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r={kind:"Variable",name:"timeRange",variableName:"timeRange"},o=[{kind:"Literal",name:"first",value:50},{kind:"Literal",name:"rootSpansOnly",value:!0},{kind:"Literal",name:"sort",value:{col:"startTime",dir:"desc"}},r],c={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},d={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},p=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],y={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:p,storageKey:null},k={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:p,storageKey:null},b={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},S={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[l,i,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},v={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null},P=[r];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectPageQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"TracesTable_spans"},{args:null,kind:"FragmentSpread",name:"ProjectPageHeader_stats"},{args:null,kind:"FragmentSpread",name:"StreamToggle_data"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectPageQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[i,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:"rootSpans",args:o,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l,c,i,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},d,m,f,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},g,y,k,b,S,v,{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"descendants",plural:!0,selections:[l,c,i,d,m,f,g,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},y,k,b,S,v],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:"rootSpans",args:o,filters:["sort","rootSpansOnly","filterCondition","timeRange"],handle:"connection",key:"TracesTable_rootSpans",kind:"LinkedHandle",name:"spans"},{alias:null,args:P,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:P,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:P,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:P,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},r],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:"latencyMsP99",args:[{kind:"Literal",name:"probability",value:.99},r],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"documentEvaluationNames",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"streamingLastUpdatedAt",storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"58844e1d5d6347db1d6c4687b539dbe4",id:null,metadata:{},name:"ProjectPageQuery",operationKind:"query",text:`query ProjectPageQuery(
1575
1578
  $id: GlobalID!
1576
1579
  $timeRange: TimeRange!
1577
1580
  ) {
@@ -1634,6 +1637,7 @@ fragment TracesTable_spans on Project {
1634
1637
  traceId
1635
1638
  }
1636
1639
  spanAnnotations {
1640
+ id
1637
1641
  name
1638
1642
  label
1639
1643
  score
@@ -1667,6 +1671,7 @@ fragment TracesTable_spans on Project {
1667
1671
  traceId
1668
1672
  }
1669
1673
  spanAnnotations {
1674
+ id
1670
1675
  name
1671
1676
  label
1672
1677
  score
@@ -2395,7 +2400,7 @@ fragment StreamToggle_data on Project {
2395
2400
  streamingLastUpdatedAt
2396
2401
  id
2397
2402
  }
2398
- `}}}();Vs.hash="30a8f0bcf1aa6021b2c9a47866f5dc49";const $s={argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:Vs,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"StreamToggle_data",selections:[{alias:null,args:null,kind:"ScalarField",name:"streamingLastUpdatedAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Project",abstractKey:null};$s.hash="30a8f0bcf1aa6021b2c9a47866f5dc49";function Os(n,a){const t=u.useRef(null);u.useEffect(()=>{t.current=n},[n]),u.useEffect(()=>{function l(){t.current&&t.current()}if(typeof a=="number"){const i=setInterval(l,a);return()=>clearInterval(i)}},[a])}const Zy=2e3;function Xy(n){const{isStreaming:a,setIsStreaming:t,setFetchKey:l}=Gn(),[i,r]=D.useRefetchableFragment($s,n.project),o=u.useRef(i.streamingLastUpdatedAt),c=u.useCallback(()=>{a&&u.startTransition(()=>{r({},{fetchPolicy:"store-and-network"})})},[a,r]),d=i.streamingLastUpdatedAt;return u.useEffect(()=>{d!=null&&(o.current==null||o.current<d)&&(o.current=d,l(`fetch-traces-${d}`))},[l,d]),Os(c,Zy),e(ia,{labelPlacement:"start",isSelected:a,onChange:()=>{t(!a)},children:"Stream"})}const Qs=function(){var n={defaultValue:null,kind:"LocalArgument",name:"after"},a={defaultValue:null,kind:"LocalArgument",name:"filterCondition"},t={defaultValue:50,kind:"LocalArgument",name:"first"},l={defaultValue:null,kind:"LocalArgument",name:"id"},i={defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},r={defaultValue:null,kind:"LocalArgument",name:"timeRange"},o=[{kind:"Variable",name:"id",variableName:"id"}],c={kind:"Variable",name:"after",variableName:"after"},d={kind:"Variable",name:"filterCondition",variableName:"filterCondition"},m={kind:"Variable",name:"first",variableName:"first"},f={kind:"Variable",name:"sort",variableName:"sort"},g={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},y={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},k=[c,d,m,{kind:"Literal",name:"rootSpansOnly",value:!0},f,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],b={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},S={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},v={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},P={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},E={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},w=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],F={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:w,storageKey:null},x={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:w,storageKey:null},L={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},_={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[y,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},O={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:[n,a,t,l,i,r],kind:"Fragment",metadata:null,name:"TracesTableQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:[c,d,m,f],kind:"FragmentSpread",name:"TracesTable_spans"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a,t,i,r,l],kind:"Operation",name:"TracesTableQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[g,{kind:"TypeDiscriminator",abstractKey:"__isNode"},p,{kind:"InlineFragment",selections:[y,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:"rootSpans",args:k,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[p,b,y,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},S,v,P,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},E,F,x,L,_,O,{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"descendants",plural:!0,selections:[p,b,y,S,v,P,E,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},F,x,L,_,O],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[g],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:"rootSpans",args:k,filters:["sort","rootSpansOnly","filterCondition","timeRange"],handle:"connection",key:"TracesTable_rootSpans",kind:"LinkedHandle",name:"spans"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"572f8769fc0e90b681883b56222bdc65",id:null,metadata:{},name:"TracesTableQuery",operationKind:"query",text:`query TracesTableQuery(
2403
+ `}}}();Vs.hash="30a8f0bcf1aa6021b2c9a47866f5dc49";const $s={argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:Vs,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"StreamToggle_data",selections:[{alias:null,args:null,kind:"ScalarField",name:"streamingLastUpdatedAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Project",abstractKey:null};$s.hash="30a8f0bcf1aa6021b2c9a47866f5dc49";function Os(n,a){const t=u.useRef(null);u.useEffect(()=>{t.current=n},[n]),u.useEffect(()=>{function l(){t.current&&t.current()}if(typeof a=="number"){const i=setInterval(l,a);return()=>clearInterval(i)}},[a])}const Zy=2e3;function Xy(n){const{isStreaming:a,setIsStreaming:t,setFetchKey:l}=Gn(),[i,r]=D.useRefetchableFragment($s,n.project),o=u.useRef(i.streamingLastUpdatedAt),c=u.useCallback(()=>{a&&u.startTransition(()=>{r({},{fetchPolicy:"store-and-network"})})},[a,r]),d=i.streamingLastUpdatedAt;return u.useEffect(()=>{d!=null&&(o.current==null||o.current<d)&&(o.current=d,l(`fetch-traces-${d}`))},[l,d]),Os(c,Zy),e(ia,{labelPlacement:"start",isSelected:a,onChange:()=>{t(!a)},children:"Stream"})}const Qs=function(){var n={defaultValue:null,kind:"LocalArgument",name:"after"},a={defaultValue:null,kind:"LocalArgument",name:"filterCondition"},t={defaultValue:50,kind:"LocalArgument",name:"first"},l={defaultValue:null,kind:"LocalArgument",name:"id"},i={defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},r={defaultValue:null,kind:"LocalArgument",name:"timeRange"},o=[{kind:"Variable",name:"id",variableName:"id"}],c={kind:"Variable",name:"after",variableName:"after"},d={kind:"Variable",name:"filterCondition",variableName:"filterCondition"},m={kind:"Variable",name:"first",variableName:"first"},f={kind:"Variable",name:"sort",variableName:"sort"},g={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},y={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},k=[c,d,m,{kind:"Literal",name:"rootSpansOnly",value:!0},f,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],b={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},S={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},v={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},P={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},E={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},w=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],F={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:w,storageKey:null},x={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:w,storageKey:null},L={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},_={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[p,y,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},O={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:[n,a,t,l,i,r],kind:"Fragment",metadata:null,name:"TracesTableQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:[c,d,m,f],kind:"FragmentSpread",name:"TracesTable_spans"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a,t,i,r,l],kind:"Operation",name:"TracesTableQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[g,{kind:"TypeDiscriminator",abstractKey:"__isNode"},p,{kind:"InlineFragment",selections:[y,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:"rootSpans",args:k,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[p,b,y,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},S,v,P,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},E,F,x,L,_,O,{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"descendants",plural:!0,selections:[p,b,y,S,v,P,E,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},F,x,L,_,O],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[g],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:"rootSpans",args:k,filters:["sort","rootSpansOnly","filterCondition","timeRange"],handle:"connection",key:"TracesTable_rootSpans",kind:"LinkedHandle",name:"spans"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"02a7f881e2b629106c3ca5af769d1175",id:null,metadata:{},name:"TracesTableQuery",operationKind:"query",text:`query TracesTableQuery(
2399
2404
  $after: String = null
2400
2405
  $filterCondition: String = null
2401
2406
  $first: Int = 50
@@ -2443,6 +2448,7 @@ fragment TracesTable_spans_1XEuU on Project {
2443
2448
  traceId
2444
2449
  }
2445
2450
  spanAnnotations {
2451
+ id
2446
2452
  name
2447
2453
  label
2448
2454
  score
@@ -2476,6 +2482,7 @@ fragment TracesTable_spans_1XEuU on Project {
2476
2482
  traceId
2477
2483
  }
2478
2484
  spanAnnotations {
2485
+ id
2479
2486
  name
2480
2487
  label
2481
2488
  score
@@ -2501,7 +2508,7 @@ fragment TracesTable_spans_1XEuU on Project {
2501
2508
  }
2502
2509
  id
2503
2510
  }
2504
- `}}}();Qs.hash="53b160969c87d5e35e08a1f4ca26aadb";const js=function(){var n=["rootSpans"],a={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},i={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},d=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],m={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:d,storageKey:null},f={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:d,storageKey:null},g={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},p={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},y={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"filterCondition"},{defaultValue:50,kind:"LocalArgument",name:"first"},{defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:Qs,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"TracesTable_spans",selections:[a,{args:null,kind:"FragmentSpread",name:"SpanColumnSelector_annotations"},{alias:"rootSpans",args:[{kind:"Variable",name:"filterCondition",variableName:"filterCondition"},{kind:"Literal",name:"rootSpansOnly",value:!0},{kind:"Variable",name:"sort",variableName:"sort"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"SpanConnection",kind:"LinkedField",name:"__TracesTable_rootSpans_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t,l,a,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},i,r,o,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},c,m,f,g,p,y,{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"descendants",plural:!0,selections:[t,l,a,i,r,o,c,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},m,f,g,p,y],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},t],type:"Project",abstractKey:null}}();js.hash="53b160969c87d5e35e08a1f4ca26aadb";const zl=50;function qs(n){const a=[];for(const t of n){const l={...t.span,children:qs(t.children)};a.push(l)}return a}function Yy(n){const a=u.useRef(null),[t,l]=u.useState({}),[i,r]=u.useState([]),[o,c]=u.useState(""),d=Z(),{fetchKey:m}=Gn(),{data:f,loadNext:g,hasNext:p,isLoadingNext:y,refetch:k}=D.usePaginationFragment(js,n.project),b=yn(M=>M.annotationColumnVisibility),S=u.useMemo(()=>Object.keys(b).filter(M=>b[M]),[b]),v=u.useMemo(()=>f.rootSpans.edges.map(({rootSpan:q})=>{const te=ru([q,...q.descendants]),[V]=qs(te);return V}),[f]),P=S.map(M=>({header:M,columns:[{header:"label",accessorKey:`${Da}${on}label${on}${M}`,cell:({row:q})=>{const te=q.original.spanAnnotations.find(V=>V.name===M);return te?te.label:null}},{header:"score",accessorKey:`${Da}${on}score${on}${M}`,cell:({row:q})=>{const te=q.original.spanAnnotations.find(V=>V.name===M);return te?te.score:null}}]})),E=[{header:()=>s(h,{direction:"row",gap:"size-50",children:[e("span",{children:"feedback"}),s(la,{children:[e(se,{level:3,weight:"heavy",children:"Feedback"}),e(qn,{children:"Feedback includes evaluations and human annotations logged via the API or set via the UI."})]})]}),accessorKey:"spanAnnotations",enableSorting:!1,cell:({row:M})=>{const q=M.original.spanAnnotations.length===0&&M.original.documentRetrievalMetrics.length===0;return s(h,{direction:"row",gap:"size-50",wrap:"wrap",children:[M.original.spanAnnotations.map(te=>e(oa,{annotation:te,layout:"horizontal",width:"500px",extra:e(Ks,{annotation:te}),children:e(fn,{annotation:te,annotationDisplayPreference:"label"})},te.name)),M.original.documentRetrievalMetrics.map(te=>s(u.Fragment,{children:[e(Oe,{name:te.evaluationName,metric:"ndcg",score:te.ndcg},"ndcg"),e(Oe,{name:te.evaluationName,metric:"precision",score:te.precision},"precision"),e(Oe,{name:te.evaluationName,metric:"hit",score:te.hit},"hit")]},"doc-evals")),q?"--":null]})}},...P],w=[{id:"select",maxSize:10,header:({table:M})=>e(Cn,{checked:M.getIsAllRowsSelected(),indeterminate:M.getIsSomeRowsSelected(),onChange:M.getToggleAllRowsSelectedHandler()}),cell:({row:M})=>e(Cn,{checked:M.getIsSelected(),disabled:!M.getCanSelect(),indeterminate:M.getIsSomeSelected(),onChange:M.getToggleSelectedHandler()})},{header:()=>s(h,{gap:"size-50",direction:"row",alignItems:"center",children:[e(vl,{isExpanded:O.getIsAllRowsExpanded(),onClick:O.getToggleAllRowsExpandedHandler(),"aria-label":"Expand all rows"}),"kind"]}),enableSorting:!1,accessorKey:"spanKind",maxSize:100,cell:M=>e("div",{css:C`
2511
+ `}}}();Qs.hash="7a8017aa7d5eebddd6255365f3372f64";const js=function(){var n=["rootSpans"],a={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},i={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},d=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],m={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:d,storageKey:null},f={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:d,storageKey:null},g={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},p={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[t,a,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},y={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"filterCondition"},{defaultValue:50,kind:"LocalArgument",name:"first"},{defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:Qs,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"TracesTable_spans",selections:[a,{args:null,kind:"FragmentSpread",name:"SpanColumnSelector_annotations"},{alias:"rootSpans",args:[{kind:"Variable",name:"filterCondition",variableName:"filterCondition"},{kind:"Literal",name:"rootSpansOnly",value:!0},{kind:"Variable",name:"sort",variableName:"sort"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"SpanConnection",kind:"LinkedField",name:"__TracesTable_rootSpans_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t,l,a,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},i,r,o,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},c,m,f,g,p,y,{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"descendants",plural:!0,selections:[t,l,a,i,r,o,c,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},m,f,g,p,y],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},t],type:"Project",abstractKey:null}}();js.hash="7a8017aa7d5eebddd6255365f3372f64";const zl=50;function qs(n){const a=[];for(const t of n){const l={...t.span,children:qs(t.children)};a.push(l)}return a}function Yy(n){const a=u.useRef(null),[t,l]=u.useState({}),[i,r]=u.useState([]),[o,c]=u.useState(""),d=Z(),{fetchKey:m}=Gn(),{data:f,loadNext:g,hasNext:p,isLoadingNext:y,refetch:k}=D.usePaginationFragment(js,n.project),b=yn(M=>M.annotationColumnVisibility),S=u.useMemo(()=>Object.keys(b).filter(M=>b[M]),[b]),v=u.useMemo(()=>f.rootSpans.edges.map(({rootSpan:q})=>{const te=ru([q,...q.descendants]),[V]=qs(te);return V}),[f]),P=S.map(M=>({header:M,columns:[{header:"label",accessorKey:`${Da}${on}label${on}${M}`,cell:({row:q})=>{const te=q.original.spanAnnotations.find(V=>V.name===M);return te?te.label:null}},{header:"score",accessorKey:`${Da}${on}score${on}${M}`,cell:({row:q})=>{const te=q.original.spanAnnotations.find(V=>V.name===M);return te?te.score:null}}]})),E=[{header:()=>s(h,{direction:"row",gap:"size-50",children:[e("span",{children:"feedback"}),s(la,{children:[e(se,{level:3,weight:"heavy",children:"Feedback"}),e(qn,{children:"Feedback includes evaluations and human annotations logged via the API or set via the UI."})]})]}),accessorKey:"spanAnnotations",enableSorting:!1,cell:({row:M})=>{const q=M.original.spanAnnotations.length===0&&M.original.documentRetrievalMetrics.length===0;return s(h,{direction:"row",gap:"size-50",wrap:"wrap",children:[M.original.spanAnnotations.map(te=>e(oa,{annotation:te,layout:"horizontal",width:"500px",extra:e(Ks,{annotation:te}),children:e(fn,{annotation:te,annotationDisplayPreference:"label"})},te.name)),M.original.documentRetrievalMetrics.map(te=>s(u.Fragment,{children:[e(Oe,{name:te.evaluationName,metric:"ndcg",score:te.ndcg},"ndcg"),e(Oe,{name:te.evaluationName,metric:"precision",score:te.precision},"precision"),e(Oe,{name:te.evaluationName,metric:"hit",score:te.hit},"hit")]},"doc-evals")),q?"--":null]})}},...P],w=[{id:"select",maxSize:10,header:({table:M})=>e(Cn,{checked:M.getIsAllRowsSelected(),indeterminate:M.getIsSomeRowsSelected(),onChange:M.getToggleAllRowsSelectedHandler()}),cell:({row:M})=>e(Cn,{checked:M.getIsSelected(),disabled:!M.getCanSelect(),indeterminate:M.getIsSomeSelected(),onChange:M.getToggleSelectedHandler()})},{header:()=>s(h,{gap:"size-50",direction:"row",alignItems:"center",children:[e(vl,{isExpanded:O.getIsAllRowsExpanded(),onClick:O.getToggleAllRowsExpandedHandler(),"aria-label":"Expand all rows"}),"kind"]}),enableSorting:!1,accessorKey:"spanKind",maxSize:100,cell:M=>e("div",{css:C`
2505
2512
  // Since rows are flattened by default,
2506
2513
  // we can use the row.depth property
2507
2514
  // and paddingLeft to visually indicate the depth
phoenix/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "7.5.1"
1
+ __version__ = "7.5.2"