promptfoo 0.30.2 → 0.31.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.
Files changed (57) hide show
  1. package/dist/package.json +2 -1
  2. package/dist/src/assertions.d.ts +14 -3
  3. package/dist/src/assertions.d.ts.map +1 -1
  4. package/dist/src/assertions.js +30 -4
  5. package/dist/src/assertions.js.map +1 -1
  6. package/dist/src/evaluator.d.ts.map +1 -1
  7. package/dist/src/evaluator.js +6 -1
  8. package/dist/src/evaluator.js.map +1 -1
  9. package/dist/src/index.d.ts.map +1 -1
  10. package/dist/src/index.js +20 -8
  11. package/dist/src/index.js.map +1 -1
  12. package/dist/src/providers/openai.d.ts +3 -6
  13. package/dist/src/providers/openai.d.ts.map +1 -1
  14. package/dist/src/providers/openai.js +2 -1
  15. package/dist/src/providers/openai.js.map +1 -1
  16. package/dist/src/providers/openaiUtil.d.ts +10 -0
  17. package/dist/src/providers/openaiUtil.d.ts.map +1 -0
  18. package/dist/src/providers/openaiUtil.js +23 -0
  19. package/dist/src/providers/openaiUtil.js.map +1 -0
  20. package/dist/src/types.d.ts +2 -2
  21. package/dist/src/types.d.ts.map +1 -1
  22. package/dist/src/web/nextui/404/index.html +1 -1
  23. package/dist/src/web/nextui/404.html +1 -1
  24. package/dist/src/web/nextui/_next/static/chunks/563-a961efef5193d79c.js +1 -1
  25. package/dist/src/web/nextui/_next/static/chunks/{82-74626c128eefc7a5.js → 82-ca0360e473d81167.js} +2 -2
  26. package/dist/src/web/nextui/_next/static/chunks/860-fd532a3130f1bd45.js +1 -0
  27. package/dist/src/web/nextui/_next/static/chunks/app/auth/login/{page-74ee07fe19cc0bbe.js → page-0c87ef00a5707e79.js} +1 -1
  28. package/dist/src/web/nextui/_next/static/chunks/app/auth/signup/{page-910ae67c25dade94.js → page-d9f9ec167e1619d3.js} +1 -1
  29. package/dist/src/web/nextui/_next/static/chunks/app/datasets/{page-8aeacfc0a957e29b.js → page-5d1f9b7d4686fe34.js} +1 -1
  30. package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/not-found-366629541fd598e9.js +1 -0
  31. package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/{page-43f68be4831f0c4a.js → page-51042a4400691368.js} +1 -1
  32. package/dist/src/web/nextui/_next/static/chunks/app/eval/page-d1c49d6aeca14868.js +1 -0
  33. package/dist/src/web/nextui/_next/static/chunks/app/{layout-7031bb251bd9af74.js → layout-2d69329b7d9c264a.js} +1 -1
  34. package/dist/src/web/nextui/_next/static/chunks/app/{page-864c14f3dfba2dc2.js → page-1ae60660130041b2.js} +1 -1
  35. package/dist/src/web/nextui/_next/static/chunks/app/prompts/{page-eaf4573ef16fa693.js → page-b1f8e85f32a45c2a.js} +1 -1
  36. package/dist/src/web/nextui/_next/static/chunks/app/setup/{page-e54cd5ba16dfce32.js → page-c19433000ee34b13.js} +1 -1
  37. package/dist/src/web/nextui/_next/static/chunks/{main-app-635e57f728b91b66.js → main-app-581ccf0003955b21.js} +1 -1
  38. package/dist/src/web/nextui/auth/login/index.html +1 -1
  39. package/dist/src/web/nextui/auth/login/index.txt +3 -3
  40. package/dist/src/web/nextui/auth/signup/index.html +1 -1
  41. package/dist/src/web/nextui/auth/signup/index.txt +3 -3
  42. package/dist/src/web/nextui/datasets/index.html +1 -1
  43. package/dist/src/web/nextui/datasets/index.txt +3 -3
  44. package/dist/src/web/nextui/eval/index.html +1 -1
  45. package/dist/src/web/nextui/eval/index.txt +3 -3
  46. package/dist/src/web/nextui/index.html +1 -1
  47. package/dist/src/web/nextui/index.txt +2 -2
  48. package/dist/src/web/nextui/prompts/index.html +1 -1
  49. package/dist/src/web/nextui/prompts/index.txt +3 -3
  50. package/dist/src/web/nextui/setup/index.html +2 -2
  51. package/dist/src/web/nextui/setup/index.txt +3 -3
  52. package/package.json +2 -1
  53. package/dist/src/web/nextui/_next/static/chunks/860-260a5df288254b9f.js +0 -1
  54. package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/not-found-8624f98413223113.js +0 -1
  55. package/dist/src/web/nextui/_next/static/chunks/app/eval/page-826da123aaa13374.js +0 -1
  56. /package/dist/src/web/nextui/_next/static/{MS3xD55A3ePhB1ApOpEoS → yobwYIjSlgTiHVK9Eo5hK}/_buildManifest.js +0 -0
  57. /package/dist/src/web/nextui/_next/static/{MS3xD55A3ePhB1ApOpEoS → yobwYIjSlgTiHVK9Eo5hK}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[860],{1860:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return ek}});var n=s(7437),l=s(2265),r=s(2130),a=s(6882),i=s(3388),o=s(4033),c=s(3082),d=s(5551),u=s(6507),p=s(7760),h=s(4081),x=s(182),m=s(819),j=s(8212),f=s(5507),g=s(923),v=s(654),y=s(33),b=s(3457),Z=s(8276),C=s(3226),S=s(2467),w=s(9605),k=s(3391),R=s(9190),N=s(6704),P=s(9394),E=s(1797),F=s(6337),V=s(1101),D=s(9872),I=s(2653),L=s(3533),M=s(4740),T=s(4660);let W=(0,T.Ue)(e=>({table:null,setTable:t=>e(()=>({table:t})),config:null,setConfig:t=>e(()=>({config:t}))})),O=["#fd7f6f","#7eb0d5","#b2e061","#bd7ebe","#ffb55a","#ffee65","#beb9db","#fdcce5","#8bd3c7"];function A(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,a=Array.from({length:11},(e,t)=>parseFloat((Math.floor(n)+t*l).toFixed(2))),i=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s].score),r=a.map(e=>n.filter(t=>t>=e&&t<e+l).length);return{label:"Prompt ".concat(s+1),data:r,backgroundColor:O[s%O.length]}});r.current=new N.kL(s.current,{type:"bar",data:{labels:a,datasets:i},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=a[t],n=a[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:O[s%O.length]}});r.current=new N.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 U(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null),[a,i]=(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),i=t.body.map(e=>{let t=e.outputs[a].score,s=e.outputs[o].score;return{x:t,y:s,backgroundColor:s>t?"green":s<t?"red":"gray"}});r.current=new N.kL(s.current,{type:"scatter",data:{datasets:[{data:i,backgroundColor:i.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(a+1," Score")}},y:{title:{display:!0,text:"Prompt ".concat(o+1," Score")}}}}})},[t,a,o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(P.Z,{open:d,onClose:()=>u(!1),children:[(0,n.jsx)(E.Z,{children:"Compare prompt outputs"}),(0,n.jsxs)(F.Z,{children:[(0,n.jsx)(h.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(v.Z,{value:a,onChange:e=>i(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(f.Z,{value:t,children:["Prompt ",t+1]},t))})}),(0,n.jsx)(h.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(v.Z,{value:o,onChange:e=>c(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(f.Z,{value:t,children:["Prompt ",t+1]},t))})})]})]}),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px",cursor:"pointer"},onClick:()=>u(!0)})]})}function _(e){let{columnVisibility:t}=e,s=(0,V.Z)();N.kL.defaults.color="dark"===s.palette.mode?"#aaa":"#666";let[r,a]=(0,l.useState)(!0),{table:i}=W();if(!i||!r||i.head.prompts.length<2)return null;let o=i.body.flatMap(e=>e.outputs.map(e=>e.score));return 1===new Set(o).size?null:(0,n.jsx)(M.SV,{fallback:null,children:(0,n.jsxs)(D.Z,{style:{position:"relative",padding:s.spacing(3)},children:[(0,n.jsx)(I.Z,{style:{position:"absolute",right:0,top:0},onClick:()=>a(!1),children:(0,n.jsx)(L.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:i})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(A,{table:i})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(U,{table:i})})]})]})})}N.kL.register(N.vn,N.ST,N.ho,N.uw,N.f$,N.ZL,N.jn,N.od,N.u,N.wL);var H=s(9116);s(5777);var J=s(7660),B=s(3216),q=s(5391),G=s(1396),Y=s.n(G);s(8715);var X=e=>{let{lookup:t}=e;return(0,n.jsx)("div",{className:"custom-metric-container",children:Object.entries(t).map(e=>{let[t,s]=e;return(0,n.jsxs)("div",{children:[t,": ",s.toFixed(2)]},t)})})},$=s(2834),K=s(5446),Q=s(9329),ee=s(4719),et=s(3701),es=s(9279),en=s(666),el=s(5795),er=s(6988),ea=s(4147);function ei(e){let{gradingResults:t}=e;return t?(0,n.jsxs)(u.Z,{mt:2,children:[(0,n.jsx)(C.Z,{variant:"subtitle1",children:"Assertions"}),(0,n.jsx)(el.Z,{children:(0,n.jsxs)(et.Z,{children:[(0,n.jsx)(er.Z,{children:(0,n.jsxs)(ea.Z,{children:[(0,n.jsx)(en.Z,{style:{fontWeight:"bold"},children:"Pass"}),(0,n.jsx)(en.Z,{style:{fontWeight:"bold"},children:"Score"}),(0,n.jsx)(en.Z,{style:{fontWeight:"bold"},children:"Type"}),(0,n.jsx)(en.Z,{style:{fontWeight:"bold"},children:"Value"}),(0,n.jsx)(en.Z,{style:{fontWeight:"bold"},children:"Reason"})]})}),(0,n.jsx)(es.Z,{children:t.map((e,t)=>{var s,l;return(0,n.jsxs)(ea.Z,{children:[(0,n.jsx)(en.Z,{children:e.pass?"✅":"❌"}),(0,n.jsx)(en.Z,{children:e.score.toFixed(2)}),(0,n.jsx)(en.Z,{children:(null===(s=e.assertion)||void 0===s?void 0:s.type)||""}),(0,n.jsx)(en.Z,{style:{whiteSpace:"pre-wrap"},children:(null===(l=e.assertion)||void 0===l?void 0:l.value)?String(e.assertion.value):"-"}),(0,n.jsx)(en.Z,{style:{whiteSpace:"pre-wrap"},children:e.reason})]},t)})})]})})]}):null}function eo(e){let{open:t,onClose:s,prompt:r,provider:a,output:i,gradingResults:o}=e,[c,p]=(0,l.useState)(!1);(0,l.useEffect)(()=>{p(!1)},[r]);let h=async e=>{await navigator.clipboard.writeText(e),p(!0)};return(0,n.jsxs)(P.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,n.jsxs)(E.Z,{children:["Details",a&&": ".concat(a)]}),(0,n.jsxs)(F.Z,{children:[(0,n.jsxs)(u.Z,{mb:2,children:[(0,n.jsx)(C.Z,{variant:"subtitle1",style:{marginBottom:"1rem"},children:"Prompt"}),(0,n.jsx)(K.u,{readOnly:!0,value:r,style:{width:"100%",padding:"0.75rem"},maxRows:20}),(0,n.jsx)(I.Z,{onClick:()=>h(r),style:{position:"absolute",right:"10px",top:"10px"},children:c?(0,n.jsx)(ee.Z,{}):(0,n.jsx)(Q.Z,{})})]}),i&&(0,n.jsxs)(u.Z,{my:2,children:[(0,n.jsx)(C.Z,{variant:"subtitle1",style:{marginBottom:"1rem",marginTop:"1rem"},children:"Output"}),(0,n.jsx)(K.u,{readOnly:!0,maxRows:20,value:i,style:{width:"100%",padding:"0.75rem"}})]}),(0,n.jsx)(ei,{gradingResults:o})]}),(0,n.jsx)($.Z,{children:(0,n.jsx)(d.Z,{onClick:s,children:"Close"})})]})}function ec(e){return null===e||0===e||1===e?"":"(".concat(e.toFixed(2),")")}function ed(e){return"string"==typeof e||"number"==typeof e?e.toString().length:Array.isArray(e)?e.reduce((e,t)=>e+ed(t),0):l.isValidElement(e)&&e.props.children?l.Children.toArray(e.props.children).reduce((e,t)=>e+ed(t),0):0}function eu(e){let t,{text:s,maxLength:r}=e,[a,i]=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=ed(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=ed(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=a?o(t):t,d=ed(t)>r;return(0,n.jsxs)("div",{style:{cursor:d?"pointer":"normal"},onClick:()=>{i(!a)},children:[c,a&&ed(t)>r&&(0,n.jsx)("span",{children:"..."})]})}function ep(e){var t,s,r;let a,{output:i,maxTextLength:o,rowIndex:c,promptIndex:d,onRating:u,firstOutput:p,filterMode:h}=e,[x,m]=l.useState(!1),j="string"==typeof i.text?i.text:JSON.stringify(i.text),f=[];if(!i.pass&&j.includes("---")?j=(f=j.split("---")).slice(1).join("---"):f=[j],"different"===h&&p){let e,t="string"==typeof p.text?p.text:JSON.stringify(p.text);t.includes("---")&&(t=t.split("---").slice(1).join("---"));try{JSON.parse(t),JSON.parse(j),e=(0,H.CT)(t,j)}catch(s){e=t.includes(". ")&&j.includes(". ")?(0,H.SY)(t,j):(0,H.NV)(t,j)}a=(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))})}let g=e=>{u(c,d,e)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"cell",children:[i.pass&&(0,n.jsxs)("div",{className:"status pass",children:["PASS ",(0,n.jsx)("span",{className:"score",children:ec(i.score)}),i.namedScores?(0,n.jsx)(X,{lookup:i.namedScores}):null]}),!i.pass&&(0,n.jsxs)("div",{className:"status fail",children:["[FAIL ",(0,n.jsx)("span",{className:"score",children:ec(i.score)}),"]"," ",(0,n.jsx)("span",{children:f[0].trim().split("\n").map((e,t)=>(0,n.jsxs)(l.Fragment,{children:[e,(0,n.jsx)("br",{})]},t))}),i.namedScores?(0,n.jsx)(X,{lookup:i.namedScores}):null]})," ",(0,n.jsx)(eu,{text:a||j,maxLength:o})]}),(0,n.jsx)("div",{className:"cell-detail",children:(null===(t=i.tokenUsage)||void 0===t?void 0:t.cached)?(0,n.jsxs)("span",{children:[i.tokenUsage.cached," tokens (cached)"]}):(0,n.jsxs)(n.Fragment,{children:[(null===(s=i.tokenUsage)||void 0===s?void 0:s.total)&&(0,n.jsxs)("span",{children:[i.tokenUsage.total," tokens"]})," |"," ",(0,n.jsxs)("span",{children:[i.latencyMs," ms"]})]})}),(0,n.jsxs)("div",{className:"cell-actions",children:[i.prompt&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"action",onClick:()=>{m(!0)},children:(0,n.jsx)(Z.Z,{title:"View ouput and test details",children:(0,n.jsx)("span",{children:"\uD83D\uDD0E"})})}),(0,n.jsx)(eo,{open:x,onClose:()=>{m(!1)},prompt:i.prompt,provider:i.provider,gradingResults:null===(r=i.gradingResult)||void 0===r?void 0:r.componentResults,output:j})]}),(0,n.jsx)("span",{className:"action",onClick:()=>g(!0),children:(0,n.jsx)(Z.Z,{title:"Mark test passed (score 1.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4D"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>g(!1),children:(0,n.jsx)(Z.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):");if(null!==e){let t=parseFloat(e);!isNaN(t)&&t>=0&&t<=1?u(c,d,!0,t):alert("Invalid score. Please enter a value between 0.0 and 1.0.")}},children:(0,n.jsx)(Z.Z,{title:"Set test score",children:(0,n.jsx)("span",{children:"✏️"})})})]})]})}function eh(e){let{text:t,maxLength:s,expandedText:r,resourceId:a}=e,[i,o]=l.useState(!1);return(0,n.jsxs)("div",{children:[(0,n.jsx)(eu,{text:t,maxLength:s}),r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Z.Z,{title:"View prompt",children:(0,n.jsx)("span",{className:"action",onClick:()=>{o(!0)},children:"\uD83D\uDD0E"})}),(0,n.jsx)(eo,{open:i,onClose:()=>{o(!1)},prompt:r}),a&&(0,n.jsx)(Z.Z,{title:"View other evals and datasets for this prompt",children:(0,n.jsx)("span",{className:"action",children:(0,n.jsx)(Y(),{href:"/prompts/?id=".concat(a),target:"_blank",children:(0,n.jsx)(q.Z,{fontSize:"small"})})})})]})]})}function ex(e){let{maxTextLength:t,columnVisibility:s,wordBreak:a,filterMode:i,failureFilter:o,onFailureFilterToggle:c}=e,{table:d,setTable:u}=W();(0,r.Z)(d,"Table should be defined");let{head:h,body:m}=d,j=h.prompts.map((e,t)=>m.reduce((e,s)=>e+(s.outputs[t].pass?1:0),0)),f=h.prompts.map((e,t)=>m.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)),g=h.prompts.map((e,t)=>m.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)),v=(e,t,s,n)=>{let l=[...m],r={...l[e]},a=[...r.outputs];a[t].pass=s,a[t].score=void 0===n?s?1:0:n||0,r.outputs=a,l[e]=r,u({head:h,body:l})},y=j.reduce((e,t,s,n)=>t>n[e]?s:e,0),b=j[y],Z=(0,J.Cl)(),C=[];h.vars.length>0&&C.push(Z.group({id:"vars",header:()=>(0,n.jsx)("span",{children:"Variables"}),columns:h.vars.map((e,s)=>Z.accessor(e=>e.vars[s],{id:"Variable ".concat(s+1),header:()=>(0,n.jsx)(eh,{text:e,maxLength:t}),cell:e=>(0,n.jsx)(eu,{text:e.getValue(),maxLength:t}),size:50}))})),C.push(Z.group({id:"prompts",header:()=>(0,n.jsx)("span",{children:"Outputs"}),columns:h.prompts.map((e,s)=>Z.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,a,d,u,h;let v=j[s]&&m.length?(j[s]/m.length*100).toFixed(2):"0.00",y=j[s]===b&&0!==b,Z="Prompt ".concat(s+1),C=o[Z]||!1;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eh,{text:"string"==typeof e?e:e.display,expandedText:"string"==typeof e?void 0:e.raw,maxLength:t,resourceId:"string"==typeof e?void 0:e.id}),"failures"===i&&(0,n.jsx)(x.Z,{sx:{"& .MuiFormControlLabel-label":{fontSize:"0.75rem"}},control:(0,n.jsx)(p.Z,{checked:C,onChange:e=>c(Z,e.target.checked)}),label:"Show failures"}),(0,n.jsxs)("div",{className:"summary",children:[(0,n.jsxs)("span",{className:y?"highlight":"",children:["Passing: ",(0,n.jsxs)("strong",{children:[v,"%"]})," (",j[s],"/",m.length," cases",f[s]?(0,n.jsxs)("span",{children:[", ",g[s],"/",f[s]," asserts"]}):null,")"]}),((null===(l=e.metrics)||void 0===l?void 0:l.totalLatencyMs)||(null===(a=e.metrics)||void 0===a?void 0:null===(r=a.tokenUsage)||void 0===r?void 0:r.total))&&(0,n.jsx)("span",{children:" avg"}),(null===(d=e.metrics)||void 0===d?void 0:d.totalLatencyMs)?(0,n.jsxs)("span",{children:[" ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.totalLatencyMs/m.length),"ms"]}):null,(null===(h=e.metrics)||void 0===h?void 0:null===(u=h.tokenUsage)||void 0===u?void 0:u.total)?(0,n.jsxs)("span",{children:[" ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.total/m.length)," ","tokens"]}):null]})]})},cell:e=>(0,n.jsx)(ep,{output:e.getValue(),maxTextLength:t,rowIndex:e.row.index,promptIndex:s,onRating:v,firstOutput:w[e.row.index].outputs[0],filterMode:i})}))}));let S=m.some(e=>e.description);S&&C.splice(0,0,{accessorFn:e=>e.description||"",id:"description",header:()=>(0,n.jsx)("span",{children:"Description"}),cell:e=>(0,n.jsx)(eu,{text:String(e.getValue()),maxLength:t}),size:50});let w=l.useMemo(()=>"failures"===i?Object.values(o).every(e=>!e)?m:m.filter(e=>e.outputs.some((e,t)=>{let s=!e.pass;return o["Prompt ".concat(t+1)]&&s})):"different"===i?m.filter(e=>!e.outputs.every(t=>t.text===e.outputs[0].text)):m,[m,o,i]),k=(0,B.b7)({data:w,columns:C,columnResizeMode:"onChange",getCoreRowModel:(0,J.sC)(),state:{columnVisibility:s}});return(0,n.jsxs)("table",{className:"results-table ".concat(t<=25?"compact":""),style:{wordBreak:a},children:[(0,n.jsx)("thead",{children:k.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,B.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:k.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,B.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)})})]})}s(2604);var em=s(7175);function ej(e){let{open:t,onClose:r}=e,{config:a}=W(),i=l.useRef(null),[o,c]=l.useState(!1),[p,h]=l.useState("");l.useEffect(()=>{t&&(async()=>{let{default:e}=await s.e(339).then(s.bind(s,8339));h(e.dump(a))})()},[t,a]);let x=()=>{c(!1),r()};return(0,n.jsxs)(P.Z,{open:t,onClose:x,"aria-labelledby":"config-dialog-title",maxWidth:"md",fullWidth:!0,children:[(0,n.jsx)(E.Z,{id:"config-dialog-title",children:(0,n.jsxs)(u.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,n.jsx)(C.Z,{variant:"h6",children:"Config"}),(0,n.jsx)(I.Z,{onClick:()=>{i.current&&(i.current.select(),document.execCommand("copy"),c(!0))},children:o?(0,n.jsx)(ee.Z,{}):(0,n.jsx)(em.Z,{})})]})}),(0,n.jsx)(F.Z,{children:(0,n.jsx)(C.Z,{variant:"body1",component:"div",children:(0,n.jsx)("textarea",{ref:i,readOnly:!0,value:p,style:{width:"100%",minHeight:"400px",fontFamily:"monospace",border:"1px solid #ccc"}})})}),(0,n.jsx)($.Z,{children:(0,n.jsx)(d.Z,{onClick:x,color:"primary",children:"Close"})})]})}var ef=s(4173),eg=s(1975),ev=e=>{let{open:t,onClose:s,shareUrl:r}=e,a=(0,l.useRef)(null),[i,o]=(0,l.useState)(!1),c=()=>{s(),o(!1)};return(0,n.jsxs)(P.Z,{open:t,onClose:c,PaperProps:{style:{minWidth:"min(660px, 100%)"}},children:[(0,n.jsx)(E.Z,{children:"Your eval is ready to share"}),(0,n.jsxs)(F.Z,{children:[(0,n.jsx)(eg.Z,{inputRef:a,value:r,fullWidth:!0,InputProps:{readOnly:!0,endAdornment:(0,n.jsx)(I.Z,{onClick:()=>{a.current&&(a.current.select(),document.execCommand("copy"),o(!0))},children:i?(0,n.jsx)(ee.Z,{}):(0,n.jsx)(em.Z,{})})}}),(0,n.jsx)(ef.Z,{sx:{fontSize:"0.75rem"},children:"Shared URLs are deleted after 1 week."})]}),(0,n.jsx)($.Z,{children:(0,n.jsx)(d.Z,{onClick:c,color:"primary",children:"Close"})})]})},ey=s(1938);let eb=(0,R.Z)(b.Z)(e=>{let{theme:t}=e;return{maxWidth:"100%",flexWrap:"wrap",[t.breakpoints.down("sm")]:{flexDirection:"column"}}});function eZ(e){let{recentEvals:t,onRecentEvalSelected:s,defaultEvalId:i}=e,c=(0,o.useRouter)(),{table:b,config:R}=W(),{setStateFromConfig:N}=(0,ey.o)(),[P,E]=l.useState(250),[F,V]=l.useState({}),[D,I]=l.useState([]),[L,M]=l.useState({}),[T,O]=l.useState("all"),[A,z]=l.useState("break-word"),[U,H]=l.useState(!1),[J,B]=l.useState(""),[q,G]=l.useState(!1),Y=async()=>{G(!0);try{let e=await fetch("https://api.promptfoo.dev/eval",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{version:2,createdAt:new Date().toISOString(),results:{table:b},config:R}})}),{id:t}=await e.json(),s="https://app.promptfoo.dev/eval/".concat(t);B(s),H(!0)}catch(e){alert("Sorry, something went wrong.")}finally{G(!1)}},[X,$]=l.useState(!1);(0,r.Z)(b,"Table data must be loaded before rendering ResultsView");let{head:K}=b,Q=[...K.vars.map((e,t)=>({value:"Variable ".concat(t+1),label:"Var ".concat(t+1,": ").concat(K.vars[t].length>100?K.vars[t].slice(0,97)+"...":K.vars[t]),group:"Variables"})),...K.prompts.map((e,t)=>({value:"Prompt ".concat(t+1),label:"Prompt ".concat(t+1,": ").concat(K.prompts[t].display.length>100?K.prompts[t].display.slice(0,97)+"...":K.prompts[t].display),group:"Prompts"}))];return l.useEffect(()=>{I(Q.map(e=>e.value))},[K]),(0,n.jsxs)("div",{style:{marginLeft:"1rem",marginRight:"1rem"},children:[(0,n.jsx)(u.Z,{py:"md",children:(0,n.jsxs)(eb,{direction:"row",spacing:4,alignItems:"center",children:[(0,n.jsx)(u.Z,{children:t&&t.length>0&&(0,n.jsxs)(h.Z,{sx:{m:1,minWidth:200},size:"small",children:[(0,n.jsx)(m.Z,{children:"View run"}),(0,n.jsx)(v.Z,{className:"recent-files",label:"Previous runs",defaultValue:i,onChange:e=>s(e.target.value),children:t.map(e=>(0,n.jsx)(f.Z,{value:e.id,children:e.label},e.id))},t.map(e=>e.id).join(","))]})}),(0,n.jsx)(u.Z,{children:(0,n.jsxs)(h.Z,{sx:{m:1,minWidth:200},size:"small",children:[(0,n.jsx)(m.Z,{id:"visible-columns-label",children:"Show columns"}),(0,n.jsx)(v.Z,{labelId:"visible-columns-label",id:"visible-columns",multiple:!0,value:D,onChange:e=>{let{target:{value:t}}=e;I("string"==typeof t?t.split(","):t);let s=[...K.vars.map((e,t)=>"Variable ".concat(t+1)),...K.prompts.map((e,t)=>"Prompt ".concat(t+1))],n={};s.forEach(e=>{n[e]=("string"==typeof t?t.split(","):t).includes(e)}),V(n)},input:(0,n.jsx)(g.Z,{label:"Visible columns"}),renderValue:e=>e.join(", "),children:Q.map(e=>(0,n.jsxs)(f.Z,{dense:!0,value:e.value,children:[(0,n.jsx)(p.Z,{checked:D.indexOf(e.value)>-1}),(0,n.jsx)(j.Z,{primary:e.label})]},e.value))})]})}),(0,n.jsx)(u.Z,{children:(0,n.jsxs)(h.Z,{sx:{minWidth:180},size:"small",children:[(0,n.jsx)(m.Z,{id:"failure-filter-mode-label",children:"Filter"}),(0,n.jsxs)(v.Z,{labelId:"filter-mode-label",id:"filter-mode",value:T,onChange:e=>{let t=e.target.value;O(t);let s={};K.prompts.forEach((e,n)=>{s["Prompt ".concat(n+1)]="failures"===t}),M(s)},label:"Filter",children:[(0,n.jsx)(f.Z,{value:"all",children:"Show all results"}),(0,n.jsx)(f.Z,{value:"failures",children:"Show failures only"}),(0,n.jsx)(f.Z,{value:"different",children:"Show different only"})]})]})}),(0,n.jsxs)(u.Z,{children:[(0,n.jsxs)(C.Z,{mt:2,children:["Max text length: ",P]}),(0,n.jsx)(y.ZP,{min:25,max:1e3,value:P,onChange:(e,t)=>E(t)})]}),(0,n.jsx)(u.Z,{children:(0,n.jsx)(Z.Z,{title:"Forcing line breaks makes it easier to adjust column widths to your liking",children:(0,n.jsx)(x.Z,{control:(0,n.jsx)(p.Z,{checked:"break-all"===A,onChange:e=>{z(e.target.checked?"break-all":"break-word")}}),label:"Force line breaks"})})}),(0,n.jsx)(u.Z,{flexGrow:1}),(0,n.jsx)(u.Z,{display:"flex",justifyContent:"flex-end",children:(0,n.jsxs)(eb,{direction:"row",spacing:2,children:[R&&(0,n.jsx)(Z.Z,{title:"View config",children:(0,n.jsx)(d.Z,{color:"primary",onClick:()=>$(!0),startIcon:(0,n.jsx)(w.Z,{}),children:"View Config"})}),R&&(0,n.jsx)(Z.Z,{title:"Edit eval",children:(0,n.jsx)(d.Z,{color:"primary",onClick:()=>{N(R),c.push("/setup/")},startIcon:(0,n.jsx)(k.Z,{}),children:"Edit Eval"})}),(null==R?void 0:R.sharing)&&(0,n.jsx)(Z.Z,{title:"Generate a unique URL that others can access",children:(0,n.jsx)(d.Z,{color:"primary",onClick:Y,disabled:q,startIcon:q?(0,n.jsx)(a.Z,{size:16}):(0,n.jsx)(S.Z,{}),children:"Share"})})]})})]})}),(0,n.jsx)(_,{columnVisibility:F}),(0,n.jsx)(ex,{maxTextLength:P,columnVisibility:F,wordBreak:A,filterMode:T,failureFilter:L,onFailureFilterToggle:(e,t)=>{M(s=>({...s,[e]:t}))}}),(0,n.jsx)(ej,{open:X,onClose:()=>$(!1)}),(0,n.jsx)(ev,{open:U,onClose:()=>H(!1),shareUrl:J})]})}var eC=s(279);async function eS(){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 ew(e){let t=(0,c.createClientComponentClient)(),{data:s,error:n}=await t.from("EvaluationResult").select("*").eq("id",e).single();return s}function ek(e){var t;let{fetchId:s,preloadedData:c,recentEvals:d,defaultEvalId:u}=e,p=(0,o.useRouter)(),{table:h,setTable:x,setConfig:m}=W(),[j,f]=l.useState(!1),[g,v]=l.useState(!1),[y,b]=l.useState(d||[]),Z=async()=>{(0,r.Z)(eC.T8,"Cannot fetch recent files when not running locally");let e=await fetch("".concat(eC.CT,"/results"),{cache:"no-store"}),t=await e.json();return b(t.data),t.data},C=async e=>{let t=await fetch("".concat(eC.CT,"/results/").concat(e),{cache:"no-store"}),s=await t.json();x(s.data.results.table),m(s.data.config)},S=async e=>{eC.T8?C(e):(f(!1),p.push("/eval/remote:".concat(encodeURIComponent(e))))},[w,k]=l.useState(u||(null===(t=y[0])||void 0===t?void 0:t.id)),R=(0,o.useSearchParams)(),N=R?R.get("file"):null;return(l.useEffect(()=>{if(N){let e=async()=>{await C(N),f(!0)};e()}else if(c){var e;x(null===(e=c.data.results)||void 0===e?void 0:e.table),m(c.data.config),f(!0)}else if(s){let e=async()=>{var e;let t=await fetch("https://api.promptfoo.dev/eval/".concat(s));if(!t.ok){v(!0);return}let n=await t.json();x(null===(e=n.data.results)||void 0===e?void 0:e.table),m(n.data.config),f(!0)};e()}else if(eC.T8){let e=(0,i.io)(eC.CT);return e.on("init",e=>{console.log("Initialized socket connection",e),f(!0),x(e.results.table),m(e.config),Z().then(e=>{var t;k(null===(t=e[0])||void 0===t?void 0:t.id)})}),e.on("update",e=>{console.log("Received data update",e),x(e.results.table),m(e.config),Z().then(e=>{var t;k(null===(t=e[0])||void 0===t?void 0:t.id)})}),()=>{e.disconnect()}}else eS().then(e=>{b(e.map(e=>({id:e.id,label:e.createdAt}))),e.length>0&&ew(e[0].id).then(t=>{(0,r.Z)(t,"Eval not found");let s=t.results,n=t.config;k(e[0].id),x(s.table),m(n),f(!0)})})},[s,x,m,c,k,N]),g)?(0,n.jsx)("div",{className:"loading",children:"404 Eval not found"}):j&&h?(0,n.jsx)(eZ,{defaultEvalId:w,recentEvals:y,onRecentEvalSelected:S}):(0,n.jsxs)("div",{className:"loading",children:[(0,n.jsx)("div",{children:(0,n.jsx)(a.Z,{size:22})}),(0,n.jsx)("div",{children:"Loading eval data"})]})}s(5038)},279:function(e,t,s){"use strict";s.d(t,{CT:function(){return r},T8:function(){return l},eA:function(){return a}});var n=s(2601);let l=!n.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,r="http://localhost:15500",a=""},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(){},5777:function(){}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[716],{8938:function(e,t,a){"use strict";a.d(t,{Z:function(){return W}});var n=a(791),i=a(3428),r=a(2265),s=a(7042),u=a(1380),o=a(5702),l=a(5600),d=a(8153),c=a(9190),h=a(4775),p=a(7437);let m=["className","component","disableGutters","fixed","maxWidth","classes"],x=(0,h.Z)(),f=(0,c.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,u.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),g=e=>(0,d.Z)({props:e,name:"MuiContainer",defaultTheme:x}),b=(e,t)=>{let{classes:a,fixed:n,disableGutters:i,maxWidth:r}=e,s={root:["root",r&&`maxWidth${(0,u.Z)(String(r))}`,n&&"fixed",i&&"disableGutters"]};return(0,l.Z)(s,e=>(0,o.Z)(t,e),a)};var v=a(8702),C=a(5843),S=a(7927);let Z=function(e={}){let{createStyledComponent:t=f,useThemeProps:a=g,componentName:u="MuiContainer"}=e,o=t(({theme:e,ownerState:t})=>(0,i.Z)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{let n=e.breakpoints.values[a];return 0!==n&&(t[e.breakpoints.up(a)]={maxWidth:`${n}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,i.Z)({},"xs"===t.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},t.maxWidth&&"xs"!==t.maxWidth&&{[e.breakpoints.up(t.maxWidth)]:{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`}})),l=r.forwardRef(function(e,t){let r=a(e),{className:l,component:d="div",disableGutters:c=!1,fixed:h=!1,maxWidth:x="lg"}=r,f=(0,n.Z)(r,m),g=(0,i.Z)({},r,{component:d,disableGutters:c,fixed:h,maxWidth:x}),v=b(g,u);return(0,p.jsx)(o,(0,i.Z)({as:d,ownerState:g,className:(0,s.Z)(v.root,l),ref:t},f))});return l}({createStyledComponent:(0,C.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,v.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,S.Z)({props:e,name:"MuiContainer"})});var W=Z},4348:function(e,t,a){Promise.resolve().then(a.bind(a,6722))},6722:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return p}});var n=a(7437),i=a(2265),r=a(1396),s=a.n(r),u=a(5551),o=a(1975),l=a(8938),d=a(3226),c=a(4033),h=a(3571);function p(){let e=(0,c.useRouter)(),[t,a]=i.useState(""),[r,p]=i.useState(""),[m,x]=i.useState(""),[f,g]=i.useState(!1),[b,v]=i.useState(null),C=i.useCallback(async()=>{let{data:e,error:t}=await h.OQ.auth.refreshSession();e&&v(e.user)},[]);i.useEffect(()=>{C()},[C]);let S=async a=>{if(g(!0),x(""),a.stopPropagation(),a.preventDefault(),!b){let{data:a,error:n}=await h.OQ.auth.signInWithPassword({email:t,password:r});n?x(n.message):e.push("/")}g(!1)};return b?(0,n.jsxs)("div",{style:{textAlign:"center"},children:["You're already logged in as ",b.email,"."]}):(0,n.jsxs)(l.Z,{component:"main",maxWidth:"xs",children:[(0,n.jsx)(d.Z,{component:"h1",variant:"h5",children:"Sign in"}),(0,n.jsx)("form",{children:!b&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,onChange:e=>a(e.target.value),value:t,error:!!m}),(0,n.jsx)(o.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:e=>p(e.target.value),value:r,error:!!m,helperText:m}),(0,n.jsx)(u.Z,{type:"submit",disabled:f,sx:{marginTop:"1em"},fullWidth:!0,variant:"contained",color:"primary",onClick:S,children:"Sign In"}),(0,n.jsxs)("p",{children:["Don't have an account yet? ",(0,n.jsx)(s(),{href:"/auth/signup",children:"Sign up"})]})]})})]})}},3571:function(e,t,a){"use strict";a.d(t,{Ho:function(){return c},OQ:function(){return s},aC:function(){return o}});var n=a(7437),i=a(2265),r=a(3082);let s=(0,r.createClientComponentClient)(),u=(0,i.createContext)({}),o=()=>(0,i.useContext)(u),l=(e,t)=>s.auth.signInWithPassword({email:e,password:t}),d=()=>s.auth.signOut(),c=e=>{let{children:t}=e,[a,r]=(0,i.useState)(null),[o,c]=(0,i.useState)(!1),h=(0,i.useCallback)(async()=>{let{data:e,error:t}=await s.auth.refreshSession();e&&r(e.user)},[]);return(0,i.useEffect)(()=>{h();let{data:e}=s.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?c(!1):"SIGNED_IN"===e&&t?(r(t.user),c(!0)):"SIGNED_OUT"===e&&(c(!1),r(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,n.jsx)(u.Provider,{value:{loggedIn:o,user:a,login:l,logout:d},children:t})}}},function(e){e.O(0,[293,808,548,82,975,971,596,744],function(){return e(e.s=4348)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[716],{8938:function(e,t,a){"use strict";a.d(t,{Z:function(){return W}});var n=a(791),i=a(3428),r=a(2265),s=a(7042),u=a(1380),o=a(5702),l=a(5600),d=a(8153),c=a(9190),h=a(4775),p=a(7437);let m=["className","component","disableGutters","fixed","maxWidth","classes"],x=(0,h.Z)(),f=(0,c.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,u.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),g=e=>(0,d.Z)({props:e,name:"MuiContainer",defaultTheme:x}),b=(e,t)=>{let{classes:a,fixed:n,disableGutters:i,maxWidth:r}=e,s={root:["root",r&&`maxWidth${(0,u.Z)(String(r))}`,n&&"fixed",i&&"disableGutters"]};return(0,l.Z)(s,e=>(0,o.Z)(t,e),a)};var v=a(8702),C=a(5843),S=a(7927);let Z=function(e={}){let{createStyledComponent:t=f,useThemeProps:a=g,componentName:u="MuiContainer"}=e,o=t(({theme:e,ownerState:t})=>(0,i.Z)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{let n=e.breakpoints.values[a];return 0!==n&&(t[e.breakpoints.up(a)]={maxWidth:`${n}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,i.Z)({},"xs"===t.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},t.maxWidth&&"xs"!==t.maxWidth&&{[e.breakpoints.up(t.maxWidth)]:{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`}})),l=r.forwardRef(function(e,t){let r=a(e),{className:l,component:d="div",disableGutters:c=!1,fixed:h=!1,maxWidth:x="lg"}=r,f=(0,n.Z)(r,m),g=(0,i.Z)({},r,{component:d,disableGutters:c,fixed:h,maxWidth:x}),v=b(g,u);return(0,p.jsx)(o,(0,i.Z)({as:d,ownerState:g,className:(0,s.Z)(v.root,l),ref:t},f))});return l}({createStyledComponent:(0,C.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,v.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,S.Z)({props:e,name:"MuiContainer"})});var W=Z},8642:function(e,t,a){Promise.resolve().then(a.bind(a,6722))},6722:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return p}});var n=a(7437),i=a(2265),r=a(1396),s=a.n(r),u=a(5551),o=a(1975),l=a(8938),d=a(3226),c=a(4033),h=a(3571);function p(){let e=(0,c.useRouter)(),[t,a]=i.useState(""),[r,p]=i.useState(""),[m,x]=i.useState(""),[f,g]=i.useState(!1),[b,v]=i.useState(null),C=i.useCallback(async()=>{let{data:e,error:t}=await h.OQ.auth.refreshSession();e&&v(e.user)},[]);i.useEffect(()=>{C()},[C]);let S=async a=>{if(g(!0),x(""),a.stopPropagation(),a.preventDefault(),!b){let{data:a,error:n}=await h.OQ.auth.signInWithPassword({email:t,password:r});n?x(n.message):e.push("/")}g(!1)};return b?(0,n.jsxs)("div",{style:{textAlign:"center"},children:["You're already logged in as ",b.email,"."]}):(0,n.jsxs)(l.Z,{component:"main",maxWidth:"xs",children:[(0,n.jsx)(d.Z,{component:"h1",variant:"h5",children:"Sign in"}),(0,n.jsx)("form",{children:!b&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,onChange:e=>a(e.target.value),value:t,error:!!m}),(0,n.jsx)(o.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:e=>p(e.target.value),value:r,error:!!m,helperText:m}),(0,n.jsx)(u.Z,{type:"submit",disabled:f,sx:{marginTop:"1em"},fullWidth:!0,variant:"contained",color:"primary",onClick:S,children:"Sign In"}),(0,n.jsxs)("p",{children:["Don't have an account yet? ",(0,n.jsx)(s(),{href:"/auth/signup",children:"Sign up"})]})]})})]})}},3571:function(e,t,a){"use strict";a.d(t,{Ho:function(){return c},OQ:function(){return s},aC:function(){return o}});var n=a(7437),i=a(2265),r=a(3082);let s=(0,r.createClientComponentClient)(),u=(0,i.createContext)({}),o=()=>(0,i.useContext)(u),l=(e,t)=>s.auth.signInWithPassword({email:e,password:t}),d=()=>s.auth.signOut(),c=e=>{let{children:t}=e,[a,r]=(0,i.useState)(null),[o,c]=(0,i.useState)(!1),h=(0,i.useCallback)(async()=>{let{data:e,error:t}=await s.auth.refreshSession();e&&r(e.user)},[]);return(0,i.useEffect)(()=>{h();let{data:e}=s.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?c(!1):"SIGNED_IN"===e&&t?(r(t.user),c(!0)):"SIGNED_OUT"===e&&(c(!1),r(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,n.jsx)(u.Provider,{value:{loggedIn:o,user:a,login:l,logout:d},children:t})}}},function(e){e.O(0,[293,808,548,82,975,971,596,744],function(){return e(e.s=8642)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[271],{8938:function(e,t,a){"use strict";a.d(t,{Z:function(){return k}});var n=a(791),i=a(3428),r=a(2265),s=a(7042),o=a(1380),u=a(5702),l=a(5600),d=a(8153),c=a(9190),h=a(4775),p=a(7437);let m=["className","component","disableGutters","fixed","maxWidth","classes"],x=(0,h.Z)(),f=(0,c.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,o.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),b=e=>(0,d.Z)({props:e,name:"MuiContainer",defaultTheme:x}),g=(e,t)=>{let{classes:a,fixed:n,disableGutters:i,maxWidth:r}=e,s={root:["root",r&&`maxWidth${(0,o.Z)(String(r))}`,n&&"fixed",i&&"disableGutters"]};return(0,l.Z)(s,e=>(0,u.Z)(t,e),a)};var v=a(8702),C=a(5843),S=a(7927);let Z=function(e={}){let{createStyledComponent:t=f,useThemeProps:a=b,componentName:o="MuiContainer"}=e,u=t(({theme:e,ownerState:t})=>(0,i.Z)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{let n=e.breakpoints.values[a];return 0!==n&&(t[e.breakpoints.up(a)]={maxWidth:`${n}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,i.Z)({},"xs"===t.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},t.maxWidth&&"xs"!==t.maxWidth&&{[e.breakpoints.up(t.maxWidth)]:{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`}})),l=r.forwardRef(function(e,t){let r=a(e),{className:l,component:d="div",disableGutters:c=!1,fixed:h=!1,maxWidth:x="lg"}=r,f=(0,n.Z)(r,m),b=(0,i.Z)({},r,{component:d,disableGutters:c,fixed:h,maxWidth:x}),v=g(b,o);return(0,p.jsx)(u,(0,i.Z)({as:d,ownerState:b,className:(0,s.Z)(v.root,l),ref:t},f))});return l}({createStyledComponent:(0,C.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,v.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,S.Z)({props:e,name:"MuiContainer"})});var k=Z},5712:function(e,t,a){Promise.resolve().then(a.bind(a,3948))},3948:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return p}});var n=a(7437),i=a(2265),r=a(1396),s=a.n(r),o=a(5551),u=a(1975),l=a(8938),d=a(3226),c=a(4033),h=a(3571);function p(){let e=(0,c.useRouter)(),[t,a]=i.useState(""),[r,p]=i.useState(""),[m,x]=i.useState(""),[f,b]=i.useState(!1),[g,v]=i.useState(null),C=i.useCallback(async()=>{let{data:e,error:t}=await h.OQ.auth.refreshSession();e&&v(e.user)},[]);i.useEffect(()=>{C()},[C]);let S=async a=>{if(b(!0),x(""),a.stopPropagation(),a.preventDefault(),!g){let{data:a,error:n}=await h.OQ.auth.signUp({email:t,password:r,options:{emailRedirectTo:"".concat(location.origin,"/auth/callback")}});n?x(n.message):e.push("/")}b(!1)};return(0,n.jsxs)(l.Z,{component:"main",maxWidth:"xs",children:[(0,n.jsx)(d.Z,{component:"h1",variant:"h5",children:"Sign up"}),(0,n.jsx)("p",{children:(0,n.jsx)(d.Z,{variant:"body1",children:"An account helps you easily save, view, and share your evals."})}),(0,n.jsxs)("form",{children:[!g&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,onChange:e=>a(e.target.value),value:t,error:!!m}),(0,n.jsx)(u.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:e=>p(e.target.value),value:r,error:!!m,helperText:m}),(0,n.jsx)(o.Z,{type:"submit",disabled:f,sx:{marginTop:"1em"},fullWidth:!0,variant:"contained",color:"primary",onClick:S,children:"Sign Up"})]}),(0,n.jsxs)("p",{children:["Already have an account? ",(0,n.jsx)(s(),{href:"/auth/login",children:"Sign in"})]})]})]})}},3571:function(e,t,a){"use strict";a.d(t,{Ho:function(){return c},OQ:function(){return s},aC:function(){return u}});var n=a(7437),i=a(2265),r=a(3082);let s=(0,r.createClientComponentClient)(),o=(0,i.createContext)({}),u=()=>(0,i.useContext)(o),l=(e,t)=>s.auth.signInWithPassword({email:e,password:t}),d=()=>s.auth.signOut(),c=e=>{let{children:t}=e,[a,r]=(0,i.useState)(null),[u,c]=(0,i.useState)(!1),h=(0,i.useCallback)(async()=>{let{data:e,error:t}=await s.auth.refreshSession();e&&r(e.user)},[]);return(0,i.useEffect)(()=>{h();let{data:e}=s.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?c(!1):"SIGNED_IN"===e&&t?(r(t.user),c(!0)):"SIGNED_OUT"===e&&(c(!1),r(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,n.jsx)(o.Provider,{value:{loggedIn:u,user:a,login:l,logout:d},children:t})}}},function(e){e.O(0,[293,808,548,82,975,971,596,744],function(){return e(e.s=5712)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[271],{8938:function(e,t,a){"use strict";a.d(t,{Z:function(){return k}});var n=a(791),i=a(3428),r=a(2265),s=a(7042),o=a(1380),u=a(5702),l=a(5600),d=a(8153),c=a(9190),h=a(4775),p=a(7437);let m=["className","component","disableGutters","fixed","maxWidth","classes"],x=(0,h.Z)(),f=(0,c.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,o.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),b=e=>(0,d.Z)({props:e,name:"MuiContainer",defaultTheme:x}),g=(e,t)=>{let{classes:a,fixed:n,disableGutters:i,maxWidth:r}=e,s={root:["root",r&&`maxWidth${(0,o.Z)(String(r))}`,n&&"fixed",i&&"disableGutters"]};return(0,l.Z)(s,e=>(0,u.Z)(t,e),a)};var v=a(8702),C=a(5843),S=a(7927);let Z=function(e={}){let{createStyledComponent:t=f,useThemeProps:a=b,componentName:o="MuiContainer"}=e,u=t(({theme:e,ownerState:t})=>(0,i.Z)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{let n=e.breakpoints.values[a];return 0!==n&&(t[e.breakpoints.up(a)]={maxWidth:`${n}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,i.Z)({},"xs"===t.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},t.maxWidth&&"xs"!==t.maxWidth&&{[e.breakpoints.up(t.maxWidth)]:{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`}})),l=r.forwardRef(function(e,t){let r=a(e),{className:l,component:d="div",disableGutters:c=!1,fixed:h=!1,maxWidth:x="lg"}=r,f=(0,n.Z)(r,m),b=(0,i.Z)({},r,{component:d,disableGutters:c,fixed:h,maxWidth:x}),v=g(b,o);return(0,p.jsx)(u,(0,i.Z)({as:d,ownerState:b,className:(0,s.Z)(v.root,l),ref:t},f))});return l}({createStyledComponent:(0,C.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,v.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,S.Z)({props:e,name:"MuiContainer"})});var k=Z},1771:function(e,t,a){Promise.resolve().then(a.bind(a,3948))},3948:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return p}});var n=a(7437),i=a(2265),r=a(1396),s=a.n(r),o=a(5551),u=a(1975),l=a(8938),d=a(3226),c=a(4033),h=a(3571);function p(){let e=(0,c.useRouter)(),[t,a]=i.useState(""),[r,p]=i.useState(""),[m,x]=i.useState(""),[f,b]=i.useState(!1),[g,v]=i.useState(null),C=i.useCallback(async()=>{let{data:e,error:t}=await h.OQ.auth.refreshSession();e&&v(e.user)},[]);i.useEffect(()=>{C()},[C]);let S=async a=>{if(b(!0),x(""),a.stopPropagation(),a.preventDefault(),!g){let{data:a,error:n}=await h.OQ.auth.signUp({email:t,password:r,options:{emailRedirectTo:"".concat(location.origin,"/auth/callback")}});n?x(n.message):e.push("/")}b(!1)};return(0,n.jsxs)(l.Z,{component:"main",maxWidth:"xs",children:[(0,n.jsx)(d.Z,{component:"h1",variant:"h5",children:"Sign up"}),(0,n.jsx)("p",{children:(0,n.jsx)(d.Z,{variant:"body1",children:"An account helps you easily save, view, and share your evals."})}),(0,n.jsxs)("form",{children:[!g&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,onChange:e=>a(e.target.value),value:t,error:!!m}),(0,n.jsx)(u.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:e=>p(e.target.value),value:r,error:!!m,helperText:m}),(0,n.jsx)(o.Z,{type:"submit",disabled:f,sx:{marginTop:"1em"},fullWidth:!0,variant:"contained",color:"primary",onClick:S,children:"Sign Up"})]}),(0,n.jsxs)("p",{children:["Already have an account? ",(0,n.jsx)(s(),{href:"/auth/login",children:"Sign in"})]})]})]})}},3571:function(e,t,a){"use strict";a.d(t,{Ho:function(){return c},OQ:function(){return s},aC:function(){return u}});var n=a(7437),i=a(2265),r=a(3082);let s=(0,r.createClientComponentClient)(),o=(0,i.createContext)({}),u=()=>(0,i.useContext)(o),l=(e,t)=>s.auth.signInWithPassword({email:e,password:t}),d=()=>s.auth.signOut(),c=e=>{let{children:t}=e,[a,r]=(0,i.useState)(null),[u,c]=(0,i.useState)(!1),h=(0,i.useCallback)(async()=>{let{data:e,error:t}=await s.auth.refreshSession();e&&r(e.user)},[]);return(0,i.useEffect)(()=>{h();let{data:e}=s.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?c(!1):"SIGNED_IN"===e&&t?(r(t.user),c(!0)):"SIGNED_OUT"===e&&(c(!1),r(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,n.jsx)(o.Provider,{value:{loggedIn:u,user:a,login:l,logout:d},children:t})}}},function(e){e.O(0,[293,808,548,82,975,971,596,744],function(){return e(e.s=1771)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[958],{4871:function(e,t,s){Promise.resolve().then(s.bind(s,4260))},4260:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return k}});var i=s(7437),l=s(2265),n=s(1396),r=s.n(n),c=s(6507),d=s(2492),a=s(3701),o=s(9279),h=s(666),u=s(6988),v=s(4147),x=s(5781),j=s(8276),p=s(4033),Z=s(8339),m=s(5551),f=s(9394),C=s(2834),w=s(6337),y=s(1797),g=s(3226),I=s(5446);function E(e){var t,s,n,c,x;let{openDialog:j,handleClose:p,testCase:E}=e,[S,k]=(0,l.useState)(1);return(0,i.jsxs)(f.Z,{open:j,onClose:p,fullWidth:!0,maxWidth:"lg",children:[(0,i.jsxs)(y.Z,{children:["Dataset ",E.id.slice(0,6)]}),(0,i.jsxs)(w.Z,{children:[(0,i.jsx)(g.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Test cases"}),(0,i.jsx)(I.u,{readOnly:!0,value:E&&Z.default.dump(E.testCases),style:{width:"100%",padding:"0.75rem"},maxRows:15}),(0,i.jsx)(g.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Used in..."}),(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(v.Z,{children:[(0,i.jsx)(h.Z,{children:"Eval ID"}),(0,i.jsx)(h.Z,{children:"Prompt ID"}),(0,i.jsx)(h.Z,{children:"Raw score"}),(0,i.jsx)(h.Z,{children:"Pass rate"}),(0,i.jsx)(h.Z,{children:"Pass count"}),(0,i.jsx)(h.Z,{children:"Fail count"}),(0,i.jsx)(h.Z,{children:"Prompt"})]})}),(0,i.jsx)(o.Z,{children:null==E?void 0:null===(t=E.prompts)||void 0===t?void 0:t.slice((S-1)*10,10*S).sort((e,t)=>t.evalId.localeCompare(e.evalId)).map((e,t)=>{var s,l,d,a,o,u,j,p;return(0,i.jsxs)(v.Z,{hover:!0,children:[(0,i.jsx)(h.Z,{children:(0,i.jsx)(r(),{href:"/eval/?file=".concat(e.evalFilepath),children:e.evalId.slice(0,6)})}),(0,i.jsx)(h.Z,{style:{minWidth:"8em"},children:(0,i.jsx)(r(),{href:"/prompts/?id=".concat(e.id),children:e.id.slice(0,6)})}),(0,i.jsx)(h.Z,{children:null!==(n=null===(s=e.prompt.metrics)||void 0===s?void 0:s.score.toFixed(2))&&void 0!==n?n:"-"}),(0,i.jsx)(h.Z,{children:(null===(l=e.prompt.metrics)||void 0===l?void 0:l.testPassCount)!==void 0&&(null===(d=e.prompt.metrics)||void 0===d?void 0:d.testFailCount)!==void 0?((null===(a=e.prompt.metrics)||void 0===a?void 0:a.testPassCount)/((null===(o=e.prompt.metrics)||void 0===o?void 0:o.testPassCount)+(null===(u=e.prompt.metrics)||void 0===u?void 0:u.testFailCount))*100).toFixed(2)+"%":"-"}),(0,i.jsx)(h.Z,{children:null!==(c=null===(j=e.prompt.metrics)||void 0===j?void 0:j.testPassCount)&&void 0!==c?c:"-"}),(0,i.jsx)(h.Z,{children:null!==(x=null===(p=e.prompt.metrics)||void 0===p?void 0:p.testFailCount)&&void 0!==x?x:"-"}),(0,i.jsx)(h.Z,{children:e.prompt.raw.length>250?e.prompt.raw.slice(0,250)+"...":e.prompt.raw})]},t)})})]}),Math.ceil(((null==E?void 0:null===(s=E.prompts)||void 0===s?void 0:s.length)||0)/10)>1&&(0,i.jsx)(d.Z,{count:Math.ceil(E.prompts.length/10),page:S,onChange:(e,t)=>{k(t)}})]}),(0,i.jsx)(C.Z,{children:(0,i.jsx)(m.Z,{onClick:p,children:"Close"})})]})}var S=s(279);function k(){let e=(0,p.useSearchParams)(),[t,s]=(0,l.useState)([]),[n,Z]=(0,l.useState)("date"),[m,f]=(0,l.useState)("desc"),[C,w]=(0,l.useState)(1),[y,g]=(0,l.useState)(10),[I,k]=(0,l.useState)(!1),[P,T]=(0,l.useState)(0),_=e=>{let t=n===e&&"asc"===m?"desc":"asc";Z(e),f(t)};(0,l.useEffect)(()=>{fetch("".concat(S.CT,"/api/datasets")).then(e=>e.json()).then(e=>{let t=[...e.data].sort((e,t)=>null===n?0:"asc"===m?e[n]>t[n]?1:-1:e[n]<t[n]?1:-1);s(t)})},[n,m]),(0,l.useEffect)(()=>{let s=null==e?void 0:e.get("id");if(s){let e=t.findIndex(e=>e.id.startsWith(s));-1!==e&&D(e)}},[t,e]);let D=e=>{T(e),k(!0)};return(0,i.jsxs)(c.Z,{paddingX:2,children:[(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(v.Z,{children:[(0,i.jsx)(h.Z,{style:{width:"10%"},children:"ID"}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(x.Z,{active:"raw"===n,direction:"raw"===n?m:"asc",onClick:()=>_("raw"),children:"Info"})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:"Variables"}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:(0,i.jsx)(x.Z,{active:"count"===n,direction:"count"===n?m:"asc",onClick:()=>_("count"),children:"Total # evals"})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(j.Z,{title:"The date of the most recent eval for this set of test cases",children:(0,i.jsx)(x.Z,{active:"date"===n,direction:"date"===n?m:"asc",onClick:()=>_("date"),children:"Most recent eval date"})})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(j.Z,{title:"The ID of the most recent eval for this set of test cases",children:(0,i.jsx)(x.Z,{active:"evalId"===n,direction:"evalId"===n?m:"asc",onClick:()=>_("evalId"),children:"Most recent eval ID"})})})]})}),(0,i.jsx)(o.Z,{children:t.slice((C-1)*y,C*y).map((e,t)=>(0,i.jsxs)(v.Z,{hover:!0,onClick:()=>D(t),style:{cursor:"pointer"},children:[(0,i.jsx)(h.Z,{children:e.id.slice(0,6)}),(0,i.jsxs)(h.Z,{style:{width:"20%",whiteSpace:"pre-wrap"},children:[e.testCases.length," test cases"]}),(0,i.jsx)(h.Z,{style:{width:"20%",whiteSpace:"pre-wrap"},children:(()=>{if(!Array.isArray(e.testCases)||"string"==typeof e.testCases[0])return"";let t=(e.testCases||[]).flatMap(e=>Object.keys(e.vars||{})),s=Array.from(new Set(t));return s.length>0?s.join(", "):"None"})()}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:e.count}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:e.recentEvalDate||"Unknown"}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:e.recentEvalId?(0,i.jsx)(r(),{href:"/eval?file=".concat(e.recentEvalFilepath),children:e.recentEvalId.slice(0,6)}):"Unknown"})]},t))})]}),Math.ceil(t.length/y)>1&&(0,i.jsx)(d.Z,{count:Math.ceil(t.length/y),page:C,onChange:(e,t)=>w(t)}),t[P]&&(0,i.jsx)(E,{openDialog:I,handleClose:()=>{k(!1)},testCase:t[P]})]})}},279:function(e,t,s){"use strict";s.d(t,{CT:function(){return n},T8:function(){return l},eA:function(){return r}});var i=s(2601);let l=!i.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,n="http://localhost:15500",r=""}},function(e){e.O(0,[293,808,238,339,21,971,596,744],function(){return e(e.s=4871)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[958],{4303:function(e,t,s){Promise.resolve().then(s.bind(s,4260))},4260:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return k}});var i=s(7437),l=s(2265),n=s(1396),r=s.n(n),c=s(6507),d=s(2492),a=s(3701),o=s(9279),h=s(666),u=s(6988),v=s(4147),x=s(5781),j=s(8276),p=s(4033),Z=s(8339),m=s(5551),f=s(9394),C=s(2834),w=s(6337),y=s(1797),g=s(3226),I=s(5446);function E(e){var t,s,n,c,x;let{openDialog:j,handleClose:p,testCase:E}=e,[S,k]=(0,l.useState)(1);return(0,i.jsxs)(f.Z,{open:j,onClose:p,fullWidth:!0,maxWidth:"lg",children:[(0,i.jsxs)(y.Z,{children:["Dataset ",E.id.slice(0,6)]}),(0,i.jsxs)(w.Z,{children:[(0,i.jsx)(g.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Test cases"}),(0,i.jsx)(I.u,{readOnly:!0,value:E&&Z.default.dump(E.testCases),style:{width:"100%",padding:"0.75rem"},maxRows:15}),(0,i.jsx)(g.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Used in..."}),(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(v.Z,{children:[(0,i.jsx)(h.Z,{children:"Eval ID"}),(0,i.jsx)(h.Z,{children:"Prompt ID"}),(0,i.jsx)(h.Z,{children:"Raw score"}),(0,i.jsx)(h.Z,{children:"Pass rate"}),(0,i.jsx)(h.Z,{children:"Pass count"}),(0,i.jsx)(h.Z,{children:"Fail count"}),(0,i.jsx)(h.Z,{children:"Prompt"})]})}),(0,i.jsx)(o.Z,{children:null==E?void 0:null===(t=E.prompts)||void 0===t?void 0:t.slice((S-1)*10,10*S).sort((e,t)=>t.evalId.localeCompare(e.evalId)).map((e,t)=>{var s,l,d,a,o,u,j,p;return(0,i.jsxs)(v.Z,{hover:!0,children:[(0,i.jsx)(h.Z,{children:(0,i.jsx)(r(),{href:"/eval/?file=".concat(e.evalFilepath),children:e.evalId.slice(0,6)})}),(0,i.jsx)(h.Z,{style:{minWidth:"8em"},children:(0,i.jsx)(r(),{href:"/prompts/?id=".concat(e.id),children:e.id.slice(0,6)})}),(0,i.jsx)(h.Z,{children:null!==(n=null===(s=e.prompt.metrics)||void 0===s?void 0:s.score.toFixed(2))&&void 0!==n?n:"-"}),(0,i.jsx)(h.Z,{children:(null===(l=e.prompt.metrics)||void 0===l?void 0:l.testPassCount)!==void 0&&(null===(d=e.prompt.metrics)||void 0===d?void 0:d.testFailCount)!==void 0?((null===(a=e.prompt.metrics)||void 0===a?void 0:a.testPassCount)/((null===(o=e.prompt.metrics)||void 0===o?void 0:o.testPassCount)+(null===(u=e.prompt.metrics)||void 0===u?void 0:u.testFailCount))*100).toFixed(2)+"%":"-"}),(0,i.jsx)(h.Z,{children:null!==(c=null===(j=e.prompt.metrics)||void 0===j?void 0:j.testPassCount)&&void 0!==c?c:"-"}),(0,i.jsx)(h.Z,{children:null!==(x=null===(p=e.prompt.metrics)||void 0===p?void 0:p.testFailCount)&&void 0!==x?x:"-"}),(0,i.jsx)(h.Z,{children:e.prompt.raw.length>250?e.prompt.raw.slice(0,250)+"...":e.prompt.raw})]},t)})})]}),Math.ceil(((null==E?void 0:null===(s=E.prompts)||void 0===s?void 0:s.length)||0)/10)>1&&(0,i.jsx)(d.Z,{count:Math.ceil(E.prompts.length/10),page:S,onChange:(e,t)=>{k(t)}})]}),(0,i.jsx)(C.Z,{children:(0,i.jsx)(m.Z,{onClick:p,children:"Close"})})]})}var S=s(279);function k(){let e=(0,p.useSearchParams)(),[t,s]=(0,l.useState)([]),[n,Z]=(0,l.useState)("date"),[m,f]=(0,l.useState)("desc"),[C,w]=(0,l.useState)(1),[y,g]=(0,l.useState)(10),[I,k]=(0,l.useState)(!1),[P,T]=(0,l.useState)(0),_=e=>{let t=n===e&&"asc"===m?"desc":"asc";Z(e),f(t)};(0,l.useEffect)(()=>{fetch("".concat(S.CT,"/api/datasets")).then(e=>e.json()).then(e=>{let t=[...e.data].sort((e,t)=>null===n?0:"asc"===m?e[n]>t[n]?1:-1:e[n]<t[n]?1:-1);s(t)})},[n,m]),(0,l.useEffect)(()=>{let s=null==e?void 0:e.get("id");if(s){let e=t.findIndex(e=>e.id.startsWith(s));-1!==e&&D(e)}},[t,e]);let D=e=>{T(e),k(!0)};return(0,i.jsxs)(c.Z,{paddingX:2,children:[(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(v.Z,{children:[(0,i.jsx)(h.Z,{style:{width:"10%"},children:"ID"}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(x.Z,{active:"raw"===n,direction:"raw"===n?m:"asc",onClick:()=>_("raw"),children:"Info"})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:"Variables"}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:(0,i.jsx)(x.Z,{active:"count"===n,direction:"count"===n?m:"asc",onClick:()=>_("count"),children:"Total # evals"})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(j.Z,{title:"The date of the most recent eval for this set of test cases",children:(0,i.jsx)(x.Z,{active:"date"===n,direction:"date"===n?m:"asc",onClick:()=>_("date"),children:"Most recent eval date"})})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(j.Z,{title:"The ID of the most recent eval for this set of test cases",children:(0,i.jsx)(x.Z,{active:"evalId"===n,direction:"evalId"===n?m:"asc",onClick:()=>_("evalId"),children:"Most recent eval ID"})})})]})}),(0,i.jsx)(o.Z,{children:t.slice((C-1)*y,C*y).map((e,t)=>(0,i.jsxs)(v.Z,{hover:!0,onClick:()=>D(t),style:{cursor:"pointer"},children:[(0,i.jsx)(h.Z,{children:e.id.slice(0,6)}),(0,i.jsxs)(h.Z,{style:{width:"20%",whiteSpace:"pre-wrap"},children:[e.testCases.length," test cases"]}),(0,i.jsx)(h.Z,{style:{width:"20%",whiteSpace:"pre-wrap"},children:(()=>{if(!Array.isArray(e.testCases)||"string"==typeof e.testCases[0])return"";let t=(e.testCases||[]).flatMap(e=>Object.keys(e.vars||{})),s=Array.from(new Set(t));return s.length>0?s.join(", "):"None"})()}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:e.count}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:e.recentEvalDate||"Unknown"}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:e.recentEvalId?(0,i.jsx)(r(),{href:"/eval?file=".concat(e.recentEvalFilepath),children:e.recentEvalId.slice(0,6)}):"Unknown"})]},t))})]}),Math.ceil(t.length/y)>1&&(0,i.jsx)(d.Z,{count:Math.ceil(t.length/y),page:C,onChange:(e,t)=>w(t)}),t[P]&&(0,i.jsx)(E,{openDialog:I,handleClose:()=>{k(!1)},testCase:t[P]})]})}},279:function(e,t,s){"use strict";s.d(t,{CT:function(){return n},T8:function(){return l},eA:function(){return r}});var i=s(2601);let l=!i.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,n="http://localhost:15500",r=""}},function(e){e.O(0,[293,808,238,339,21,971,596,744],function(){return e(e.s=4303)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[466],{5330:function(n,e,u){Promise.resolve().then(u.t.bind(u,4116,23))},4116:function(){}},function(n){n.O(0,[971,596,744],function(){return n(n.s=5330)}),_N_E=n.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[421],{3566:function(e,n,t){Promise.resolve().then(t.t.bind(t,6656,23)),Promise.resolve().then(t.t.bind(t,6208,23)),Promise.resolve().then(t.t.bind(t,8169,23)),Promise.resolve().then(t.t.bind(t,3699,23)),Promise.resolve().then(t.bind(t,1860)),Promise.resolve().then(t.t.bind(t,4116,23))},3699:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e,n){for(var t in n)Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}(n,{suspense:function(){return o},NoSSR:function(){return i}}),t(1024),t(2265);let r=t(7669);function o(){let e=Error(r.NEXT_DYNAMIC_NO_SSR_CODE);throw e.digest=r.NEXT_DYNAMIC_NO_SSR_CODE,e}function i(e){let{children:n}=e;return n}},4116:function(){}},function(e){e.O(0,[674,293,808,548,82,238,975,320,919,502,860,971,596,744],function(){return e(e.s=3566)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[421],{6427:function(e,n,t){Promise.resolve().then(t.t.bind(t,6656,23)),Promise.resolve().then(t.t.bind(t,6208,23)),Promise.resolve().then(t.t.bind(t,8169,23)),Promise.resolve().then(t.t.bind(t,3699,23)),Promise.resolve().then(t.bind(t,1860)),Promise.resolve().then(t.t.bind(t,4116,23))},3699:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e,n){for(var t in n)Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}(n,{suspense:function(){return o},NoSSR:function(){return i}}),t(1024),t(2265);let r=t(7669);function o(){let e=Error(r.NEXT_DYNAMIC_NO_SSR_CODE);throw e.digest=r.NEXT_DYNAMIC_NO_SSR_CODE,e}function i(e){let{children:n}=e;return n}},4116:function(){}},function(e){e.O(0,[674,293,808,548,82,238,975,320,919,502,860,971,596,744],function(){return e(e.s=6427)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[11],{7304:function(e,n,s){Promise.resolve().then(s.t.bind(s,6685,23)),Promise.resolve().then(s.bind(s,1860))}},function(e){e.O(0,[674,293,808,548,82,238,975,320,919,502,860,971,596,744],function(){return e(e.s=7304)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{6124:function(e,t,n){Promise.resolve().then(n.bind(n,2112)),Promise.resolve().then(n.t.bind(n,9362,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 P}});var r=n(7437),s=n(2265),o=n(2135),i=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 p=n(3283),j=n(3375),v=n(5507),b=n(2653);function k(){let{user:e,logout:t}=(0,l.aC)(),[n,o]=s.useState(null),i=async()=>{null==t||t(),a()},a=()=>{o(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=>{o(e.currentTarget)},color:"inherit",children:(0,r.jsx)(p.Z,{sx:{width:"1em",height:"1em",bgcolor:"#1976d2"}})}),(0,r.jsxs)(j.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:i,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)(p.Z,{sx:{width:"1em",height:"1em"}})})})}var E=n(9864),C=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)(E.Z,{}):(0,r.jsx)(C.Z,{})})}n(2794);var _=n(279);n(5154);var O=n(2601);function S(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 Z(e){let{darkMode:t,onToggleDarkMode:n}=e;return O.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)(S,{href:"/setup",label:"New Eval"}),(0,r.jsx)(S,{href:"/eval",label:"Evals"}),(0,r.jsx)(S,{href:"/prompts",label:"Prompts"}),(0,r.jsx)(S,{href:"/datasets",label:"Datasets"}),(0,r.jsxs)("div",{className:"right-aligned",children:[_.T8?null:(0,r.jsx)(k,{}),(0,r.jsx)(N,{darkMode:t,onToggleDarkMode:n})]})]})}function P(e){let{children:t}=e,n=(0,o.Z)("(prefers-color-scheme: dark)"),[u,c]=s.useState(n),d=s.useMemo(()=>(0,i.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)(Z,{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,{CT:function(){return o},T8:function(){return s},eA:function(){return i}});var r=n(2601);let s=!r.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,o="http://localhost:15500",i=""},3571:function(e,t,n){"use strict";n.d(t,{Ho:function(){return d},OQ:function(){return i},aC:function(){return l}});var r=n(7437),s=n(2265),o=n(3082);let i=(0,o.createClientComponentClient)(),a=(0,s.createContext)({}),l=()=>(0,s.useContext)(a),u=(e,t)=>i.auth.signInWithPassword({email:e,password:t}),c=()=>i.auth.signOut(),d=e=>{let{children:t}=e,[n,o]=(0,s.useState)(null),[l,d]=(0,s.useState)(!1),h=(0,s.useCallback)(async()=>{let{data:e,error:t}=await i.auth.refreshSession();e&&o(e.user)},[]);return(0,s.useEffect)(()=>{h();let{data:e}=i.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?d(!1):"SIGNED_IN"===e&&t?(o(t.user),d(!0)):"SIGNED_OUT"===e&&(d(!1),o(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,320,563,971,596,744],function(){return e(e.s=6124)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{8845:function(e,t,n){Promise.resolve().then(n.bind(n,2112)),Promise.resolve().then(n.t.bind(n,9362,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 P}});var r=n(7437),s=n(2265),o=n(2135),i=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 p=n(3283),j=n(3375),v=n(5507),b=n(2653);function k(){let{user:e,logout:t}=(0,l.aC)(),[n,o]=s.useState(null),i=async()=>{null==t||t(),a()},a=()=>{o(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=>{o(e.currentTarget)},color:"inherit",children:(0,r.jsx)(p.Z,{sx:{width:"1em",height:"1em",bgcolor:"#1976d2"}})}),(0,r.jsxs)(j.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:i,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)(p.Z,{sx:{width:"1em",height:"1em"}})})})}var E=n(9864),C=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)(E.Z,{}):(0,r.jsx)(C.Z,{})})}n(2794);var _=n(279);n(5154);var O=n(2601);function S(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 Z(e){let{darkMode:t,onToggleDarkMode:n}=e;return O.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)(S,{href:"/setup",label:"New Eval"}),(0,r.jsx)(S,{href:"/eval",label:"Evals"}),(0,r.jsx)(S,{href:"/prompts",label:"Prompts"}),(0,r.jsx)(S,{href:"/datasets",label:"Datasets"}),(0,r.jsxs)("div",{className:"right-aligned",children:[_.T8?null:(0,r.jsx)(k,{}),(0,r.jsx)(N,{darkMode:t,onToggleDarkMode:n})]})]})}function P(e){let{children:t}=e,n=(0,o.Z)("(prefers-color-scheme: dark)"),[u,c]=s.useState(n),d=s.useMemo(()=>(0,i.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)(Z,{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,{CT:function(){return o},T8:function(){return s},eA:function(){return i}});var r=n(2601);let s=!r.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,o="http://localhost:15500",i=""},3571:function(e,t,n){"use strict";n.d(t,{Ho:function(){return d},OQ:function(){return i},aC:function(){return l}});var r=n(7437),s=n(2265),o=n(3082);let i=(0,o.createClientComponentClient)(),a=(0,s.createContext)({}),l=()=>(0,s.useContext)(a),u=(e,t)=>i.auth.signInWithPassword({email:e,password:t}),c=()=>i.auth.signOut(),d=e=>{let{children:t}=e,[n,o]=(0,s.useState)(null),[l,d]=(0,s.useState)(!1),h=(0,s.useCallback)(async()=>{let{data:e,error:t}=await i.auth.refreshSession();e&&o(e.user)},[]);return(0,s.useEffect)(()=>{h();let{data:e}=i.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?d(!1):"SIGNED_IN"===e&&t?(o(t.user),d(!0)):"SIGNED_OUT"===e&&(d(!1),o(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,320,563,971,596,744],function(){return e(e.s=8845)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{9256:function(e,n,t){Promise.resolve().then(t.t.bind(t,6656,23)),Promise.resolve().then(t.t.bind(t,6208,23)),Promise.resolve().then(t.t.bind(t,8169,23)),Promise.resolve().then(t.t.bind(t,3699,23)),Promise.resolve().then(t.t.bind(t,6339,23))},3699:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e,n){for(var t in n)Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}(n,{suspense:function(){return o},NoSSR:function(){return i}}),t(1024),t(2265);let r=t(7669);function o(){let e=Error(r.NEXT_DYNAMIC_NO_SSR_CODE);throw e.digest=r.NEXT_DYNAMIC_NO_SSR_CODE,e}function i(e){let{children:n}=e;return n}},6339:function(){}},function(e){e.O(0,[971,596,744],function(){return e(e.s=9256)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{8803:function(e,n,t){Promise.resolve().then(t.t.bind(t,6656,23)),Promise.resolve().then(t.t.bind(t,6208,23)),Promise.resolve().then(t.t.bind(t,8169,23)),Promise.resolve().then(t.t.bind(t,3699,23)),Promise.resolve().then(t.t.bind(t,6339,23))},3699:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e,n){for(var t in n)Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}(n,{suspense:function(){return o},NoSSR:function(){return i}}),t(1024),t(2265);let r=t(7669);function o(){let e=Error(r.NEXT_DYNAMIC_NO_SSR_CODE);throw e.digest=r.NEXT_DYNAMIC_NO_SSR_CODE,e}function i(e){let{children:n}=e;return n}},6339:function(){}},function(e){e.O(0,[971,596,744],function(){return e(e.s=8803)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[794],{5809:function(e,t,n){Promise.resolve().then(n.bind(n,176))},176:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return S}});var i=n(7437),s=n(2265),l=n(1396),r=n.n(l),c=n(6507),d=n(2492),a=n(3701),o=n(9279),h=n(666),u=n(6988),x=n(4147),j=n(5781),Z=n(8276),v=n(4033),p=n(279),f=n(9394),m=n(2834),w=n(6337),C=n(1797),E=n(5446),P=n(3226),g=n(5551),y=e=>{var t;let{openDialog:n,handleClose:s,selectedPrompt:l}=e;return(0,i.jsxs)(f.Z,{open:n,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,i.jsxs)(C.Z,{children:["Prompt ",l.id.slice(0,6)]}),(0,i.jsxs)(w.Z,{children:[(0,i.jsx)(P.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Prompt"}),(0,i.jsx)(E.u,{readOnly:!0,value:null==l?void 0:null===(t=l.prompt)||void 0===t?void 0:t.raw,style:{width:"100%",padding:"0.75rem"},maxRows:50}),(0,i.jsx)(P.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Used in..."}),(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(h.Z,{children:"Eval ID"}),(0,i.jsx)(h.Z,{children:"Dataset ID"}),(0,i.jsx)(h.Z,{children:"Raw score"}),(0,i.jsx)(h.Z,{children:"Pass rate"}),(0,i.jsx)(h.Z,{children:"Pass count"}),(0,i.jsx)(h.Z,{children:"Fail count"})]})}),(0,i.jsx)(o.Z,{children:null==l?void 0:l.evals.sort((e,t)=>t.id.localeCompare(e.id)).map(e=>{var t,n,s,l,c,d;let a=null!==(l=null===(t=e.metrics)||void 0===t?void 0:t.testPassCount)&&void 0!==l?l:0,o=null!==(c=null===(n=e.metrics)||void 0===n?void 0:n.testFailCount)&&void 0!==c?c:0,u=a+o>0?(a/(a+o)*100).toFixed(2)+"%":"-";return(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(h.Z,{children:(0,i.jsx)(r(),{href:"/eval/?file=".concat(e.filePath),children:e.id.slice(0,6)})}),(0,i.jsx)(h.Z,{children:(0,i.jsx)(r(),{href:"/datasets/?id=".concat(e.datasetId),children:e.datasetId.slice(0,6)})}),(0,i.jsx)(h.Z,{children:null!==(d=null===(s=e.metrics)||void 0===s?void 0:s.score.toFixed(2))&&void 0!==d?d:"-"}),(0,i.jsx)(h.Z,{children:u}),(0,i.jsx)(h.Z,{children:a}),(0,i.jsx)(h.Z,{children:o})]},"eval-".concat(e.id))})})]})]}),(0,i.jsx)(m.Z,{children:(0,i.jsx)(g.Z,{onClick:s,children:"Close"})})]})};function S(){let e=(0,v.useSearchParams)(),[t,n]=(0,s.useState)([]),[l,f]=(0,s.useState)("date"),[m,w]=(0,s.useState)("desc"),[C,E]=(0,s.useState)(1),[P,g]=(0,s.useState)(10),[S,_]=(0,s.useState)(!1),[k,D]=(0,s.useState)(0),I=e=>{let t=l===e&&"asc"===m?"desc":"asc";f(e),w(t)};(0,s.useEffect)(()=>{fetch("".concat(p.CT,"/api/prompts")).then(e=>e.json()).then(e=>{let t=[...e.data].sort((e,t)=>null===l?0:"asc"===m?e[l]>t[l]?1:-1:e[l]<t[l]?1:-1);n(t)})},[l,m]),(0,s.useEffect)(()=>{let n=null==e?void 0:e.get("id");if(n){let e=t.findIndex(e=>e.id.startsWith(n));-1!==e&&T(e)}},[t,e]);let T=e=>{_(!0),D(e)};return(0,i.jsxs)(c.Z,{paddingX:2,children:[(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(h.Z,{style:{width:"10%"},children:"ID"}),(0,i.jsx)(h.Z,{style:{width:"60%"},children:(0,i.jsx)(j.Z,{active:"raw"===l,direction:"raw"===l?m:"asc",onClick:()=>I("raw"),children:"Prompt"})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(Z.Z,{title:"The date of the most recent eval for this prompt",children:(0,i.jsx)(j.Z,{active:"date"===l,direction:"date"===l?m:"asc",onClick:()=>I("date"),children:"Most recent eval"})})}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:(0,i.jsx)(j.Z,{active:"count"===l,direction:"count"===l?m:"asc",onClick:()=>I("count"),children:"# Evals"})})]})}),(0,i.jsx)(o.Z,{children:t.slice((C-1)*P,C*P).map((e,t)=>(0,i.jsxs)(x.Z,{hover:!0,children:[(0,i.jsx)(h.Z,{style:{width:"10%"},children:e.id.slice(0,6)}),(0,i.jsx)(h.Z,{style:{width:"60%",whiteSpace:"pre-wrap",cursor:"pointer"},onClick:()=>T(t),children:e.prompt.raw.length>500?e.prompt.raw.slice(0,500)+"...":e.prompt.raw}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:e.recentEvalDate?(0,i.jsx)(r(),{href:"/eval?file=".concat(e.recentEvalId),children:e.recentEvalDate}):"Unknown"}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:e.count})]},t))})]}),Math.ceil(t.length/P)>1&&(0,i.jsx)(d.Z,{count:Math.ceil(t.length/P),page:C,onChange:(e,t)=>E(t)}),t[k]&&(0,i.jsx)(y,{openDialog:S,handleClose:()=>{_(!1)},selectedPrompt:t[k]})]})}},279:function(e,t,n){"use strict";n.d(t,{CT:function(){return l},T8:function(){return s},eA:function(){return r}});var i=n(2601);let s=!i.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,l="http://localhost:15500",r=""}},function(e){e.O(0,[293,808,238,21,971,596,744],function(){return e(e.s=5809)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[794],{8050:function(e,t,n){Promise.resolve().then(n.bind(n,176))},176:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return S}});var i=n(7437),s=n(2265),l=n(1396),r=n.n(l),c=n(6507),d=n(2492),a=n(3701),o=n(9279),h=n(666),u=n(6988),x=n(4147),j=n(5781),Z=n(8276),v=n(4033),p=n(279),f=n(9394),m=n(2834),w=n(6337),C=n(1797),E=n(5446),P=n(3226),g=n(5551),y=e=>{var t;let{openDialog:n,handleClose:s,selectedPrompt:l}=e;return(0,i.jsxs)(f.Z,{open:n,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,i.jsxs)(C.Z,{children:["Prompt ",l.id.slice(0,6)]}),(0,i.jsxs)(w.Z,{children:[(0,i.jsx)(P.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Prompt"}),(0,i.jsx)(E.u,{readOnly:!0,value:null==l?void 0:null===(t=l.prompt)||void 0===t?void 0:t.raw,style:{width:"100%",padding:"0.75rem"},maxRows:50}),(0,i.jsx)(P.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Used in..."}),(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(h.Z,{children:"Eval ID"}),(0,i.jsx)(h.Z,{children:"Dataset ID"}),(0,i.jsx)(h.Z,{children:"Raw score"}),(0,i.jsx)(h.Z,{children:"Pass rate"}),(0,i.jsx)(h.Z,{children:"Pass count"}),(0,i.jsx)(h.Z,{children:"Fail count"})]})}),(0,i.jsx)(o.Z,{children:null==l?void 0:l.evals.sort((e,t)=>t.id.localeCompare(e.id)).map(e=>{var t,n,s,l,c,d;let a=null!==(l=null===(t=e.metrics)||void 0===t?void 0:t.testPassCount)&&void 0!==l?l:0,o=null!==(c=null===(n=e.metrics)||void 0===n?void 0:n.testFailCount)&&void 0!==c?c:0,u=a+o>0?(a/(a+o)*100).toFixed(2)+"%":"-";return(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(h.Z,{children:(0,i.jsx)(r(),{href:"/eval/?file=".concat(e.filePath),children:e.id.slice(0,6)})}),(0,i.jsx)(h.Z,{children:(0,i.jsx)(r(),{href:"/datasets/?id=".concat(e.datasetId),children:e.datasetId.slice(0,6)})}),(0,i.jsx)(h.Z,{children:null!==(d=null===(s=e.metrics)||void 0===s?void 0:s.score.toFixed(2))&&void 0!==d?d:"-"}),(0,i.jsx)(h.Z,{children:u}),(0,i.jsx)(h.Z,{children:a}),(0,i.jsx)(h.Z,{children:o})]},"eval-".concat(e.id))})})]})]}),(0,i.jsx)(m.Z,{children:(0,i.jsx)(g.Z,{onClick:s,children:"Close"})})]})};function S(){let e=(0,v.useSearchParams)(),[t,n]=(0,s.useState)([]),[l,f]=(0,s.useState)("date"),[m,w]=(0,s.useState)("desc"),[C,E]=(0,s.useState)(1),[P,g]=(0,s.useState)(10),[S,_]=(0,s.useState)(!1),[k,D]=(0,s.useState)(0),I=e=>{let t=l===e&&"asc"===m?"desc":"asc";f(e),w(t)};(0,s.useEffect)(()=>{fetch("".concat(p.CT,"/api/prompts")).then(e=>e.json()).then(e=>{let t=[...e.data].sort((e,t)=>null===l?0:"asc"===m?e[l]>t[l]?1:-1:e[l]<t[l]?1:-1);n(t)})},[l,m]),(0,s.useEffect)(()=>{let n=null==e?void 0:e.get("id");if(n){let e=t.findIndex(e=>e.id.startsWith(n));-1!==e&&T(e)}},[t,e]);let T=e=>{_(!0),D(e)};return(0,i.jsxs)(c.Z,{paddingX:2,children:[(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(h.Z,{style:{width:"10%"},children:"ID"}),(0,i.jsx)(h.Z,{style:{width:"60%"},children:(0,i.jsx)(j.Z,{active:"raw"===l,direction:"raw"===l?m:"asc",onClick:()=>I("raw"),children:"Prompt"})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(Z.Z,{title:"The date of the most recent eval for this prompt",children:(0,i.jsx)(j.Z,{active:"date"===l,direction:"date"===l?m:"asc",onClick:()=>I("date"),children:"Most recent eval"})})}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:(0,i.jsx)(j.Z,{active:"count"===l,direction:"count"===l?m:"asc",onClick:()=>I("count"),children:"# Evals"})})]})}),(0,i.jsx)(o.Z,{children:t.slice((C-1)*P,C*P).map((e,t)=>(0,i.jsxs)(x.Z,{hover:!0,children:[(0,i.jsx)(h.Z,{style:{width:"10%"},children:e.id.slice(0,6)}),(0,i.jsx)(h.Z,{style:{width:"60%",whiteSpace:"pre-wrap",cursor:"pointer"},onClick:()=>T(t),children:e.prompt.raw.length>500?e.prompt.raw.slice(0,500)+"...":e.prompt.raw}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:e.recentEvalDate?(0,i.jsx)(r(),{href:"/eval?file=".concat(e.recentEvalId),children:e.recentEvalDate}):"Unknown"}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:e.count})]},t))})]}),Math.ceil(t.length/P)>1&&(0,i.jsx)(d.Z,{count:Math.ceil(t.length/P),page:C,onChange:(e,t)=>E(t)}),t[k]&&(0,i.jsx)(y,{openDialog:S,handleClose:()=>{_(!1)},selectedPrompt:t[k]})]})}},279:function(e,t,n){"use strict";n.d(t,{CT:function(){return l},T8:function(){return s},eA:function(){return r}});var i=n(2601);let s=!i.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,l="http://localhost:15500",r=""}},function(e){e.O(0,[293,808,238,21,971,596,744],function(){return e(e.s=8050)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[413],{5363: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 ec}});var a=n(7437),r=n(2265),i=n(5551),l=n(8938),o=n(3226),s=n(6507),c=n(3457),d=n(9394),p=n(2834),u=n(6337),h=n(4173),x=n(1797),m=n(4740),j=n(4033),g=n(6882),f=n(1938),v=n(279),Z=()=>{let e=(0,j.useRouter)(),{env:t,description:n,providers:l,prompts:o,testCases:s}=(0,f.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/"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t,description:n,providers:l,prompts:o,tests:s})});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/").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)(g.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,f.o)(),[n,l]=(0,r.useState)(!1),[o,s]=(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:o.OPENAI_API_KEY,onChange:e=>s({...o,OPENAI_API_KEY:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI API host",fullWidth:!0,margin:"normal",value:o.OPENAI_API_HOST,onChange:e=>s({...o,OPENAI_API_HOST:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI organization",fullWidth:!0,margin:"normal",value:o.OPENAI_ORGANIZATION,onChange:e=>s({...o,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:o.AZURE_OPENAI_API_KEY,onChange:e=>s({...o,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:o.AWS_BEDROCK_REGION,onChange:e=>s({...o,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:o.ANTHROPIC_API_KEY,onChange:e=>s({...o,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:o.VERTEX_API_KEY,onChange:e=>s({...o,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:o.VERTEX_PROJECT_ID,onChange:e=>s({...o,VERTEX_PROJECT_ID:e.target.value})})}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex Region",fullWidth:!0,margin:"normal",value:o.VERTEX_REGION,onChange:e=>s({...o,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:o.REPLICATE_API_KEY,onChange:e=>s({...o,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(o),c()},color:"primary",variant:"contained",children:"Save"})]})]})]})},E=n(2653),I=n(3701),S=n(9279),P=n(666),T=n(5795),O=n(4147),w=n(8276),R=n(3391),N=n(6446),W=n(1280),z=n(9329),V=e=>{let{open:t,prompt:n,index:l,onAdd:o,onCancel:s}=e,[c,h]=r.useState(n),m=r.useRef(null);r.useEffect(()=>{h(n)},[n]);let j=e=>{o(c),h(""),e?s():m.current&&m.current.focus()};return(0,a.jsxs)(d.Z,{open:t,onClose:s,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:j.bind(null,!0),color:"primary",variant:"contained",disabled:!c.length,children:"Add"}),(0,a.jsx)(i.Z,{onClick:j.bind(null,!1),color:"primary",variant:"contained",disabled:!c.length,children:"Add Another"}),(0,a.jsx)(i.Z,{onClick:s,color:"secondary",children:"Cancel"})]})]})};n(2280);var F=()=>{let[e,t]=(0,r.useState)(!1),[n,l]=(0,r.useState)(null),{prompts:s,setPrompts:d}=(0,f.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=s[t];d([...s,n])},x=(e,t)=>{d(s.map((n,a)=>a===e?t:n))},m=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to remove this prompt?")&&d(s.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)(o.Z,{variant:"h5",children:"Prompts"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-prompt",children:(0,a.jsx)(w.Z,{title:"Upload prompt from file",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(W.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([...s,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)(T.Z,{children:(0,a.jsx)(I.Z,{children:(0,a.jsx)(S.Z,{children:0===s.length?(0,a.jsx)(O.Z,{children:(0,a.jsx)(P.Z,{colSpan:2,align:"center",children:"No prompts added yet."})}):s.map((e,t)=>(0,a.jsxs)(O.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>u(t),children:[(0,a.jsx)(P.Z,{children:(0,a.jsxs)(o.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)(P.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)(N.Z,{})})]})]},t))})})}),(0,a.jsx)(V,{open:e,prompt:null!==n?s[n]:"",index:null!==n?n:0,onAdd:e=>{null!==n?x(n,e):d([...s,e]),l(null)},onCancel:()=>{l(null),t(!1)}})]})},L=n(6988),K=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)(s.Z,{my:2,children:[(0,a.jsx)(o.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)(o.Z,{variant:"subtitle1",gutterBottom:!0,children:["Add variables to your prompt using the ","{{varname}}"," syntax."]})]})},B=n(8440);let Y=["equals","contains","icontains","contains-all","contains-any","starts-with","regex","is-json","contains-json","similar","llm-rubric","model-graded-closedqa","model-graded-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"];var J=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)(o.Z,{variant:"h6",children:"Asserts"}),(0,a.jsx)(s.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:Y,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)(N.Z,{})})]},n))})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>{let e=[...l,{type:"equals",value:""}];d(e),t(e)},children:"Add Assert"})]})},U=e=>{let{open:t,onAdd:n,varsList:l,initialValues:o,onCancel:c}=e,[h,m]=(0,r.useState)((null==o?void 0:o.description)||""),[j,g]=(0,r.useState)((null==o?void 0:o.vars)||{}),[f,v]=(0,r.useState)((null==o?void 0:o.assert)||[]),[Z,b]=(0,r.useState)(0);r.useEffect(()=>{o?(m(o.description||""),g(o.vars||{}),v(o.assert||[])):(m(""),g({}),v([]))},[o]);let y=e=>{n({description:h,vars:j,assert:f},e),e&&c(),m(""),g({}),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:o?"Edit Test Case":"Add Test Case"}),(0,a.jsx)(u.Z,{children:(0,a.jsxs)(s.Z,{children:[(0,a.jsx)(K,{onAdd:e=>g(e),varsList:l,initialValues:null==o?void 0:o.vars}),(0,a.jsx)(J,{onAdd:e=>v(e),initialValues:(null==o?void 0:o.assert)||[]},Z)]})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:y.bind(void 0,!0),color:"primary",variant:"contained",children:o?"Update Test Case":"Add Test Case"}),!o&&(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=e=>{let{varsList:t}=e,{testCases:n,setTestCases:l}=(0,f.o)(),[s,d]=r.useState(null),[p,u]=r.useState(!1),h=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to delete this test case?")&&l(n.filter((e,n)=>n!==t))},x=(e,t)=>{e.stopPropagation();let a=JSON.parse(JSON.stringify(n[t]));l([...n,a])};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(o.Z,{variant:"h5",children:"Test Cases"}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>u(!0),variant:"contained",children:"Add Test Case"})]}),(0,a.jsx)(T.Z,{children:(0,a.jsxs)(I.Z,{children:[(0,a.jsx)(L.Z,{children:(0,a.jsxs)(O.Z,{children:[(0,a.jsx)(P.Z,{children:"Description"}),(0,a.jsx)(P.Z,{children:"Assertions"}),(0,a.jsx)(P.Z,{children:"Variables"}),(0,a.jsx)(P.Z,{align:"right"})]})}),(0,a.jsx)(S.Z,{children:0===n.length?(0,a.jsx)(O.Z,{children:(0,a.jsx)(P.Z,{colSpan:4,align:"center",children:"No test cases added yet."})}):n.map((e,t)=>{var n;return(0,a.jsxs)(O.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>{d(t),u(!0)},children:[(0,a.jsx)(P.Z,{children:(0,a.jsx)(o.Z,{variant:"body2",children:e.description||"Test Case #".concat(t+1)})}),(0,a.jsxs)(P.Z,{children:[(null===(n=e.assert)||void 0===n?void 0:n.length)||0," assertions"]}),(0,a.jsx)(P.Z,{children:Object.entries(e.vars||{}).map(e=>{let[t,n]=e;return t+"="+n}).join(", ")}),(0,a.jsxs)(P.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>{d(t),u(!0)},size:"small",children:(0,a.jsx)(R.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(z.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(N.Z,{})})]})]},t)})})]})}),(0,a.jsx)(U,{open:p,onAdd:(e,t)=>{if(null===s)l([...n,e]);else{let t=n.map((t,n)=>n===s?e:t);l(t),d(null)}t&&u(!1)},varsList:t,initialValues:null!==s?n[s]:void 0,onCancel:()=>{d(null),u(!1)}})]})},q=n(7827),G=e=>{let{onChange:t,...n}=e,[i,l]=r.useState(""),[o,s]=r.useState(!1);return(0,a.jsx)(_.Z,{...n,error:o,helperText:o?"Invalid JSON":"",value:i,onChange:e=>{let n=e.target.value;try{let e=JSON.parse(n);l(n),s(!1),t&&t(e)}catch(e){l(n),s(!0)}}})},X=e=>{let{open:t,providerId:n,config:l,onClose:o,onSave:c}=e,[h,m]=r.useState(l);return r.useEffect(()=>{m(l)},[l]),(0,a.jsxs)(d.Z,{open:t,onClose:o,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)(s.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)(s.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:o,children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{c(h)},children:"Save"})]})]})};let H=[].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)),M={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),o=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)(s.Z,{mt:2,children:[(0,a.jsx)(B.Z,{multiple:!0,freeSolo:!0,options:H,value:t,groupBy:e=>(function(e){if(!e)return"Other";let t=e.split(":")[0];return M[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=o(e),i=c(e,n);return(0,r.createElement)(q.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)(X,{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)}}})]})},$=n(3425),ee=n.n($),et=n(4759);n(5341),n(7555);var en=n(8339),ea=n(9963),er=n(1396),ei=n.n(er);n(695);var el=()=>{let{env:e,setEnv:t,description:n,setDescription:l,providers:c,setProviders:d,prompts:p,setPrompts:u,testCases:h,setTestCases:x}=(0,f.o)(),[m,j]=r.useState(""),[g,v]=r.useState(!0);r.useEffect(()=>{j(en.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)(s.Z,{mt:4,children:[(0,a.jsx)(o.Z,{variant:"h5",gutterBottom:!0,children:"Configuration"}),(0,a.jsxs)(o.Z,{variant:"body1",gutterBottom:!0,children:["This is the YAML config that defines the evaluation and is processed by promptfoo. See"," ",(0,a.jsx)(ei(),{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:g?(0,a.jsx)(R.Z,{}):(0,a.jsx)(ea.Z,{}),onClick:()=>{if(!g)try{let e=en.default.load(m,{json:!0});Z(e)}catch(e){}v(!g)},children:g?"Edit YAML":"Save"}),(0,a.jsx)(ee(),{autoCapitalize:"off",value:m,onValueChange:e=>{g||j(e)},highlight:e=>(0,et.highlight)(e,et.languages.yaml),padding:10,style:{fontFamily:'"Fira code", "Fira Mono", monospace',fontSize:14},disabled:g,className:g?"":"glowing-border"})]})};n(284);var eo=n(2601);function es(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 ec=()=>{let[e,t]=(0,r.useState)(!1),{description:n,setDescription:j,providers:g,setProviders:v,prompts:b,setPrompts:y,testCases:C,setTestCases:_}=(0,f.o)();if((0,r.useEffect)(()=>{f.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)(o.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)(s.Z,{mt:4}),(0,a.jsx)(s.Z,{mt:2,children:(0,a.jsx)(m.SV,{FallbackComponent:es,onReset:()=>{v([])},children:(0,a.jsxs)(c.Z,{direction:"column",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(o.Z,{variant:"h5",children:"Providers"}),(0,a.jsx)(Q,{providers:g,onChange:v})]})})}),(0,a.jsx)(s.Z,{mt:4}),(0,a.jsx)(m.SV,{FallbackComponent:es,onReset:()=>{y([])},children:(0,a.jsx)(F,{})}),(0,a.jsx)(s.Z,{mt:6}),(0,a.jsx)(m.SV,{FallbackComponent:es,onReset:()=>{_([])},children:(0,a.jsx)(D,{varsList:k})}),(0,a.jsx)(el,{}),(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:()=>{j(""),v([]),y([]),_([]),t(!1)},autoFocus:!0,children:"Reset"})]})]})]})}},279:function(e,t,n){"use strict";n.d(t,{CT:function(){return i},T8:function(){return r},eA:function(){return l}});var a=n(2601);let r=!a.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,i="http://localhost:15500",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(){}},function(e){e.O(0,[293,808,548,238,975,320,339,919,753,971,596,744],function(){return e(e.s=5363)}),_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 ec}});var a=n(7437),r=n(2265),i=n(5551),l=n(8938),o=n(3226),s=n(6507),c=n(3457),d=n(9394),p=n(2834),u=n(6337),h=n(4173),x=n(1797),m=n(4740),j=n(4033),g=n(6882),f=n(1938),v=n(279),Z=()=>{let e=(0,j.useRouter)(),{env:t,description:n,providers:l,prompts:o,testCases:s}=(0,f.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/"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t,description:n,providers:l,prompts:o,tests:s})});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/").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)(g.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,f.o)(),[n,l]=(0,r.useState)(!1),[o,s]=(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:o.OPENAI_API_KEY,onChange:e=>s({...o,OPENAI_API_KEY:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI API host",fullWidth:!0,margin:"normal",value:o.OPENAI_API_HOST,onChange:e=>s({...o,OPENAI_API_HOST:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI organization",fullWidth:!0,margin:"normal",value:o.OPENAI_ORGANIZATION,onChange:e=>s({...o,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:o.AZURE_OPENAI_API_KEY,onChange:e=>s({...o,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:o.AWS_BEDROCK_REGION,onChange:e=>s({...o,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:o.ANTHROPIC_API_KEY,onChange:e=>s({...o,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:o.VERTEX_API_KEY,onChange:e=>s({...o,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:o.VERTEX_PROJECT_ID,onChange:e=>s({...o,VERTEX_PROJECT_ID:e.target.value})})}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex Region",fullWidth:!0,margin:"normal",value:o.VERTEX_REGION,onChange:e=>s({...o,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:o.REPLICATE_API_KEY,onChange:e=>s({...o,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(o),c()},color:"primary",variant:"contained",children:"Save"})]})]})]})},E=n(2653),I=n(3701),S=n(9279),P=n(666),T=n(5795),O=n(4147),w=n(8276),R=n(3391),N=n(6446),W=n(1280),z=n(9329),V=e=>{let{open:t,prompt:n,index:l,onAdd:o,onCancel:s}=e,[c,h]=r.useState(n),m=r.useRef(null);r.useEffect(()=>{h(n)},[n]);let j=e=>{o(c),h(""),e?s():m.current&&m.current.focus()};return(0,a.jsxs)(d.Z,{open:t,onClose:s,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:j.bind(null,!0),color:"primary",variant:"contained",disabled:!c.length,children:"Add"}),(0,a.jsx)(i.Z,{onClick:j.bind(null,!1),color:"primary",variant:"contained",disabled:!c.length,children:"Add Another"}),(0,a.jsx)(i.Z,{onClick:s,color:"secondary",children:"Cancel"})]})]})};n(2280);var F=()=>{let[e,t]=(0,r.useState)(!1),[n,l]=(0,r.useState)(null),{prompts:s,setPrompts:d}=(0,f.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=s[t];d([...s,n])},x=(e,t)=>{d(s.map((n,a)=>a===e?t:n))},m=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to remove this prompt?")&&d(s.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)(o.Z,{variant:"h5",children:"Prompts"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-prompt",children:(0,a.jsx)(w.Z,{title:"Upload prompt from file",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(W.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([...s,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)(T.Z,{children:(0,a.jsx)(I.Z,{children:(0,a.jsx)(S.Z,{children:0===s.length?(0,a.jsx)(O.Z,{children:(0,a.jsx)(P.Z,{colSpan:2,align:"center",children:"No prompts added yet."})}):s.map((e,t)=>(0,a.jsxs)(O.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>u(t),children:[(0,a.jsx)(P.Z,{children:(0,a.jsxs)(o.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)(P.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)(N.Z,{})})]})]},t))})})}),(0,a.jsx)(V,{open:e,prompt:null!==n?s[n]:"",index:null!==n?n:0,onAdd:e=>{null!==n?x(n,e):d([...s,e]),l(null)},onCancel:()=>{l(null),t(!1)}})]})},L=n(6988),K=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)(s.Z,{my:2,children:[(0,a.jsx)(o.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)(o.Z,{variant:"subtitle1",gutterBottom:!0,children:["Add variables to your prompt using the ","{{varname}}"," syntax."]})]})},B=n(8440);let Y=["equals","contains","icontains","contains-all","contains-any","starts-with","regex","is-json","contains-json","similar","llm-rubric","model-graded-closedqa","model-graded-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"];var J=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)(o.Z,{variant:"h6",children:"Asserts"}),(0,a.jsx)(s.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:Y,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)(N.Z,{})})]},n))})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>{let e=[...l,{type:"equals",value:""}];d(e),t(e)},children:"Add Assert"})]})},U=e=>{let{open:t,onAdd:n,varsList:l,initialValues:o,onCancel:c}=e,[h,m]=(0,r.useState)((null==o?void 0:o.description)||""),[j,g]=(0,r.useState)((null==o?void 0:o.vars)||{}),[f,v]=(0,r.useState)((null==o?void 0:o.assert)||[]),[Z,b]=(0,r.useState)(0);r.useEffect(()=>{o?(m(o.description||""),g(o.vars||{}),v(o.assert||[])):(m(""),g({}),v([]))},[o]);let y=e=>{n({description:h,vars:j,assert:f},e),e&&c(),m(""),g({}),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:o?"Edit Test Case":"Add Test Case"}),(0,a.jsx)(u.Z,{children:(0,a.jsxs)(s.Z,{children:[(0,a.jsx)(K,{onAdd:e=>g(e),varsList:l,initialValues:null==o?void 0:o.vars}),(0,a.jsx)(J,{onAdd:e=>v(e),initialValues:(null==o?void 0:o.assert)||[]},Z)]})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:y.bind(void 0,!0),color:"primary",variant:"contained",children:o?"Update Test Case":"Add Test Case"}),!o&&(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=e=>{let{varsList:t}=e,{testCases:n,setTestCases:l}=(0,f.o)(),[s,d]=r.useState(null),[p,u]=r.useState(!1),h=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to delete this test case?")&&l(n.filter((e,n)=>n!==t))},x=(e,t)=>{e.stopPropagation();let a=JSON.parse(JSON.stringify(n[t]));l([...n,a])};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(o.Z,{variant:"h5",children:"Test Cases"}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>u(!0),variant:"contained",children:"Add Test Case"})]}),(0,a.jsx)(T.Z,{children:(0,a.jsxs)(I.Z,{children:[(0,a.jsx)(L.Z,{children:(0,a.jsxs)(O.Z,{children:[(0,a.jsx)(P.Z,{children:"Description"}),(0,a.jsx)(P.Z,{children:"Assertions"}),(0,a.jsx)(P.Z,{children:"Variables"}),(0,a.jsx)(P.Z,{align:"right"})]})}),(0,a.jsx)(S.Z,{children:0===n.length?(0,a.jsx)(O.Z,{children:(0,a.jsx)(P.Z,{colSpan:4,align:"center",children:"No test cases added yet."})}):n.map((e,t)=>{var n;return(0,a.jsxs)(O.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>{d(t),u(!0)},children:[(0,a.jsx)(P.Z,{children:(0,a.jsx)(o.Z,{variant:"body2",children:e.description||"Test Case #".concat(t+1)})}),(0,a.jsxs)(P.Z,{children:[(null===(n=e.assert)||void 0===n?void 0:n.length)||0," assertions"]}),(0,a.jsx)(P.Z,{children:Object.entries(e.vars||{}).map(e=>{let[t,n]=e;return t+"="+n}).join(", ")}),(0,a.jsxs)(P.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>{d(t),u(!0)},size:"small",children:(0,a.jsx)(R.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(z.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(N.Z,{})})]})]},t)})})]})}),(0,a.jsx)(U,{open:p,onAdd:(e,t)=>{if(null===s)l([...n,e]);else{let t=n.map((t,n)=>n===s?e:t);l(t),d(null)}t&&u(!1)},varsList:t,initialValues:null!==s?n[s]:void 0,onCancel:()=>{d(null),u(!1)}})]})},q=n(7827),G=e=>{let{onChange:t,...n}=e,[i,l]=r.useState(""),[o,s]=r.useState(!1);return(0,a.jsx)(_.Z,{...n,error:o,helperText:o?"Invalid JSON":"",value:i,onChange:e=>{let n=e.target.value;try{let e=JSON.parse(n);l(n),s(!1),t&&t(e)}catch(e){l(n),s(!0)}}})},X=e=>{let{open:t,providerId:n,config:l,onClose:o,onSave:c}=e,[h,m]=r.useState(l);return r.useEffect(()=>{m(l)},[l]),(0,a.jsxs)(d.Z,{open:t,onClose:o,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)(s.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)(s.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:o,children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{c(h)},children:"Save"})]})]})};let H=[].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)),M={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),o=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)(s.Z,{mt:2,children:[(0,a.jsx)(B.Z,{multiple:!0,freeSolo:!0,options:H,value:t,groupBy:e=>(function(e){if(!e)return"Other";let t=e.split(":")[0];return M[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=o(e),i=c(e,n);return(0,r.createElement)(q.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)(X,{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)}}})]})},$=n(3425),ee=n.n($),et=n(4759);n(5341),n(7555);var en=n(8339),ea=n(9963),er=n(1396),ei=n.n(er);n(695);var el=()=>{let{env:e,setEnv:t,description:n,setDescription:l,providers:c,setProviders:d,prompts:p,setPrompts:u,testCases:h,setTestCases:x}=(0,f.o)(),[m,j]=r.useState(""),[g,v]=r.useState(!0);r.useEffect(()=>{j(en.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)(s.Z,{mt:4,children:[(0,a.jsx)(o.Z,{variant:"h5",gutterBottom:!0,children:"Configuration"}),(0,a.jsxs)(o.Z,{variant:"body1",gutterBottom:!0,children:["This is the YAML config that defines the evaluation and is processed by promptfoo. See"," ",(0,a.jsx)(ei(),{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:g?(0,a.jsx)(R.Z,{}):(0,a.jsx)(ea.Z,{}),onClick:()=>{if(!g)try{let e=en.default.load(m,{json:!0});Z(e)}catch(e){}v(!g)},children:g?"Edit YAML":"Save"}),(0,a.jsx)(ee(),{autoCapitalize:"off",value:m,onValueChange:e=>{g||j(e)},highlight:e=>(0,et.highlight)(e,et.languages.yaml),padding:10,style:{fontFamily:'"Fira code", "Fira Mono", monospace',fontSize:14},disabled:g,className:g?"":"glowing-border"})]})};n(284);var eo=n(2601);function es(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 ec=()=>{let[e,t]=(0,r.useState)(!1),{description:n,setDescription:j,providers:g,setProviders:v,prompts:b,setPrompts:y,testCases:C,setTestCases:_}=(0,f.o)();if((0,r.useEffect)(()=>{f.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)(o.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)(s.Z,{mt:4}),(0,a.jsx)(s.Z,{mt:2,children:(0,a.jsx)(m.SV,{FallbackComponent:es,onReset:()=>{v([])},children:(0,a.jsxs)(c.Z,{direction:"column",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(o.Z,{variant:"h5",children:"Providers"}),(0,a.jsx)(Q,{providers:g,onChange:v})]})})}),(0,a.jsx)(s.Z,{mt:4}),(0,a.jsx)(m.SV,{FallbackComponent:es,onReset:()=>{y([])},children:(0,a.jsx)(F,{})}),(0,a.jsx)(s.Z,{mt:6}),(0,a.jsx)(m.SV,{FallbackComponent:es,onReset:()=>{_([])},children:(0,a.jsx)(D,{varsList:k})}),(0,a.jsx)(el,{}),(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:()=>{j(""),v([]),y([]),_([]),t(!1)},autoFocus:!0,children:"Reset"})]})]})]})}},279:function(e,t,n){"use strict";n.d(t,{CT:function(){return i},T8:function(){return r},eA:function(){return l}});var a=n(2601);let r=!a.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,i="http://localhost:15500",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(){}},function(e){e.O(0,[293,808,548,238,975,320,339,919,753,971,596,744],function(){return e(e.s=3515)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{9742:function(e,n,t){Promise.resolve().then(t.t.bind(t,6628,23)),Promise.resolve().then(t.t.bind(t,7948,23)),Promise.resolve().then(t.t.bind(t,7767,23)),Promise.resolve().then(t.t.bind(t,7920,23)),Promise.resolve().then(t.t.bind(t,4839,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,596],function(){return n(2916),n(9742)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{4487:function(e,n,t){Promise.resolve().then(t.t.bind(t,6628,23)),Promise.resolve().then(t.t.bind(t,7948,23)),Promise.resolve().then(t.t.bind(t,7767,23)),Promise.resolve().then(t.t.bind(t,7920,23)),Promise.resolve().then(t.t.bind(t,4839,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,596],function(){return n(2916),n(4487)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><link rel="preload" as="font" href="/_next/static/media/0e4fe491bf84089c-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/627622453ef56b0d-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/934c4b7cb736f2a3-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/09cb35b4c681097c.css" data-precedence="next"/><link rel="preload" href="/_next/static/chunks/webpack-cb9069cc30d68b35.js" as="script"/><link rel="preload" href="/_next/static/chunks/fd9d1056-fba4b53a2f01213b.js" as="script"/><link rel="preload" href="/_next/static/chunks/596-297f7ff4a0436e87.js" as="script"/><link rel="preload" href="/_next/static/chunks/main-app-635e57f728b91b66.js" as="script"/><title>promptfoo</title><meta name="description" content="LLM testing and evaluation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta property="og:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body class="__className_979022"><div><style data-emotion="css jj2ztu">.css-jj2ztu{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}.css-jj2ztu>:not(style):not(style){margin:0;}.css-jj2ztu>:not(style)~:not(style){margin-left:16px;}</style><div class="MuiStack-root nav css-jj2ztu"><div class="logo MuiBox-root css-0"><img alt="Promptfoo logo" loading="lazy" width="25" height="25" decoding="async" data-nimg="1" style="color:transparent" src="/logo.svg"/> <span>promptfoo</span></div><a class="" href="/setup/">New Eval</a><a class="" href="/eval/">Evals</a><a class="" href="/prompts/">Prompts</a><a class="" href="/datasets/">Datasets</a><div class="right-aligned"><div class="dark-mode-toggle"><style data-emotion="css vubbuv">.css-vubbuv{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:1em;height:1em;display:inline-block;fill:currentColor;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-transition:fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;font-size:1.5rem;}</style><svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="LightModeIcon"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z"></path></svg></div></div></div><div><style data-emotion="css hltdia">.css-hltdia{width:100%;margin-left:auto;box-sizing:border-box;margin-right:auto;display:block;padding-left:16px;padding-right:16px;}@media (min-width:600px){.css-hltdia{padding-left:24px;padding-right:24px;}}@media (min-width:0px){.css-hltdia{max-width:444px;}}</style><main class="MuiContainer-root MuiContainer-maxWidthXs css-hltdia"><style data-emotion="css 1d79rw6">.css-1d79rw6{margin:0;font-family:inherit;font-weight:400;font-size:1.5rem;line-height:1.334;}</style><h1 class="MuiTypography-root MuiTypography-h5 css-1d79rw6">Sign in</h1><form><style data-emotion="css 1u0h3mu">.css-1u0h3mu{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;position:relative;min-width:0;padding:0;margin:0;border:0;vertical-align:top;margin-top:16px;margin-bottom:8px;width:100%;}</style><div class="MuiFormControl-root MuiFormControl-marginNormal MuiFormControl-fullWidth MuiTextField-root css-1u0h3mu"><style data-emotion="css nd1nwr">.css-nd1nwr{display:block;transform-origin:top left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);position:absolute;left:0;top:0;-webkit-transform:translate(14px, 16px) scale(1);-moz-transform:translate(14px, 16px) scale(1);-ms-transform:translate(14px, 16px) scale(1);transform:translate(14px, 16px) scale(1);-webkit-transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,-webkit-transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;z-index:1;pointer-events:none;}</style><style data-emotion="css jzaigm">.css-jzaigm{color:rgba(0, 0, 0, 0.6);font-family:inherit;font-weight:400;font-size:1rem;line-height:1.4375em;padding:0;position:relative;display:block;transform-origin:top left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);position:absolute;left:0;top:0;-webkit-transform:translate(14px, 16px) scale(1);-moz-transform:translate(14px, 16px) scale(1);-ms-transform:translate(14px, 16px) scale(1);transform:translate(14px, 16px) scale(1);-webkit-transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,-webkit-transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;z-index:1;pointer-events:none;}.css-jzaigm.Mui-focused{color:#1976d2;}.css-jzaigm.Mui-disabled{color:rgba(0, 0, 0, 0.38);}.css-jzaigm.Mui-error{color:#d32f2f;}</style><label class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-outlined css-jzaigm" data-shrink="false" for="email" id="email-label">Email Address<style data-emotion="css sp68t1">.css-sp68t1.Mui-error{color:#d32f2f;}</style><span aria-hidden="true" class="MuiFormLabel-asterisk MuiInputLabel-asterisk css-sp68t1"> <!-- -->*</span></label><style data-emotion="css-global 1prfaxn">@-webkit-keyframes mui-auto-fill{from{display:block;}}@keyframes mui-auto-fill{from{display:block;}}@-webkit-keyframes mui-auto-fill-cancel{from{display:block;}}@keyframes mui-auto-fill-cancel{from{display:block;}}</style><style data-emotion="css 18bxsfn">.css-18bxsfn{font-family:inherit;font-weight:400;font-size:1rem;line-height:1.4375em;color:rgba(0, 0, 0, 0.87);box-sizing:border-box;position:relative;cursor:text;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;position:relative;border-radius:4px;}.css-18bxsfn.Mui-disabled{color:rgba(0, 0, 0, 0.38);cursor:default;}.css-18bxsfn:hover .MuiOutlinedInput-notchedOutline{border-color:rgba(0, 0, 0, 0.87);}@media (hover: none){.css-18bxsfn:hover .MuiOutlinedInput-notchedOutline{border-color:rgba(0, 0, 0, 0.23);}}.css-18bxsfn.Mui-focused .MuiOutlinedInput-notchedOutline{border-color:#1976d2;border-width:2px;}.css-18bxsfn.Mui-error .MuiOutlinedInput-notchedOutline{border-color:#d32f2f;}.css-18bxsfn.Mui-disabled .MuiOutlinedInput-notchedOutline{border-color:rgba(0, 0, 0, 0.26);}</style><div class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-18bxsfn"><style data-emotion="css 1x5jdmq">.css-1x5jdmq{font:inherit;letter-spacing:inherit;color:currentColor;padding:4px 0 5px;border:0;box-sizing:content-box;background:none;height:1.4375em;margin:0;-webkit-tap-highlight-color:transparent;display:block;min-width:0;width:100%;-webkit-animation-name:mui-auto-fill-cancel;animation-name:mui-auto-fill-cancel;-webkit-animation-duration:10ms;animation-duration:10ms;padding:16.5px 14px;}.css-1x5jdmq::-webkit-input-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq::-moz-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq:-ms-input-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq::-ms-input-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq:focus{outline:0;}.css-1x5jdmq:invalid{box-shadow:none;}.css-1x5jdmq::-webkit-search-decoration{-webkit-appearance:none;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq::-webkit-input-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq::-moz-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:-ms-input-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq::-ms-input-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus::-webkit-input-placeholder{opacity:0.42;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus::-moz-placeholder{opacity:0.42;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus:-ms-input-placeholder{opacity:0.42;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus::-ms-input-placeholder{opacity:0.42;}.css-1x5jdmq.Mui-disabled{opacity:1;-webkit-text-fill-color:rgba(0, 0, 0, 0.38);}.css-1x5jdmq:-webkit-autofill{-webkit-animation-duration:5000s;animation-duration:5000s;-webkit-animation-name:mui-auto-fill;animation-name:mui-auto-fill;}.css-1x5jdmq:-webkit-autofill{border-radius:inherit;}</style><input aria-invalid="false" autoComplete="email" autofocus="" id="email" required="" type="text" class="MuiInputBase-input MuiOutlinedInput-input css-1x5jdmq" name="email" value=""/><style data-emotion="css 19w1uun">.css-19w1uun{border-color:rgba(0, 0, 0, 0.23);}</style><style data-emotion="css igs3ac">.css-igs3ac{text-align:left;position:absolute;bottom:0;right:0;top:-5px;left:0;margin:0;padding:0 8px;pointer-events:none;border-radius:inherit;border-style:solid;border-width:1px;overflow:hidden;min-width:0%;border-color:rgba(0, 0, 0, 0.23);}</style><fieldset aria-hidden="true" class="MuiOutlinedInput-notchedOutline css-igs3ac"><style data-emotion="css yjsfm1">.css-yjsfm1{float:unset;width:auto;overflow:hidden;display:block;padding:0;height:11px;font-size:0.75em;visibility:hidden;max-width:0.01px;-webkit-transition:max-width 50ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;transition:max-width 50ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;white-space:nowrap;}.css-yjsfm1>span{padding-left:5px;padding-right:5px;display:inline-block;opacity:0;visibility:visible;}</style><legend class="css-yjsfm1"><span>Email Address<!-- --> <!-- -->*</span></legend></fieldset></div></div><div class="MuiFormControl-root MuiFormControl-marginNormal MuiFormControl-fullWidth MuiTextField-root css-1u0h3mu"><label class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-outlined css-jzaigm" data-shrink="false" for="password" id="password-label">Password<span aria-hidden="true" class="MuiFormLabel-asterisk MuiInputLabel-asterisk css-sp68t1"> <!-- -->*</span></label><style data-emotion="css-global 1prfaxn">@-webkit-keyframes mui-auto-fill{from{display:block;}}@keyframes mui-auto-fill{from{display:block;}}@-webkit-keyframes mui-auto-fill-cancel{from{display:block;}}@keyframes mui-auto-fill-cancel{from{display:block;}}</style><div class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-18bxsfn"><input aria-invalid="false" autoComplete="current-password" id="password" required="" type="password" class="MuiInputBase-input MuiOutlinedInput-input css-1x5jdmq" name="password" value=""/><fieldset aria-hidden="true" class="MuiOutlinedInput-notchedOutline css-igs3ac"><legend class="css-yjsfm1"><span>Password<!-- --> <!-- -->*</span></legend></fieldset></div></div><style data-emotion="css 1pz372j">.css-1pz372j{font-family:inherit;font-weight:500;font-size:0.875rem;line-height:1.75;text-transform:uppercase;min-width:64px;padding:6px 16px;border-radius:4px;-webkit-transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;color:#fff;background-color:#1976d2;box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12);width:100%;margin-top:1em;}.css-1pz372j:hover{-webkit-text-decoration:none;text-decoration:none;background-color:#1565c0;box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);}@media (hover: none){.css-1pz372j:hover{background-color:#1976d2;}}.css-1pz372j:active{box-shadow:0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12);}.css-1pz372j.Mui-focusVisible{box-shadow:0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12);}.css-1pz372j.Mui-disabled{color:rgba(0, 0, 0, 0.26);box-shadow:none;background-color:rgba(0, 0, 0, 0.12);}</style><style data-emotion="css 1j0w7x1">.css-1j0w7x1{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;background-color:transparent;outline:0;border:0;margin:0;border-radius:0;padding:0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-moz-appearance:none;-webkit-appearance:none;-webkit-text-decoration:none;text-decoration:none;color:inherit;font-family:inherit;font-weight:500;font-size:0.875rem;line-height:1.75;text-transform:uppercase;min-width:64px;padding:6px 16px;border-radius:4px;-webkit-transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;color:#fff;background-color:#1976d2;box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12);width:100%;margin-top:1em;}.css-1j0w7x1::-moz-focus-inner{border-style:none;}.css-1j0w7x1.Mui-disabled{pointer-events:none;cursor:default;}@media print{.css-1j0w7x1{-webkit-print-color-adjust:exact;color-adjust:exact;}}.css-1j0w7x1:hover{-webkit-text-decoration:none;text-decoration:none;background-color:#1565c0;box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);}@media (hover: none){.css-1j0w7x1:hover{background-color:#1976d2;}}.css-1j0w7x1:active{box-shadow:0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12);}.css-1j0w7x1.Mui-focusVisible{box-shadow:0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12);}.css-1j0w7x1.Mui-disabled{color:rgba(0, 0, 0, 0.26);box-shadow:none;background-color:rgba(0, 0, 0, 0.12);}</style><button class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-fullWidth MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-fullWidth css-1j0w7x1" tabindex="0" type="submit">Sign In</button><p>Don&#x27;t have an account yet? <a href="/auth/signup/">Sign up</a></p></form></main></div></div><script src="/_next/static/chunks/webpack-cb9069cc30d68b35.js" async=""></script><script src="/_next/static/chunks/fd9d1056-fba4b53a2f01213b.js" async=""></script><script src="/_next/static/chunks/596-297f7ff4a0436e87.js" async=""></script><script src="/_next/static/chunks/main-app-635e57f728b91b66.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/0e4fe491bf84089c-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/627622453ef56b0d-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/934c4b7cb736f2a3-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/css/09cb35b4c681097c.css\",{\"as\":\"style\"}]\n0:\"$L5\"\n"])</script><script>self.__next_f.push([1,"6:I{\"id\":7948,\"chunks\":[\"272:static/chunks/webpack-cb9069cc30d68b35.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\n8:I{\"id\":6628,\"chunks\":[\"272:static/chunks/webpack-cb9069cc30d68b35.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"\",\"async\":false}\n9:I{\"id\":2112,\"chunks\":[\"293:static/chunks/293-f7537306415679fd.js\",\"548:static/chunks/548-46c7c1d35ca1bc02.js\",\"82:static/"])</script><script>self.__next_f.push([1,"chunks/82-74626c128eefc7a5.js\",\"320:static/chunks/320-d41e321556b1b694.js\",\"563:static/chunks/563-a961efef5193d79c.js\",\"185:static/chunks/app/layout-7031bb251bd9af74.js\"],\"name\":\"PageShell\",\"async\":false}\na:I{\"id\":7767,\"chunks\":[\"272:static/chunks/webpack-cb9069cc30d68b35.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\nb:I{\"id\":7920,\"chunks\":[\"272:static/chunks/webpack-cb9069cc30d68b35.js\",\"971:static/chunks/fd9d1056-fba4b53a2"])</script><script>self.__next_f.push([1,"f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\nd:I{\"id\":6722,\"chunks\":[\"293:static/chunks/293-f7537306415679fd.js\",\"808:static/chunks/808-90426be34a5d9784.js\",\"548:static/chunks/548-46c7c1d35ca1bc02.js\",\"82:static/chunks/82-74626c128eefc7a5.js\",\"975:static/chunks/975-380318b3b26ba688.js\",\"716:static/chunks/app/auth/login/page-74ee07fe19cc0bbe.js\"],\"name\":\"\",\"async\":false}\n"])</script><script>self.__next_f.push([1,"5:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/09cb35b4c681097c.css\",\"precedence\":\"next\"}]],[\"$\",\"$L6\",null,{\"buildId\":\"MS3xD55A3ePhB1ApOpEoS\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/auth/login/\",\"initialTree\":[\"\",{\"children\":[\"auth\",{\"children\":[\"login\",{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],\"initialHead\":\"$L7\",\"globalErrorComponent\":\"$8\",\"children\":[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_979022\",\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"auth\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"auth\",\"children\",\"login\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$Lc\",[\"$\",\"$Ld\",null,{}],null],\"segment\":\"__PAGE__\"},\"styles\":[]}],\"segment\":\"login\"},\"styles\":[]}],\"segment\":\"auth\"},\"styles\":[]}]}]}]}],null]}]]\n"])</script><script>self.__next_f.push([1,"7:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"1\",{\"children\":\"promptfoo\"}],[\"$\",\"meta\",\"2\",{\"name\":\"description\",\"content\":\"LLM testing and evaluation\"}],[\"$\",\"meta\",\"3\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"4\",{\"property\":\"og:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"5\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"6\",{\"name\":\"twitter:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"7\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"c:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><link rel="preload" as="font" href="/_next/static/media/0e4fe491bf84089c-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/627622453ef56b0d-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/934c4b7cb736f2a3-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/09cb35b4c681097c.css" data-precedence="next"/><link rel="preload" href="/_next/static/chunks/webpack-cb9069cc30d68b35.js" as="script"/><link rel="preload" href="/_next/static/chunks/fd9d1056-fba4b53a2f01213b.js" as="script"/><link rel="preload" href="/_next/static/chunks/596-297f7ff4a0436e87.js" as="script"/><link rel="preload" href="/_next/static/chunks/main-app-581ccf0003955b21.js" as="script"/><title>promptfoo</title><meta name="description" content="LLM testing and evaluation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta property="og:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body class="__className_979022"><div><style data-emotion="css jj2ztu">.css-jj2ztu{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}.css-jj2ztu>:not(style):not(style){margin:0;}.css-jj2ztu>:not(style)~:not(style){margin-left:16px;}</style><div class="MuiStack-root nav css-jj2ztu"><div class="logo MuiBox-root css-0"><img alt="Promptfoo logo" loading="lazy" width="25" height="25" decoding="async" data-nimg="1" style="color:transparent" src="/logo.svg"/> <span>promptfoo</span></div><a class="" href="/setup/">New Eval</a><a class="" href="/eval/">Evals</a><a class="" href="/prompts/">Prompts</a><a class="" href="/datasets/">Datasets</a><div class="right-aligned"><div class="dark-mode-toggle"><style data-emotion="css vubbuv">.css-vubbuv{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:1em;height:1em;display:inline-block;fill:currentColor;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-transition:fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;font-size:1.5rem;}</style><svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="LightModeIcon"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z"></path></svg></div></div></div><div><style data-emotion="css hltdia">.css-hltdia{width:100%;margin-left:auto;box-sizing:border-box;margin-right:auto;display:block;padding-left:16px;padding-right:16px;}@media (min-width:600px){.css-hltdia{padding-left:24px;padding-right:24px;}}@media (min-width:0px){.css-hltdia{max-width:444px;}}</style><main class="MuiContainer-root MuiContainer-maxWidthXs css-hltdia"><style data-emotion="css 1d79rw6">.css-1d79rw6{margin:0;font-family:inherit;font-weight:400;font-size:1.5rem;line-height:1.334;}</style><h1 class="MuiTypography-root MuiTypography-h5 css-1d79rw6">Sign in</h1><form><style data-emotion="css 1u0h3mu">.css-1u0h3mu{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;position:relative;min-width:0;padding:0;margin:0;border:0;vertical-align:top;margin-top:16px;margin-bottom:8px;width:100%;}</style><div class="MuiFormControl-root MuiFormControl-marginNormal MuiFormControl-fullWidth MuiTextField-root css-1u0h3mu"><style data-emotion="css nd1nwr">.css-nd1nwr{display:block;transform-origin:top left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);position:absolute;left:0;top:0;-webkit-transform:translate(14px, 16px) scale(1);-moz-transform:translate(14px, 16px) scale(1);-ms-transform:translate(14px, 16px) scale(1);transform:translate(14px, 16px) scale(1);-webkit-transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,-webkit-transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;z-index:1;pointer-events:none;}</style><style data-emotion="css jzaigm">.css-jzaigm{color:rgba(0, 0, 0, 0.6);font-family:inherit;font-weight:400;font-size:1rem;line-height:1.4375em;padding:0;position:relative;display:block;transform-origin:top left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);position:absolute;left:0;top:0;-webkit-transform:translate(14px, 16px) scale(1);-moz-transform:translate(14px, 16px) scale(1);-ms-transform:translate(14px, 16px) scale(1);transform:translate(14px, 16px) scale(1);-webkit-transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,-webkit-transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;z-index:1;pointer-events:none;}.css-jzaigm.Mui-focused{color:#1976d2;}.css-jzaigm.Mui-disabled{color:rgba(0, 0, 0, 0.38);}.css-jzaigm.Mui-error{color:#d32f2f;}</style><label class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-outlined css-jzaigm" data-shrink="false" for="email" id="email-label">Email Address<style data-emotion="css sp68t1">.css-sp68t1.Mui-error{color:#d32f2f;}</style><span aria-hidden="true" class="MuiFormLabel-asterisk MuiInputLabel-asterisk css-sp68t1"> <!-- -->*</span></label><style data-emotion="css-global 1prfaxn">@-webkit-keyframes mui-auto-fill{from{display:block;}}@keyframes mui-auto-fill{from{display:block;}}@-webkit-keyframes mui-auto-fill-cancel{from{display:block;}}@keyframes mui-auto-fill-cancel{from{display:block;}}</style><style data-emotion="css 18bxsfn">.css-18bxsfn{font-family:inherit;font-weight:400;font-size:1rem;line-height:1.4375em;color:rgba(0, 0, 0, 0.87);box-sizing:border-box;position:relative;cursor:text;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;position:relative;border-radius:4px;}.css-18bxsfn.Mui-disabled{color:rgba(0, 0, 0, 0.38);cursor:default;}.css-18bxsfn:hover .MuiOutlinedInput-notchedOutline{border-color:rgba(0, 0, 0, 0.87);}@media (hover: none){.css-18bxsfn:hover .MuiOutlinedInput-notchedOutline{border-color:rgba(0, 0, 0, 0.23);}}.css-18bxsfn.Mui-focused .MuiOutlinedInput-notchedOutline{border-color:#1976d2;border-width:2px;}.css-18bxsfn.Mui-error .MuiOutlinedInput-notchedOutline{border-color:#d32f2f;}.css-18bxsfn.Mui-disabled .MuiOutlinedInput-notchedOutline{border-color:rgba(0, 0, 0, 0.26);}</style><div class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-18bxsfn"><style data-emotion="css 1x5jdmq">.css-1x5jdmq{font:inherit;letter-spacing:inherit;color:currentColor;padding:4px 0 5px;border:0;box-sizing:content-box;background:none;height:1.4375em;margin:0;-webkit-tap-highlight-color:transparent;display:block;min-width:0;width:100%;-webkit-animation-name:mui-auto-fill-cancel;animation-name:mui-auto-fill-cancel;-webkit-animation-duration:10ms;animation-duration:10ms;padding:16.5px 14px;}.css-1x5jdmq::-webkit-input-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq::-moz-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq:-ms-input-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq::-ms-input-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq:focus{outline:0;}.css-1x5jdmq:invalid{box-shadow:none;}.css-1x5jdmq::-webkit-search-decoration{-webkit-appearance:none;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq::-webkit-input-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq::-moz-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:-ms-input-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq::-ms-input-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus::-webkit-input-placeholder{opacity:0.42;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus::-moz-placeholder{opacity:0.42;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus:-ms-input-placeholder{opacity:0.42;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus::-ms-input-placeholder{opacity:0.42;}.css-1x5jdmq.Mui-disabled{opacity:1;-webkit-text-fill-color:rgba(0, 0, 0, 0.38);}.css-1x5jdmq:-webkit-autofill{-webkit-animation-duration:5000s;animation-duration:5000s;-webkit-animation-name:mui-auto-fill;animation-name:mui-auto-fill;}.css-1x5jdmq:-webkit-autofill{border-radius:inherit;}</style><input aria-invalid="false" autoComplete="email" autofocus="" id="email" required="" type="text" class="MuiInputBase-input MuiOutlinedInput-input css-1x5jdmq" name="email" value=""/><style data-emotion="css 19w1uun">.css-19w1uun{border-color:rgba(0, 0, 0, 0.23);}</style><style data-emotion="css igs3ac">.css-igs3ac{text-align:left;position:absolute;bottom:0;right:0;top:-5px;left:0;margin:0;padding:0 8px;pointer-events:none;border-radius:inherit;border-style:solid;border-width:1px;overflow:hidden;min-width:0%;border-color:rgba(0, 0, 0, 0.23);}</style><fieldset aria-hidden="true" class="MuiOutlinedInput-notchedOutline css-igs3ac"><style data-emotion="css yjsfm1">.css-yjsfm1{float:unset;width:auto;overflow:hidden;display:block;padding:0;height:11px;font-size:0.75em;visibility:hidden;max-width:0.01px;-webkit-transition:max-width 50ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;transition:max-width 50ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;white-space:nowrap;}.css-yjsfm1>span{padding-left:5px;padding-right:5px;display:inline-block;opacity:0;visibility:visible;}</style><legend class="css-yjsfm1"><span>Email Address<!-- --> <!-- -->*</span></legend></fieldset></div></div><div class="MuiFormControl-root MuiFormControl-marginNormal MuiFormControl-fullWidth MuiTextField-root css-1u0h3mu"><label class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-outlined css-jzaigm" data-shrink="false" for="password" id="password-label">Password<span aria-hidden="true" class="MuiFormLabel-asterisk MuiInputLabel-asterisk css-sp68t1"> <!-- -->*</span></label><style data-emotion="css-global 1prfaxn">@-webkit-keyframes mui-auto-fill{from{display:block;}}@keyframes mui-auto-fill{from{display:block;}}@-webkit-keyframes mui-auto-fill-cancel{from{display:block;}}@keyframes mui-auto-fill-cancel{from{display:block;}}</style><div class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-18bxsfn"><input aria-invalid="false" autoComplete="current-password" id="password" required="" type="password" class="MuiInputBase-input MuiOutlinedInput-input css-1x5jdmq" name="password" value=""/><fieldset aria-hidden="true" class="MuiOutlinedInput-notchedOutline css-igs3ac"><legend class="css-yjsfm1"><span>Password<!-- --> <!-- -->*</span></legend></fieldset></div></div><style data-emotion="css 1pz372j">.css-1pz372j{font-family:inherit;font-weight:500;font-size:0.875rem;line-height:1.75;text-transform:uppercase;min-width:64px;padding:6px 16px;border-radius:4px;-webkit-transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;color:#fff;background-color:#1976d2;box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12);width:100%;margin-top:1em;}.css-1pz372j:hover{-webkit-text-decoration:none;text-decoration:none;background-color:#1565c0;box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);}@media (hover: none){.css-1pz372j:hover{background-color:#1976d2;}}.css-1pz372j:active{box-shadow:0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12);}.css-1pz372j.Mui-focusVisible{box-shadow:0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12);}.css-1pz372j.Mui-disabled{color:rgba(0, 0, 0, 0.26);box-shadow:none;background-color:rgba(0, 0, 0, 0.12);}</style><style data-emotion="css 1j0w7x1">.css-1j0w7x1{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;background-color:transparent;outline:0;border:0;margin:0;border-radius:0;padding:0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-moz-appearance:none;-webkit-appearance:none;-webkit-text-decoration:none;text-decoration:none;color:inherit;font-family:inherit;font-weight:500;font-size:0.875rem;line-height:1.75;text-transform:uppercase;min-width:64px;padding:6px 16px;border-radius:4px;-webkit-transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;color:#fff;background-color:#1976d2;box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12);width:100%;margin-top:1em;}.css-1j0w7x1::-moz-focus-inner{border-style:none;}.css-1j0w7x1.Mui-disabled{pointer-events:none;cursor:default;}@media print{.css-1j0w7x1{-webkit-print-color-adjust:exact;color-adjust:exact;}}.css-1j0w7x1:hover{-webkit-text-decoration:none;text-decoration:none;background-color:#1565c0;box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);}@media (hover: none){.css-1j0w7x1:hover{background-color:#1976d2;}}.css-1j0w7x1:active{box-shadow:0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12);}.css-1j0w7x1.Mui-focusVisible{box-shadow:0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12);}.css-1j0w7x1.Mui-disabled{color:rgba(0, 0, 0, 0.26);box-shadow:none;background-color:rgba(0, 0, 0, 0.12);}</style><button class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-fullWidth MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-fullWidth css-1j0w7x1" tabindex="0" type="submit">Sign In</button><p>Don&#x27;t have an account yet? <a href="/auth/signup/">Sign up</a></p></form></main></div></div><script src="/_next/static/chunks/webpack-cb9069cc30d68b35.js" async=""></script><script src="/_next/static/chunks/fd9d1056-fba4b53a2f01213b.js" async=""></script><script src="/_next/static/chunks/596-297f7ff4a0436e87.js" async=""></script><script src="/_next/static/chunks/main-app-581ccf0003955b21.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/0e4fe491bf84089c-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/627622453ef56b0d-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/934c4b7cb736f2a3-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/css/09cb35b4c681097c.css\",{\"as\":\"style\"}]\n0:\"$L5\"\n"])</script><script>self.__next_f.push([1,"6:I{\"id\":7948,\"chunks\":[\"272:static/chunks/webpack-cb9069cc30d68b35.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\n8:I{\"id\":6628,\"chunks\":[\"272:static/chunks/webpack-cb9069cc30d68b35.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"\",\"async\":false}\n9:I{\"id\":2112,\"chunks\":[\"293:static/chunks/293-f7537306415679fd.js\",\"548:static/chunks/548-46c7c1d35ca1bc02.js\",\"82:static/"])</script><script>self.__next_f.push([1,"chunks/82-ca0360e473d81167.js\",\"320:static/chunks/320-d41e321556b1b694.js\",\"563:static/chunks/563-a961efef5193d79c.js\",\"185:static/chunks/app/layout-2d69329b7d9c264a.js\"],\"name\":\"PageShell\",\"async\":false}\na:I{\"id\":7767,\"chunks\":[\"272:static/chunks/webpack-cb9069cc30d68b35.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\nb:I{\"id\":7920,\"chunks\":[\"272:static/chunks/webpack-cb9069cc30d68b35.js\",\"971:static/chunks/fd9d1056-fba4b53a2"])</script><script>self.__next_f.push([1,"f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\nd:I{\"id\":6722,\"chunks\":[\"293:static/chunks/293-f7537306415679fd.js\",\"808:static/chunks/808-90426be34a5d9784.js\",\"548:static/chunks/548-46c7c1d35ca1bc02.js\",\"82:static/chunks/82-ca0360e473d81167.js\",\"975:static/chunks/975-380318b3b26ba688.js\",\"716:static/chunks/app/auth/login/page-0c87ef00a5707e79.js\"],\"name\":\"\",\"async\":false}\n"])</script><script>self.__next_f.push([1,"5:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/09cb35b4c681097c.css\",\"precedence\":\"next\"}]],[\"$\",\"$L6\",null,{\"buildId\":\"yobwYIjSlgTiHVK9Eo5hK\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/auth/login/\",\"initialTree\":[\"\",{\"children\":[\"auth\",{\"children\":[\"login\",{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],\"initialHead\":\"$L7\",\"globalErrorComponent\":\"$8\",\"children\":[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_979022\",\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"auth\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"auth\",\"children\",\"login\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$Lc\",[\"$\",\"$Ld\",null,{}],null],\"segment\":\"__PAGE__\"},\"styles\":[]}],\"segment\":\"login\"},\"styles\":[]}],\"segment\":\"auth\"},\"styles\":[]}]}]}]}],null]}]]\n"])</script><script>self.__next_f.push([1,"7:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"1\",{\"children\":\"promptfoo\"}],[\"$\",\"meta\",\"2\",{\"name\":\"description\",\"content\":\"LLM testing and evaluation\"}],[\"$\",\"meta\",\"3\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"4\",{\"property\":\"og:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"5\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"6\",{\"name\":\"twitter:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"7\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"c:null\n"])</script></body></html>
@@ -2,11 +2,11 @@
2
2
  2:HL["/_next/static/media/627622453ef56b0d-s.p.woff2",{"as":"font","type":"font/woff2"}]
3
3
  3:HL["/_next/static/media/934c4b7cb736f2a3-s.p.woff2",{"as":"font","type":"font/woff2"}]
4
4
  4:HL["/_next/static/css/09cb35b4c681097c.css",{"as":"style"}]
5
- 0:["MS3xD55A3ePhB1ApOpEoS",[[["",{"children":["auth",{"children":["login",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],"$L5",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/09cb35b4c681097c.css","precedence":"next"}]],"$L6"]]]]
6
- 7:I{"id":2112,"chunks":["293:static/chunks/293-f7537306415679fd.js","548:static/chunks/548-46c7c1d35ca1bc02.js","82:static/chunks/82-74626c128eefc7a5.js","320:static/chunks/320-d41e321556b1b694.js","563:static/chunks/563-a961efef5193d79c.js","185:static/chunks/app/layout-7031bb251bd9af74.js"],"name":"PageShell","async":false}
5
+ 0:["yobwYIjSlgTiHVK9Eo5hK",[[["",{"children":["auth",{"children":["login",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],"$L5",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/09cb35b4c681097c.css","precedence":"next"}]],"$L6"]]]]
6
+ 7:I{"id":2112,"chunks":["293:static/chunks/293-f7537306415679fd.js","548:static/chunks/548-46c7c1d35ca1bc02.js","82:static/chunks/82-ca0360e473d81167.js","320:static/chunks/320-d41e321556b1b694.js","563:static/chunks/563-a961efef5193d79c.js","185:static/chunks/app/layout-2d69329b7d9c264a.js"],"name":"PageShell","async":false}
7
7
  8:I{"id":7767,"chunks":["272:static/chunks/webpack-cb9069cc30d68b35.js","971:static/chunks/fd9d1056-fba4b53a2f01213b.js","596:static/chunks/596-297f7ff4a0436e87.js"],"name":"default","async":false}
8
8
  9:I{"id":7920,"chunks":["272:static/chunks/webpack-cb9069cc30d68b35.js","971:static/chunks/fd9d1056-fba4b53a2f01213b.js","596:static/chunks/596-297f7ff4a0436e87.js"],"name":"default","async":false}
9
- b:I{"id":6722,"chunks":["293:static/chunks/293-f7537306415679fd.js","808:static/chunks/808-90426be34a5d9784.js","548:static/chunks/548-46c7c1d35ca1bc02.js","82:static/chunks/82-74626c128eefc7a5.js","975:static/chunks/975-380318b3b26ba688.js","716:static/chunks/app/auth/login/page-74ee07fe19cc0bbe.js"],"name":"","async":false}
9
+ b:I{"id":6722,"chunks":["293:static/chunks/293-f7537306415679fd.js","808:static/chunks/808-90426be34a5d9784.js","548:static/chunks/548-46c7c1d35ca1bc02.js","82:static/chunks/82-ca0360e473d81167.js","975:static/chunks/975-380318b3b26ba688.js","716:static/chunks/app/auth/login/page-0c87ef00a5707e79.js"],"name":"","async":false}
10
10
  5:[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_979022","children":["$","$L7",null,{"children":["$","$L8",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L9",null,{}],"templateStyles":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":"$undefined","childProp":{"current":["$","$L8",null,{"parallelRouterKey":"children","segmentPath":["children","auth","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L9",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L8",null,{"parallelRouterKey":"children","segmentPath":["children","auth","children","login","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L9",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$La",["$","$Lb",null,{}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"login"},"styles":[]}],"segment":"auth"},"styles":[]}]}]}]}],null]
11
11
  6:[["$","meta","0",{"charSet":"utf-8"}],["$","title","1",{"children":"promptfoo"}],["$","meta","2",{"name":"description","content":"LLM testing and evaluation"}],["$","meta","3",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","4",{"property":"og:image","content":"https://www.promptfoo.dev/img/thumbnail.png"}],["$","meta","5",{"name":"twitter:card","content":"summary"}],["$","meta","6",{"name":"twitter:image","content":"https://www.promptfoo.dev/img/thumbnail.png"}],["$","meta","7",{"name":"next-size-adjust"}]]
12
12
  a:null