promptfoo 0.45.2 → 0.46.0
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.
- package/dist/package.json +1 -1
- package/dist/src/assertions.d.ts.map +1 -1
- package/dist/src/assertions.js +21 -7
- package/dist/src/assertions.js.map +1 -1
- package/dist/src/feedback.js +1 -1
- package/dist/src/feedback.js.map +1 -1
- package/dist/src/prompts.d.ts.map +1 -1
- package/dist/src/prompts.js +22 -12
- package/dist/src/prompts.js.map +1 -1
- package/dist/src/providers/anthropic.d.ts.map +1 -1
- package/dist/src/providers/anthropic.js +15 -31
- package/dist/src/providers/anthropic.js.map +1 -1
- package/dist/src/providers/openai.d.ts.map +1 -1
- package/dist/src/providers/openai.js +17 -2
- package/dist/src/providers/openai.js.map +1 -1
- package/dist/src/providers.js +2 -2
- package/dist/src/providers.js.map +1 -1
- package/dist/src/share.js +1 -1
- package/dist/src/share.js.map +1 -1
- package/dist/src/types.d.ts +6 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/util.d.ts +3 -3
- package/dist/src/util.d.ts.map +1 -1
- package/dist/src/util.js +15 -5
- package/dist/src/util.js.map +1 -1
- package/dist/src/web/nextui/404/index.html +1 -1
- package/dist/src/web/nextui/404.html +1 -1
- package/dist/src/web/nextui/_next/static/chunks/{952-b674b8ee77cfa5c7.js → 952-1367984f076e3060.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/{layout-f887d1009f0f8cf1.js → layout-d634a41da738217d.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/setup/{page-bd58a8506813a971.js → page-83c7e62787113081.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/{webpack-4590f5da0889fc85.js → webpack-ff9953f1ad73867d.js} +1 -1
- package/dist/src/web/nextui/_next/static/css/{a22c0b8ec9b5026b.css → 87fb00eed311e9cd.css} +1 -1
- package/dist/src/web/nextui/_next/static/css/{fb8d3287f9f8ec6d.css → e162c4971c41c2ac.css} +1 -1
- package/dist/src/web/nextui/api/results +1 -1
- package/dist/src/web/nextui/auth/login/index.html +1 -1
- package/dist/src/web/nextui/auth/login/index.txt +4 -4
- package/dist/src/web/nextui/auth/signup/index.html +1 -1
- package/dist/src/web/nextui/auth/signup/index.txt +4 -4
- package/dist/src/web/nextui/datasets/index.html +1 -1
- package/dist/src/web/nextui/datasets/index.txt +4 -4
- package/dist/src/web/nextui/eval/index.html +1 -1
- package/dist/src/web/nextui/eval/index.txt +7 -7
- package/dist/src/web/nextui/index.html +1 -1
- package/dist/src/web/nextui/index.txt +4 -4
- package/dist/src/web/nextui/prompts/index.html +1 -1
- package/dist/src/web/nextui/prompts/index.txt +4 -4
- package/dist/src/web/nextui/setup/index.html +2 -2
- package/dist/src/web/nextui/setup/index.txt +6 -6
- package/dist/src/web/server.d.ts.map +1 -1
- package/dist/src/web/server.js +5 -5
- package/dist/src/web/server.js.map +1 -1
- package/package.json +1 -1
- /package/dist/src/web/nextui/_next/static/{dpOPOkbjyEnq8K-_tq4vY → Np8tRhZUzimy-v_hu8F8W}/_buildManifest.js +0 -0
- /package/dist/src/web/nextui/_next/static/{dpOPOkbjyEnq8K-_tq4vY → Np8tRhZUzimy-v_hu8F8W}/_ssgManifest.js +0 -0
- /package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/{page-aec85c1e519871fb.js → page-f2a24fd303cf1367.js} +0 -0
- /package/dist/src/web/nextui/_next/static/chunks/app/eval/{page-5439c164205bd74d.js → page-19730873b1e61513.js} +0 -0
package/dist/src/web/nextui/_next/static/chunks/{952-b674b8ee77cfa5c7.js → 952-1367984f076e3060.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[952],{2810:function(e,t,s){"use strict";let n;async function l(){if(!n){let e=await fetch("/api/config"),t=await e.json();n=t.apiBaseUrl}return n}s.d(t,{b:function(){return l}})},9952:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return eA}});var n=s(7437),l=s(2265),r=s(2130),i=s(6882),a=s(3388),o=s(4033),c=s(3082),d=s(8440),u=s(6507),h=s(5551),p=s(7760),m=s(3391),x=s(4081),j=s(3226),g=s(819),f=s(8212),v=s(5507),b=s(923),y=s(654),Z=s(3295),C=s(2467),k=s(3457),S=s(1975),w=s(8276),N=s(9605),R=s(9190),P=s(2053),E=s(6704),O=s(9394),F=s(1797),T=s(6337),I=s(1101),L=s(9872),M=s(2653),D=s(3533),A=s(4740),U=s(4660);let _=(0,U.Ue)(e=>({filePath:null,setFilePath:t=>e(()=>({filePath:t})),table:null,setTable:t=>e(()=>({table:t})),config:null,setConfig:t=>e(()=>({config:t})),maxTextLength:250,setMaxTextLength:t=>e(()=>({maxTextLength:t})),wordBreak:"break-word",setWordBreak:t=>e(()=>({wordBreak:t})),showInferenceDetails:!0,setShowInferenceDetails:t=>e(()=>({showInferenceDetails:t})),renderMarkdown:!1,setRenderMarkdown:t=>e(()=>({renderMarkdown:t})),prettifyJson:!1,setPrettifyJson:t=>e(()=>({prettifyJson:t}))})),W=["#fd7f6f","#7eb0d5","#b2e061","#bd7ebe","#ffb55a","#ffee65","#beb9db","#fdcce5","#8bd3c7"];function V(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;r.current&&r.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=(Math.ceil(Math.max(...e))-Math.floor(n))/10,i=Array.from({length:11},(e,t)=>parseFloat((Math.floor(n)+t*l).toFixed(2))),a=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s].score),r=i.map(e=>n.filter(t=>t>=e&&t<e+l).length);return{label:"Prompt ".concat(s+1),data:r,backgroundColor:W[s%W.length]}});r.current=new E.kL(s.current,{type:"bar",data:{labels:i,datasets:a},options:{animation:!1,plugins:{title:{display:!0,text:"Score Distribution"},legend:{display:!1},tooltip:{callbacks:{title:function(e){let t=e[0].datasetIndex;return"Prompt ".concat(t+1)},label:function(e){let t=e.dataIndex,s=i[t],n=i[t+1];return n?"".concat(s," <= score < ").concat(n):"".concat(s," <= score")}}}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function z(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;r.current&&r.current.destroy();let e=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s]),l=n.filter(e=>e.pass).length,r=l/n.length*100;return{label:"Prompt ".concat(s+1),data:[r],backgroundColor:W[s%W.length]}});r.current=new E.kL(s.current,{type:"bar",data:{labels:["Pass Rate (%)"],datasets:e},options:{animation:!1,plugins:{title:{display:!0,text:"Pass rate"},legend:{display:!0}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function B(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null),[i,a]=(0,l.useState)(0),[o,c]=(0,l.useState)(1),[d,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!s.current)return;r.current&&r.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=Math.max(...e),a=t.body.map(e=>{let t=e.outputs[i].score,s=e.outputs[o].score;return{x:t,y:s,backgroundColor:s>t?"green":s<t?"red":"gray"}});r.current=new E.kL(s.current,{type:"scatter",data:{datasets:[{data:a,backgroundColor:a.map(e=>e.backgroundColor)},{type:"line",data:[{x:n,y:n},{x:l,y:l}],borderColor:"gray",borderWidth:1,borderDash:[5,5],pointRadius:0}]},options:{animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(e){let s=t.body[e.dataIndex],n=s.outputs[0].text,l=s.outputs[1].text;return n.length>30&&(n=n.substring(0,30)+"..."),l.length>30&&(l=l.substring(0,30)+"..."),"Output 1: ".concat(n,"\nOutput 2: ").concat(l)}}}},scales:{x:{title:{display:!0,text:"Prompt ".concat(i+1," Score")}},y:{title:{display:!0,text:"Prompt ".concat(o+1," Score")}}}}})},[t,i,o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(O.Z,{open:d,onClose:()=>u(!1),children:[(0,n.jsx)(F.Z,{children:"Compare prompt outputs"}),(0,n.jsxs)(T.Z,{children:[(0,n.jsx)(x.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(y.Z,{value:i,onChange:e=>a(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(v.Z,{value:t,children:["Prompt ",t+1]},t))})}),(0,n.jsx)(x.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(y.Z,{value:o,onChange:e=>c(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(v.Z,{value:t,children:["Prompt ",t+1]},t))})})]})]}),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px",cursor:"pointer"},onClick:()=>u(!0)})]})}function J(e){let{columnVisibility:t}=e,s=(0,I.Z)();E.kL.defaults.color="dark"===s.palette.mode?"#aaa":"#666";let[r,i]=(0,l.useState)(!0),{table:a}=_();if(!a||!r||a.head.prompts.length<2)return null;let o=a.body.flatMap(e=>e.outputs.map(e=>e.score));return 1===new Set(o).size?null:(0,n.jsx)(A.SV,{fallback:null,children:(0,n.jsxs)(L.Z,{style:{position:"relative",padding:s.spacing(3)},children:[(0,n.jsx)(M.Z,{style:{position:"absolute",right:0,top:0},onClick:()=>i(!1),children:(0,n.jsx)(D.Z,{})}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(z,{table:a})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(V,{table:a})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(B,{table:a})})]})]})})}E.kL.register(E.vn,E.ST,E.ho,E.uw,E.f$,E.ZL,E.jn,E.od,E.u,E.wL);var H=s(9116);s(5777);var G=s(3425),X=s(7660),q=s(3216),Y=s(182),$=s(5391),K=s(1396),Q=s.n(K);s(8715);var ee=e=>{let{lookup:t}=e;return t&&Object.keys(t).length?(0,n.jsx)("div",{className:"custom-metric-container",children:Object.entries(t).map(e=>{let[t,s]=e;return t&&s?(0,n.jsxs)("span",{children:[t,": ",s.toFixed(2)]},t):null})}):null},et=s(2834),es=s(5446),en=s(9329),el=s(4719),er=s(3701),ei=s(9279),ea=s(666),eo=s(5795),ec=s(6988),ed=s(4147);function eu(e){let{gradingResults:t}=e;return t?(0,n.jsxs)(u.Z,{mt:2,children:[(0,n.jsx)(j.Z,{variant:"subtitle1",children:"Assertions"}),(0,n.jsx)(eo.Z,{children:(0,n.jsxs)(er.Z,{children:[(0,n.jsx)(ec.Z,{children:(0,n.jsxs)(ed.Z,{children:[(0,n.jsx)(ea.Z,{style:{fontWeight:"bold"},children:"Pass"}),(0,n.jsx)(ea.Z,{style:{fontWeight:"bold"},children:"Score"}),(0,n.jsx)(ea.Z,{style:{fontWeight:"bold"},children:"Type"}),(0,n.jsx)(ea.Z,{style:{fontWeight:"bold"},children:"Value"}),(0,n.jsx)(ea.Z,{style:{fontWeight:"bold"},children:"Reason"})]})}),(0,n.jsx)(ei.Z,{children:t.map((e,t)=>{var s,l;return(0,n.jsxs)(ed.Z,{children:[(0,n.jsx)(ea.Z,{children:e.pass?"✅":"❌"}),(0,n.jsx)(ea.Z,{children:e.score.toFixed(2)}),(0,n.jsx)(ea.Z,{children:(null===(s=e.assertion)||void 0===s?void 0:s.type)||""}),(0,n.jsx)(ea.Z,{style:{whiteSpace:"pre-wrap"},children:(null===(l=e.assertion)||void 0===l?void 0:l.value)?String(e.assertion.value):"-"}),(0,n.jsx)(ea.Z,{style:{whiteSpace:"pre-wrap"},children:e.reason})]},t)})})]})})]}):null}function eh(e){let{open:t,onClose:s,prompt:r,provider:i,output:a,gradingResults:o}=e,[c,d]=(0,l.useState)(!1);(0,l.useEffect)(()=>{d(!1)},[r]);let p=async e=>{await navigator.clipboard.writeText(e),d(!0)};return(0,n.jsxs)(O.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,n.jsxs)(F.Z,{children:["Details",i&&": ".concat(i)]}),(0,n.jsxs)(T.Z,{children:[(0,n.jsxs)(u.Z,{mb:2,children:[(0,n.jsx)(j.Z,{variant:"subtitle1",style:{marginBottom:"1rem"},children:"Prompt"}),(0,n.jsx)(es.u,{readOnly:!0,value:r,style:{width:"100%",padding:"0.75rem"},maxRows:20}),(0,n.jsx)(M.Z,{onClick:()=>p(r),style:{position:"absolute",right:"10px",top:"10px"},children:c?(0,n.jsx)(el.Z,{}):(0,n.jsx)(en.Z,{})})]}),a&&(0,n.jsxs)(u.Z,{my:2,children:[(0,n.jsx)(j.Z,{variant:"subtitle1",style:{marginBottom:"1rem",marginTop:"1rem"},children:"Output"}),(0,n.jsx)(es.u,{readOnly:!0,maxRows:20,value:a,style:{width:"100%",padding:"0.75rem"}})]}),(0,n.jsx)(eu,{gradingResults:o})]}),(0,n.jsx)(et.Z,{children:(0,n.jsx)(h.Z,{onClick:s,children:"Close"})})]})}var ep=s(9396),em=s(4173),ex=function(){let e=(0,I.Z)(),[t,s]=l.useState(!1),r=()=>{s(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{textAlign:"center",marginTop:20,marginBottom:40},children:(0,n.jsx)(h.Z,{variant:"text",color:"primary",startIcon:(0,n.jsx)(ep.Z,{}),onClick:()=>{s(!0)},children:"Generate test cases"})}),(0,n.jsxs)(O.Z,{open:t,onClose:r,children:[(0,n.jsx)(F.Z,{children:"Run on Command Line"}),(0,n.jsx)(T.Z,{children:(0,n.jsxs)(em.Z,{children:[(0,n.jsx)("p",{children:"This feature is in beta. UI coming soon."}),(0,n.jsxs)("p",{children:["Run"," ",(0,n.jsx)(u.Z,{component:"code",sx:{backgroundColor:"dark"===e.palette.mode?"#424242":"#f0f0f0",padding:"2px 4px",borderRadius:"4px"},children:"promptfoo generate dataset"}),"to generate test cases on the command line."]})]})}),(0,n.jsx)(et.Z,{children:(0,n.jsx)(h.Z,{onClick:r,color:"primary",children:"Close"})})]})]})},ej=s(2810);function eg(e){return null===e||0===e||1===e?"":"(".concat(e.toFixed(2),")")}function ef(e){return"string"==typeof e||"number"==typeof e?e.toString().length:Array.isArray(e)?e.reduce((e,t)=>e+ef(t),0):l.isValidElement(e)&&e.props.children?l.Children.toArray(e.props.children).reduce((e,t)=>e+ef(t),0):0}function ev(e){let t,{text:s,maxLength:r}=e,[i,a]=l.useState(!0),o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("string"==typeof e||"number"==typeof e){let s=e.toString();return s.slice(0,r-t)}if(Array.isArray(e)){let s=[],n=t;for(let t of e){let e=ef(t);if(n+e>r){s.push(o(t,n));break}s.push(t),n+=e}return s}if(l.isValidElement(e)&&e.props.children){let s=ef(e.props.children);if(s>r-t)return l.cloneElement(e,{...e.props,children:o(e.props.children,t)})}return e};t=l.isValidElement(s)||"string"==typeof s?s:JSON.stringify(s);let c=i?o(t):t,d=ef(t)>r;return(0,n.jsxs)("div",{style:{cursor:d?"pointer":"normal"},onClick:()=>{a(!i)},children:[c,i&&ef(t)>r&&(0,n.jsx)("span",{children:"..."})]})}function eb(e){var t,s,r,i,a,o;let c,d,u,h,p,{output:m,maxTextLength:x,rowIndex:j,promptIndex:g,onRating:f,firstOutput:v,filterMode:b,searchText:y,showStats:Z}=e,{renderMarkdown:C,prettifyJson:k}=_(),[S,N]=l.useState(!1),[R,P]=l.useState(!1),E=()=>P(!R),O="string"==typeof m.text?m.text:JSON.stringify(m.text),F=[];if(O.startsWith("[IMAGE]")){let e=O.slice(7).trim();c=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("img",{loading:"lazy",src:e,alt:m.prompt,onClick:E}),R&&(0,n.jsx)("div",{className:"lightbox",onClick:E,children:(0,n.jsx)("img",{src:e,alt:m.prompt})})]})}else!m.pass&&O.includes("---")?O=(F=O.split("---")).slice(1).join("---"):F=[O];if("different"===b&&v){let e,t="string"==typeof v.text?v.text:JSON.stringify(v.text);t.includes("---")&&(t=t.split("---").slice(1).join("---"));try{JSON.parse(t),JSON.parse(O),e=(0,H.CT)(t,O)}catch(s){e=t.includes(". ")&&O.includes(". ")?(0,H.SY)(t,O):(0,H.NV)(t,O)}c=(0,n.jsx)(n.Fragment,{children:e.map((e,t)=>e.added?(0,n.jsx)("ins",{children:e.value},t):e.removed?(0,n.jsx)("del",{children:e.value},t):(0,n.jsx)("span",{children:e.value},t))})}if(y){let e;let t=RegExp(y,"gi"),s=[];for(;null!==(e=t.exec(O));)s.push({start:e.index,end:t.lastIndex}),t.lastIndex;c=(0,n.jsx)(n.Fragment,{children:s.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:O.substring(0,s[0].start)},"text-before"),s.map((e,t)=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"search-highlight",children:O.substring(e.start,e.end)},"match-"+t),(0,n.jsx)("span",{children:O.substring(e.end,s[t+1]?s[t+1].start:O.length)},"text-after-"+t)]}))]}):(0,n.jsx)("span",{children:O},"no-match")})}else if(C)c=(0,n.jsx)(G.U,{children:O});else if(k)try{c=(0,n.jsx)("pre",{children:JSON.stringify(JSON.parse(O),null,2)})}catch(e){}let T=e=>{var t;f(j,g,e,void 0,null===(t=m.gradingResult)||void 0===t?void 0:t.comment)},I=()=>{var e;let t=prompt("Comment:",(null===(e=m.gradingResult)||void 0===e?void 0:e.comment)||"");null!=t&&f(j,g,void 0,void 0,t)};if(null===(t=m.tokenUsage)||void 0===t?void 0:t.completion){u=(0,n.jsxs)("span",{children:[Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(m.latencyMs)," ms"]});let e=m.tokenUsage.completion/(m.latencyMs/1e3);h=(0,n.jsx)("span",{children:Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e)})}m.cost&&(p=(0,n.jsxs)("span",{children:["$",m.cost.toPrecision(2)]})),(null===(s=m.tokenUsage)||void 0===s?void 0:s.cached)?d=(0,n.jsxs)("span",{children:[Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(m.tokenUsage.cached)," ","(cached)"]}):(null===(r=m.tokenUsage)||void 0===r?void 0:r.total)&&(d=(0,n.jsx)("span",{children:Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(m.tokenUsage.total)}));let L=(null===(i=m.gradingResult)||void 0===i?void 0:i.comment)?(0,n.jsx)("div",{className:"comment",onClick:I,children:m.gradingResult.comment}):null,M=Z?(0,n.jsxs)("div",{className:"cell-detail",children:[d&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Tokens:"})," ",d]}),u&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Latency:"})," ",u]}),h&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Tokens/Sec:"})," ",h]}),p&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Cost:"})," ",p]})]}):null,D=(0,n.jsxs)("div",{className:"cell-actions",children:[m.prompt&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"action",onClick:()=>{N(!0)},children:(0,n.jsx)(w.Z,{title:"View ouput and test details",children:(0,n.jsx)("span",{children:"\uD83D\uDD0E"})})}),(0,n.jsx)(eh,{open:S,onClose:()=>{N(!1)},prompt:m.prompt,provider:m.provider,gradingResults:null===(a=m.gradingResult)||void 0===a?void 0:a.componentResults,output:O})]}),(0,n.jsx)("span",{className:"action",onClick:()=>T(!0),children:(0,n.jsx)(w.Z,{title:"Mark test passed (score 1.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4D"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>T(!1),children:(0,n.jsx)(w.Z,{title:"Mark test failed (score 0.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4E"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>{let e=prompt("Set test score (0.0 - 1.0):",String(m.score));if(null!==e){let s=parseFloat(e);if(!isNaN(s)&&s>=0&&s<=1){var t;f(j,g,void 0,s,null===(t=m.gradingResult)||void 0===t?void 0:t.comment)}else alert("Invalid score. Please enter a value between 0.0 and 1.0.")}},children:(0,n.jsx)(w.Z,{title:"Set test score",children:(0,n.jsx)("span",{children:"\uD83D\uDD22"})})}),(0,n.jsx)("span",{className:"action",onClick:I,children:(0,n.jsx)(w.Z,{title:"Edit comment",children:(0,n.jsx)("span",{children:"✏️"})})})]});return(0,n.jsxs)("div",{className:"cell",children:[m.pass?(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"status pass",children:[(0,n.jsxs)("div",{className:"pill",children:["PASS",(0,n.jsx)("span",{className:"score",children:eg(m.score)})]}),(0,n.jsx)(ee,{lookup:m.namedScores})]})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"status fail",children:[(0,n.jsxs)("div",{className:"pill",children:["FAIL",m.score>0?" ":"",(0,n.jsx)("span",{className:"score",children:eg(m.score)})]}),(0,n.jsx)(ee,{lookup:m.namedScores}),(0,n.jsx)("span",{className:"fail-reason",children:null===(o=F[0])||void 0===o?void 0:o.trim().split("\n").map((e,t)=>(0,n.jsxs)(l.Fragment,{children:[e,(0,n.jsx)("br",{})]},t))})]})}),(0,n.jsx)(ev,{text:c||O,maxLength:x}),L,M,D]})}function ey(e){let{text:t,maxLength:s,expandedText:r,resourceId:i,className:a}=e,[o,c]=l.useState(!1);return(0,n.jsxs)("div",{className:"".concat(a||""),children:[(0,n.jsx)(ev,{text:t,maxLength:s}),r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w.Z,{title:"View prompt",children:(0,n.jsx)("span",{className:"action",onClick:()=>{c(!0)},children:"\uD83D\uDD0E"})}),(0,n.jsx)(eh,{open:o,onClose:()=>{c(!1)},prompt:r}),i&&(0,n.jsx)(w.Z,{title:"View other evals and datasets for this prompt",children:(0,n.jsx)("span",{className:"action",children:(0,n.jsx)(Q(),{href:"/prompts/?id=".concat(i),target:"_blank",children:(0,n.jsx)($.Z,{fontSize:"small"})})})})]})]})}function eZ(e){let{maxTextLength:t,columnVisibility:s,wordBreak:i,filterMode:a,failureFilter:o,searchText:c,showStats:d,onFailureFilterToggle:u}=e,{filePath:h,table:m,setTable:x}=_();(0,r.Z)(m,"Table should be defined");let{head:j,body:g}=m,f=j.prompts.map((e,t)=>g.reduce((e,s)=>e+(s.outputs[t].pass?1:0),0)),v=j.prompts.map((e,t)=>g.reduce((e,s)=>{var n,l;return e+((null===(l=s.outputs[t].gradingResult)||void 0===l?void 0:null===(n=l.componentResults)||void 0===n?void 0:n.length)||0)},0)),b=j.prompts.map((e,t)=>g.reduce((e,s)=>{var n;let l=null===(n=s.outputs[t].gradingResult)||void 0===n?void 0:n.componentResults;return e+(l?l.filter(e=>e.pass).length:0)},0)),y=async(e,t,s,n,l)=>{let r=[...g],i={...r[e]},a=[...i.outputs],o=null!=s?s:a[t].pass,c=void 0===n?s?1:0:n||0;a[t].pass=o,a[t].score=c;let d={...a[t].gradingResult||{},pass:o,score:c,reason:"Manual result (overrides all other grading results)",comment:l,assertion:null};a[t].gradingResult=d,i.outputs=a,r[e]=i;let u={head:j,body:r};x(u);try{let e=await fetch("".concat(await (0,ej.b)(),"/api/eval/").concat(h),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({table:u})});if(!e.ok)throw Error("Network response was not ok")}catch(e){console.error("Failed to update table:",e)}},Z=f.reduce((e,t,s,n)=>t>n[e]?s:e,0),C=f[Z],k=(0,X.Cl)(),S=[];j.vars.length>0&&S.push(k.group({id:"vars",header:()=>(0,n.jsx)("span",{className:"font-bold",children:"Variables"}),columns:j.vars.map((e,s)=>k.accessor(e=>e.vars[s],{id:"Variable ".concat(s+1),header:()=>(0,n.jsx)(ey,{text:e,maxLength:t,className:"font-bold"}),cell:e=>(0,n.jsx)(ev,{text:e.getValue(),maxLength:t}),size:50}))})),S.push(k.group({id:"prompts",header:()=>(0,n.jsx)("span",{className:"font-bold",children:"Outputs"}),columns:j.prompts.map((e,s)=>k.accessor(e=>(function(e){if("string"==typeof e){let t=e.startsWith("[PASS]"),s=e;return e.startsWith("[PASS]")?s=s.slice(6):e.startsWith("[FAIL]")&&(s=s.slice(6)),{text:s,pass:t,score:t?1:0}}return e})(e.outputs[s]),{id:"Prompt ".concat(s+1),header:()=>{var l,r,i,c,h,m,x,y;let Z=f[s]&&g.length?(f[s]/g.length*100).toFixed(2):"0.00",k=f[s]===C&&0!==C,S="Prompt ".concat(s+1),w=o[S]||!1,N=d?(0,n.jsxs)("div",{className:"prompt-detail",children:[v[s]?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Asserts:"})," ",b[s],"/",v[s]," passed"]}):null,(null===(l=e.metrics)||void 0===l?void 0:l.totalLatencyMs)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Avg Latency:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.totalLatencyMs/g.length)," ","ms"]}):null,(null===(i=e.metrics)||void 0===i?void 0:null===(r=i.tokenUsage)||void 0===r?void 0:r.total)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Avg Tokens:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.total/g.length)]}):null,(null===(c=e.metrics)||void 0===c?void 0:c.totalLatencyMs)&&(null===(m=e.metrics)||void 0===m?void 0:null===(h=m.tokenUsage)||void 0===h?void 0:h.completion)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Tokens/Sec:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.completion/(e.metrics.totalLatencyMs/1e3))]}):null,(null===(x=e.metrics)||void 0===x?void 0:x.cost)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Cost:"})," $",e.metrics.cost.toPrecision(2)]}):null]}):null,R=j.prompts.every(e=>e.provider===j.prompts[0].provider),P=e.provider?e.provider.split(":"):[],E=P.length>1?(0,n.jsxs)(n.Fragment,{children:[P[0],":",(0,n.jsx)("strong",{children:P.slice(1).join(":")})]}):(0,n.jsx)("strong",{children:e.provider});return(0,n.jsxs)("div",{className:"output-header",children:[(0,n.jsxs)("div",{className:"pills",children:[!R&&e.provider?(0,n.jsx)("div",{className:"provider",children:E}):null,(0,n.jsx)("div",{className:"summary",children:(0,n.jsxs)("div",{className:"highlight ".concat(k?"success":""),children:[(0,n.jsxs)("strong",{children:[Z,"% passing"]})," (",f[s],"/",g.length," cases)"]})}),(null===(y=e.metrics)||void 0===y?void 0:y.namedScores)&&Object.keys(e.metrics.namedScores).length>0?(0,n.jsx)(ee,{lookup:e.metrics.namedScores}):null]}),(0,n.jsx)(ey,{className:"prompt-container",text:e.display,expandedText:e.raw,maxLength:t,resourceId:e.id}),N,"failures"===a&&(0,n.jsx)(Y.Z,{sx:{"& .MuiFormControlLabel-label":{fontSize:"0.75rem"}},control:(0,n.jsx)(p.Z,{checked:w,onChange:e=>u(S,e.target.checked)}),label:"Show failures"})]})},cell:e=>(0,n.jsx)(eb,{output:e.getValue(),maxTextLength:t,rowIndex:e.row.index,promptIndex:s,onRating:y,firstOutput:R[e.row.index].outputs[0],filterMode:a,searchText:c,showStats:d})}))}));let w=g.some(e=>e.description);w&&S.splice(0,0,{accessorFn:e=>e.description||"",id:"description",header:()=>(0,n.jsx)("span",{className:"font-bold",children:"Description"}),cell:e=>(0,n.jsx)(ev,{text:String(e.getValue()),maxLength:t}),size:50});let N=Object.keys(s).length>0,R=l.useMemo(()=>{let e=RegExp(c,"i");return g.filter(t=>{let n="failures"===a?t.outputs.some((e,t)=>{let n="Prompt ".concat(t+1);return o[n]&&!e.pass&&(!N||s[n])}):"different"!==a||!t.outputs.every(e=>e.text===t.outputs[0].text),l=!c||t.outputs.some(t=>{var s;let n="".concat(t.text," ").concat(Object.keys(t.namedScores)," ").concat(null===(s=t.gradingResult)||void 0===s?void 0:s.reason);return e.test(n)});return n&&l})},[g,o,a,c,s,N]),P=(0,q.b7)({data:R,columns:S,columnResizeMode:"onChange",getCoreRowModel:(0,X.sC)(),state:{columnVisibility:s}});return(0,n.jsxs)("div",{children:[(0,n.jsxs)("table",{className:"results-table firefox-fix ".concat(t<=25?"compact":""),style:{wordBreak:i},children:[(0,n.jsx)("thead",{children:P.getHeaderGroups().map(e=>(0,n.jsx)("tr",{className:"header",children:e.headers.map(e=>(0,n.jsxs)("th",{colSpan:e.colSpan,style:{width:e.getSize()},children:[e.isPlaceholder?null:(0,q.ie)(e.column.columnDef.header,e.getContext()),(0,n.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"resizer ".concat(e.column.getIsResizing()?"isResizing":"")})]},e.id))},e.id))}),(0,n.jsx)("tbody",{children:P.getRowModel().rows.map((e,t)=>{let s=!1;return(0,n.jsx)("tr",{children:e.getVisibleCells().map(e=>{let l=e.column.id.startsWith("Variable")||"description"===e.column.id,r=!l&&!s;return r&&(s=!0),(0,n.jsx)("td",{style:{width:e.column.getSize()},className:"".concat(l?"variable":""," ").concat(0!==t||l?"":"first-prompt-row"," ").concat(r?"first-prompt-col":""),children:(0,q.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)})})]}),(0,n.jsx)(ex,{})]})}s(2604);var eC=s(2481),ek=s(7175);function eS(e){let{open:t,onClose:r}=e,{config:i}=_(),a=l.useRef(null),[o,c]=l.useState(!1),[d,p]=l.useState("");l.useEffect(()=>{t&&(async()=>{let{default:e}=await s.e(339).then(s.bind(s,8339));p(e.dump(i))})()},[t,i]);let m=()=>{c(!1),r()};return(0,n.jsxs)(O.Z,{open:t,onClose:m,"aria-labelledby":"config-dialog-title",maxWidth:"md",fullWidth:!0,children:[(0,n.jsx)(F.Z,{id:"config-dialog-title",children:(0,n.jsxs)(u.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,n.jsx)(j.Z,{variant:"h6",style:{flexGrow:1},children:"Config"}),(0,n.jsxs)(u.Z,{children:[(0,n.jsx)(w.Z,{title:"Copy to clipboard",children:(0,n.jsx)(M.Z,{onClick:()=>{a.current&&(a.current.select(),document.execCommand("copy"),c(!0))},children:o?(0,n.jsx)(el.Z,{}):(0,n.jsx)(ek.Z,{})})}),(0,n.jsx)(w.Z,{title:"Download .yaml",children:(0,n.jsx)(M.Z,{onClick:()=>{let e=new Blob([d],{type:"text/yaml;charset=utf-8"}),t=URL.createObjectURL(e),s=document.createElement("a");s.href=t,s.download="config.yaml",document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(t)},children:(0,n.jsx)(eC.Z,{})})})]})]})}),(0,n.jsx)(T.Z,{children:(0,n.jsx)(j.Z,{variant:"body1",component:"div",children:(0,n.jsx)("textarea",{ref:a,readOnly:!0,value:d,style:{width:"100%",minHeight:"400px",fontFamily:"monospace",border:"1px solid #ccc"}})})}),(0,n.jsx)(et.Z,{children:(0,n.jsx)(h.Z,{onClick:m,color:"primary",children:"Close"})})]})}var ew=e=>{let{open:t,onClose:s,shareUrl:r}=e,i=(0,l.useRef)(null),[a,o]=(0,l.useState)(!1),c=()=>{s(),o(!1)};return(0,n.jsxs)(O.Z,{open:t,onClose:c,PaperProps:{style:{minWidth:"min(660px, 100%)"}},children:[(0,n.jsx)(F.Z,{children:"Your eval is ready to share"}),(0,n.jsxs)(T.Z,{children:[(0,n.jsx)(S.Z,{inputRef:i,value:r,fullWidth:!0,InputProps:{readOnly:!0,endAdornment:(0,n.jsx)(M.Z,{onClick:()=>{i.current&&(i.current.select(),document.execCommand("copy"),o(!0))},children:a?(0,n.jsx)(el.Z,{}):(0,n.jsx)(ek.Z,{})})}}),(0,n.jsx)(em.Z,{sx:{fontSize:"0.75rem"},children:"Shared URLs are deleted after 1 week."})]}),(0,n.jsx)(et.Z,{children:(0,n.jsx)(h.Z,{onClick:c,color:"primary",children:"Close"})})]})},eN=s(33),eR=e=>{let{open:t,onClose:s}=e,{maxTextLength:l,setMaxTextLength:r,wordBreak:i,setWordBreak:a,showInferenceDetails:o,setShowInferenceDetails:c,renderMarkdown:d,setRenderMarkdown:m,prettifyJson:x,setPrettifyJson:g}=_();return(0,n.jsxs)(O.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"sm",children:[(0,n.jsx)(F.Z,{children:"Table View Settings"}),(0,n.jsxs)(T.Z,{children:[(0,n.jsx)(u.Z,{children:(0,n.jsx)(w.Z,{title:"Forcing line breaks makes it easier to adjust column widths to your liking",children:(0,n.jsx)(Y.Z,{control:(0,n.jsx)(p.Z,{checked:"break-all"===i,onChange:e=>a(e.target.checked?"break-all":"break-word")}),label:"Force line breaks"})})}),(0,n.jsx)(u.Z,{children:(0,n.jsx)(Y.Z,{control:(0,n.jsx)(p.Z,{checked:d,onChange:e=>m(e.target.checked)}),label:"Render model outputs as Markdown"})}),(0,n.jsx)(u.Z,{children:(0,n.jsx)(Y.Z,{control:(0,n.jsx)(p.Z,{checked:x,onChange:e=>g(e.target.checked)}),label:"Prettify JSON outputs"})}),(0,n.jsx)(u.Z,{children:(0,n.jsx)(w.Z,{title:"Show detailed inference statistics such as latency, tokens used, cost, etc.",children:(0,n.jsx)(Y.Z,{control:(0,n.jsx)(p.Z,{checked:o,onChange:e=>c(e.target.checked)}),label:"Show inference details"})})}),(0,n.jsxs)(u.Z,{maxWidth:"sm",children:[(0,n.jsxs)(j.Z,{mt:2,children:["Max text length: ",l]}),(0,n.jsx)(eN.ZP,{min:25,max:1e3,value:l,onChange:(e,t)=>r(t)})]})]}),(0,n.jsx)(et.Z,{children:(0,n.jsx)(h.Z,{onClick:s,children:"Close"})})]})},eP=s(1938),eE=s(7580);let eO=eE.env.NEXT_PUBLIC_PROMPTFOO_REMOTE_API_BASE_URL||eE.env.PROMPTFOO_REMOTE_API_BASE_URL||"https://api.promptfoo.dev",eF=eE.env.NEXT_PUBLIC_PROMPTFOO_REMOTE_APP_BASE_URL||eE.env.PROMPTFOO_REMOTE_APP_BASE_URL||"https://app.promptfoo.dev";s(6911);let eT=(0,R.Z)(k.Z)(e=>{let{theme:t}=e;return{maxWidth:"100%",flexWrap:"wrap",[t.breakpoints.down("sm")]:{flexDirection:"column"}}});function eI(e){let{recentEvals:t,onRecentEvalSelected:s,defaultEvalId:a}=e,c=(0,o.useRouter)(),{table:k,config:R,maxTextLength:E,wordBreak:O,showInferenceDetails:F,filePath:T}=_(),{setStateFromConfig:I}=(0,eP.o)(),[L,M]=l.useState({}),[D,A]=l.useState([]),[U,W]=l.useState(""),[V]=(0,P.Nr)(U,1e3),[z,B]=l.useState({}),[H,G]=l.useState("all"),[X,q]=l.useState(!1),[Y,$]=l.useState(""),[K,Q]=l.useState(!1),ee=async()=>{Q(!0);try{let e=await fetch("".concat(eO,"/eval"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{version:2,createdAt:new Date().toISOString(),results:{table:k},config:R}})}),{id:t}=await e.json(),s="".concat(eF,"/eval/").concat(t);$(s),q(!0)}catch(e){alert("Sorry, something went wrong.")}finally{Q(!1)}},[et,es]=l.useState(!1),[en,el]=l.useState(!1);(0,r.Z)(k,"Table data must be loaded before rendering ResultsView");let{head:er}=k,ei=[...er.vars.map((e,t)=>({value:"Variable ".concat(t+1),label:"Var ".concat(t+1,": ").concat(er.vars[t].length>100?er.vars[t].slice(0,97)+"...":er.vars[t]),group:"Variables"})),...er.prompts.map((e,t)=>({value:"Prompt ".concat(t+1),label:"Prompt ".concat(t+1,": ").concat(er.prompts[t].display.length>100?er.prompts[t].display.slice(0,97)+"...":er.prompts[t].display),group:"Prompts"}))];return l.useEffect(()=>{A(ei.map(e=>e.value))},[er]),(0,n.jsxs)("div",{style:{marginLeft:"1rem",marginRight:"1rem"},children:[(null==R?void 0:R.description)&&(0,n.jsx)(u.Z,{mb:2,children:(0,n.jsxs)(j.Z,{variant:"h5",children:[R.description," ",(0,n.jsx)("span",{className:"description-filepath",children:T})]})}),(0,n.jsx)(u.Z,{py:"md",children:(0,n.jsxs)(eT,{direction:"row",spacing:4,alignItems:"center",children:[(0,n.jsx)(u.Z,{children:t&&t.length>0&&(0,n.jsx)(x.Z,{sx:{m:1,minWidth:200},size:"small",children:(0,n.jsx)(d.Z,{size:"small",options:t,renderOption:(e,t)=>(0,l.createElement)("li",{...e,key:t.id},t.label),style:{width:350},renderInput:e=>(0,n.jsx)(S.Z,{...e,label:"Eval run",variant:"outlined"}),defaultValue:t.find(e=>e.id===a)||t[0],onChange:(e,t)=>{t&&t.id&&s(t.id)},disableClearable:!0})})}),(0,n.jsx)(u.Z,{children:(0,n.jsxs)(x.Z,{sx:{m:1,minWidth:200,maxWidth:350},size:"small",children:[(0,n.jsx)(g.Z,{id:"visible-columns-label",children:"Columns"}),(0,n.jsx)(y.Z,{labelId:"visible-columns-label",id:"visible-columns",multiple:!0,value:D,onChange:e=>{let{target:{value:t}}=e;A("string"==typeof t?t.split(","):t);let s=[...er.vars.map((e,t)=>"Variable ".concat(t+1)),...er.prompts.map((e,t)=>"Prompt ".concat(t+1))],n={};s.forEach(e=>{n[e]=("string"==typeof t?t.split(","):t).includes(e)}),M(n)},input:(0,n.jsx)(b.Z,{label:"Visible columns"}),renderValue:e=>e.join(", "),children:ei.map(e=>(0,n.jsxs)(v.Z,{dense:!0,value:e.value,children:[(0,n.jsx)(p.Z,{checked:D.indexOf(e.value)>-1}),(0,n.jsx)(f.Z,{primary:e.label})]},e.value))})]})}),(0,n.jsx)(u.Z,{children:(0,n.jsxs)(x.Z,{sx:{minWidth:180},size:"small",children:[(0,n.jsx)(g.Z,{id:"failure-filter-mode-label",children:"Display"}),(0,n.jsxs)(y.Z,{labelId:"filter-mode-label",id:"filter-mode",value:H,onChange:e=>{let t=e.target.value;G(t);let s={};er.prompts.forEach((e,n)=>{s["Prompt ".concat(n+1)]="failures"===t}),B(s)},label:"Filter",children:[(0,n.jsx)(v.Z,{value:"all",children:"Show all results"}),(0,n.jsx)(v.Z,{value:"failures",children:"Show failures only"}),(0,n.jsx)(v.Z,{value:"different",children:"Show different only"})]})]})}),(0,n.jsx)(u.Z,{children:(0,n.jsx)(S.Z,{sx:{minWidth:180},size:"small",label:"Search",placeholder:"Text or regex",value:U,onChange:e=>{W(e.target.value)}})}),(0,n.jsx)(u.Z,{flexGrow:1}),(0,n.jsx)(u.Z,{display:"flex",justifyContent:"flex-end",children:(0,n.jsxs)(eT,{direction:"row",spacing:2,children:[(0,n.jsx)(w.Z,{title:"Edit table view settings",children:(0,n.jsx)(h.Z,{color:"primary",onClick:()=>el(!0),startIcon:(0,n.jsx)(Z.Z,{}),children:"Table Settings"})}),R&&(0,n.jsx)(w.Z,{title:"View the configuration that defines this eval",children:(0,n.jsx)(h.Z,{color:"primary",onClick:()=>es(!0),startIcon:(0,n.jsx)(N.Z,{}),children:"View YAML"})}),R&&(0,n.jsx)(w.Z,{title:"Edit eval",children:(0,n.jsx)(h.Z,{color:"primary",onClick:()=>{I(R),c.push("/setup/")},startIcon:(0,n.jsx)(m.Z,{}),children:"Edit Eval"})}),(null==R?void 0:R.sharing)&&(0,n.jsx)(w.Z,{title:"Generate a unique URL that others can access",children:(0,n.jsx)(h.Z,{color:"primary",onClick:ee,disabled:K,startIcon:K?(0,n.jsx)(i.Z,{size:16}):(0,n.jsx)(C.Z,{}),children:"Share"})})]})})]})}),(0,n.jsx)(J,{columnVisibility:L}),(0,n.jsx)(eZ,{maxTextLength:E,columnVisibility:L,wordBreak:O,showStats:F,filterMode:H,failureFilter:z,searchText:V,onFailureFilterToggle:(e,t)=>{B(s=>({...s,[e]:t}))}}),(0,n.jsx)(eS,{open:et,onClose:()=>es(!1)}),(0,n.jsx)(ew,{open:X,onClose:()=>q(!1),shareUrl:Y}),(0,n.jsx)(eR,{open:en,onClose:()=>el(!1)})]})}var eL=s(279);async function eM(){let e=(0,c.createClientComponentClient)(),{data:{user:t}}=await e.auth.getUser();(0,r.Z)(t,"User not logged in");let{data:s,error:n}=await e.from("EvaluationResult").select("id, createdAt").eq("user_id",t.id).order("createdAt",{ascending:!1}).limit(100);return s||[]}async function eD(e){let t=(0,c.createClientComponentClient)(),{data:s,error:n}=await t.from("EvaluationResult").select("*").eq("id",e).single();return s}function eA(e){var t;let{fetchId:s,preloadedData:c,recentEvals:d,defaultEvalId:u}=e,h=(0,o.useRouter)(),{table:p,setTable:m,setConfig:x,setFilePath:j}=_(),[g,f]=l.useState(!1),[v,b]=l.useState(!1),[y,Z]=l.useState(d||[]),C=async()=>{let e=await fetch("".concat(await (0,ej.b)(),"/results"),{cache:"no-store"}),t=await e.json();return Z(t.data),t.data},k=l.useCallback(async e=>{let t=await fetch("".concat(await (0,ej.b)(),"/results/").concat(e),{cache:"no-store"}),s=await t.json();m(s.data.results.table),x(s.data.config),j(e)},[m,x,j]),S=async e=>{eL.Ox?(f(!1),h.push("/eval/remote:".concat(encodeURIComponent(e)))):(k(e),h.push("/eval/?file=".concat(encodeURIComponent(e))))},[w,N]=l.useState(u||(null===(t=y[0])||void 0===t?void 0:t.id)),R=(0,o.useSearchParams)(),P=R?R.get("file"):null;return(l.useEffect(()=>{if(P){let e=async()=>{await k(P),f(!0),N(P),C()};e()}else if(c){var e;m(null===(e=c.data.results)||void 0===e?void 0:e.table),x(c.data.config),f(!0)}else if(s){let e=async()=>{var e;let t="".concat(eO,"/eval/").concat(s);console.log("Fetching eval from remote server",t);let n=await fetch(t);if(!n.ok){b(!0);return}let l=await n.json();m(null===(e=l.data.results)||void 0===e?void 0:e.table),x(l.data.config),f(!0)};e()}else if(eL.T8)(0,ej.b)().then(e=>{let t=(0,a.io)(e);return t.on("init",e=>{console.log("Initialized socket connection",e),f(!0),m(e.results.table),x(e.config),C().then(e=>{var t,s;N(null===(t=e[0])||void 0===t?void 0:t.id),j(null===(s=e[0])||void 0===s?void 0:s.id)})}),t.on("update",e=>{console.log("Received data update",e),m(e.results.table),x(e.config),C().then(e=>{var t;N(null===(t=e[0])||void 0===t?void 0:t.id)})}),()=>{t.disconnect()}});else if(eL.Ox)eM().then(e=>{Z(e.map(e=>({id:e.id,label:e.createdAt}))),e.length>0&&eD(e[0].id).then(t=>{(0,r.Z)(t,"Eval not found");let s=t.results,n=t.config;N(e[0].id),m(s.table),x(n),f(!0)})});else{let e=async()=>{let e=await C();if(!(e.length>0))return(0,n.jsx)("div",{className:"notice",children:"No evals yet. Share some evals to this server and they will appear here."});{let t=await (0,ej.b)(),s=e[0].id,n=await fetch("".concat(t,"/results/").concat(s)),l=await n.json();m(l.data.results.table),x(l.data.config),f(!0),N(s)}};e()}},[s,m,x,j,k,c,N,P]),v)?(0,n.jsx)("div",{className:"notice",children:"404 Eval not found"}):g&&p?(0,n.jsx)(eI,{defaultEvalId:w,recentEvals:y,onRecentEvalSelected:S}):(0,n.jsxs)("div",{className:"notice",children:[(0,n.jsx)("div",{children:(0,n.jsx)(i.Z,{size:22})}),(0,n.jsx)("div",{children:"Loading eval data"})]})}s(5038)},279:function(e,t,s){"use strict";s.d(t,{Ox:function(){return r},T8:function(){return l},eA:function(){return i}});var n=s(7580);let l=!n.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,r=!!n.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,i=""},1938:function(e,t,s){"use strict";s.d(t,{o:function(){return r}});var n=s(4660),l=s(4810);let r=(0,n.Ue)()((0,l.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setStateFromConfig:t=>{let s={};t.description&&(s.description=t.description||""),t.tests&&(s.testCases=t.tests),t.providers&&(s.providers=t.providers),t.prompts&&("string"==typeof t.prompts?s.prompts=[t.prompts]:Array.isArray(t.prompts)?s.prompts=t.prompts.filter(e=>!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),e(s)},getTestSuite:()=>{let{description:e,testCases:s,providers:n,prompts:l,env:r}=t();return{env:r,description:e,providers:n,prompts:l,tests:s}}}),{name:"promptfoo",skipHydration:!0}))},8715:function(){},5038:function(){},2604:function(){},6911:function(){},5777:function(){}}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[952],{2810:function(e,t,s){"use strict";let n;async function l(){if(!n){let e=await fetch("/api/config"),t=await e.json();n=t.apiBaseUrl}return n}s.d(t,{b:function(){return l}})},9952:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return eA}});var n=s(7437),l=s(2265),r=s(2130),i=s(6882),a=s(3388),o=s(4033),c=s(3082),d=s(8440),u=s(6507),p=s(5551),h=s(7760),m=s(3391),x=s(4081),j=s(3226),g=s(819),f=s(8212),v=s(5507),b=s(923),y=s(654),Z=s(3295),C=s(2467),k=s(3457),w=s(1975),S=s(8276),N=s(9605),R=s(9190),E=s(2053),P=s(6704),O=s(9394),F=s(1797),T=s(6337),I=s(1101),L=s(9872),M=s(2653),D=s(3533),A=s(4740),U=s(4660);let _=(0,U.Ue)(e=>({filePath:null,setFilePath:t=>e(()=>({filePath:t})),table:null,setTable:t=>e(()=>({table:t})),config:null,setConfig:t=>e(()=>({config:t})),maxTextLength:250,setMaxTextLength:t=>e(()=>({maxTextLength:t})),wordBreak:"break-word",setWordBreak:t=>e(()=>({wordBreak:t})),showInferenceDetails:!0,setShowInferenceDetails:t=>e(()=>({showInferenceDetails:t})),renderMarkdown:!1,setRenderMarkdown:t=>e(()=>({renderMarkdown:t})),prettifyJson:!1,setPrettifyJson:t=>e(()=>({prettifyJson:t}))})),W=["#fd7f6f","#7eb0d5","#b2e061","#bd7ebe","#ffb55a","#ffee65","#beb9db","#fdcce5","#8bd3c7"];function V(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;r.current&&r.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=(Math.ceil(Math.max(...e))-Math.floor(n))/10,i=Array.from({length:11},(e,t)=>parseFloat((Math.floor(n)+t*l).toFixed(2))),a=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s].score),r=i.map(e=>n.filter(t=>t>=e&&t<e+l).length);return{label:"Prompt ".concat(s+1),data:r,backgroundColor:W[s%W.length]}});r.current=new P.kL(s.current,{type:"bar",data:{labels:i,datasets:a},options:{animation:!1,plugins:{title:{display:!0,text:"Score Distribution"},legend:{display:!1},tooltip:{callbacks:{title:function(e){let t=e[0].datasetIndex;return"Prompt ".concat(t+1)},label:function(e){let t=e.dataIndex,s=i[t],n=i[t+1];return n?"".concat(s," <= score < ").concat(n):"".concat(s," <= score")}}}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function z(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;r.current&&r.current.destroy();let e=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s]),l=n.filter(e=>e.pass).length,r=l/n.length*100;return{label:"Prompt ".concat(s+1),data:[r],backgroundColor:W[s%W.length]}});r.current=new P.kL(s.current,{type:"bar",data:{labels:["Pass Rate (%)"],datasets:e},options:{animation:!1,plugins:{title:{display:!0,text:"Pass rate"},legend:{display:!0}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function B(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null),[i,a]=(0,l.useState)(0),[o,c]=(0,l.useState)(1),[d,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!s.current)return;r.current&&r.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=Math.max(...e),a=t.body.map(e=>{let t=e.outputs[i].score,s=e.outputs[o].score;return{x:t,y:s,backgroundColor:s>t?"green":s<t?"red":"gray"}});r.current=new P.kL(s.current,{type:"scatter",data:{datasets:[{data:a,backgroundColor:a.map(e=>e.backgroundColor)},{type:"line",data:[{x:n,y:n},{x:l,y:l}],borderColor:"gray",borderWidth:1,borderDash:[5,5],pointRadius:0}]},options:{animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(e){let s=t.body[e.dataIndex],n=s.outputs[0].text,l=s.outputs[1].text;return n.length>30&&(n=n.substring(0,30)+"..."),l.length>30&&(l=l.substring(0,30)+"..."),"Output 1: ".concat(n,"\nOutput 2: ").concat(l)}}}},scales:{x:{title:{display:!0,text:"Prompt ".concat(i+1," Score")}},y:{title:{display:!0,text:"Prompt ".concat(o+1," Score")}}}}})},[t,i,o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(O.Z,{open:d,onClose:()=>u(!1),children:[(0,n.jsx)(F.Z,{children:"Compare prompt outputs"}),(0,n.jsxs)(T.Z,{children:[(0,n.jsx)(x.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(y.Z,{value:i,onChange:e=>a(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(v.Z,{value:t,children:["Prompt ",t+1]},t))})}),(0,n.jsx)(x.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(y.Z,{value:o,onChange:e=>c(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(v.Z,{value:t,children:["Prompt ",t+1]},t))})})]})]}),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px",cursor:"pointer"},onClick:()=>u(!0)})]})}function J(e){let{columnVisibility:t}=e,s=(0,I.Z)();P.kL.defaults.color="dark"===s.palette.mode?"#aaa":"#666";let[r,i]=(0,l.useState)(!0),{table:a}=_();if(!a||!r||a.head.prompts.length<2)return null;let o=a.body.flatMap(e=>e.outputs.map(e=>e.score));return 1===new Set(o).size?null:(0,n.jsx)(A.SV,{fallback:null,children:(0,n.jsxs)(L.Z,{style:{position:"relative",padding:s.spacing(3)},children:[(0,n.jsx)(M.Z,{style:{position:"absolute",right:0,top:0},onClick:()=>i(!1),children:(0,n.jsx)(D.Z,{})}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(z,{table:a})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(V,{table:a})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(B,{table:a})})]})]})})}P.kL.register(P.vn,P.ST,P.ho,P.uw,P.f$,P.ZL,P.jn,P.od,P.u,P.wL);var H=s(9116);s(5777);var G=s(3425),X=s(7660),q=s(3216),Y=s(182),$=s(5391),K=s(1396),Q=s.n(K);s(8715);var ee=e=>{let{lookup:t}=e;return t&&Object.keys(t).length?(0,n.jsx)("div",{className:"custom-metric-container",children:Object.entries(t).map(e=>{let[t,s]=e;return t&&s?(0,n.jsxs)("span",{children:[t,": ",s.toFixed(2)]},t):null})}):null},et=s(2834),es=s(5446),en=s(9329),el=s(4719),er=s(3701),ei=s(9279),ea=s(666),eo=s(5795),ec=s(6988),ed=s(4147);function eu(e){let{gradingResults:t}=e;return t?(0,n.jsxs)(u.Z,{mt:2,children:[(0,n.jsx)(j.Z,{variant:"subtitle1",children:"Assertions"}),(0,n.jsx)(eo.Z,{children:(0,n.jsxs)(er.Z,{children:[(0,n.jsx)(ec.Z,{children:(0,n.jsxs)(ed.Z,{children:[(0,n.jsx)(ea.Z,{style:{fontWeight:"bold"},children:"Pass"}),(0,n.jsx)(ea.Z,{style:{fontWeight:"bold"},children:"Score"}),(0,n.jsx)(ea.Z,{style:{fontWeight:"bold"},children:"Type"}),(0,n.jsx)(ea.Z,{style:{fontWeight:"bold"},children:"Value"}),(0,n.jsx)(ea.Z,{style:{fontWeight:"bold"},children:"Reason"})]})}),(0,n.jsx)(ei.Z,{children:t.map((e,t)=>{var s,l;return(0,n.jsxs)(ed.Z,{children:[(0,n.jsx)(ea.Z,{children:e.pass?"✅":"❌"}),(0,n.jsx)(ea.Z,{children:e.score.toFixed(2)}),(0,n.jsx)(ea.Z,{children:(null===(s=e.assertion)||void 0===s?void 0:s.type)||""}),(0,n.jsx)(ea.Z,{style:{whiteSpace:"pre-wrap"},children:(null===(l=e.assertion)||void 0===l?void 0:l.value)?String(e.assertion.value):"-"}),(0,n.jsx)(ea.Z,{style:{whiteSpace:"pre-wrap"},children:e.reason})]},t)})})]})})]}):null}function ep(e){let{open:t,onClose:s,prompt:r,provider:i,output:a,gradingResults:o}=e,[c,d]=(0,l.useState)(!1);(0,l.useEffect)(()=>{d(!1)},[r]);let h=async e=>{await navigator.clipboard.writeText(e),d(!0)};return(0,n.jsxs)(O.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,n.jsxs)(F.Z,{children:["Details",i&&": ".concat(i)]}),(0,n.jsxs)(T.Z,{children:[(0,n.jsxs)(u.Z,{mb:2,children:[(0,n.jsx)(j.Z,{variant:"subtitle1",style:{marginBottom:"1rem"},children:"Prompt"}),(0,n.jsx)(es.u,{readOnly:!0,value:r,style:{width:"100%",padding:"0.75rem"},maxRows:20}),(0,n.jsx)(M.Z,{onClick:()=>h(r),style:{position:"absolute",right:"10px",top:"10px"},children:c?(0,n.jsx)(el.Z,{}):(0,n.jsx)(en.Z,{})})]}),a&&(0,n.jsxs)(u.Z,{my:2,children:[(0,n.jsx)(j.Z,{variant:"subtitle1",style:{marginBottom:"1rem",marginTop:"1rem"},children:"Output"}),(0,n.jsx)(es.u,{readOnly:!0,maxRows:20,value:a,style:{width:"100%",padding:"0.75rem"}})]}),(0,n.jsx)(eu,{gradingResults:o})]}),(0,n.jsx)(et.Z,{children:(0,n.jsx)(p.Z,{onClick:s,children:"Close"})})]})}var eh=s(9396),em=s(4173),ex=function(){let e=(0,I.Z)(),[t,s]=l.useState(!1),r=()=>{s(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{textAlign:"center",marginTop:20,marginBottom:40},children:(0,n.jsx)(p.Z,{variant:"text",color:"primary",startIcon:(0,n.jsx)(eh.Z,{}),onClick:()=>{s(!0)},children:"Generate test cases"})}),(0,n.jsxs)(O.Z,{open:t,onClose:r,children:[(0,n.jsx)(F.Z,{children:"Run on Command Line"}),(0,n.jsx)(T.Z,{children:(0,n.jsxs)(em.Z,{children:[(0,n.jsx)("p",{children:"This feature is in beta. UI coming soon."}),(0,n.jsxs)("p",{children:["Run"," ",(0,n.jsx)(u.Z,{component:"code",sx:{backgroundColor:"dark"===e.palette.mode?"#424242":"#f0f0f0",padding:"2px 4px",borderRadius:"4px"},children:"promptfoo generate dataset"}),"to generate test cases on the command line."]})]})}),(0,n.jsx)(et.Z,{children:(0,n.jsx)(p.Z,{onClick:r,color:"primary",children:"Close"})})]})]})},ej=s(2810);function eg(e){return null===e||0===e||1===e?"":"(".concat(e.toFixed(2),")")}function ef(e){return"string"==typeof e||"number"==typeof e?e.toString().length:Array.isArray(e)?e.reduce((e,t)=>e+ef(t),0):l.isValidElement(e)&&e.props.children?l.Children.toArray(e.props.children).reduce((e,t)=>e+ef(t),0):0}function ev(e){let t,{text:s,maxLength:r}=e,[i,a]=l.useState(!0),o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("string"==typeof e||"number"==typeof e){let s=e.toString();return s.slice(0,r-t)}if(Array.isArray(e)){let s=[],n=t;for(let t of e){let e=ef(t);if(n+e>r){s.push(o(t,n));break}s.push(t),n+=e}return s}if(l.isValidElement(e)&&e.props.children){let s=ef(e.props.children);if(s>r-t)return l.cloneElement(e,{...e.props,children:o(e.props.children,t)})}return e};t=l.isValidElement(s)||"string"==typeof s?s:JSON.stringify(s);let c=i?o(t):t,d=ef(t)>r;return(0,n.jsxs)("div",{style:{cursor:d?"pointer":"normal"},onClick:()=>{a(!i)},children:[c,i&&ef(t)>r&&(0,n.jsx)("span",{children:"..."})]})}function eb(e){var t,s,r,i,a,o;let c,d,u,p,h,{output:m,maxTextLength:x,rowIndex:j,promptIndex:g,onRating:f,firstOutput:v,filterMode:b,searchText:y,showStats:Z}=e,{renderMarkdown:C,prettifyJson:k}=_(),[w,N]=l.useState(!1),[R,E]=l.useState(!1),P=()=>E(!R),O="string"==typeof m.text?m.text:JSON.stringify(m.text),F=[];if(O.startsWith("[IMAGE]")){let e=O.slice(7).trim();c=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("img",{loading:"lazy",src:e,alt:m.prompt,onClick:P}),R&&(0,n.jsx)("div",{className:"lightbox",onClick:P,children:(0,n.jsx)("img",{src:e,alt:m.prompt})})]})}else!m.pass&&O.includes("---")?O=(F=O.split("---")).slice(1).join("---"):F=[O];if("different"===b&&v){let e,t="string"==typeof v.text?v.text:JSON.stringify(v.text);t.includes("---")&&(t=t.split("---").slice(1).join("---"));try{JSON.parse(t),JSON.parse(O),e=(0,H.CT)(t,O)}catch(s){e=t.includes(". ")&&O.includes(". ")?(0,H.SY)(t,O):(0,H.NV)(t,O)}c=(0,n.jsx)(n.Fragment,{children:e.map((e,t)=>e.added?(0,n.jsx)("ins",{children:e.value},t):e.removed?(0,n.jsx)("del",{children:e.value},t):(0,n.jsx)("span",{children:e.value},t))})}if(y){let e;let t=RegExp(y,"gi"),s=[];for(;null!==(e=t.exec(O));)s.push({start:e.index,end:t.lastIndex}),t.lastIndex;c=(0,n.jsx)(n.Fragment,{children:s.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:O.substring(0,s[0].start)},"text-before"),s.map((e,t)=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"search-highlight",children:O.substring(e.start,e.end)},"match-"+t),(0,n.jsx)("span",{children:O.substring(e.end,s[t+1]?s[t+1].start:O.length)},"text-after-"+t)]}))]}):(0,n.jsx)("span",{children:O},"no-match")})}else if(C)c=(0,n.jsx)(G.U,{children:O});else if(k)try{c=(0,n.jsx)("pre",{children:JSON.stringify(JSON.parse(O),null,2)})}catch(e){}let T=e=>{var t;f(j,g,e,void 0,null===(t=m.gradingResult)||void 0===t?void 0:t.comment)},I=()=>{var e;let t=prompt("Comment:",(null===(e=m.gradingResult)||void 0===e?void 0:e.comment)||"");null!=t&&f(j,g,void 0,void 0,t)};if(null===(t=m.tokenUsage)||void 0===t?void 0:t.completion){u=(0,n.jsxs)("span",{children:[Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(m.latencyMs)," ms"]});let e=m.tokenUsage.completion/(m.latencyMs/1e3);p=(0,n.jsx)("span",{children:Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e)})}m.cost&&(h=(0,n.jsxs)("span",{children:["$",m.cost.toPrecision(2)]})),(null===(s=m.tokenUsage)||void 0===s?void 0:s.cached)?d=(0,n.jsxs)("span",{children:[Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(m.tokenUsage.cached)," ","(cached)"]}):(null===(r=m.tokenUsage)||void 0===r?void 0:r.total)&&(d=(0,n.jsx)("span",{children:Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(m.tokenUsage.total)}));let L=(null===(i=m.gradingResult)||void 0===i?void 0:i.comment)?(0,n.jsx)("div",{className:"comment",onClick:I,children:m.gradingResult.comment}):null,M=Z?(0,n.jsxs)("div",{className:"cell-detail",children:[d&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Tokens:"})," ",d]}),u&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Latency:"})," ",u]}),p&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Tokens/Sec:"})," ",p]}),h&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Cost:"})," ",h]})]}):null,D=(0,n.jsxs)("div",{className:"cell-actions",children:[m.prompt&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"action",onClick:()=>{N(!0)},children:(0,n.jsx)(S.Z,{title:"View ouput and test details",children:(0,n.jsx)("span",{children:"\uD83D\uDD0E"})})}),(0,n.jsx)(ep,{open:w,onClose:()=>{N(!1)},prompt:m.prompt,provider:m.provider,gradingResults:null===(a=m.gradingResult)||void 0===a?void 0:a.componentResults,output:O})]}),(0,n.jsx)("span",{className:"action",onClick:()=>T(!0),children:(0,n.jsx)(S.Z,{title:"Mark test passed (score 1.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4D"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>T(!1),children:(0,n.jsx)(S.Z,{title:"Mark test failed (score 0.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4E"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>{let e=prompt("Set test score (0.0 - 1.0):",String(m.score));if(null!==e){let s=parseFloat(e);if(!isNaN(s)&&s>=0&&s<=1){var t;f(j,g,void 0,s,null===(t=m.gradingResult)||void 0===t?void 0:t.comment)}else alert("Invalid score. Please enter a value between 0.0 and 1.0.")}},children:(0,n.jsx)(S.Z,{title:"Set test score",children:(0,n.jsx)("span",{children:"\uD83D\uDD22"})})}),(0,n.jsx)("span",{className:"action",onClick:I,children:(0,n.jsx)(S.Z,{title:"Edit comment",children:(0,n.jsx)("span",{children:"✏️"})})})]});return(0,n.jsxs)("div",{className:"cell",children:[m.pass?(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"status pass",children:[(0,n.jsxs)("div",{className:"pill",children:["PASS",(0,n.jsx)("span",{className:"score",children:eg(m.score)})]}),(0,n.jsx)(ee,{lookup:m.namedScores})]})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"status fail",children:[(0,n.jsxs)("div",{className:"pill",children:["FAIL",m.score>0?" ":"",(0,n.jsx)("span",{className:"score",children:eg(m.score)})]}),(0,n.jsx)(ee,{lookup:m.namedScores}),(0,n.jsx)("span",{className:"fail-reason",children:null===(o=F[0])||void 0===o?void 0:o.trim().split("\n").map((e,t)=>(0,n.jsxs)(l.Fragment,{children:[e,(0,n.jsx)("br",{})]},t))})]})}),(0,n.jsx)(ev,{text:c||O,maxLength:x}),L,M,D]})}function ey(e){let{text:t,maxLength:s,expandedText:r,resourceId:i,className:a}=e,[o,c]=l.useState(!1);return(0,n.jsxs)("div",{className:"".concat(a||""),children:[(0,n.jsx)(ev,{text:t,maxLength:s}),r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(S.Z,{title:"View prompt",children:(0,n.jsx)("span",{className:"action",onClick:()=>{c(!0)},children:"\uD83D\uDD0E"})}),(0,n.jsx)(ep,{open:o,onClose:()=>{c(!1)},prompt:r}),i&&(0,n.jsx)(S.Z,{title:"View other evals and datasets for this prompt",children:(0,n.jsx)("span",{className:"action",children:(0,n.jsx)(Q(),{href:"/prompts/?id=".concat(i),target:"_blank",children:(0,n.jsx)($.Z,{fontSize:"small"})})})})]})]})}function eZ(e){let{maxTextLength:t,columnVisibility:s,wordBreak:i,filterMode:a,failureFilter:o,searchText:c,showStats:d,onFailureFilterToggle:u}=e,{filePath:p,table:m,setTable:x}=_();(0,r.Z)(m,"Table should be defined");let{head:j,body:g}=m,f=j.prompts.map((e,t)=>g.reduce((e,s)=>e+(s.outputs[t].pass?1:0),0)),v=j.prompts.map((e,t)=>g.reduce((e,s)=>{var n,l;return e+((null===(l=s.outputs[t].gradingResult)||void 0===l?void 0:null===(n=l.componentResults)||void 0===n?void 0:n.length)||0)},0)),b=j.prompts.map((e,t)=>g.reduce((e,s)=>{var n;let l=null===(n=s.outputs[t].gradingResult)||void 0===n?void 0:n.componentResults;return e+(l?l.filter(e=>e.pass).length:0)},0)),y=async(e,t,s,n,l)=>{let r=[...g],i={...r[e]},a=[...i.outputs],o=null!=s?s:a[t].pass,c=void 0===n?s?1:0:n||0;a[t].pass=o,a[t].score=c;let d={...a[t].gradingResult||{},pass:o,score:c,reason:"Manual result (overrides all other grading results)",comment:l,assertion:null};a[t].gradingResult=d,i.outputs=a,r[e]=i;let u={head:j,body:r};x(u);try{let e=await fetch("".concat(await (0,ej.b)(),"/api/eval/").concat(p),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({table:u})});if(!e.ok)throw Error("Network response was not ok")}catch(e){console.error("Failed to update table:",e)}},Z=f.reduce((e,t,s,n)=>t>n[e]?s:e,0),C=f[Z],k=(0,X.Cl)(),w=[];j.vars.length>0&&w.push(k.group({id:"vars",header:()=>(0,n.jsx)("span",{className:"font-bold",children:"Variables"}),columns:j.vars.map((e,s)=>k.accessor(e=>e.vars[s],{id:"Variable ".concat(s+1),header:()=>(0,n.jsx)(ey,{text:e,maxLength:t,className:"font-bold"}),cell:e=>(0,n.jsx)(ev,{text:e.getValue(),maxLength:t}),size:50}))})),w.push(k.group({id:"prompts",header:()=>(0,n.jsx)("span",{className:"font-bold",children:"Outputs"}),columns:j.prompts.map((e,s)=>k.accessor(e=>(function(e){if("string"==typeof e){let t=e.startsWith("[PASS]"),s=e;return e.startsWith("[PASS]")?s=s.slice(6):e.startsWith("[FAIL]")&&(s=s.slice(6)),{text:s,pass:t,score:t?1:0}}return e})(e.outputs[s]),{id:"Prompt ".concat(s+1),header:()=>{var l,r,i,c,p,m,x,y;let Z=f[s]&&g.length?(f[s]/g.length*100).toFixed(2):"0.00",k=f[s]===C&&0!==C,w="Prompt ".concat(s+1),S=o[w]||!1,N=d?(0,n.jsxs)("div",{className:"prompt-detail",children:[v[s]?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Asserts:"})," ",b[s],"/",v[s]," passed"]}):null,(null===(l=e.metrics)||void 0===l?void 0:l.totalLatencyMs)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Avg Latency:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.totalLatencyMs/g.length)," ","ms"]}):null,(null===(i=e.metrics)||void 0===i?void 0:null===(r=i.tokenUsage)||void 0===r?void 0:r.total)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Avg Tokens:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.total/g.length)]}):null,(null===(c=e.metrics)||void 0===c?void 0:c.totalLatencyMs)&&(null===(m=e.metrics)||void 0===m?void 0:null===(p=m.tokenUsage)||void 0===p?void 0:p.completion)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Tokens/Sec:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.completion/(e.metrics.totalLatencyMs/1e3))]}):null,(null===(x=e.metrics)||void 0===x?void 0:x.cost)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Cost:"})," $",e.metrics.cost.toPrecision(2)]}):null]}):null,R=j.prompts.every(e=>e.provider===j.prompts[0].provider),E=e.provider?e.provider.split(":"):[],P=E.length>1?(0,n.jsxs)(n.Fragment,{children:[E[0],":",(0,n.jsx)("strong",{children:E.slice(1).join(":")})]}):(0,n.jsx)("strong",{children:e.provider});return(0,n.jsxs)("div",{className:"output-header",children:[(0,n.jsxs)("div",{className:"pills",children:[!R&&e.provider?(0,n.jsx)("div",{className:"provider",children:P}):null,(0,n.jsx)("div",{className:"summary",children:(0,n.jsxs)("div",{className:"highlight ".concat(k?"success":""),children:[(0,n.jsxs)("strong",{children:[Z,"% passing"]})," (",f[s],"/",g.length," cases)"]})}),(null===(y=e.metrics)||void 0===y?void 0:y.namedScores)&&Object.keys(e.metrics.namedScores).length>0?(0,n.jsx)(ee,{lookup:e.metrics.namedScores}):null]}),(0,n.jsx)(ey,{className:"prompt-container",text:e.display,expandedText:e.raw,maxLength:t,resourceId:e.id}),N,"failures"===a&&(0,n.jsx)(Y.Z,{sx:{"& .MuiFormControlLabel-label":{fontSize:"0.75rem"}},control:(0,n.jsx)(h.Z,{checked:S,onChange:e=>u(w,e.target.checked)}),label:"Show failures"})]})},cell:e=>(0,n.jsx)(eb,{output:e.getValue(),maxTextLength:t,rowIndex:e.row.index,promptIndex:s,onRating:y,firstOutput:R[e.row.index].outputs[0],filterMode:a,searchText:c,showStats:d})}))}));let S=g.some(e=>e.description);S&&w.splice(0,0,{accessorFn:e=>e.description||"",id:"description",header:()=>(0,n.jsx)("span",{className:"font-bold",children:"Description"}),cell:e=>(0,n.jsx)(ev,{text:String(e.getValue()),maxLength:t}),size:50});let N=Object.keys(s).length>0,R=l.useMemo(()=>{let e=RegExp(c,"i");return g.filter(t=>{let n="failures"===a?t.outputs.some((e,t)=>{let n="Prompt ".concat(t+1);return o[n]&&!e.pass&&(!N||s[n])}):"different"!==a||!t.outputs.every(e=>e.text===t.outputs[0].text),l=!c||t.outputs.some(t=>{var s;let n="".concat(t.text," ").concat(Object.keys(t.namedScores)," ").concat(null===(s=t.gradingResult)||void 0===s?void 0:s.reason);return e.test(n)});return n&&l})},[g,o,a,c,s,N]),E=(0,q.b7)({data:R,columns:w,columnResizeMode:"onChange",getCoreRowModel:(0,X.sC)(),state:{columnVisibility:s}});return(0,n.jsxs)("div",{children:[(0,n.jsxs)("table",{className:"results-table firefox-fix ".concat(t<=25?"compact":""),style:{wordBreak:i},children:[(0,n.jsx)("thead",{children:E.getHeaderGroups().map(e=>(0,n.jsx)("tr",{className:"header",children:e.headers.map(e=>(0,n.jsxs)("th",{colSpan:e.colSpan,style:{width:e.getSize()},children:[e.isPlaceholder?null:(0,q.ie)(e.column.columnDef.header,e.getContext()),(0,n.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"resizer ".concat(e.column.getIsResizing()?"isResizing":"")})]},e.id))},e.id))}),(0,n.jsx)("tbody",{children:E.getRowModel().rows.map((e,t)=>{let s=!1;return(0,n.jsx)("tr",{children:e.getVisibleCells().map(e=>{let l=e.column.id.startsWith("Variable")||"description"===e.column.id,r=!l&&!s;return r&&(s=!0),(0,n.jsx)("td",{style:{width:e.column.getSize()},className:"".concat(l?"variable":""," ").concat(0!==t||l?"":"first-prompt-row"," ").concat(r?"first-prompt-col":""),children:(0,q.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)})})]}),(0,n.jsx)(ex,{})]})}s(2604);var eC=s(2481),ek=s(7175);function ew(e){let{open:t,onClose:r}=e,{config:i}=_(),a=l.useRef(null),[o,c]=l.useState(!1),[d,h]=l.useState("");l.useEffect(()=>{t&&(async()=>{let{default:e}=await s.e(339).then(s.bind(s,8339));h(e.dump(i))})()},[t,i]);let m=()=>{c(!1),r()};return(0,n.jsxs)(O.Z,{open:t,onClose:m,"aria-labelledby":"config-dialog-title",maxWidth:"md",fullWidth:!0,children:[(0,n.jsx)(F.Z,{id:"config-dialog-title",children:(0,n.jsxs)(u.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,n.jsx)(j.Z,{variant:"h6",style:{flexGrow:1},children:"Config"}),(0,n.jsxs)(u.Z,{children:[(0,n.jsx)(S.Z,{title:"Copy to clipboard",children:(0,n.jsx)(M.Z,{onClick:()=>{a.current&&(a.current.select(),document.execCommand("copy"),c(!0))},children:o?(0,n.jsx)(el.Z,{}):(0,n.jsx)(ek.Z,{})})}),(0,n.jsx)(S.Z,{title:"Download .yaml",children:(0,n.jsx)(M.Z,{onClick:()=>{let e=new Blob([d],{type:"text/yaml;charset=utf-8"}),t=URL.createObjectURL(e),s=document.createElement("a");s.href=t,s.download="config.yaml",document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(t)},children:(0,n.jsx)(eC.Z,{})})})]})]})}),(0,n.jsx)(T.Z,{children:(0,n.jsx)(j.Z,{variant:"body1",component:"div",children:(0,n.jsx)("textarea",{ref:a,readOnly:!0,value:d,style:{width:"100%",minHeight:"400px",fontFamily:"monospace",border:"1px solid #ccc"}})})}),(0,n.jsx)(et.Z,{children:(0,n.jsx)(p.Z,{onClick:m,color:"primary",children:"Close"})})]})}var eS=e=>{let{open:t,onClose:s,shareUrl:r}=e,i=(0,l.useRef)(null),[a,o]=(0,l.useState)(!1),c=()=>{s(),o(!1)};return(0,n.jsxs)(O.Z,{open:t,onClose:c,PaperProps:{style:{minWidth:"min(660px, 100%)"}},children:[(0,n.jsx)(F.Z,{children:"Your eval is ready to share"}),(0,n.jsxs)(T.Z,{children:[(0,n.jsx)(w.Z,{inputRef:i,value:r,fullWidth:!0,InputProps:{readOnly:!0,endAdornment:(0,n.jsx)(M.Z,{onClick:()=>{i.current&&(i.current.select(),document.execCommand("copy"),o(!0))},children:a?(0,n.jsx)(el.Z,{}):(0,n.jsx)(ek.Z,{})})}}),(0,n.jsx)(em.Z,{sx:{fontSize:"0.75rem"},children:"Shared URLs are deleted after 2 weeks."})]}),(0,n.jsx)(et.Z,{children:(0,n.jsx)(p.Z,{onClick:c,color:"primary",children:"Close"})})]})},eN=s(33),eR=e=>{let{open:t,onClose:s}=e,{maxTextLength:l,setMaxTextLength:r,wordBreak:i,setWordBreak:a,showInferenceDetails:o,setShowInferenceDetails:c,renderMarkdown:d,setRenderMarkdown:m,prettifyJson:x,setPrettifyJson:g}=_();return(0,n.jsxs)(O.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"sm",children:[(0,n.jsx)(F.Z,{children:"Table View Settings"}),(0,n.jsxs)(T.Z,{children:[(0,n.jsx)(u.Z,{children:(0,n.jsx)(S.Z,{title:"Forcing line breaks makes it easier to adjust column widths to your liking",children:(0,n.jsx)(Y.Z,{control:(0,n.jsx)(h.Z,{checked:"break-all"===i,onChange:e=>a(e.target.checked?"break-all":"break-word")}),label:"Force line breaks"})})}),(0,n.jsx)(u.Z,{children:(0,n.jsx)(Y.Z,{control:(0,n.jsx)(h.Z,{checked:d,onChange:e=>m(e.target.checked)}),label:"Render model outputs as Markdown"})}),(0,n.jsx)(u.Z,{children:(0,n.jsx)(Y.Z,{control:(0,n.jsx)(h.Z,{checked:x,onChange:e=>g(e.target.checked)}),label:"Prettify JSON outputs"})}),(0,n.jsx)(u.Z,{children:(0,n.jsx)(S.Z,{title:"Show detailed inference statistics such as latency, tokens used, cost, etc.",children:(0,n.jsx)(Y.Z,{control:(0,n.jsx)(h.Z,{checked:o,onChange:e=>c(e.target.checked)}),label:"Show inference details"})})}),(0,n.jsxs)(u.Z,{maxWidth:"sm",children:[(0,n.jsxs)(j.Z,{mt:2,children:["Max text length: ",l]}),(0,n.jsx)(eN.ZP,{min:25,max:1e3,value:l,onChange:(e,t)=>r(t)})]})]}),(0,n.jsx)(et.Z,{children:(0,n.jsx)(p.Z,{onClick:s,children:"Close"})})]})},eE=s(1938),eP=s(7580);let eO=eP.env.NEXT_PUBLIC_PROMPTFOO_REMOTE_API_BASE_URL||eP.env.PROMPTFOO_REMOTE_API_BASE_URL||"https://api.promptfoo.dev",eF=eP.env.NEXT_PUBLIC_PROMPTFOO_REMOTE_APP_BASE_URL||eP.env.PROMPTFOO_REMOTE_APP_BASE_URL||"https://app.promptfoo.dev";s(6911);let eT=(0,R.Z)(k.Z)(e=>{let{theme:t}=e;return{maxWidth:"100%",flexWrap:"wrap",[t.breakpoints.down("sm")]:{flexDirection:"column"}}});function eI(e){let{recentEvals:t,onRecentEvalSelected:s,defaultEvalId:a}=e,c=(0,o.useRouter)(),{table:k,config:R,setConfig:P,maxTextLength:O,wordBreak:F,showInferenceDetails:T,filePath:I}=_(),{setStateFromConfig:L}=(0,eE.o)(),[M,D]=l.useState({}),[A,U]=l.useState([]),[W,V]=l.useState(""),[z]=(0,E.Nr)(W,1e3),[B,H]=l.useState({}),[G,X]=l.useState("all"),[q,Y]=l.useState(!1),[$,K]=l.useState(""),[Q,ee]=l.useState(!1),et=async()=>{ee(!0);try{let e=await fetch("".concat(eO,"/api/eval"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{version:2,createdAt:new Date().toISOString(),results:{table:k},config:R}})}),{id:t}=await e.json(),s="".concat(eF,"/eval/").concat(t);K(s),Y(!0)}catch(e){alert("Sorry, something went wrong.")}finally{ee(!1)}},[es,en]=l.useState(!1),[el,er]=l.useState(!1);(0,r.Z)(k,"Table data must be loaded before rendering ResultsView");let{head:ei}=k,ea=async()=>{(0,r.Z)(R,"Config must be loaded before clicking its description");let e=window.prompt("Enter new description:",R.description);if(null!==e&&e!==R.description){let t={...R,description:e};try{let e=await fetch("".concat(await (0,ej.b)(),"/api/eval/").concat(I),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:t})});if(!e.ok)throw Error("Network response was not ok");P(t)}catch(e){console.error("Failed to update table:",e)}}},eo=[...ei.vars.map((e,t)=>({value:"Variable ".concat(t+1),label:"Var ".concat(t+1,": ").concat(ei.vars[t].length>100?ei.vars[t].slice(0,97)+"...":ei.vars[t]),group:"Variables"})),...ei.prompts.map((e,t)=>({value:"Prompt ".concat(t+1),label:"Prompt ".concat(t+1,": ").concat(ei.prompts[t].display.length>100?ei.prompts[t].display.slice(0,97)+"...":ei.prompts[t].display),group:"Prompts"}))];return l.useEffect(()=>{U(eo.map(e=>e.value))},[ei]),(0,n.jsxs)("div",{style:{marginLeft:"1rem",marginRight:"1rem"},children:[(null==R?void 0:R.description)&&(0,n.jsx)(u.Z,{mb:2,sx:{display:"flex",alignItems:"center"},children:(0,n.jsxs)(j.Z,{variant:"h5",sx:{flexGrow:1},children:[(0,n.jsx)("span",{className:"description",onClick:ea,children:R.description})," ",(0,n.jsx)("span",{className:"description-filepath",children:I})]})}),(0,n.jsx)(u.Z,{py:"md",children:(0,n.jsxs)(eT,{direction:"row",spacing:4,alignItems:"center",children:[(0,n.jsx)(u.Z,{children:t&&t.length>0&&(0,n.jsx)(x.Z,{sx:{m:1,minWidth:200},size:"small",children:(0,n.jsx)(d.Z,{size:"small",options:t,renderOption:(e,t)=>(0,l.createElement)("li",{...e,key:t.id},t.label),style:{width:350},renderInput:e=>(0,n.jsx)(w.Z,{...e,label:"Eval run",variant:"outlined"}),defaultValue:t.find(e=>e.id===a)||t[0],onChange:(e,t)=>{t&&t.id&&s(t.id)},disableClearable:!0})})}),(0,n.jsx)(u.Z,{children:(0,n.jsxs)(x.Z,{sx:{m:1,minWidth:200,maxWidth:350},size:"small",children:[(0,n.jsx)(g.Z,{id:"visible-columns-label",children:"Columns"}),(0,n.jsx)(y.Z,{labelId:"visible-columns-label",id:"visible-columns",multiple:!0,value:A,onChange:e=>{let{target:{value:t}}=e;U("string"==typeof t?t.split(","):t);let s=[...ei.vars.map((e,t)=>"Variable ".concat(t+1)),...ei.prompts.map((e,t)=>"Prompt ".concat(t+1))],n={};s.forEach(e=>{n[e]=("string"==typeof t?t.split(","):t).includes(e)}),D(n)},input:(0,n.jsx)(b.Z,{label:"Visible columns"}),renderValue:e=>e.join(", "),children:eo.map(e=>(0,n.jsxs)(v.Z,{dense:!0,value:e.value,children:[(0,n.jsx)(h.Z,{checked:A.indexOf(e.value)>-1}),(0,n.jsx)(f.Z,{primary:e.label})]},e.value))})]})}),(0,n.jsx)(u.Z,{children:(0,n.jsxs)(x.Z,{sx:{minWidth:180},size:"small",children:[(0,n.jsx)(g.Z,{id:"failure-filter-mode-label",children:"Display"}),(0,n.jsxs)(y.Z,{labelId:"filter-mode-label",id:"filter-mode",value:G,onChange:e=>{let t=e.target.value;X(t);let s={};ei.prompts.forEach((e,n)=>{s["Prompt ".concat(n+1)]="failures"===t}),H(s)},label:"Filter",children:[(0,n.jsx)(v.Z,{value:"all",children:"Show all results"}),(0,n.jsx)(v.Z,{value:"failures",children:"Show failures only"}),(0,n.jsx)(v.Z,{value:"different",children:"Show different only"})]})]})}),(0,n.jsx)(u.Z,{children:(0,n.jsx)(w.Z,{sx:{minWidth:180},size:"small",label:"Search",placeholder:"Text or regex",value:W,onChange:e=>{V(e.target.value)}})}),(0,n.jsx)(u.Z,{flexGrow:1}),(0,n.jsx)(u.Z,{display:"flex",justifyContent:"flex-end",children:(0,n.jsxs)(eT,{direction:"row",spacing:2,children:[(0,n.jsx)(S.Z,{title:"Edit table view settings",children:(0,n.jsx)(p.Z,{color:"primary",onClick:()=>er(!0),startIcon:(0,n.jsx)(Z.Z,{}),children:"Table Settings"})}),R&&(0,n.jsx)(S.Z,{title:"View the configuration that defines this eval",children:(0,n.jsx)(p.Z,{color:"primary",onClick:()=>en(!0),startIcon:(0,n.jsx)(N.Z,{}),children:"View YAML"})}),R&&(0,n.jsx)(S.Z,{title:"Edit eval",children:(0,n.jsx)(p.Z,{color:"primary",onClick:()=>{L(R),c.push("/setup/")},startIcon:(0,n.jsx)(m.Z,{}),children:"Edit Eval"})}),(null==R?void 0:R.sharing)&&(0,n.jsx)(S.Z,{title:"Generate a unique URL that others can access",children:(0,n.jsx)(p.Z,{color:"primary",onClick:et,disabled:Q,startIcon:Q?(0,n.jsx)(i.Z,{size:16}):(0,n.jsx)(C.Z,{}),children:"Share"})})]})})]})}),(0,n.jsx)(J,{columnVisibility:M}),(0,n.jsx)(eZ,{maxTextLength:O,columnVisibility:M,wordBreak:F,showStats:T,filterMode:G,failureFilter:B,searchText:z,onFailureFilterToggle:(e,t)=>{H(s=>({...s,[e]:t}))}}),(0,n.jsx)(ew,{open:es,onClose:()=>en(!1)}),(0,n.jsx)(eS,{open:q,onClose:()=>Y(!1),shareUrl:$}),(0,n.jsx)(eR,{open:el,onClose:()=>er(!1)})]})}var eL=s(279);async function eM(){let e=(0,c.createClientComponentClient)(),{data:{user:t}}=await e.auth.getUser();(0,r.Z)(t,"User not logged in");let{data:s,error:n}=await e.from("EvaluationResult").select("id, createdAt").eq("user_id",t.id).order("createdAt",{ascending:!1}).limit(100);return s||[]}async function eD(e){let t=(0,c.createClientComponentClient)(),{data:s,error:n}=await t.from("EvaluationResult").select("*").eq("id",e).single();return s}function eA(e){var t;let{fetchId:s,preloadedData:c,recentEvals:d,defaultEvalId:u}=e,p=(0,o.useRouter)(),{table:h,setTable:m,setConfig:x,setFilePath:j}=_(),[g,f]=l.useState(!1),[v,b]=l.useState(!1),[y,Z]=l.useState(d||[]),C=async()=>{let e=await fetch("".concat(await (0,ej.b)(),"/api/results"),{cache:"no-store"}),t=await e.json();return Z(t.data),t.data},k=l.useCallback(async e=>{let t=await fetch("".concat(await (0,ej.b)(),"/api/results/").concat(e),{cache:"no-store"}),s=await t.json();m(s.data.results.table),x(s.data.config),j(e)},[m,x,j]),w=async e=>{eL.Ox?(f(!1),p.push("/eval/remote:".concat(encodeURIComponent(e)))):(k(e),p.push("/eval/?file=".concat(encodeURIComponent(e))))},[S,N]=l.useState(u||(null===(t=y[0])||void 0===t?void 0:t.id)),R=(0,o.useSearchParams)(),E=R?R.get("file"):null;return(l.useEffect(()=>{if(E){let e=async()=>{await k(E),f(!0),N(E),C()};e()}else if(c){var e;m(null===(e=c.data.results)||void 0===e?void 0:e.table),x(c.data.config),f(!0)}else if(s){let e=async()=>{var e;let t="".concat(eO,"/api/eval/").concat(s);console.log("Fetching eval from remote server",t);let n=await fetch(t);if(!n.ok){b(!0);return}let l=await n.json();m(null===(e=l.data.results)||void 0===e?void 0:e.table),x(l.data.config),f(!0)};e()}else if(eL.T8)(0,ej.b)().then(e=>{let t=(0,a.io)(e);return t.on("init",e=>{console.log("Initialized socket connection",e),f(!0),m(e.results.table),x(e.config),C().then(e=>{var t,s;N(null===(t=e[0])||void 0===t?void 0:t.id),j(null===(s=e[0])||void 0===s?void 0:s.id)})}),t.on("update",e=>{console.log("Received data update",e),m(e.results.table),x(e.config),C().then(e=>{var t;N(null===(t=e[0])||void 0===t?void 0:t.id)})}),()=>{t.disconnect()}});else if(eL.Ox)eM().then(e=>{Z(e.map(e=>({id:e.id,label:e.createdAt}))),e.length>0&&eD(e[0].id).then(t=>{(0,r.Z)(t,"Eval not found");let s=t.results,n=t.config;N(e[0].id),m(s.table),x(n),f(!0)})});else{let e=async()=>{let e=await C();if(!(e.length>0))return(0,n.jsx)("div",{className:"notice",children:"No evals yet. Share some evals to this server and they will appear here."});{let t=await (0,ej.b)(),s=e[0].id,n=await fetch("".concat(t,"/api/results/").concat(s)),l=await n.json();m(l.data.results.table),x(l.data.config),f(!0),N(s),j(s)}};e()}},[s,m,x,j,k,c,N,E]),v)?(0,n.jsx)("div",{className:"notice",children:"404 Eval not found"}):g&&h?(0,n.jsx)(eI,{defaultEvalId:S,recentEvals:y,onRecentEvalSelected:w}):(0,n.jsxs)("div",{className:"notice",children:[(0,n.jsx)("div",{children:(0,n.jsx)(i.Z,{size:22})}),(0,n.jsx)("div",{children:"Loading eval data"})]})}s(5038)},279:function(e,t,s){"use strict";s.d(t,{Ox:function(){return r},T8:function(){return l},eA:function(){return i}});var n=s(7580);let l=!n.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,r=!!n.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,i=""},1938:function(e,t,s){"use strict";s.d(t,{o:function(){return r}});var n=s(4660),l=s(4810);let r=(0,n.Ue)()((0,l.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setStateFromConfig:t=>{let s={};t.description&&(s.description=t.description||""),t.tests&&(s.testCases=t.tests),t.providers&&(s.providers=t.providers),t.prompts&&("string"==typeof t.prompts?s.prompts=[t.prompts]:Array.isArray(t.prompts)?s.prompts=t.prompts.filter(e=>!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),e(s)},getTestSuite:()=>{let{description:e,testCases:s,providers:n,prompts:l,env:r}=t();return{env:r,description:e,providers:n,prompts:l,tests:s}}}),{name:"promptfoo",skipHydration:!0}))},8715:function(){},5038:function(){},2604:function(){},6911:function(){},5777:function(){}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{679:function(e,t,n){Promise.resolve().then(n.bind(n,2112)),Promise.resolve().then(n.t.bind(n,8384,23)),Promise.resolve().then(n.t.bind(n,2471,23))},2112:function(e,t,n){"use strict";n.r(t),n.d(t,{PageShell:function(){return Z}});var r=n(7437),s=n(2265),i=n(2135),o=n(606),a=n(5573),l=n(3571),u=n(1396),c=n.n(u),d=n(3457),h=n(4033),f=n(6691),m=n.n(f),x=n(6507);function g(){return(0,r.jsxs)(x.Z,{className:"logo",children:[(0,r.jsx)(m(),{width:25,height:25,src:"/logo.svg",alt:"Promptfoo logo"})," ",(0,r.jsx)("span",{children:"promptfoo"})]})}n(1320);var j=n(3283),p=n(3375),v=n(5507),b=n(2653);function E(){let{user:e,logout:t}=(0,l.aC)(),[n,i]=s.useState(null),o=async()=>{null==t||t(),a()},a=()=>{i(null)};return e?(0,r.jsxs)("div",{children:[(0,r.jsx)(b.Z,{edge:"end","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:e=>{i(e.currentTarget)},color:"inherit",children:(0,r.jsx)(j.Z,{sx:{width:"1em",height:"1em",bgcolor:"#1976d2"}})}),(0,r.jsxs)(p.Z,{id:"menu-appbar",anchorEl:n,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:!!n,onClose:a,children:[(0,r.jsxs)(v.Z,{disabled:!0,children:["Logged in as ",e.email]}),(0,r.jsx)(v.Z,{onClick:o,children:"Logout"})]})]}):(0,r.jsx)(c(),{href:"/auth/signup/",children:(0,r.jsx)(b.Z,{edge:"end","aria-label":"User not logged in","aria-controls":"menu-appbar","aria-haspopup":"true",color:"inherit",children:(0,r.jsx)(j.Z,{sx:{width:"1em",height:"1em"}})})})}var _=n(9864),k=n(7028);function N(e){let{darkMode:t,onToggleDarkMode:n}=e;return(0,r.jsx)("div",{className:"dark-mode-toggle",onClick:n,children:t?(0,r.jsx)(_.Z,{}):(0,r.jsx)(k.Z,{})})}n(2794);var O=n(279);n(5154);var C=n(7580);function P(e){let{href:t,label:n}=e,s=(0,h.usePathname)()||"";return(0,r.jsx)(c(),{href:t,className:s.startsWith(t)?"active":"",children:n})}function S(e){let{darkMode:t,onToggleDarkMode:n}=e;return C.env.NEXT_PUBLIC_NO_BROWSING?(0,r.jsxs)(d.Z,{direction:"row",spacing:2,className:"nav",children:[(0,r.jsx)(g,{}),(0,r.jsx)(N,{darkMode:t,onToggleDarkMode:n})]}):(0,r.jsxs)(d.Z,{direction:"row",spacing:2,className:"nav",children:[(0,r.jsx)(g,{}),(0,r.jsx)(P,{href:"/setup",label:"New Eval"}),(0,r.jsx)(P,{href:"/eval",label:"Evals"}),(0,r.jsx)(P,{href:"/prompts",label:"Prompts"}),(0,r.jsx)(P,{href:"/datasets",label:"Datasets"}),(0,r.jsxs)("div",{className:"right-aligned",children:[O.Ox?
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{679:function(e,t,n){Promise.resolve().then(n.bind(n,2112)),Promise.resolve().then(n.t.bind(n,8384,23)),Promise.resolve().then(n.t.bind(n,2471,23))},2112:function(e,t,n){"use strict";n.r(t),n.d(t,{PageShell:function(){return Z}});var r=n(7437),s=n(2265),i=n(2135),o=n(606),a=n(5573),l=n(3571),u=n(1396),c=n.n(u),d=n(3457),h=n(4033),f=n(6691),m=n.n(f),x=n(6507);function g(){return(0,r.jsxs)(x.Z,{className:"logo",children:[(0,r.jsx)(m(),{width:25,height:25,src:"/logo.svg",alt:"Promptfoo logo"})," ",(0,r.jsx)("span",{children:"promptfoo"})]})}n(1320);var j=n(3283),p=n(3375),v=n(5507),b=n(2653);function E(){let{user:e,logout:t}=(0,l.aC)(),[n,i]=s.useState(null),o=async()=>{null==t||t(),a()},a=()=>{i(null)};return e?(0,r.jsxs)("div",{children:[(0,r.jsx)(b.Z,{edge:"end","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:e=>{i(e.currentTarget)},color:"inherit",children:(0,r.jsx)(j.Z,{sx:{width:"1em",height:"1em",bgcolor:"#1976d2"}})}),(0,r.jsxs)(p.Z,{id:"menu-appbar",anchorEl:n,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:!!n,onClose:a,children:[(0,r.jsxs)(v.Z,{disabled:!0,children:["Logged in as ",e.email]}),(0,r.jsx)(v.Z,{onClick:o,children:"Logout"})]})]}):(0,r.jsx)(c(),{href:"/auth/signup/",children:(0,r.jsx)(b.Z,{edge:"end","aria-label":"User not logged in","aria-controls":"menu-appbar","aria-haspopup":"true",color:"inherit",children:(0,r.jsx)(j.Z,{sx:{width:"1em",height:"1em"}})})})}var _=n(9864),k=n(7028);function N(e){let{darkMode:t,onToggleDarkMode:n}=e;return(0,r.jsx)("div",{className:"dark-mode-toggle",onClick:n,children:t?(0,r.jsx)(_.Z,{}):(0,r.jsx)(k.Z,{})})}n(2794);var O=n(279);n(5154);var C=n(7580);function P(e){let{href:t,label:n}=e,s=(0,h.usePathname)()||"";return(0,r.jsx)(c(),{href:t,className:s.startsWith(t)?"active":"",children:n})}function S(e){let{darkMode:t,onToggleDarkMode:n}=e;return C.env.NEXT_PUBLIC_NO_BROWSING?(0,r.jsxs)(d.Z,{direction:"row",spacing:2,className:"nav",children:[(0,r.jsx)(g,{}),(0,r.jsx)(N,{darkMode:t,onToggleDarkMode:n})]}):(0,r.jsxs)(d.Z,{direction:"row",spacing:2,className:"nav",children:[(0,r.jsx)(g,{}),(0,r.jsx)(P,{href:"/setup",label:"New Eval"}),(0,r.jsx)(P,{href:"/eval",label:"Evals"}),(0,r.jsx)(P,{href:"/prompts",label:"Prompts"}),(0,r.jsx)(P,{href:"/datasets",label:"Datasets"}),(0,r.jsxs)("div",{className:"right-aligned",children:[O.Ox?(0,r.jsx)(E,{}):null,(0,r.jsx)(N,{darkMode:t,onToggleDarkMode:n})]})]})}function Z(e){let{children:t}=e,n=(0,i.Z)("(prefers-color-scheme: dark)"),[u,c]=s.useState(n),d=s.useMemo(()=>(0,o.Z)({typography:{fontFamily:"inherit"},palette:{mode:u||n?"dark":"light"}}),[u,n]);return s.useEffect(()=>{n&&document.documentElement.setAttribute("data-theme","dark")},[n]),(0,r.jsx)(s.StrictMode,{children:(0,r.jsx)(a.Z,{theme:d,children:(0,r.jsx)(l.Ho,{children:(0,r.jsxs)(T,{children:[(0,r.jsx)(S,{darkMode:u,onToggleDarkMode:()=>{c(!u),u?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme","dark")}}),(0,r.jsx)("div",{children:t})]})})})})}function T(e){let{children:t}=e;return(0,r.jsx)("div",{children:t})}n(5587)},279:function(e,t,n){"use strict";n.d(t,{Ox:function(){return i},T8:function(){return s},eA:function(){return o}});var r=n(7580);let s=!r.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,i=!!r.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,o=""},3571:function(e,t,n){"use strict";n.d(t,{Ho:function(){return d},OQ:function(){return o},aC:function(){return l}});var r=n(7437),s=n(2265),i=n(3082);let o=(0,i.createClientComponentClient)(),a=(0,s.createContext)({}),l=()=>(0,s.useContext)(a),u=(e,t)=>o.auth.signInWithPassword({email:e,password:t}),c=()=>o.auth.signOut(),d=e=>{let{children:t}=e,[n,i]=(0,s.useState)(null),[l,d]=(0,s.useState)(!1),h=(0,s.useCallback)(async()=>{let{data:e,error:t}=await o.auth.refreshSession();e&&i(e.user)},[]);return(0,s.useEffect)(()=>{h();let{data:e}=o.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?d(!1):"SIGNED_IN"===e&&t?(i(t.user),d(!0)):"SIGNED_OUT"===e&&(d(!1),i(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,r.jsx)(a.Provider,{value:{loggedIn:l,user:n,login:u,logout:c},children:t})}},2794:function(){},1320:function(){},5154:function(){},5587:function(){},2471:function(){}},function(e){e.O(0,[293,548,82,886,445,971,596,744],function(){return e(e.s=679)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[413],{3515:function(e,t,n){Promise.resolve().then(n.bind(n,2378))},2378:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ed}});var a=n(7437),r=n(2265),i=n(5551),l=n(8938),s=n(3226),o=n(6507),c=n(3457),d=n(9394),p=n(2834),u=n(6337),h=n(4173),x=n(1797),m=n(4740),f=n(4033),j=n(6882),g=n(1938),v=n(279),Z=()=>{let e=(0,f.useRouter)(),{env:t,description:n,providers:l,prompts:s,testCases:o}=(0,g.o)(),[c,d]=(0,r.useState)(!1),[p,u]=(0,r.useState)(0),h=async()=>{d(!0);try{let a=await fetch("".concat(v.eA,"/api/eval/job/"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t,description:n,providers:l,prompts:s,tests:o})});if(!a.ok)throw Error("HTTP error! status: ".concat(a.status));let r=await a.json(),i=setInterval(async()=>{let t=await fetch("".concat(v.eA,"/api/eval/job/").concat(r.id,"/"));if(!t.ok)throw clearInterval(i),Error("HTTP error! status: ".concat(t.status));let n=await t.json();if("complete"===n.status)clearInterval(i),d(!1),v.T8?e.push("/eval"):e.push("/eval/remote:".concat(encodeURIComponent(r.id)));else if("failed"===n.status)throw clearInterval(i),d(!1),Error("Job failed");else{let e=0===n.total?0:Math.round(n.progress/n.total*100);u(e)}},1e3)}catch(e){console.error(e),d(!1),alert("An error occurred: ".concat(e.message))}};return(0,a.jsx)(i.Z,{variant:"contained",color:"primary",onClick:h,disabled:c,children:c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j.Z,{size:24,sx:{marginRight:2}}),p.toFixed(0),"% complete"]}):"Run Evaluation"})},b=n(2057),y=n(8768),C=n(5873),_=n(1975),k=n(3295),A=()=>{let{env:e,setEnv:t}=(0,g.o)(),[n,l]=(0,r.useState)(!1),[s,o]=(0,r.useState)(e),c=()=>{l(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Z,{variant:"outlined",startIcon:(0,a.jsx)(k.Z,{}),onClick:()=>{l(!0)},children:"API keys"}),(0,a.jsxs)(d.Z,{open:n,onClose:c,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Provider settings"}),(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(b.Z,{defaultExpanded:!0,children:[(0,a.jsx)(C.Z,{children:"OpenAI"}),(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(_.Z,{label:"OpenAI API key",fullWidth:!0,margin:"normal",value:s.OPENAI_API_KEY,onChange:e=>o({...s,OPENAI_API_KEY:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI API host",fullWidth:!0,margin:"normal",value:s.OPENAI_API_HOST,onChange:e=>o({...s,OPENAI_API_HOST:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI organization",fullWidth:!0,margin:"normal",value:s.OPENAI_ORGANIZATION,onChange:e=>o({...s,OPENAI_ORGANIZATION:e.target.value})})]})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Azure"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Azure API key",fullWidth:!0,margin:"normal",value:s.AZURE_OPENAI_API_KEY,onChange:e=>o({...s,AZURE_OPENAI_API_KEY:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Amazon Bedrock"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Bedrock Region",fullWidth:!0,margin:"normal",value:s.AWS_BEDROCK_REGION,onChange:e=>o({...s,AWS_BEDROCK_REGION:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Anthropic"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Anthropic API key",fullWidth:!0,margin:"normal",value:s.ANTHROPIC_API_KEY,onChange:e=>o({...s,ANTHROPIC_API_KEY:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Google Vertex AI"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex API Key",fullWidth:!0,margin:"normal",value:s.VERTEX_API_KEY,onChange:e=>o({...s,VERTEX_API_KEY:e.target.value})})}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex Project ID",fullWidth:!0,margin:"normal",value:s.VERTEX_PROJECT_ID,onChange:e=>o({...s,VERTEX_PROJECT_ID:e.target.value})})}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex Region",fullWidth:!0,margin:"normal",value:s.VERTEX_REGION,onChange:e=>o({...s,VERTEX_REGION:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Replicate"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Replicate API key",fullWidth:!0,margin:"normal",value:s.REPLICATE_API_KEY,onChange:e=>o({...s,REPLICATE_API_KEY:e.target.value})})})]})]}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:c,color:"primary",children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{t(s),c()},color:"primary",variant:"contained",children:"Save"})]})]})]})},E=n(2653),I=n(3701),P=n(9279),S=n(666),O=n(5795),w=n(4147),T=n(8276),R=n(3391),W=n(6446),N=n(1280),z=n(9329),V=e=>{let{open:t,prompt:n,index:l,onAdd:s,onCancel:o}=e,[c,h]=r.useState(n),m=r.useRef(null);r.useEffect(()=>{h(n)},[n]);let f=e=>{s(c),h(""),e?o():m.current&&m.current.focus()};return(0,a.jsxs)(d.Z,{open:t,onClose:o,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Edit Prompt ".concat(l+1)}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(_.Z,{value:c,onChange:e=>h(e.target.value),fullWidth:!0,margin:"normal",multiline:!0,placeholder:"The quick brown {{animal1}} jumps over the lazy {{animal2}}.",helperText:"Tip: use the {{varname}} syntax to add variables to your prompt.",inputRef:m})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:f.bind(null,!0),color:"primary",variant:"contained",disabled:!c.length,children:"Add"}),(0,a.jsx)(i.Z,{onClick:f.bind(null,!1),color:"primary",variant:"contained",disabled:!c.length,children:"Add Another"}),(0,a.jsx)(i.Z,{onClick:o,color:"secondary",children:"Cancel"})]})]})};n(2280);var F=()=>{let[e,t]=(0,r.useState)(!1),[n,l]=(0,r.useState)(null),{prompts:o,setPrompts:d}=(0,g.o)(),p=(0,r.useRef)(null);(0,r.useEffect)(()=>{null!==n&&n>0&&p.current&&p.current.focus()},[n]);let u=e=>{l(e),t(!0)},h=(e,t)=>{e.stopPropagation();let n=o[t];d([...o,n])},x=(e,t)=>{d(o.map((n,a)=>a===e?t:n))},m=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to remove this prompt?")&&d(o.filter((e,n)=>n!==t))};return(0,a.jsxs)("div",{children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h5",children:"Prompts"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-prompt",children:(0,a.jsx)(T.Z,{title:"Upload prompt from file",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)("input",{id:"file-input-add-prompt",type:"file",accept:".txt,.md",onChange:e=>{var t;e.stopPropagation(),e.preventDefault();let n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(n){let e=new FileReader;e.onload=e=>{var t,n;let a=null===(n=e.target)||void 0===n?void 0:null===(t=n.result)||void 0===t?void 0:t.toString();a&&d([...o,a])},e.readAsText(n)}},style:{display:"none"}})]})})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>{t(!0)},variant:"contained",children:"Add Prompt"})]})]}),(0,a.jsx)(O.Z,{children:(0,a.jsx)(I.Z,{children:(0,a.jsx)(P.Z,{children:0===o.length?(0,a.jsx)(w.Z,{children:(0,a.jsx)(S.Z,{colSpan:2,align:"center",children:"No prompts added yet."})}):o.map((e,t)=>(0,a.jsxs)(w.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>u(t),children:[(0,a.jsx)(S.Z,{children:(0,a.jsxs)(s.Z,{variant:"body2",children:["Prompt #".concat(t+1,": "),(e.length>250?e.slice(0,250)+" ...":e).split(/({{\w+}})/g).map((e,t)=>/{{\w+}}/g.test(e)?(0,a.jsx)("span",{className:"prompt-var-highlight",children:e},t):e)]})}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>u(t),size:"small",children:(0,a.jsx)(R.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(z.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>m(e,t),size:"small",children:(0,a.jsx)(W.Z,{})})]})]},t))})})}),(0,a.jsx)(V,{open:e,prompt:null!==n?o[n]:"",index:null!==n?n:0,onAdd:e=>{null!==n?x(n,e):d([...o,e]),l(null)},onCancel:()=>{l(null),t(!1)}})]})},L=n(6988),U=e=>{let{onAdd:t,varsList:n,initialValues:i}=e,[l,d]=r.useState(i||{});return(0,r.useEffect)(()=>{let e={};n.forEach(t=>{e[t]=(null==i?void 0:i[t])||""}),d(e)},[n,i]),(0,a.jsxs)(o.Z,{my:2,children:[(0,a.jsx)(s.Z,{variant:"h6",mb:2,children:"Vars"}),n.length>0?(0,a.jsx)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:Object.keys(l).map((e,n)=>(0,a.jsx)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:(0,a.jsx)(_.Z,{placeholder:e,label:e,value:l[e],fullWidth:!0,onChange:n=>{let a=n.target.value,r={...l,[e]:a};d(r),t(r)}})},n))}):(0,a.jsxs)(s.Z,{variant:"subtitle1",gutterBottom:!0,children:["Add variables to your prompt using the ","{{varname}}"," syntax."]})]})},B=n(8440);let K=["equals","contains","icontains","contains-all","contains-any","starts-with","regex","is-json","contains-json","similar","llm-rubric","model-graded-closedqa","factuality","webhook","rouge-n","rouge-s","rouge-l","not-equals","not-contains","not-icontains","not-contains-all","not-contains-any","not-starts-with","not-regex","not-is-json","not-contains-json","not-similar","not-webhook","not-rouge-n","not-rouge-s","not-rouge-l","is-valid-openai-function-call","is-valid-openai-tools-call","latency","perplexity","perplexity-score","cost","answer-relevance","context-faithfulness","context-recall","context-relevance","select-best"];var Y=e=>{let{onAdd:t,initialValues:n}=e,[l,d]=(0,r.useState)(n||[]),p=e=>{let n=l.filter((t,n)=>n!==e);d(n),t(n)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.Z,{variant:"h6",children:"Asserts"}),(0,a.jsx)(o.Z,{my:l.length>0?2:0,children:(0,a.jsx)(c.Z,{direction:"column",spacing:2,children:l.map((e,n)=>(0,a.jsxs)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:[(0,a.jsx)(B.Z,{value:e.type,options:K,sx:{minWidth:200},onChange:(e,a)=>{let r=l.map((e,t)=>t===n?{...e,type:a}:e);d(r),t(r)},renderInput:e=>(0,a.jsx)(_.Z,{...e,label:"Type"})}),(0,a.jsx)(_.Z,{label:"Value",value:e.value,fullWidth:!0,onChange:e=>{let a=e.target.value,r=l.map((e,t)=>t===n?{...e,value:a}:e);d(r),t(r)}}),(0,a.jsx)(E.Z,{onClick:()=>p(n),size:"small",children:(0,a.jsx)(W.Z,{})})]},n))})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>{let e=[...l,{type:"equals",value:""}];d(e),t(e)},children:"Add Assert"})]})},q=e=>{let{open:t,onAdd:n,varsList:l,initialValues:s,onCancel:c}=e,[h,m]=(0,r.useState)((null==s?void 0:s.description)||""),[f,j]=(0,r.useState)((null==s?void 0:s.vars)||{}),[g,v]=(0,r.useState)((null==s?void 0:s.assert)||[]),[Z,b]=(0,r.useState)(0);r.useEffect(()=>{s?(m(s.description||""),j(s.vars||{}),v(s.assert||[])):(m(""),j({}),v([]))},[s]);let y=e=>{n({description:h,vars:f,assert:g},e),e&&c(),m(""),j({}),v([]),b(e=>e+1)};return(0,a.jsxs)(d.Z,{open:t,onClose:c,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:s?"Edit Test Case":"Add Test Case"}),(0,a.jsx)(u.Z,{children:(0,a.jsxs)(o.Z,{children:[(0,a.jsx)(U,{onAdd:e=>j(e),varsList:l,initialValues:null==s?void 0:s.vars}),(0,a.jsx)(Y,{onAdd:e=>v(e),initialValues:(null==s?void 0:s.assert)||[]},Z)]})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:y.bind(void 0,!0),color:"primary",variant:"contained",children:s?"Update Test Case":"Add Test Case"}),!s&&(0,a.jsx)(i.Z,{onClick:y.bind(void 0,!1),color:"primary",variant:"contained",children:"Add Another"}),(0,a.jsx)(i.Z,{onClick:c,color:"secondary",children:"Cancel"})]})]})},D=n(5320),J=e=>{let{varsList:t}=e,{testCases:l,setTestCases:o}=(0,g.o)(),[d,p]=r.useState(null),[u,h]=r.useState(!1),x=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to delete this test case?")&&o(l.filter((e,n)=>n!==t))},m=(e,t)=>{e.stopPropagation();let n=JSON.parse(JSON.stringify(l[t]));o([...l,n])};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h5",children:"Test Cases"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-test-case",children:(0,a.jsx)(T.Z,{title:"Upload test cases from csv",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)("input",{id:"file-input-add-test-case",type:"file",accept:".csv",onChange:e=>{var t;e.stopPropagation(),e.preventDefault();let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a){let e=new FileReader;e.onload=async e=>{var t,a;let r=null===(a=e.target)||void 0===a?void 0:null===(t=a.result)||void 0===t?void 0:t.toString();if(r){let{parse:e}=await Promise.all([n.e(631),n.e(922)]).then(n.bind(n,8922)),t=e(r,{columns:!0});o([...l,...t.map(e=>(0,D.It)(e))])}},e.readAsText(a)}},style:{display:"none"}})]})})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>h(!0),variant:"contained",children:"Add Test Case"})]})]}),(0,a.jsx)(O.Z,{children:(0,a.jsxs)(I.Z,{children:[(0,a.jsx)(L.Z,{children:(0,a.jsxs)(w.Z,{children:[(0,a.jsx)(S.Z,{children:"Description"}),(0,a.jsx)(S.Z,{children:"Assertions"}),(0,a.jsx)(S.Z,{children:"Variables"}),(0,a.jsx)(S.Z,{align:"right"})]})}),(0,a.jsx)(P.Z,{children:0===l.length?(0,a.jsx)(w.Z,{children:(0,a.jsx)(S.Z,{colSpan:4,align:"center",children:"No test cases added yet."})}):l.map((e,t)=>{var n;return(0,a.jsxs)(w.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>{p(t),h(!0)},children:[(0,a.jsx)(S.Z,{children:(0,a.jsx)(s.Z,{variant:"body2",children:e.description||"Test Case #".concat(t+1)})}),(0,a.jsxs)(S.Z,{children:[(null===(n=e.assert)||void 0===n?void 0:n.length)||0," assertions"]}),(0,a.jsx)(S.Z,{children:Object.entries(e.vars||{}).map(e=>{let[t,n]=e;return t+"="+n}).join(", ")}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>{p(t),h(!0)},size:"small",children:(0,a.jsx)(R.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>m(e,t),size:"small",children:(0,a.jsx)(z.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(W.Z,{})})]})]},t)})})]})}),(0,a.jsx)(q,{open:u,onAdd:(e,t)=>{if(null===d)o([...l,e]);else{let t=l.map((t,n)=>n===d?e:t);o(t),p(null)}t&&h(!1)},varsList:t,initialValues:null!==d?l[d]:void 0,onCancel:()=>{p(null),h(!1)}})]})},X=n(7827),G=e=>{let{onChange:t,...n}=e,[i,l]=r.useState(""),[s,o]=r.useState(!1);return(0,a.jsx)(_.Z,{...n,error:s,helperText:s?"Invalid JSON":"",value:i,onChange:e=>{let n=e.target.value;try{let e=JSON.parse(n);l(n),o(!1),t&&t(e)}catch(e){l(n),o(!0)}}})},H=e=>{let{open:t,providerId:n,config:l,onClose:s,onSave:c}=e,[h,m]=r.useState(l);return r.useEffect(()=>{m(l)},[l]),(0,a.jsxs)(d.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"md",children:[(0,a.jsxs)(x.Z,{children:["Edit ",n.length>50?n.slice(0,50)+"...":n]}),(0,a.jsx)(u.Z,{children:Object.keys(h).map(e=>{let t;let n=h[e];return"number"==typeof n||"boolean"==typeof n||"string"==typeof n?(t="number"==typeof n?t=>m({...h,[e]:parseFloat(t.target.value)}):"boolean"==typeof n?t=>m({...h,[e]:"true"===t.target.value}):t=>{let n=t.target.value.trim();if(n.startsWith("{")||n.startsWith("["))try{m({...h,[e]:JSON.parse(n)})}catch(t){m({...h,[e]:n})}else"null"===n?m({...h,[e]:null}):"undefined"===n?m({...h,[e]:void 0}):m({...h,[e]:n})},(0,a.jsx)(o.Z,{my:2,children:(0,a.jsx)(_.Z,{label:e,value:n,onChange:t,fullWidth:!0,InputLabelProps:{shrink:!0},type:"number"==typeof n?"number":"text"})},e)):(0,a.jsx)(o.Z,{my:2,children:(0,a.jsx)(G,{label:e,defaultValue:JSON.stringify(n),onChange:t=>{m({...h,[e]:t})},fullWidth:!0,multiline:!0,minRows:2,InputLabelProps:{shrink:!0}})},e)})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:s,children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{c(h)},children:"Save"})]})]})};let M=[].concat(["replicate:replicate/flan-t5-small:69716ad8c34274043bf4a135b7315c7c569ec931d8f23d6826e249e1c142a264"].map(e=>({id:e,config:{temperature:.5,max_length:1024,repetition_penality:1}}))).concat(["replicate:replicate/codellama-7b-instruct:0103579e86fc75ba0d65912890fa19ef03c84a68554635319accf2e0ba93d3ae","replicate:replicate/codellama-13b-instruct:da5676342de1a5a335b848383af297f592b816b950a43d251a0a9edd0113604b","replicate:replicate/llama-2-70b-chat:2796ee9483c3fd7aa2e171d38f4ca12251a30609463dcfd4cd76703f22e96cdf"].map(e=>({id:e,config:{system_prompt:"",temperature:.75,top_p:.9,top_k:50,max_new_tokens:128,min_new_tokens:-1}}))).concat(["replicate:replicate/codellama-7b:6880b103613a9cd23950c5fd6c140197e519905bd0dd00e448c4858bdd06090a","replicate:replicate/codellama-13b-python:09b87c02dfa403e0c3289166dece62286b3bce49bae39a9c9204713cf94b8b7d","replicate:replicate/codellama-13b:1c914d844307b0588599b8393480a3ba917b660c7e9dfae681542b5325f228db","replicate:replicate/codellama-34b-python:9048743d22a7b19cd0abb018066809ea6af4f2b4717bef9aad3c5ae21ceac00d","replicate:replicate/codellama-34b:0666717e5ead8557dff55ee8f11924b5c0309f5f1ca52f64bb8eec405fdb38a7"].map(e=>({id:e,config:{temperature:.75,top_p:.9,top_k:50,max_new_tokens:128,min_new_tokens:-1}}))).concat(["replicate:a16z-infra/llama-2-7b-chat:7b0bfc9aff140d5b75bacbed23e91fd3c34b01a1e958d32132de6e0a19796e2c","replicate:a16z-infra/llama-2-13b-chat:2a7f981751ec7fdf87b5b91ad4db53683a98082e9ff7bfd12c8cd5ea85980a52"].map(e=>({id:e,config:{temperature:.95,top_p:.95,top_k:250,max_new_tokens:500,min_new_tokens:-1,repetition_penality:1,system_prompt:""}}))).concat(["anthropic:claude-1","anthropic:claude-1-100k","anthropic:claude-instant-1","anthropic:claude-instant-1-100k"].map(e=>({id:e,config:{max_tokens_to_sample:256,temperature:.5}}))).concat(["bedrock:anthropic.claude-instant-v1","bedrock:anthropic.claude-v1","bedrock:anthropic.claude-v2"].map(e=>({id:e,config:{max_tokens_to_sample:256,temperature:.5}}))).concat(["openai:gpt-3.5-turbo","openai:gpt-3.5-turbo-0301","openai:gpt-3.5-turbo-0613","openai:gpt-3.5-turbo-16k","openai:gpt-3.5-turbo-16k-0613","openai:gpt-4","openai:gpt-4-0314","openai:gpt-4-0613","openai:gpt-4-32k","openai:gpt-4-32k-0314"].map(e=>({id:e,config:{organization:"",temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0,function_call:void 0,functions:void 0,stop:void 0}}))).concat(["azureopenai:gpt-3.5-turbo","azureopenai:gpt-3.5-turbo-0301","azureopenai:gpt-3.5-turbo-0613","azureopenai:gpt-3.5-turbo-16k","azureopenai:gpt-3.5-turbo-16k-0613","azureopenai:gpt-4","azureopenai:gpt-4-0314","azureopenai:gpt-4-0613","azureopenai:gpt-4-32k","azureopenai:gpt-4-32k-0314"].map(e=>({id:e,config:{temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0,function_call:void 0,functions:void 0,stop:void 0}}))).concat(["vertex:chat-bison@001","vertex:chat-bison","vertex:chat-bison-32k","vertex:chat-bison-32k@001"].map(e=>({id:e,config:{context:void 0,examples:void 0,temperature:0,maxOutputTokens:1024,topP:.95,topK:40,safetySettings:void 0,stopSequence:void 0}}))).sort((e,t)=>e.id.localeCompare(t.id)),$={anthropic:"Anthropic",bedrock:"Amazon Web Services",azureopenai:"Azure",openai:"OpenAI",replicate:"Replicate"};var Q=e=>{let{providers:t,onChange:n}=e,[i,l]=r.useState(null),s=e=>"string"==typeof e?e:e.id||"Unknown provider",c=(e,t)=>"string"==typeof e?e:e.id||t,d=e=>{"string"==typeof e?alert("Cannot edit custom providers"):e.config?l(e):alert("There is no config for this provider")};return(0,a.jsxs)(o.Z,{mt:2,children:[(0,a.jsx)(B.Z,{multiple:!0,freeSolo:!0,options:M,value:t,groupBy:e=>(function(e){if(!e)return"Other";let t=e.split(":")[0];return $[t]||t})(e.id),onChange:(e,t)=>{n(t.map(e=>"string"==typeof e?{id:e}:e))},getOptionLabel:e=>{if(!e)return"";let t="";"string"==typeof e&&(t=e),e.id&&"string"==typeof e.id&&(t=e.id);let n=t.split(":");return n.length>1?n[1]:"Unknown provider"},renderTags:(e,t)=>e.map((e,n)=>{let a=s(e),i=c(e,n);return(0,r.createElement)(X.Z,{variant:"outlined",label:a,...t({index:n}),key:i,onClick:()=>d(e)})}),renderInput:e=>(0,a.jsx)(_.Z,{...e,variant:"outlined",placeholder:"Select LLM providers",helperText:t.length>0?"Click a provider to configure its settings.":null})}),i&&i.id&&(0,a.jsx)(H,{open:!!i,providerId:i.id,config:i.config,onClose:()=>l(null),onSave:e=>{if(i){let a=t.map(t=>t.id===i.id?{...t,config:e}:t);n(a),l(null)}}})]})},ee=n(2666),et=n.n(ee),en=n(4759);n(5341),n(7555);var ea=n(8339),er=n(9963),ei=n(1396),el=n.n(ei);n(695);var es=()=>{let{env:e,setEnv:t,description:n,setDescription:l,providers:c,setProviders:d,prompts:p,setPrompts:u,testCases:h,setTestCases:x}=(0,g.o)(),[m,f]=r.useState(""),[j,v]=r.useState(!0);r.useEffect(()=>{f(ea.default.dump({env:e,description:n,providers:c,prompts:p,tests:h}))},[e,n,c,p,h]);let Z=e=>{t(e.env||{}),l(e.description||""),d(e.providers||[]),u(e.prompts||[]),x(e.tests||[])};return(0,a.jsxs)(o.Z,{mt:4,children:[(0,a.jsx)(s.Z,{variant:"h5",gutterBottom:!0,children:"Configuration"}),(0,a.jsxs)(s.Z,{variant:"body1",gutterBottom:!0,children:["This is the YAML config that defines the evaluation and is processed by promptfoo. See"," ",(0,a.jsx)(el(),{target:"_blank",href:"https://promptfoo.dev/docs/configuration/guide",children:"configuration docs"})," ","to learn more."]}),(0,a.jsx)(i.Z,{variant:"text",color:"primary",startIcon:j?(0,a.jsx)(R.Z,{}):(0,a.jsx)(er.Z,{}),onClick:()=>{if(!j)try{let e=ea.default.load(m,{json:!0});Z(e)}catch(e){}v(!j)},children:j?"Edit YAML":"Save"}),(0,a.jsx)(et(),{autoCapitalize:"off",value:m,onValueChange:e=>{j||f(e)},highlight:e=>(0,en.highlight)(e,en.languages.yaml),padding:10,style:{fontFamily:'"Fira code", "Fira Mono", monospace',fontSize:14},disabled:j,className:j?"":"glowing-border"})]})};n(284);var eo=n(7580);function ec(e){let{error:t,resetErrorBoundary:n}=e;return(0,a.jsxs)("div",{role:"alert",children:[(0,a.jsx)("p",{children:"Something went wrong:"}),(0,a.jsx)("pre",{children:t.message}),(0,a.jsx)("button",{onClick:n,children:"Try again"})]})}var ed=()=>{let[e,t]=(0,r.useState)(!1),{description:n,setDescription:f,providers:j,setProviders:v,prompts:b,setPrompts:y,testCases:C,setTestCases:_}=(0,g.o)();if((0,r.useEffect)(()=>{g.o.persist.rehydrate()},[]),eo.env.NEXT_PUBLIC_NO_BROWSING)return null;let k=(e=>{let t=/{{(\w+)}}/g,n=new Set;return e.forEach(e=>{let a;for(;null!==(a=t.exec(e));)n.add(a[1])}),Array.from(n)})(b);return(0,a.jsxs)(l.Z,{maxWidth:"lg",sx:{marginTop:"2rem"},children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h4",children:"Set up an evaluation"}),(0,a.jsxs)(c.Z,{direction:"row",spacing:2,children:[(0,a.jsx)(Z,{}),(0,a.jsx)(A,{}),(0,a.jsx)(i.Z,{variant:"outlined",color:"primary",onClick:()=>t(!0),children:"Reset"})]})]}),(0,a.jsx)(o.Z,{mt:4}),(0,a.jsx)(o.Z,{mt:2,children:(0,a.jsx)(m.SV,{FallbackComponent:ec,onReset:()=>{v([])},children:(0,a.jsxs)(c.Z,{direction:"column",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h5",children:"Providers"}),(0,a.jsx)(Q,{providers:j,onChange:v})]})})}),(0,a.jsx)(o.Z,{mt:4}),(0,a.jsx)(m.SV,{FallbackComponent:ec,onReset:()=>{y([])},children:(0,a.jsx)(F,{})}),(0,a.jsx)(o.Z,{mt:6}),(0,a.jsx)(m.SV,{FallbackComponent:ec,onReset:()=>{_([])},children:(0,a.jsx)(J,{varsList:k})}),(0,a.jsx)(es,{}),(0,a.jsxs)(d.Z,{open:e,onClose:()=>t(!1),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,a.jsx)(x.Z,{id:"alert-dialog-title",children:"Confirm Reset"}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(h.Z,{id:"alert-dialog-description",children:"Are you sure you want to reset all the fields? This action cannot be undone."})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:()=>t(!1),children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{f(""),v([]),y([]),_([]),t(!1)},autoFocus:!0,children:"Reset"})]})]})]})}},279:function(e,t,n){"use strict";n.d(t,{Ox:function(){return i},T8:function(){return r},eA:function(){return l}});var a=n(7580);let r=!a.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,i=!!a.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,l=""},1938:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var a=n(4660),r=n(4810);let i=(0,a.Ue)()((0,r.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setStateFromConfig:t=>{let n={};t.description&&(n.description=t.description||""),t.tests&&(n.testCases=t.tests),t.providers&&(n.providers=t.providers),t.prompts&&("string"==typeof t.prompts?n.prompts=[t.prompts]:Array.isArray(t.prompts)?n.prompts=t.prompts.filter(e=>!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),e(n)},getTestSuite:()=>{let{description:e,testCases:n,providers:a,prompts:r,env:i}=t();return{env:i,description:e,providers:a,prompts:r,tests:n}}}),{name:"promptfoo",skipHydration:!0}))},2280:function(){},695:function(){},284:function(){},5320:function(e,t){"use strict";t.It=void 0,t.It=function(e){let t={},n=[],a={};for(let[r,i]of Object.entries(e))r.startsWith("__expected")?""!==i.trim()&&n.push(function(e){if(e.startsWith("javascript:")||e.startsWith("fn:")||e.startsWith("eval:")){let t;e.startsWith("javascript:")&&(t=11),e.startsWith("fn:")&&(t=3),e.startsWith("eval:")&&(t=5);let n=e.slice(t);return{type:"javascript",value:n}}if(e.startsWith("grade:")||e.startsWith("llm-rubric:"))return{type:"llm-rubric",value:e.slice(6)};if(e.startsWith("python:")){let t=e.slice(7);return{type:"python",value:t}}let t=e.match(/^(not-)?(equals|contains-any|contains-all|icontains-any|icontains-all|contains-json|is-json|regex|icontains|contains|webhook|rouge-n|similar|starts-with|levenshtein|classifier|model-graded-factuality|factuality|model-graded-closedqa|answer-relevance|context-recall|context-relevance|context-faithfulness|is-valid-openai-function-call|is-valid-openai-tools-call|latency|perplexity|perplexity-score|cost)(?:\((\d+(?:\.\d+)?)\))?(?::(.*))?$/);if(t){let[e,n,a,r,i]=t,l=n?`not-${a}`:a,s=parseFloat(r);return"contains-any"===a||"contains-all"===a||"icontains-any"===a||"icontains-all"===a?{type:l,value:i.split(",").map(e=>e.trim())}:"contains-json"===a||"is-json"===a?{type:l}:"rouge-n"===a||"similar"===a||"starts-with"===a||"levenshtein"===a||"classifier"===a||"answer-relevance"===a||"context-recall"===a||"context-relevance"===a||"context-faithfulness"===a||"latency"===a||"perplexity"===a||"perplexity-score"===a||"cost"===a?{type:l,value:i,threshold:s||("similar"===a?.8:.75)}:{type:l,value:i}}return{type:"equals",value:e}}(i)):"__prefix"===r?a.prefix=i:"__suffix"===r?a.suffix=i:t[r]=i;return{vars:t,assert:n,options:a}}}},function(e){e.O(0,[293,808,548,420,975,886,683,339,376,971,596,744],function(){return e(e.s=3515)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[413],{3515:function(e,t,n){Promise.resolve().then(n.bind(n,2378))},2378:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ed}});var a=n(7437),r=n(2265),i=n(5551),l=n(8938),s=n(3226),o=n(6507),c=n(3457),d=n(9394),p=n(2834),u=n(6337),h=n(4173),x=n(1797),m=n(4740),f=n(4033),j=n(6882),g=n(1938),v=n(279),Z=()=>{let e=(0,f.useRouter)(),{env:t,description:n,providers:l,prompts:s,testCases:o}=(0,g.o)(),[c,d]=(0,r.useState)(!1),[p,u]=(0,r.useState)(0),h=async()=>{d(!0);try{let a=await fetch("".concat(v.eA,"/api/eval/job/"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t,description:n,providers:l,prompts:s,tests:o})});if(!a.ok)throw Error("HTTP error! status: ".concat(a.status));let r=await a.json(),i=setInterval(async()=>{let t=await fetch("".concat(v.eA,"/api/eval/job/").concat(r.id,"/"));if(!t.ok)throw clearInterval(i),Error("HTTP error! status: ".concat(t.status));let n=await t.json();if("complete"===n.status)clearInterval(i),d(!1),v.Ox?e.push("/eval/remote:".concat(encodeURIComponent(r.id))):e.push("/eval");else if("failed"===n.status)throw clearInterval(i),d(!1),Error("Job failed");else{let e=0===n.total?0:Math.round(n.progress/n.total*100);u(e)}},1e3)}catch(e){console.error(e),d(!1),alert("An error occurred: ".concat(e.message))}};return(0,a.jsx)(i.Z,{variant:"contained",color:"primary",onClick:h,disabled:c,children:c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j.Z,{size:24,sx:{marginRight:2}}),p.toFixed(0),"% complete"]}):"Run Evaluation"})},b=n(2057),y=n(8768),C=n(5873),_=n(1975),k=n(3295),A=()=>{let{env:e,setEnv:t}=(0,g.o)(),[n,l]=(0,r.useState)(!1),[s,o]=(0,r.useState)(e),c=()=>{l(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Z,{variant:"outlined",startIcon:(0,a.jsx)(k.Z,{}),onClick:()=>{l(!0)},children:"API keys"}),(0,a.jsxs)(d.Z,{open:n,onClose:c,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Provider settings"}),(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(b.Z,{defaultExpanded:!0,children:[(0,a.jsx)(C.Z,{children:"OpenAI"}),(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(_.Z,{label:"OpenAI API key",fullWidth:!0,margin:"normal",value:s.OPENAI_API_KEY,onChange:e=>o({...s,OPENAI_API_KEY:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI API host",fullWidth:!0,margin:"normal",value:s.OPENAI_API_HOST,onChange:e=>o({...s,OPENAI_API_HOST:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI organization",fullWidth:!0,margin:"normal",value:s.OPENAI_ORGANIZATION,onChange:e=>o({...s,OPENAI_ORGANIZATION:e.target.value})})]})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Azure"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Azure API key",fullWidth:!0,margin:"normal",value:s.AZURE_OPENAI_API_KEY,onChange:e=>o({...s,AZURE_OPENAI_API_KEY:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Amazon Bedrock"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Bedrock Region",fullWidth:!0,margin:"normal",value:s.AWS_BEDROCK_REGION,onChange:e=>o({...s,AWS_BEDROCK_REGION:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Anthropic"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Anthropic API key",fullWidth:!0,margin:"normal",value:s.ANTHROPIC_API_KEY,onChange:e=>o({...s,ANTHROPIC_API_KEY:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Google Vertex AI"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex API Key",fullWidth:!0,margin:"normal",value:s.VERTEX_API_KEY,onChange:e=>o({...s,VERTEX_API_KEY:e.target.value})})}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex Project ID",fullWidth:!0,margin:"normal",value:s.VERTEX_PROJECT_ID,onChange:e=>o({...s,VERTEX_PROJECT_ID:e.target.value})})}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex Region",fullWidth:!0,margin:"normal",value:s.VERTEX_REGION,onChange:e=>o({...s,VERTEX_REGION:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Replicate"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Replicate API key",fullWidth:!0,margin:"normal",value:s.REPLICATE_API_KEY,onChange:e=>o({...s,REPLICATE_API_KEY:e.target.value})})})]})]}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:c,color:"primary",children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{t(s),c()},color:"primary",variant:"contained",children:"Save"})]})]})]})},E=n(2653),I=n(3701),P=n(9279),S=n(666),O=n(5795),w=n(4147),T=n(8276),R=n(3391),W=n(6446),N=n(1280),z=n(9329),V=e=>{let{open:t,prompt:n,index:l,onAdd:s,onCancel:o}=e,[c,h]=r.useState(n),m=r.useRef(null);r.useEffect(()=>{h(n)},[n]);let f=e=>{s(c),h(""),e?o():m.current&&m.current.focus()};return(0,a.jsxs)(d.Z,{open:t,onClose:o,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Edit Prompt ".concat(l+1)}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(_.Z,{value:c,onChange:e=>h(e.target.value),fullWidth:!0,margin:"normal",multiline:!0,placeholder:"The quick brown {{animal1}} jumps over the lazy {{animal2}}.",helperText:"Tip: use the {{varname}} syntax to add variables to your prompt.",inputRef:m})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:f.bind(null,!0),color:"primary",variant:"contained",disabled:!c.length,children:"Add"}),(0,a.jsx)(i.Z,{onClick:f.bind(null,!1),color:"primary",variant:"contained",disabled:!c.length,children:"Add Another"}),(0,a.jsx)(i.Z,{onClick:o,color:"secondary",children:"Cancel"})]})]})};n(2280);var F=()=>{let[e,t]=(0,r.useState)(!1),[n,l]=(0,r.useState)(null),{prompts:o,setPrompts:d}=(0,g.o)(),p=(0,r.useRef)(null);(0,r.useEffect)(()=>{null!==n&&n>0&&p.current&&p.current.focus()},[n]);let u=e=>{l(e),t(!0)},h=(e,t)=>{e.stopPropagation();let n=o[t];d([...o,n])},x=(e,t)=>{d(o.map((n,a)=>a===e?t:n))},m=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to remove this prompt?")&&d(o.filter((e,n)=>n!==t))};return(0,a.jsxs)("div",{children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h5",children:"Prompts"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-prompt",children:(0,a.jsx)(T.Z,{title:"Upload prompt from file",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)("input",{id:"file-input-add-prompt",type:"file",accept:".txt,.md",onChange:e=>{var t;e.stopPropagation(),e.preventDefault();let n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(n){let e=new FileReader;e.onload=e=>{var t,n;let a=null===(n=e.target)||void 0===n?void 0:null===(t=n.result)||void 0===t?void 0:t.toString();a&&d([...o,a])},e.readAsText(n)}},style:{display:"none"}})]})})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>{t(!0)},variant:"contained",children:"Add Prompt"})]})]}),(0,a.jsx)(O.Z,{children:(0,a.jsx)(I.Z,{children:(0,a.jsx)(P.Z,{children:0===o.length?(0,a.jsx)(w.Z,{children:(0,a.jsx)(S.Z,{colSpan:2,align:"center",children:"No prompts added yet."})}):o.map((e,t)=>(0,a.jsxs)(w.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>u(t),children:[(0,a.jsx)(S.Z,{children:(0,a.jsxs)(s.Z,{variant:"body2",children:["Prompt #".concat(t+1,": "),(e.length>250?e.slice(0,250)+" ...":e).split(/({{\w+}})/g).map((e,t)=>/{{\w+}}/g.test(e)?(0,a.jsx)("span",{className:"prompt-var-highlight",children:e},t):e)]})}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>u(t),size:"small",children:(0,a.jsx)(R.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(z.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>m(e,t),size:"small",children:(0,a.jsx)(W.Z,{})})]})]},t))})})}),(0,a.jsx)(V,{open:e,prompt:null!==n?o[n]:"",index:null!==n?n:0,onAdd:e=>{null!==n?x(n,e):d([...o,e]),l(null)},onCancel:()=>{l(null),t(!1)}})]})},L=n(6988),U=e=>{let{onAdd:t,varsList:n,initialValues:i}=e,[l,d]=r.useState(i||{});return(0,r.useEffect)(()=>{let e={};n.forEach(t=>{e[t]=(null==i?void 0:i[t])||""}),d(e)},[n,i]),(0,a.jsxs)(o.Z,{my:2,children:[(0,a.jsx)(s.Z,{variant:"h6",mb:2,children:"Vars"}),n.length>0?(0,a.jsx)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:Object.keys(l).map((e,n)=>(0,a.jsx)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:(0,a.jsx)(_.Z,{placeholder:e,label:e,value:l[e],fullWidth:!0,onChange:n=>{let a=n.target.value,r={...l,[e]:a};d(r),t(r)}})},n))}):(0,a.jsxs)(s.Z,{variant:"subtitle1",gutterBottom:!0,children:["Add variables to your prompt using the ","{{varname}}"," syntax."]})]})},B=n(8440);let K=["equals","contains","icontains","contains-all","contains-any","starts-with","regex","is-json","contains-json","similar","llm-rubric","model-graded-closedqa","factuality","webhook","rouge-n","rouge-s","rouge-l","not-equals","not-contains","not-icontains","not-contains-all","not-contains-any","not-starts-with","not-regex","not-is-json","not-contains-json","not-similar","not-webhook","not-rouge-n","not-rouge-s","not-rouge-l","is-valid-openai-function-call","is-valid-openai-tools-call","latency","perplexity","perplexity-score","cost","answer-relevance","context-faithfulness","context-recall","context-relevance","select-best"];var Y=e=>{let{onAdd:t,initialValues:n}=e,[l,d]=(0,r.useState)(n||[]),p=e=>{let n=l.filter((t,n)=>n!==e);d(n),t(n)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.Z,{variant:"h6",children:"Asserts"}),(0,a.jsx)(o.Z,{my:l.length>0?2:0,children:(0,a.jsx)(c.Z,{direction:"column",spacing:2,children:l.map((e,n)=>(0,a.jsxs)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:[(0,a.jsx)(B.Z,{value:e.type,options:K,sx:{minWidth:200},onChange:(e,a)=>{let r=l.map((e,t)=>t===n?{...e,type:a}:e);d(r),t(r)},renderInput:e=>(0,a.jsx)(_.Z,{...e,label:"Type"})}),(0,a.jsx)(_.Z,{label:"Value",value:e.value,fullWidth:!0,onChange:e=>{let a=e.target.value,r=l.map((e,t)=>t===n?{...e,value:a}:e);d(r),t(r)}}),(0,a.jsx)(E.Z,{onClick:()=>p(n),size:"small",children:(0,a.jsx)(W.Z,{})})]},n))})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>{let e=[...l,{type:"equals",value:""}];d(e),t(e)},children:"Add Assert"})]})},q=e=>{let{open:t,onAdd:n,varsList:l,initialValues:s,onCancel:c}=e,[h,m]=(0,r.useState)((null==s?void 0:s.description)||""),[f,j]=(0,r.useState)((null==s?void 0:s.vars)||{}),[g,v]=(0,r.useState)((null==s?void 0:s.assert)||[]),[Z,b]=(0,r.useState)(0);r.useEffect(()=>{s?(m(s.description||""),j(s.vars||{}),v(s.assert||[])):(m(""),j({}),v([]))},[s]);let y=e=>{n({description:h,vars:f,assert:g},e),e&&c(),m(""),j({}),v([]),b(e=>e+1)};return(0,a.jsxs)(d.Z,{open:t,onClose:c,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:s?"Edit Test Case":"Add Test Case"}),(0,a.jsx)(u.Z,{children:(0,a.jsxs)(o.Z,{children:[(0,a.jsx)(U,{onAdd:e=>j(e),varsList:l,initialValues:null==s?void 0:s.vars}),(0,a.jsx)(Y,{onAdd:e=>v(e),initialValues:(null==s?void 0:s.assert)||[]},Z)]})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:y.bind(void 0,!0),color:"primary",variant:"contained",children:s?"Update Test Case":"Add Test Case"}),!s&&(0,a.jsx)(i.Z,{onClick:y.bind(void 0,!1),color:"primary",variant:"contained",children:"Add Another"}),(0,a.jsx)(i.Z,{onClick:c,color:"secondary",children:"Cancel"})]})]})},D=n(5320),J=e=>{let{varsList:t}=e,{testCases:l,setTestCases:o}=(0,g.o)(),[d,p]=r.useState(null),[u,h]=r.useState(!1),x=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to delete this test case?")&&o(l.filter((e,n)=>n!==t))},m=(e,t)=>{e.stopPropagation();let n=JSON.parse(JSON.stringify(l[t]));o([...l,n])};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h5",children:"Test Cases"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-test-case",children:(0,a.jsx)(T.Z,{title:"Upload test cases from csv",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)("input",{id:"file-input-add-test-case",type:"file",accept:".csv",onChange:e=>{var t;e.stopPropagation(),e.preventDefault();let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a){let e=new FileReader;e.onload=async e=>{var t,a;let r=null===(a=e.target)||void 0===a?void 0:null===(t=a.result)||void 0===t?void 0:t.toString();if(r){let{parse:e}=await Promise.all([n.e(631),n.e(922)]).then(n.bind(n,8922)),t=e(r,{columns:!0});o([...l,...t.map(e=>(0,D.It)(e))])}},e.readAsText(a)}},style:{display:"none"}})]})})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>h(!0),variant:"contained",children:"Add Test Case"})]})]}),(0,a.jsx)(O.Z,{children:(0,a.jsxs)(I.Z,{children:[(0,a.jsx)(L.Z,{children:(0,a.jsxs)(w.Z,{children:[(0,a.jsx)(S.Z,{children:"Description"}),(0,a.jsx)(S.Z,{children:"Assertions"}),(0,a.jsx)(S.Z,{children:"Variables"}),(0,a.jsx)(S.Z,{align:"right"})]})}),(0,a.jsx)(P.Z,{children:0===l.length?(0,a.jsx)(w.Z,{children:(0,a.jsx)(S.Z,{colSpan:4,align:"center",children:"No test cases added yet."})}):l.map((e,t)=>{var n;return(0,a.jsxs)(w.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>{p(t),h(!0)},children:[(0,a.jsx)(S.Z,{children:(0,a.jsx)(s.Z,{variant:"body2",children:e.description||"Test Case #".concat(t+1)})}),(0,a.jsxs)(S.Z,{children:[(null===(n=e.assert)||void 0===n?void 0:n.length)||0," assertions"]}),(0,a.jsx)(S.Z,{children:Object.entries(e.vars||{}).map(e=>{let[t,n]=e;return t+"="+n}).join(", ")}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>{p(t),h(!0)},size:"small",children:(0,a.jsx)(R.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>m(e,t),size:"small",children:(0,a.jsx)(z.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(W.Z,{})})]})]},t)})})]})}),(0,a.jsx)(q,{open:u,onAdd:(e,t)=>{if(null===d)o([...l,e]);else{let t=l.map((t,n)=>n===d?e:t);o(t),p(null)}t&&h(!1)},varsList:t,initialValues:null!==d?l[d]:void 0,onCancel:()=>{p(null),h(!1)}})]})},X=n(7827),G=e=>{let{onChange:t,...n}=e,[i,l]=r.useState(""),[s,o]=r.useState(!1);return(0,a.jsx)(_.Z,{...n,error:s,helperText:s?"Invalid JSON":"",value:i,onChange:e=>{let n=e.target.value;try{let e=JSON.parse(n);l(n),o(!1),t&&t(e)}catch(e){l(n),o(!0)}}})},H=e=>{let{open:t,providerId:n,config:l,onClose:s,onSave:c}=e,[h,m]=r.useState(l);return r.useEffect(()=>{m(l)},[l]),(0,a.jsxs)(d.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"md",children:[(0,a.jsxs)(x.Z,{children:["Edit ",n.length>50?n.slice(0,50)+"...":n]}),(0,a.jsx)(u.Z,{children:Object.keys(h).map(e=>{let t;let n=h[e];return"number"==typeof n||"boolean"==typeof n||"string"==typeof n?(t="number"==typeof n?t=>m({...h,[e]:parseFloat(t.target.value)}):"boolean"==typeof n?t=>m({...h,[e]:"true"===t.target.value}):t=>{let n=t.target.value.trim();if(n.startsWith("{")||n.startsWith("["))try{m({...h,[e]:JSON.parse(n)})}catch(t){m({...h,[e]:n})}else"null"===n?m({...h,[e]:null}):"undefined"===n?m({...h,[e]:void 0}):m({...h,[e]:n})},(0,a.jsx)(o.Z,{my:2,children:(0,a.jsx)(_.Z,{label:e,value:n,onChange:t,fullWidth:!0,InputLabelProps:{shrink:!0},type:"number"==typeof n?"number":"text"})},e)):(0,a.jsx)(o.Z,{my:2,children:(0,a.jsx)(G,{label:e,defaultValue:JSON.stringify(n),onChange:t=>{m({...h,[e]:t})},fullWidth:!0,multiline:!0,minRows:2,InputLabelProps:{shrink:!0}})},e)})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:s,children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{c(h)},children:"Save"})]})]})};let M=[].concat(["replicate:replicate/flan-t5-small:69716ad8c34274043bf4a135b7315c7c569ec931d8f23d6826e249e1c142a264"].map(e=>({id:e,config:{temperature:.5,max_length:1024,repetition_penality:1}}))).concat(["replicate:replicate/codellama-7b-instruct:0103579e86fc75ba0d65912890fa19ef03c84a68554635319accf2e0ba93d3ae","replicate:replicate/codellama-13b-instruct:da5676342de1a5a335b848383af297f592b816b950a43d251a0a9edd0113604b","replicate:replicate/llama-2-70b-chat:2796ee9483c3fd7aa2e171d38f4ca12251a30609463dcfd4cd76703f22e96cdf"].map(e=>({id:e,config:{system_prompt:"",temperature:.75,top_p:.9,top_k:50,max_new_tokens:128,min_new_tokens:-1}}))).concat(["replicate:replicate/codellama-7b:6880b103613a9cd23950c5fd6c140197e519905bd0dd00e448c4858bdd06090a","replicate:replicate/codellama-13b-python:09b87c02dfa403e0c3289166dece62286b3bce49bae39a9c9204713cf94b8b7d","replicate:replicate/codellama-13b:1c914d844307b0588599b8393480a3ba917b660c7e9dfae681542b5325f228db","replicate:replicate/codellama-34b-python:9048743d22a7b19cd0abb018066809ea6af4f2b4717bef9aad3c5ae21ceac00d","replicate:replicate/codellama-34b:0666717e5ead8557dff55ee8f11924b5c0309f5f1ca52f64bb8eec405fdb38a7"].map(e=>({id:e,config:{temperature:.75,top_p:.9,top_k:50,max_new_tokens:128,min_new_tokens:-1}}))).concat(["replicate:a16z-infra/llama-2-7b-chat:7b0bfc9aff140d5b75bacbed23e91fd3c34b01a1e958d32132de6e0a19796e2c","replicate:a16z-infra/llama-2-13b-chat:2a7f981751ec7fdf87b5b91ad4db53683a98082e9ff7bfd12c8cd5ea85980a52"].map(e=>({id:e,config:{temperature:.95,top_p:.95,top_k:250,max_new_tokens:500,min_new_tokens:-1,repetition_penality:1,system_prompt:""}}))).concat(["anthropic:claude-1","anthropic:claude-1-100k","anthropic:claude-instant-1","anthropic:claude-instant-1-100k"].map(e=>({id:e,config:{max_tokens_to_sample:256,temperature:.5}}))).concat(["bedrock:anthropic.claude-instant-v1","bedrock:anthropic.claude-v1","bedrock:anthropic.claude-v2"].map(e=>({id:e,config:{max_tokens_to_sample:256,temperature:.5}}))).concat(["openai:gpt-3.5-turbo","openai:gpt-3.5-turbo-0301","openai:gpt-3.5-turbo-0613","openai:gpt-3.5-turbo-16k","openai:gpt-3.5-turbo-16k-0613","openai:gpt-4","openai:gpt-4-0314","openai:gpt-4-0613","openai:gpt-4-32k","openai:gpt-4-32k-0314"].map(e=>({id:e,config:{organization:"",temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0,function_call:void 0,functions:void 0,stop:void 0}}))).concat(["azureopenai:gpt-3.5-turbo","azureopenai:gpt-3.5-turbo-0301","azureopenai:gpt-3.5-turbo-0613","azureopenai:gpt-3.5-turbo-16k","azureopenai:gpt-3.5-turbo-16k-0613","azureopenai:gpt-4","azureopenai:gpt-4-0314","azureopenai:gpt-4-0613","azureopenai:gpt-4-32k","azureopenai:gpt-4-32k-0314"].map(e=>({id:e,config:{temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0,function_call:void 0,functions:void 0,stop:void 0}}))).concat(["vertex:chat-bison@001","vertex:chat-bison","vertex:chat-bison-32k","vertex:chat-bison-32k@001"].map(e=>({id:e,config:{context:void 0,examples:void 0,temperature:0,maxOutputTokens:1024,topP:.95,topK:40,safetySettings:void 0,stopSequence:void 0}}))).sort((e,t)=>e.id.localeCompare(t.id)),$={anthropic:"Anthropic",bedrock:"Amazon Web Services",azureopenai:"Azure",openai:"OpenAI",replicate:"Replicate"};var Q=e=>{let{providers:t,onChange:n}=e,[i,l]=r.useState(null),s=e=>"string"==typeof e?e:e.id||"Unknown provider",c=(e,t)=>"string"==typeof e?e:e.id||t,d=e=>{"string"==typeof e?alert("Cannot edit custom providers"):e.config?l(e):alert("There is no config for this provider")};return(0,a.jsxs)(o.Z,{mt:2,children:[(0,a.jsx)(B.Z,{multiple:!0,freeSolo:!0,options:M,value:t,groupBy:e=>(function(e){if(!e)return"Other";let t=e.split(":")[0];return $[t]||t})(e.id),onChange:(e,t)=>{n(t.map(e=>"string"==typeof e?{id:e}:e))},getOptionLabel:e=>{if(!e)return"";let t="";"string"==typeof e&&(t=e),e.id&&"string"==typeof e.id&&(t=e.id);let n=t.split(":");return n.length>1?n[1]:"Unknown provider"},renderTags:(e,t)=>e.map((e,n)=>{let a=s(e),i=c(e,n);return(0,r.createElement)(X.Z,{variant:"outlined",label:a,...t({index:n}),key:i,onClick:()=>d(e)})}),renderInput:e=>(0,a.jsx)(_.Z,{...e,variant:"outlined",placeholder:"Select LLM providers",helperText:t.length>0?"Click a provider to configure its settings.":null})}),i&&i.id&&(0,a.jsx)(H,{open:!!i,providerId:i.id,config:i.config,onClose:()=>l(null),onSave:e=>{if(i){let a=t.map(t=>t.id===i.id?{...t,config:e}:t);n(a),l(null)}}})]})},ee=n(2666),et=n.n(ee),en=n(4759);n(5341),n(7555);var ea=n(8339),er=n(9963),ei=n(1396),el=n.n(ei);n(695);var es=()=>{let{env:e,setEnv:t,description:n,setDescription:l,providers:c,setProviders:d,prompts:p,setPrompts:u,testCases:h,setTestCases:x}=(0,g.o)(),[m,f]=r.useState(""),[j,v]=r.useState(!0);r.useEffect(()=>{f(ea.default.dump({env:e,description:n,providers:c,prompts:p,tests:h}))},[e,n,c,p,h]);let Z=e=>{t(e.env||{}),l(e.description||""),d(e.providers||[]),u(e.prompts||[]),x(e.tests||[])};return(0,a.jsxs)(o.Z,{mt:4,children:[(0,a.jsx)(s.Z,{variant:"h5",gutterBottom:!0,children:"Configuration"}),(0,a.jsxs)(s.Z,{variant:"body1",gutterBottom:!0,children:["This is the YAML config that defines the evaluation and is processed by promptfoo. See"," ",(0,a.jsx)(el(),{target:"_blank",href:"https://promptfoo.dev/docs/configuration/guide",children:"configuration docs"})," ","to learn more."]}),(0,a.jsx)(i.Z,{variant:"text",color:"primary",startIcon:j?(0,a.jsx)(R.Z,{}):(0,a.jsx)(er.Z,{}),onClick:()=>{if(!j)try{let e=ea.default.load(m,{json:!0});Z(e)}catch(e){}v(!j)},children:j?"Edit YAML":"Save"}),(0,a.jsx)(et(),{autoCapitalize:"off",value:m,onValueChange:e=>{j||f(e)},highlight:e=>(0,en.highlight)(e,en.languages.yaml),padding:10,style:{fontFamily:'"Fira code", "Fira Mono", monospace',fontSize:14},disabled:j,className:j?"":"glowing-border"})]})};n(284);var eo=n(7580);function ec(e){let{error:t,resetErrorBoundary:n}=e;return(0,a.jsxs)("div",{role:"alert",children:[(0,a.jsx)("p",{children:"Something went wrong:"}),(0,a.jsx)("pre",{children:t.message}),(0,a.jsx)("button",{onClick:n,children:"Try again"})]})}var ed=()=>{let[e,t]=(0,r.useState)(!1),{description:n,setDescription:f,providers:j,setProviders:v,prompts:b,setPrompts:y,testCases:C,setTestCases:_}=(0,g.o)();if((0,r.useEffect)(()=>{g.o.persist.rehydrate()},[]),eo.env.NEXT_PUBLIC_NO_BROWSING)return null;let k=(e=>{let t=/{{(\w+)}}/g,n=new Set;return e.forEach(e=>{let a;for(;null!==(a=t.exec(e));)n.add(a[1])}),Array.from(n)})(b);return(0,a.jsxs)(l.Z,{maxWidth:"lg",sx:{marginTop:"2rem"},children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h4",children:"Set up an evaluation"}),(0,a.jsxs)(c.Z,{direction:"row",spacing:2,children:[(0,a.jsx)(Z,{}),(0,a.jsx)(A,{}),(0,a.jsx)(i.Z,{variant:"outlined",color:"primary",onClick:()=>t(!0),children:"Reset"})]})]}),(0,a.jsx)(o.Z,{mt:4}),(0,a.jsx)(o.Z,{mt:2,children:(0,a.jsx)(m.SV,{FallbackComponent:ec,onReset:()=>{v([])},children:(0,a.jsxs)(c.Z,{direction:"column",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h5",children:"Providers"}),(0,a.jsx)(Q,{providers:j,onChange:v})]})})}),(0,a.jsx)(o.Z,{mt:4}),(0,a.jsx)(m.SV,{FallbackComponent:ec,onReset:()=>{y([])},children:(0,a.jsx)(F,{})}),(0,a.jsx)(o.Z,{mt:6}),(0,a.jsx)(m.SV,{FallbackComponent:ec,onReset:()=>{_([])},children:(0,a.jsx)(J,{varsList:k})}),(0,a.jsx)(es,{}),(0,a.jsxs)(d.Z,{open:e,onClose:()=>t(!1),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,a.jsx)(x.Z,{id:"alert-dialog-title",children:"Confirm Reset"}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(h.Z,{id:"alert-dialog-description",children:"Are you sure you want to reset all the fields? This action cannot be undone."})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:()=>t(!1),children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{f(""),v([]),y([]),_([]),t(!1)},autoFocus:!0,children:"Reset"})]})]})]})}},279:function(e,t,n){"use strict";n.d(t,{Ox:function(){return i},T8:function(){return r},eA:function(){return l}});var a=n(7580);let r=!a.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,i=!!a.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,l=""},1938:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var a=n(4660),r=n(4810);let i=(0,a.Ue)()((0,r.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setStateFromConfig:t=>{let n={};t.description&&(n.description=t.description||""),t.tests&&(n.testCases=t.tests),t.providers&&(n.providers=t.providers),t.prompts&&("string"==typeof t.prompts?n.prompts=[t.prompts]:Array.isArray(t.prompts)?n.prompts=t.prompts.filter(e=>!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),e(n)},getTestSuite:()=>{let{description:e,testCases:n,providers:a,prompts:r,env:i}=t();return{env:i,description:e,providers:a,prompts:r,tests:n}}}),{name:"promptfoo",skipHydration:!0}))},2280:function(){},695:function(){},284:function(){},5320:function(e,t){"use strict";t.It=void 0,t.It=function(e){let t={},n=[],a={};for(let[r,i]of Object.entries(e))r.startsWith("__expected")?""!==i.trim()&&n.push(function(e){if(e.startsWith("javascript:")||e.startsWith("fn:")||e.startsWith("eval:")){let t;e.startsWith("javascript:")&&(t=11),e.startsWith("fn:")&&(t=3),e.startsWith("eval:")&&(t=5);let n=e.slice(t);return{type:"javascript",value:n}}if(e.startsWith("grade:")||e.startsWith("llm-rubric:"))return{type:"llm-rubric",value:e.slice(6)};if(e.startsWith("python:")){let t=e.slice(7);return{type:"python",value:t}}let t=e.match(/^(not-)?(equals|contains-any|contains-all|icontains-any|icontains-all|contains-json|is-json|regex|icontains|contains|webhook|rouge-n|similar|starts-with|levenshtein|classifier|model-graded-factuality|factuality|model-graded-closedqa|answer-relevance|context-recall|context-relevance|context-faithfulness|is-valid-openai-function-call|is-valid-openai-tools-call|latency|perplexity|perplexity-score|cost)(?:\((\d+(?:\.\d+)?)\))?(?::(.*))?$/);if(t){let[e,n,a,r,i]=t,l=n?`not-${a}`:a,s=parseFloat(r);return"contains-any"===a||"contains-all"===a||"icontains-any"===a||"icontains-all"===a?{type:l,value:i.split(",").map(e=>e.trim())}:"contains-json"===a||"is-json"===a?{type:l}:"rouge-n"===a||"similar"===a||"starts-with"===a||"levenshtein"===a||"classifier"===a||"answer-relevance"===a||"context-recall"===a||"context-relevance"===a||"context-faithfulness"===a||"latency"===a||"perplexity"===a||"perplexity-score"===a||"cost"===a?{type:l,value:i,threshold:s||("similar"===a?.8:.75)}:{type:l,value:i}}return{type:"equals",value:e}}(i)):"__prefix"===r?a.prefix=i:"__suffix"===r?a.suffix=i:t[r]=i;return{vars:t,assert:n,options:a}}}},function(e){e.O(0,[293,808,548,420,975,886,683,339,376,971,596,744],function(){return e(e.s=3515)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var e,t,n,r,o,u,i,c,f,a={},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}},r=!0;try{a[e].call(n.exports,n,n.exports,s),r=!1}finally{r&&delete l[e]}return n.exports}s.m=a,e=[],s.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var n=e[u][0],r=e[u][1],o=e[u][2],c=!0,f=0;f<n.length;f++)i>=o&&Object.keys(s.O).every(function(e){return s.O[e](n[f])})?n.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=r();void 0!==a&&(t=a)}}return t},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},s.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);s.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},s.d(o,u),o},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){return 922===e?"static/chunks/922.2b3e75a995f09e1b.js":"static/chunks/"+e+"-"+({339:"501c32916b785ef1",631:"b333d4a78100eabe"})[e]+".js"},s.miniCssF=function(e){return"static/css/"+({11:"
|
|
1
|
+
!function(){"use strict";var e,t,n,r,o,u,i,c,f,a={},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}},r=!0;try{a[e].call(n.exports,n,n.exports,s),r=!1}finally{r&&delete l[e]}return n.exports}s.m=a,e=[],s.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var n=e[u][0],r=e[u][1],o=e[u][2],c=!0,f=0;f<n.length;f++)i>=o&&Object.keys(s.O).every(function(e){return s.O[e](n[f])})?n.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=r();void 0!==a&&(t=a)}}return t},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},s.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);s.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},s.d(o,u),o},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){return 922===e?"static/chunks/922.2b3e75a995f09e1b.js":"static/chunks/"+e+"-"+({339:"501c32916b785ef1",631:"b333d4a78100eabe"})[e]+".js"},s.miniCssF=function(e){return"static/css/"+({11:"87fb00eed311e9cd",185:"51a17e8edcdfdbb2",413:"16c1dd82fc87c9d7",421:"e162c4971c41c2ac",466:"48d388184a2f4ce3",931:"8119d8bd13a8adab"})[e]+".css"},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="_N_E:",s.l=function(e,t,n,u){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var i,c,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var l=f[a];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+n){i=l;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",o+n),i.src=s.tu(e)),r[e]=[t];var d=function(t,n){i.onerror=i.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.tt=function(){return void 0===u&&(u={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},s.tu=function(e){return s.tt().createScriptURL(e)},s.p="/_next/",i={272:0},s.f.j=function(e,t){var n=s.o(i,e)?i[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(272!=e){var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=s.p+s.u(e),u=Error();s.l(o,function(t){if(s.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+e,e)}else i[e]=0}},s.O.j=function(e){return 0===i[e]},c=function(e,t){var n,r,o=t[0],u=t[1],c=t[2],f=0;if(o.some(function(e){return 0!==i[e]})){for(n in u)s.o(u,n)&&(s.m[n]=u[n]);if(c)var a=c(s)}for(e&&e(t);f<o.length;f++)r=o[f],s.o(i,r)&&i[r]&&i[r][0](),i[r]=0;return s.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),f.push=c.bind(null,f.push.bind(f))}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.custom-metric-container{display:inline-flex;flex-wrap:wrap;gap:.25rem;font-weight:400}.custom-metric-container>span{padding:.25rem .5rem;border-radius:4px;color:var(--text-color);border:1px solid var(--border-color);margin-right:.25rem}pre{white-space:pre-wrap}.font-bold{font-weight:700}.divTable,table.results-table{border:1px solid var(--table-border-color);border-collapse:collapse;width:100%;margin:1rem 0;box-shadow:0 2px 4px rgba(0,0,0,.1)}.results-table ins{background-color:var(--insert-highlight-color);text-decoration:none}.results-table del{background-color:var(--delete-highlight-color);-webkit-text-decoration:strikethrough;text-decoration:strikethrough}.tr{display:flex}.results-table tr,.tr{width:-moz-fit-content;width:fit-content}.results-table tr:hover,.tr:hover{background-color:rgba(0,0,0,.02)}.results-table td,.results-table th,.td,.th{position:relative;box-shadow:inset 0 0 0 1px var(--border-color);vertical-align:top;padding:1rem}.compact .td,.compact .th,.compact.results-table td,.compact.results-table th{padding:.5rem}.results-table td.variable,.results-table th.variable,.td.variable,.th.variable{background-color:var(--variable-background-color)}.results-table tr.header{background-color:var(--header-background-color)}.results-table th,.th{padding:1rem;position:relative;vertical-align:bottom;text-align:left;white-space:pre-wrap;font-weight:400}.results-table th .action{cursor:pointer;margin-left:.5rem}.results-table th .action svg{vertical-align:middle}.results-table td,.results-table th{height:1px}@-moz-document url-prefix(){.results-table td,.results-table th{height:100%}}.firefox-fix{display:table;height:100%}.results-table tr .cell{display:flex;flex-direction:column;white-space:pre-wrap;height:100%}.results-table tr .cell img{max-width:256px;max-height:256px;cursor:pointer}.compact.results-table tr .cell>*,.results-table tr .variable>*{display:inline}.results-table tr .cell-actions{display:flex;gap:.5rem;visibility:hidden;position:absolute;top:1.25rem;right:.75rem;line-height:0;font-size:1.25rem}.results-table tr:hover .cell-actions{visibility:visible}.results-table tr .cell-detail{display:flex;flex-wrap:wrap;column-gap:.5rem;row-gap:.25rem;padding-top:1rem;margin-top:auto}.results-table tr .stat-item{font-weight:400;font-size:.75rem;color:#888}.results-table tr .cell-actions .action{cursor:pointer}.results-table th .output-header{display:flex;flex-direction:column;height:100%;align-items:flex-start}.results-table th .output-header .pills{display:flex;flex-wrap:wrap;gap:.25rem;align-items:center;margin-bottom:.5rem}.results-table th .prompt-container{font-weight:700;margin-bottom:.5rem}.results-table th .prompt-container>*{display:inline}.results-table th .provider{display:inline-block;padding:.25rem .5rem;background-color:var(--neutral-background-color);border:1px solid var(--border-color);border-radius:4px;margin-right:.25rem}.results-table th .summary{font-weight:400}.results-table th .prompt-detail{display:flex;flex-wrap:wrap;column-gap:.5rem;row-gap:.25rem;font-size:.75rem;color:#888;margin-top:auto}.results-table th .summary .highlight{padding:.25rem .5rem;border-radius:4px;background-color:var(--fail-background-color);border:1px solid var(--border-color)}.results-table th .summary .highlight.success{background-color:var(--success-background-color);border:1px solid var(--pass-color)}.results-table .status{font-weight:700;margin-bottom:.5rem}.results-table .status .pill{display:inline-block;padding:.25rem .5rem;border-radius:4px;margin-right:.25rem}.results-table .pass .pill{background-color:var(--success-background-color);color:var(--pass-color);border:1px solid var(--pass-color)}.results-table .fail .pill{border:1px solid var(--fail-color)}.fail-reason,.results-table .fail{color:var(--fail-color)}.fail-reason{font-weight:700}.compact .fail-reason{display:inline}.results-table .fail .pill{background-color:var(--fail-background-color)}.results-table td .score{font-weight:400}.results-table .comment{margin-top:.5rem;padding:.25rem .5rem;border-radius:4px;background-color:var(--neutral-background-color);font-style:italic;cursor:pointer}.first-prompt-col{border-left:2px solid #888}.first-prompt-row{border-top:2px solid #888}.search-highlight{color:var(--search-text-color);background-color:var(--search-highlight-color)}.results-table tr .cell .lightbox{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;z-index:1000}.results-table tr .cell .lightbox img{max-width:90%;max-height:90%}.resizer{position:absolute;right:0;top:0;height:100%;width:5px;cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:none;background:var(--text-color);opacity:.5}.resizer.isResizing{background:var(--text-color);opacity:1}@media (hover:hover){.resizer{opacity:0}:hover>.resizer{opacity:1}}.description-filepath{color:#bbb;font-size:.75rem}body{background-color:var(--background-color);color:var(--text-color)}.
|
|
1
|
+
.custom-metric-container{display:inline-flex;flex-wrap:wrap;gap:.25rem;font-weight:400}.custom-metric-container>span{padding:.25rem .5rem;border-radius:4px;color:var(--text-color);border:1px solid var(--border-color);margin-right:.25rem}pre{white-space:pre-wrap}.font-bold{font-weight:700}.divTable,table.results-table{border:1px solid var(--table-border-color);border-collapse:collapse;width:100%;margin:1rem 0;box-shadow:0 2px 4px rgba(0,0,0,.1)}.results-table ins{background-color:var(--insert-highlight-color);text-decoration:none}.results-table del{background-color:var(--delete-highlight-color);-webkit-text-decoration:strikethrough;text-decoration:strikethrough}.tr{display:flex}.results-table tr,.tr{width:-moz-fit-content;width:fit-content}.results-table tr:hover,.tr:hover{background-color:rgba(0,0,0,.02)}.results-table td,.results-table th,.td,.th{position:relative;box-shadow:inset 0 0 0 1px var(--border-color);vertical-align:top;padding:1rem}.compact .td,.compact .th,.compact.results-table td,.compact.results-table th{padding:.5rem}.results-table td.variable,.results-table th.variable,.td.variable,.th.variable{background-color:var(--variable-background-color)}.results-table tr.header{background-color:var(--header-background-color)}.results-table th,.th{padding:1rem;position:relative;vertical-align:bottom;text-align:left;white-space:pre-wrap;font-weight:400}.results-table th .action{cursor:pointer;margin-left:.5rem}.results-table th .action svg{vertical-align:middle}.results-table td,.results-table th{height:1px}@-moz-document url-prefix(){.results-table td,.results-table th{height:100%}}.firefox-fix{display:table;height:100%}.results-table tr .cell{display:flex;flex-direction:column;white-space:pre-wrap;height:100%}.results-table tr .cell img{max-width:256px;max-height:256px;cursor:pointer}.compact.results-table tr .cell>*,.results-table tr .variable>*{display:inline}.results-table tr .cell-actions{display:flex;gap:.5rem;visibility:hidden;position:absolute;top:1.25rem;right:.75rem;line-height:0;font-size:1.25rem}.results-table tr:hover .cell-actions{visibility:visible}.results-table tr .cell-detail{display:flex;flex-wrap:wrap;column-gap:.5rem;row-gap:.25rem;padding-top:1rem;margin-top:auto}.results-table tr .stat-item{font-weight:400;font-size:.75rem;color:#888}.results-table tr .cell-actions .action{cursor:pointer}.results-table th .output-header{display:flex;flex-direction:column;height:100%;align-items:flex-start}.results-table th .output-header .pills{display:flex;flex-wrap:wrap;gap:.25rem;align-items:center;margin-bottom:.5rem}.results-table th .prompt-container{font-weight:700;margin-bottom:.5rem}.results-table th .prompt-container>*{display:inline}.results-table th .provider{display:inline-block;padding:.25rem .5rem;background-color:var(--neutral-background-color);border:1px solid var(--border-color);border-radius:4px;margin-right:.25rem}.results-table th .summary{font-weight:400}.results-table th .prompt-detail{display:flex;flex-wrap:wrap;column-gap:.5rem;row-gap:.25rem;font-size:.75rem;color:#888;margin-top:auto}.results-table th .summary .highlight{padding:.25rem .5rem;border-radius:4px;background-color:var(--fail-background-color);border:1px solid var(--border-color)}.results-table th .summary .highlight.success{background-color:var(--success-background-color);border:1px solid var(--pass-color)}.results-table .status{font-weight:700;margin-bottom:.5rem}.results-table .status .pill{display:inline-block;padding:.25rem .5rem;border-radius:4px;margin-right:.25rem}.results-table .pass .pill{background-color:var(--success-background-color);color:var(--pass-color);border:1px solid var(--pass-color)}.results-table .fail .pill{border:1px solid var(--fail-color)}.fail-reason,.results-table .fail{color:var(--fail-color)}.fail-reason{font-weight:700}.compact .fail-reason{display:inline}.results-table .fail .pill{background-color:var(--fail-background-color)}.results-table td .score{font-weight:400}.results-table .comment{margin-top:.5rem;padding:.25rem .5rem;border-radius:4px;background-color:var(--neutral-background-color);font-style:italic;cursor:pointer}.first-prompt-col{border-left:2px solid #888}.first-prompt-row{border-top:2px solid #888}.search-highlight{color:var(--search-text-color);background-color:var(--search-highlight-color)}.results-table tr .cell .lightbox{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;z-index:1000}.results-table tr .cell .lightbox img{max-width:90%;max-height:90%}.resizer{position:absolute;right:0;top:0;height:100%;width:5px;cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:none;background:var(--text-color);opacity:.5}.resizer.isResizing{background:var(--text-color);opacity:1}@media (hover:hover){.resizer{opacity:0}:hover>.resizer{opacity:1}}.description{cursor:pointer;transition:background-color .3s ease}.description:hover{background-color:#f0f0f0}.description-filepath{color:#bbb;font-size:.75rem}body{background-color:var(--background-color);color:var(--text-color)}.notice{display:flex;flex-direction:column;gap:1.5rem;justify-content:center;align-items:center;height:9rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.custom-metric-container{display:inline-flex;flex-wrap:wrap;gap:.25rem;font-weight:400}.custom-metric-container>span{padding:.25rem .5rem;border-radius:4px;color:var(--text-color);border:1px solid var(--border-color);margin-right:.25rem}pre{white-space:pre-wrap}.font-bold{font-weight:700}.divTable,table.results-table{border:1px solid var(--table-border-color);border-collapse:collapse;width:100%;margin:1rem 0;box-shadow:0 2px 4px rgba(0,0,0,.1)}.results-table ins{background-color:var(--insert-highlight-color);text-decoration:none}.results-table del{background-color:var(--delete-highlight-color);-webkit-text-decoration:strikethrough;text-decoration:strikethrough}.tr{display:flex}.results-table tr,.tr{width:-moz-fit-content;width:fit-content}.results-table tr:hover,.tr:hover{background-color:rgba(0,0,0,.02)}.results-table td,.results-table th,.td,.th{position:relative;box-shadow:inset 0 0 0 1px var(--border-color);vertical-align:top;padding:1rem}.compact .td,.compact .th,.compact.results-table td,.compact.results-table th{padding:.5rem}.results-table td.variable,.results-table th.variable,.td.variable,.th.variable{background-color:var(--variable-background-color)}.results-table tr.header{background-color:var(--header-background-color)}.results-table th,.th{padding:1rem;position:relative;vertical-align:bottom;text-align:left;white-space:pre-wrap;font-weight:400}.results-table th .action{cursor:pointer;margin-left:.5rem}.results-table th .action svg{vertical-align:middle}.results-table td,.results-table th{height:1px}@-moz-document url-prefix(){.results-table td,.results-table th{height:100%}}.firefox-fix{display:table;height:100%}.results-table tr .cell{display:flex;flex-direction:column;white-space:pre-wrap;height:100%}.results-table tr .cell img{max-width:256px;max-height:256px;cursor:pointer}.compact.results-table tr .cell>*,.results-table tr .variable>*{display:inline}.results-table tr .cell-actions{display:flex;gap:.5rem;visibility:hidden;position:absolute;top:1.25rem;right:.75rem;line-height:0;font-size:1.25rem}.results-table tr:hover .cell-actions{visibility:visible}.results-table tr .cell-detail{display:flex;flex-wrap:wrap;column-gap:.5rem;row-gap:.25rem;padding-top:1rem;margin-top:auto}.results-table tr .stat-item{font-weight:400;font-size:.75rem;color:#888}.results-table tr .cell-actions .action{cursor:pointer}.results-table th .output-header{display:flex;flex-direction:column;height:100%;align-items:flex-start}.results-table th .output-header .pills{display:flex;flex-wrap:wrap;gap:.25rem;align-items:center;margin-bottom:.5rem}.results-table th .prompt-container{font-weight:700;margin-bottom:.5rem}.results-table th .prompt-container>*{display:inline}.results-table th .provider{display:inline-block;padding:.25rem .5rem;background-color:var(--neutral-background-color);border:1px solid var(--border-color);border-radius:4px;margin-right:.25rem}.results-table th .summary{font-weight:400}.results-table th .prompt-detail{display:flex;flex-wrap:wrap;column-gap:.5rem;row-gap:.25rem;font-size:.75rem;color:#888;margin-top:auto}.results-table th .summary .highlight{padding:.25rem .5rem;border-radius:4px;background-color:var(--fail-background-color);border:1px solid var(--border-color)}.results-table th .summary .highlight.success{background-color:var(--success-background-color);border:1px solid var(--pass-color)}.results-table .status{font-weight:700;margin-bottom:.5rem}.results-table .status .pill{display:inline-block;padding:.25rem .5rem;border-radius:4px;margin-right:.25rem}.results-table .pass .pill{background-color:var(--success-background-color);color:var(--pass-color);border:1px solid var(--pass-color)}.results-table .fail .pill{border:1px solid var(--fail-color)}.fail-reason,.results-table .fail{color:var(--fail-color)}.fail-reason{font-weight:700}.compact .fail-reason{display:inline}.results-table .fail .pill{background-color:var(--fail-background-color)}.results-table td .score{font-weight:400}.results-table .comment{margin-top:.5rem;padding:.25rem .5rem;border-radius:4px;background-color:var(--neutral-background-color);font-style:italic;cursor:pointer}.first-prompt-col{border-left:2px solid #888}.first-prompt-row{border-top:2px solid #888}.search-highlight{color:var(--search-text-color);background-color:var(--search-highlight-color)}.results-table tr .cell .lightbox{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;z-index:1000}.results-table tr .cell .lightbox img{max-width:90%;max-height:90%}.resizer{position:absolute;right:0;top:0;height:100%;width:5px;cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:none;background:var(--text-color);opacity:.5}.resizer.isResizing{background:var(--text-color);opacity:1}@media (hover:hover){.resizer{opacity:0}:hover>.resizer{opacity:1}}.description-filepath{color:#bbb;font-size:.75rem}body{background-color:var(--background-color);color:var(--text-color)}.notice{display:flex;flex-direction:column;gap:1.5rem;justify-content:center;align-items:center;height:9rem}
|
|
1
|
+
.custom-metric-container{display:inline-flex;flex-wrap:wrap;gap:.25rem;font-weight:400}.custom-metric-container>span{padding:.25rem .5rem;border-radius:4px;color:var(--text-color);border:1px solid var(--border-color);margin-right:.25rem}pre{white-space:pre-wrap}.font-bold{font-weight:700}.divTable,table.results-table{border:1px solid var(--table-border-color);border-collapse:collapse;width:100%;margin:1rem 0;box-shadow:0 2px 4px rgba(0,0,0,.1)}.results-table ins{background-color:var(--insert-highlight-color);text-decoration:none}.results-table del{background-color:var(--delete-highlight-color);-webkit-text-decoration:strikethrough;text-decoration:strikethrough}.tr{display:flex}.results-table tr,.tr{width:-moz-fit-content;width:fit-content}.results-table tr:hover,.tr:hover{background-color:rgba(0,0,0,.02)}.results-table td,.results-table th,.td,.th{position:relative;box-shadow:inset 0 0 0 1px var(--border-color);vertical-align:top;padding:1rem}.compact .td,.compact .th,.compact.results-table td,.compact.results-table th{padding:.5rem}.results-table td.variable,.results-table th.variable,.td.variable,.th.variable{background-color:var(--variable-background-color)}.results-table tr.header{background-color:var(--header-background-color)}.results-table th,.th{padding:1rem;position:relative;vertical-align:bottom;text-align:left;white-space:pre-wrap;font-weight:400}.results-table th .action{cursor:pointer;margin-left:.5rem}.results-table th .action svg{vertical-align:middle}.results-table td,.results-table th{height:1px}@-moz-document url-prefix(){.results-table td,.results-table th{height:100%}}.firefox-fix{display:table;height:100%}.results-table tr .cell{display:flex;flex-direction:column;white-space:pre-wrap;height:100%}.results-table tr .cell img{max-width:256px;max-height:256px;cursor:pointer}.compact.results-table tr .cell>*,.results-table tr .variable>*{display:inline}.results-table tr .cell-actions{display:flex;gap:.5rem;visibility:hidden;position:absolute;top:1.25rem;right:.75rem;line-height:0;font-size:1.25rem}.results-table tr:hover .cell-actions{visibility:visible}.results-table tr .cell-detail{display:flex;flex-wrap:wrap;column-gap:.5rem;row-gap:.25rem;padding-top:1rem;margin-top:auto}.results-table tr .stat-item{font-weight:400;font-size:.75rem;color:#888}.results-table tr .cell-actions .action{cursor:pointer}.results-table th .output-header{display:flex;flex-direction:column;height:100%;align-items:flex-start}.results-table th .output-header .pills{display:flex;flex-wrap:wrap;gap:.25rem;align-items:center;margin-bottom:.5rem}.results-table th .prompt-container{font-weight:700;margin-bottom:.5rem}.results-table th .prompt-container>*{display:inline}.results-table th .provider{display:inline-block;padding:.25rem .5rem;background-color:var(--neutral-background-color);border:1px solid var(--border-color);border-radius:4px;margin-right:.25rem}.results-table th .summary{font-weight:400}.results-table th .prompt-detail{display:flex;flex-wrap:wrap;column-gap:.5rem;row-gap:.25rem;font-size:.75rem;color:#888;margin-top:auto}.results-table th .summary .highlight{padding:.25rem .5rem;border-radius:4px;background-color:var(--fail-background-color);border:1px solid var(--border-color)}.results-table th .summary .highlight.success{background-color:var(--success-background-color);border:1px solid var(--pass-color)}.results-table .status{font-weight:700;margin-bottom:.5rem}.results-table .status .pill{display:inline-block;padding:.25rem .5rem;border-radius:4px;margin-right:.25rem}.results-table .pass .pill{background-color:var(--success-background-color);color:var(--pass-color);border:1px solid var(--pass-color)}.results-table .fail .pill{border:1px solid var(--fail-color)}.fail-reason,.results-table .fail{color:var(--fail-color)}.fail-reason{font-weight:700}.compact .fail-reason{display:inline}.results-table .fail .pill{background-color:var(--fail-background-color)}.results-table td .score{font-weight:400}.results-table .comment{margin-top:.5rem;padding:.25rem .5rem;border-radius:4px;background-color:var(--neutral-background-color);font-style:italic;cursor:pointer}.first-prompt-col{border-left:2px solid #888}.first-prompt-row{border-top:2px solid #888}.search-highlight{color:var(--search-text-color);background-color:var(--search-highlight-color)}.results-table tr .cell .lightbox{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;z-index:1000}.results-table tr .cell .lightbox img{max-width:90%;max-height:90%}.resizer{position:absolute;right:0;top:0;height:100%;width:5px;cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:none;background:var(--text-color);opacity:.5}.resizer.isResizing{background:var(--text-color);opacity:1}@media (hover:hover){.resizer{opacity:0}:hover>.resizer{opacity:1}}.description{cursor:pointer;transition:background-color .3s ease}.description:hover{background-color:#f0f0f0}.description-filepath{color:#bbb;font-size:.75rem}body{background-color:var(--background-color);color:var(--text-color)}.error,.notice{display:flex;flex-direction:column;gap:1.5rem;justify-content:center;align-items:center;height:9rem}.error{font-size:1.5rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"data":[{"id":"eval-2024-03-
|
|
1
|
+
{"data":[{"id":"eval-2024-03-08T16-57-04.195Z.json","label":"March 8, 2024 at 08:57:04 AM PST"},{"id":"eval-2024-03-08T16-40-52.209Z.json","label":"March 8, 2024 at 08:40:52 AM PST"},{"id":"eval-2024-03-08T16-40-29.924Z.json","label":"March 8, 2024 at 08:40:29 AM PST"},{"id":"eval-2024-03-08T16-37-52.761Z.json","label":"March 8, 2024 at 08:37:52 AM PST"},{"id":"eval-2024-03-08T16-36-36.278Z.json","label":"March 8, 2024 at 08:36:36 AM PST"},{"id":"eval-2024-03-08T16-36-23.249Z.json","label":"March 8, 2024 at 08:36:23 AM PST"},{"id":"eval-2024-03-08T16-35-43.967Z.json","label":"March 8, 2024 at 08:35:43 AM PST"},{"id":"eval-2024-03-08T16-34-40.884Z.json","label":"March 8, 2024 at 08:34:40 AM PST"},{"id":"eval-2024-03-08T04-39-57.167Z.json","label":"March 7, 2024 at 08:39:57 PM PST"},{"id":"eval-2024-03-08T04-38-28.255Z.json","label":"March 7, 2024 at 08:38:28 PM PST"},{"id":"eval-2024-03-07T17-55-36.631Z.json","label":"March 7, 2024 at 09:55:36 AM PST"},{"id":"eval-2024-03-07T17-53-26.933Z.json","label":"March 7, 2024 at 09:53:26 AM PST"},{"id":"eval-2024-03-07T17-53-21.893Z.json","label":"March 7, 2024 at 09:53:21 AM PST"},{"id":"eval-2024-03-07T17-52-54.849Z.json","label":"March 7, 2024 at 09:52:54 AM PST"},{"id":"eval-2024-03-07T17-52-33.387Z.json","label":"March 7, 2024 at 09:52:33 AM PST"},{"id":"eval-2024-03-07T17-50-30.013Z.json","label":"March 7, 2024 at 09:50:30 AM PST"},{"id":"eval-2024-03-07T17-35-33.747Z.json","label":"March 7, 2024 at 09:35:33 AM PST"},{"id":"eval-2024-03-07T17-34-54.457Z.json","label":"March 7, 2024 at 09:34:54 AM PST"},{"id":"eval-2024-03-07T17-33-59.120Z.json","label":"March 7, 2024 at 09:33:59 AM PST"},{"id":"eval-2024-03-07T17-33-54.184Z.json","label":"March 7, 2024 at 09:33:54 AM PST"},{"id":"eval-2024-03-07T17-33-16.575Z.json","label":"March 7, 2024 at 09:33:16 AM PST"},{"id":"eval-2024-03-07T17-21-46.771Z.json","label":"March 7, 2024 at 09:21:46 AM PST"},{"id":"eval-2024-03-07T17-19-48.976Z.json","label":"March 7, 2024 at 09:19:48 AM PST"},{"id":"eval-2024-03-07T17-19-31.316Z.json","label":"March 7, 2024 at 09:19:31 AM PST"},{"id":"eval-2024-03-07T17-03-51.628Z.json","label":"My first eval (March 7, 2024 at 09:03:51 AM PST)"},{"id":"eval-2024-03-07T17-03-39.461Z.json","label":"My first eval (March 7, 2024 at 09:03:39 AM PST)"},{"id":"eval-2024-03-07T17-03-25.493Z.json","label":"My first eval (March 7, 2024 at 09:03:25 AM PST)"},{"id":"eval-2024-03-07T17-03-15.277Z.json","label":"meowww (March 7, 2024 at 09:03:15 AM PST)"},{"id":"eval-2024-03-07T17-02-56.658Z.json","label":"My first eval (March 7, 2024 at 09:02:56 AM PST)"},{"id":"eval-2024-03-07T17-02-23.652Z.json","label":"My first eval (March 7, 2024 at 09:02:23 AM PST)"},{"id":"eval-2024-03-07T16-16-50.234Z.json","label":"March 7, 2024 at 08:16:50 AM PST"},{"id":"eval-2024-03-07T16-16-34.093Z.json","label":"March 7, 2024 at 08:16:34 AM PST"},{"id":"eval-2024-03-07T16-16-22.468Z.json","label":"March 7, 2024 at 08:16:22 AM PST"},{"id":"eval-2024-03-07T00-18-36.021Z.json","label":"March 6, 2024 at 04:18:36 PM PST"},{"id":"eval-2024-03-07T00-18-07.070Z.json","label":"March 6, 2024 at 04:18:07 PM PST"},{"id":"eval-2024-03-07T00-17-39.926Z.json","label":"March 6, 2024 at 04:17:39 PM PST"},{"id":"eval-2024-03-07T00-17-30.297Z.json","label":"March 6, 2024 at 04:17:30 PM PST"},{"id":"eval-2024-03-07T00-15-58.198Z.json","label":"March 6, 2024 at 04:15:58 PM PST"},{"id":"eval-2024-03-06T23-12-36.786Z.json","label":"March 6, 2024 at 03:12:36 PM PST"},{"id":"eval-2024-03-06T23-12-11.477Z.json","label":"March 6, 2024 at 03:12:11 PM PST"},{"id":"eval-2024-03-06T23-10-04.324Z.json","label":"March 6, 2024 at 03:10:04 PM PST"},{"id":"eval-2024-03-06T23-09-38.679Z.json","label":"March 6, 2024 at 03:09:38 PM PST"},{"id":"eval-2024-03-06T23-09-17.487Z.json","label":"March 6, 2024 at 03:09:17 PM PST"},{"id":"eval-2024-03-06T23-08-59.948Z.json","label":"March 6, 2024 at 03:08:59 PM PST"},{"id":"eval-2024-03-06T23-08-04.931Z.json","label":"March 6, 2024 at 03:08:04 PM PST"},{"id":"eval-2024-03-06T23-07-48.341Z.json","label":"March 6, 2024 at 03:07:48 PM PST"},{"id":"eval-2024-03-06T23-06-37.786Z.json","label":"March 6, 2024 at 03:06:37 PM PST"},{"id":"eval-2024-03-06T23-02-17.158Z.json","label":"March 6, 2024 at 03:02:17 PM PST"},{"id":"eval-2024-03-06T23-00-57.387Z.json","label":"March 6, 2024 at 03:00:57 PM PST"},{"id":"eval-2024-03-06T22-59-58.669Z.json","label":"March 6, 2024 at 02:59:58 PM PST"},{"id":"eval-2024-03-06T22-59-45.611Z.json","label":"March 6, 2024 at 02:59:45 PM PST"},{"id":"eval-2024-03-06T22-59-20.272Z.json","label":"March 6, 2024 at 02:59:20 PM PST"},{"id":"eval-2024-03-06T22-58-18.398Z.json","label":"March 6, 2024 at 02:58:18 PM PST"},{"id":"eval-2024-03-06T22-57-53.203Z.json","label":"March 6, 2024 at 02:57:53 PM PST"},{"id":"eval-2024-03-06T22-57-06.798Z.json","label":"March 6, 2024 at 02:57:06 PM PST"},{"id":"eval-2024-03-06T22-42-39.704Z.json","label":"March 6, 2024 at 02:42:39 PM PST"},{"id":"eval-2024-03-06T22-42-13.831Z.json","label":"March 6, 2024 at 02:42:13 PM PST"},{"id":"eval-2024-03-06T22-42-00.331Z.json","label":"March 6, 2024 at 02:42:00 PM PST"},{"id":"eval-2024-03-01T18-32-04.646Z.json","label":"March 1, 2024 at 10:32:04 AM PST"},{"id":"eval-2024-03-01T18-26-40.004Z.json","label":"March 1, 2024 at 10:26:40 AM PST"},{"id":"eval-2024-02-25T05-46-34.688Z.json","label":"February 24, 2024 at 09:46:34 PM PST"},{"id":"eval-2024-02-25T05-46-23.166Z.json","label":"February 24, 2024 at 09:46:23 PM PST"},{"id":"eval-2024-02-24T19-41-44.902Z.json","label":"HF private inference endpoint (February 24, 2024 at 11:41:44 AM PST)"},{"id":"eval-2024-02-24T19-41-25.865Z.json","label":"HF private inference endpoint (February 24, 2024 at 11:41:25 AM PST)"},{"id":"eval-2024-02-24T19-41-13.898Z.json","label":"HF private inference endpoint (February 24, 2024 at 11:41:13 AM PST)"},{"id":"eval-2024-02-24T18-28-09.803Z.json","label":"A translator built with LLM (February 24, 2024 at 10:28:09 AM PST)"},{"id":"eval-2024-02-24T18-14-22.589Z.json","label":"Dynamic var example (February 24, 2024 at 10:14:22 AM PST)"},{"id":"eval-2024-02-24T18-14-13.420Z.json","label":"Dynamic var example (February 24, 2024 at 10:14:13 AM PST)"},{"id":"eval-2024-02-24T05-06-30.886Z.json","label":"February 23, 2024 at 09:06:30 PM PST"},{"id":"eval-2024-02-24T05-05-33.897Z.json","label":"February 23, 2024 at 09:05:33 PM PST"},{"id":"eval-2024-02-24T05-04-50.927Z.json","label":"February 23, 2024 at 09:04:50 PM PST"},{"id":"eval-2024-02-24T04-32-29.319Z.json","label":"Dynamic var example :) (February 23, 2024 at 08:32:29 PM PST)"},{"id":"eval-2024-02-23T17-32-37.042Z.json","label":"February 23, 2024 at 09:32:37 AM PST"},{"id":"eval-2024-02-23T05-37-27.415Z.json","label":"February 22, 2024 at 09:37:27 PM PST"},{"id":"eval-2024-02-23T05-10-01.334Z.json","label":"Simple test (February 22, 2024 at 09:10:01 PM PST)"},{"id":"eval-2024-02-22T19-05-05.212Z.json","label":"February 22, 2024 at 11:05:05 AM PST"},{"id":"eval-2024-02-22T19-04-22.877Z.json","label":"February 22, 2024 at 11:04:22 AM PST"},{"id":"eval-2024-02-22T19-01-18.845Z.json","label":"February 22, 2024 at 11:01:18 AM PST"},{"id":"eval-2024-02-22T19-00-50.888Z.json","label":"February 22, 2024 at 11:00:50 AM PST"},{"id":"eval-2024-02-22T18-47-12.150Z.json","label":"February 22, 2024 at 10:47:12 AM PST"},{"id":"eval-2024-02-22T18-44-08.279Z.json","label":"February 22, 2024 at 10:44:08 AM PST"},{"id":"eval-2024-02-22T18-43-14.164Z.json","label":"February 22, 2024 at 10:43:14 AM PST"},{"id":"eval-2024-02-22T18-14-29.668Z.json","label":"February 22, 2024 at 10:14:29 AM PST"},{"id":"eval-2024-02-22T18-12-24.160Z.json","label":"February 22, 2024 at 10:12:24 AM PST"},{"id":"eval-2024-02-22T18-11-57.254Z.json","label":"February 22, 2024 at 10:11:57 AM PST"},{"id":"eval-2024-02-22T18-11-14.156Z.json","label":"February 22, 2024 at 10:11:14 AM PST"},{"id":"eval-2024-02-22T18-09-19.870Z.json","label":"February 22, 2024 at 10:09:19 AM PST"},{"id":"eval-2024-02-22T17-36-48.681Z.json","label":"February 22, 2024 at 09:36:48 AM PST"},{"id":"eval-2024-02-22T16-56-55.069Z.json","label":"February 22, 2024 at 08:56:55 AM PST"},{"id":"eval-2024-02-22T16-53-33.297Z.json","label":"February 22, 2024 at 08:53:33 AM PST"},{"id":"eval-2024-02-22T06-42-08.553Z.json","label":"February 21, 2024 at 10:42:08 PM PST"},{"id":"eval-2024-02-22T06-30-02.619Z.json","label":"February 21, 2024 at 10:30:02 PM PST"},{"id":"eval-2024-02-22T06-28-39.850Z.json","label":"February 21, 2024 at 10:28:39 PM PST"},{"id":"eval-2024-02-22T06-28-10.322Z.json","label":"February 21, 2024 at 10:28:10 PM PST"},{"id":"eval-2024-02-22T06-27-41.835Z.json","label":"February 21, 2024 at 10:27:41 PM PST"},{"id":"eval-2024-02-22T06-22-02.390Z.json","label":"February 21, 2024 at 10:22:02 PM PST"},{"id":"eval-2024-02-20T06-03-40.351Z.json","label":"February 19, 2024 at 10:03:40 PM PST"},{"id":"eval-2024-02-20T06-03-04.894Z.json","label":"February 19, 2024 at 10:03:04 PM PST"},{"id":"eval-2024-02-20T06-02-49.837Z.json","label":"February 19, 2024 at 10:02:49 PM PST"},{"id":"eval-2024-02-20T06-01-51.153Z.json","label":"February 19, 2024 at 10:01:51 PM PST"}]}
|