promptfoo 0.76.0 → 0.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +2 -2
- package/dist/src/assertions.d.ts +2 -0
- package/dist/src/assertions.d.ts.map +1 -1
- package/dist/src/assertions.js +12 -11
- package/dist/src/assertions.js.map +1 -1
- package/dist/src/commands/generate/redteam.d.ts.map +1 -1
- package/dist/src/commands/generate/redteam.js +6 -5
- package/dist/src/commands/generate/redteam.js.map +1 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +24 -22
- package/dist/src/config.js.map +1 -1
- package/dist/src/database/tables.d.ts +3 -0
- package/dist/src/database/tables.d.ts.map +1 -1
- package/dist/src/evaluator.d.ts.map +1 -1
- package/dist/src/evaluator.js +1 -0
- package/dist/src/evaluator.js.map +1 -1
- package/dist/src/evaluatorHelpers.d.ts.map +1 -1
- package/dist/src/evaluatorHelpers.js +29 -38
- package/dist/src/evaluatorHelpers.js.map +1 -1
- package/dist/src/prompts/index.js +1 -1
- package/dist/src/prompts/index.js.map +1 -1
- package/dist/src/prompts/processors/javascript.d.ts.map +1 -1
- package/dist/src/prompts/processors/javascript.js +1 -0
- package/dist/src/prompts/processors/javascript.js.map +1 -1
- package/dist/src/prompts/processors/json.d.ts.map +1 -1
- package/dist/src/prompts/processors/json.js +1 -0
- package/dist/src/prompts/processors/json.js.map +1 -1
- package/dist/src/prompts/processors/jsonl.d.ts.map +1 -1
- package/dist/src/prompts/processors/jsonl.js +1 -0
- package/dist/src/prompts/processors/jsonl.js.map +1 -1
- package/dist/src/prompts/processors/python.d.ts.map +1 -1
- package/dist/src/prompts/processors/python.js +1 -0
- package/dist/src/prompts/processors/python.js.map +1 -1
- package/dist/src/prompts/processors/string.d.ts.map +1 -1
- package/dist/src/prompts/processors/string.js +1 -0
- package/dist/src/prompts/processors/string.js.map +1 -1
- package/dist/src/prompts/processors/text.d.ts.map +1 -1
- package/dist/src/prompts/processors/text.js +1 -0
- package/dist/src/prompts/processors/text.js.map +1 -1
- package/dist/src/prompts/processors/yaml.d.ts.map +1 -1
- package/dist/src/prompts/processors/yaml.js +1 -0
- package/dist/src/prompts/processors/yaml.js.map +1 -1
- package/dist/src/providers/azureopenai.js +1 -1
- package/dist/src/providers/azureopenai.js.map +1 -1
- package/dist/src/providers/localai.d.ts.map +1 -1
- package/dist/src/providers/localai.js +6 -6
- package/dist/src/providers/localai.js.map +1 -1
- package/dist/src/providers/promptfoo.d.ts.map +1 -1
- package/dist/src/providers/promptfoo.js +3 -3
- package/dist/src/providers/promptfoo.js.map +1 -1
- package/dist/src/providers/voyage.d.ts.map +1 -1
- package/dist/src/providers/voyage.js +2 -2
- package/dist/src/providers/voyage.js.map +1 -1
- package/dist/src/redteam/constants.d.ts +3 -2
- package/dist/src/redteam/constants.d.ts.map +1 -1
- package/dist/src/redteam/constants.js +11 -2
- package/dist/src/redteam/constants.js.map +1 -1
- package/dist/src/redteam/graders.d.ts.map +1 -1
- package/dist/src/redteam/graders.js +2 -0
- package/dist/src/redteam/graders.js.map +1 -1
- package/dist/src/redteam/plugins/harmful.d.ts.map +1 -1
- package/dist/src/redteam/plugins/harmful.js +10 -4
- package/dist/src/redteam/plugins/harmful.js.map +1 -1
- package/dist/src/redteam/plugins/index.d.ts.map +1 -1
- package/dist/src/redteam/plugins/index.js +5 -0
- package/dist/src/redteam/plugins/index.js.map +1 -1
- package/dist/src/redteam/plugins/ssrf.d.ts +16 -0
- package/dist/src/redteam/plugins/ssrf.d.ts.map +1 -0
- package/dist/src/redteam/plugins/ssrf.js +119 -0
- package/dist/src/redteam/plugins/ssrf.js.map +1 -0
- package/dist/src/suggestions.d.ts.map +1 -1
- package/dist/src/suggestions.js +0 -1
- package/dist/src/suggestions.js.map +1 -1
- package/dist/src/types/index.d.ts +60 -2
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/prompts.d.ts +1 -0
- package/dist/src/types/prompts.d.ts.map +1 -1
- package/dist/src/types/redteam.d.ts +1 -1
- package/dist/src/types/redteam.d.ts.map +1 -1
- package/dist/src/util/index.d.ts +9 -0
- package/dist/src/util/index.d.ts.map +1 -1
- package/dist/src/util/index.js +11 -2
- package/dist/src/util/index.js.map +1 -1
- package/dist/src/util/transform.d.ts +18 -3
- package/dist/src/util/transform.d.ts.map +1 -1
- package/dist/src/util/transform.js +48 -32
- package/dist/src/util/transform.js.map +1 -1
- package/dist/src/validators/prompts.d.ts +3 -0
- package/dist/src/validators/prompts.d.ts.map +1 -1
- package/dist/src/validators/prompts.js +3 -1
- package/dist/src/validators/prompts.js.map +1 -1
- package/dist/src/validators/providers.d.ts +15 -0
- package/dist/src/validators/providers.d.ts.map +1 -1
- package/dist/src/validators/providers.js +1 -0
- package/dist/src/validators/providers.js.map +1 -1
- package/dist/src/validators/redteam.d.ts +28 -28
- package/dist/src/validators/redteam.d.ts.map +1 -1
- package/dist/src/validators/redteam.js +11 -5
- package/dist/src/validators/redteam.js.map +1 -1
- package/dist/src/web/nextui/404/index.html +1 -1
- package/dist/src/web/nextui/404.html +1 -1
- package/dist/src/web/nextui/_next/static/chunks/258-e4da2950edde8e2a.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/374-45af52ed3050e856.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/485-d94c512bab4204ef.js +6 -0
- package/dist/src/web/nextui/_next/static/chunks/{902-17fd074eab50e03c.js → 856-808babe20420dc5b.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/{222-8d27a2c754bc8029.js → 983-9c47c398e832cf0b.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/auth/login/{page-92f9144478c53546.js → page-7134c0901e4f0212.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/auth/signup/{page-a52bd72f4be1d8a3.js → page-d7ebbf82bbbce998.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/datasets/{page-f877135091782ccc.js → page-28f9bf8ecd740718.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/{page-c72cfe418b720579.js → page-6c4e63c9602f522f.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/eval/{page-e64af76a729b3178.js → page-acc3dae78a7a9e91.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/{layout-a749f6361f84152a.js → layout-3e4716f7ebdd0dab.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/prompts/page-34d8a2070dde71a1.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/report/page-c630a8d0cba86664.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/setup/{page-ff63fc392248afc1.js → page-e19ab8695d6ac015.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/main-app-4398f7af7ad8387f.js +1 -0
- package/dist/src/web/nextui/auth/login/index.html +1 -1
- package/dist/src/web/nextui/auth/login/index.txt +3 -3
- package/dist/src/web/nextui/auth/signup/index.html +1 -1
- package/dist/src/web/nextui/auth/signup/index.txt +3 -3
- package/dist/src/web/nextui/datasets/index.html +1 -1
- package/dist/src/web/nextui/datasets/index.txt +3 -3
- package/dist/src/web/nextui/eval/index.html +1 -1
- package/dist/src/web/nextui/eval/index.txt +3 -3
- package/dist/src/web/nextui/index.html +1 -1
- package/dist/src/web/nextui/index.txt +2 -2
- package/dist/src/web/nextui/progress/index.html +1 -1
- package/dist/src/web/nextui/progress/index.txt +3 -3
- package/dist/src/web/nextui/prompts/index.html +1 -1
- package/dist/src/web/nextui/prompts/index.txt +3 -3
- package/dist/src/web/nextui/report/index.html +1 -1
- package/dist/src/web/nextui/report/index.txt +3 -3
- package/dist/src/web/nextui/setup/index.html +1 -1
- package/dist/src/web/nextui/setup/index.txt +3 -3
- package/dist/test/assertions.test.js +24 -0
- package/dist/test/assertions.test.js.map +1 -1
- package/dist/test/evaluator.test.js +61 -0
- package/dist/test/evaluator.test.js.map +1 -1
- package/dist/test/providers.anthropic.test.js +1 -1
- package/dist/test/providers.anthropic.test.js.map +1 -1
- package/dist/test/providers.test.js +2 -2
- package/dist/test/providers.test.js.map +1 -1
- package/dist/test/redteam/validators.test.js +28 -17
- package/dist/test/redteam/validators.test.js.map +1 -1
- package/dist/test/util.test.js +220 -197
- package/dist/test/util.test.js.map +1 -1
- package/dist/test/util.transform.test.js +6 -0
- package/dist/test/util.transform.test.js.map +1 -1
- package/package.json +2 -2
- package/dist/src/web/nextui/_next/static/chunks/163-ee6a283eb46aef3a.js +0 -6
- package/dist/src/web/nextui/_next/static/chunks/258-62f675217b82626c.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/281-64d9f1415a301ee5.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/prompts/page-086373e027220e78.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/report/page-a7dd52951b145b11.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/main-app-0dc90092cd7acaaf.js +0 -1
- /package/dist/src/web/nextui/_next/static/chunks/app/progress/{page-32f742244e1ce920.js → page-2d2dd4e665a6304a.js} +0 -0
- /package/dist/src/web/nextui/_next/static/{rznp6ATZbrfeCiJE-WYrp → dLlNz9-V4NvRIcKyU_b89}/_buildManifest.js +0 -0
- /package/dist/src/web/nextui/_next/static/{rznp6ATZbrfeCiJE-WYrp → dLlNz9-V4NvRIcKyU_b89}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[716],{11520:function(e,t,r){"use strict";r.d(t,{Z:function(){return S}});var a=r(94312),n=r(79042),i=r(14978),o=r(53468),s=r(80683),l=r(84006),u=r(78673),d=r(48976),h=r(14059),p=r(23437),c=r(24004);let m=["className","component","disableGutters","fixed","maxWidth","classes"],g=(0,p.Z)(),f=(0,h.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`maxWidth${(0,u.Z)(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),x=e=>(0,d.Z)({props:e,name:"MuiContainer",defaultTheme:g}),v=(e,t)=>{let{classes:r,fixed:a,disableGutters:n,maxWidth:i}=e,o={root:["root",i&&`maxWidth${(0,u.Z)(String(i))}`,a&&"fixed",n&&"disableGutters"]};return(0,l.Z)(o,e=>(0,s.ZP)(t,e),r)};var b=r(81427),y=r(31608),Z=r(87286);let w=function(e={}){let{createStyledComponent:t=f,useThemeProps:r=x,componentName:s="MuiContainer"}=e,l=t(({theme:e,ownerState:t})=>(0,n.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,r)=>{let a=e.breakpoints.values[r];return 0!==a&&(t[e.breakpoints.up(r)]={maxWidth:`${a}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,n.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}`}})),u=i.forwardRef(function(e,t){let i=r(e),{className:u,component:d="div",disableGutters:h=!1,fixed:p=!1,maxWidth:g="lg"}=i,f=(0,a.Z)(i,m),x=(0,n.Z)({},i,{component:d,disableGutters:h,fixed:p,maxWidth:g}),b=v(x,s);return(0,c.jsx)(l,(0,n.Z)({as:d,ownerState:x,className:(0,o.Z)(b.root,u),ref:t},f))});return u}({createStyledComponent:(0,y.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`maxWidth${(0,b.Z)(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,Z.i)({props:e,name:"MuiContainer"})});var S=w},22689:function(e,t,r){"use strict";var a=r(79042),n=r(94312),i=r(14978),o=r(50774),s=r(77412),l=r(39468),u=r(37708),d=r(24004);let h=["onChange","maxRows","minRows","style","value"];function p(e){return parseInt(e,10)||0}let c={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}},m=i.forwardRef(function(e,t){let{onChange:r,maxRows:m,minRows:g=1,style:f,value:x}=e,v=(0,n.Z)(e,h),{current:b}=i.useRef(null!=x),y=i.useRef(null),Z=(0,o.Z)(t,y),w=i.useRef(null),S=i.useRef(null),C=i.useCallback(()=>{let t=y.current,r=(0,s.Z)(t),a=r.getComputedStyle(t);if("0px"===a.width)return{outerHeightStyle:0,overflowing:!1};let n=S.current;n.style.width=a.width,n.value=t.value||e.placeholder||"x","\n"===n.value.slice(-1)&&(n.value+=" ");let i=a.boxSizing,o=p(a.paddingBottom)+p(a.paddingTop),l=p(a.borderBottomWidth)+p(a.borderTopWidth),u=n.scrollHeight;n.value="x";let d=n.scrollHeight,h=u;g&&(h=Math.max(Number(g)*d,h)),m&&(h=Math.min(Number(m)*d,h)),h=Math.max(h,d);let c=h+("border-box"===i?o+l:0),f=1>=Math.abs(h-u);return{outerHeightStyle:c,overflowing:f}},[m,g,e.placeholder]),W=i.useCallback(()=>{let e=C();if(null==e||0===Object.keys(e).length||0===e.outerHeightStyle&&!e.overflowing)return;let t=e.outerHeightStyle,r=y.current;w.current!==t&&(w.current=t,r.style.height=`${t}px`),r.style.overflow=e.overflowing?"hidden":""},[C]);return(0,l.Z)(()=>{let e,t;let r=()=>{W()},a=(0,u.Z)(r),n=y.current,i=(0,s.Z)(n);return i.addEventListener("resize",a),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(r)).observe(n),()=>{a.clear(),cancelAnimationFrame(e),i.removeEventListener("resize",a),t&&t.disconnect()}},[C,W]),(0,l.Z)(()=>{W()}),(0,d.jsxs)(i.Fragment,{children:[(0,d.jsx)("textarea",(0,a.Z)({value:x,onChange:e=>{b||W(),r&&r(e)},ref:Z,rows:g,style:f},v)),(0,d.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:S,tabIndex:-1,style:(0,a.Z)({},c.shadow,f,{paddingTop:0,paddingBottom:0})})]})});t.Z=m},63147:function(e,t,r){"use strict";r.d(t,{Z:function(){return S}});var a=r(94312),n=r(79042),i=r(14978),o=r(53468),s=r(86251),l=r(84006),u=r(31608),d=r(87286),h=r(81427),p=r(60201),c=r(80683);function m(e){return(0,c.ZP)("MuiTypography",e)}(0,p.Z)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);var g=r(24004);let f=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],x=e=>{let{align:t,gutterBottom:r,noWrap:a,paragraph:n,variant:i,classes:o}=e,s={root:["root",i,"inherit"!==e.align&&`align${(0,h.Z)(t)}`,r&&"gutterBottom",a&&"noWrap",n&&"paragraph"]};return(0,l.Z)(s,m,o)},v=(0,u.ZP)("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],"inherit"!==r.align&&t[`align${(0,h.Z)(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>(0,n.Z)({margin:0},"inherit"===t.variant&&{font:"inherit"},"inherit"!==t.variant&&e.typography[t.variant],"inherit"!==t.align&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),b={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},y={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Z=e=>y[e]||e,w=i.forwardRef(function(e,t){let r=(0,d.i)({props:e,name:"MuiTypography"}),i=Z(r.color),l=(0,s.Z)((0,n.Z)({},r,{color:i})),{align:u="inherit",className:h,component:p,gutterBottom:c=!1,noWrap:m=!1,paragraph:y=!1,variant:w="body1",variantMapping:S=b}=l,C=(0,a.Z)(l,f),W=(0,n.Z)({},l,{align:u,color:i,className:h,component:p,gutterBottom:c,noWrap:m,paragraph:y,variant:w,variantMapping:S}),R=p||(y?"p":S[w]||b[w])||"span",k=x(W);return(0,g.jsx)(v,(0,n.Z)({as:R,ref:t,ownerState:W,className:(0,o.Z)(k.root,h)},C))});var S=w},8791:function(e,t,r){Promise.resolve().then(r.bind(r,92030))},92030:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return c}});var a=r(24004),n=r(14978),i=r(1445),o=r(40982),s=r(11520),l=r(67339),u=r(63147),d=r(38640),h=r.n(d),p=r(28891);function c(){let e=(0,p.useRouter)(),[t,r]=n.useState(""),[d,c]=n.useState(""),[m,g]=n.useState(""),[f,x]=n.useState(!1),[v,b]=n.useState(null),y=n.useCallback(async()=>{let{data:e
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[716],{11520:function(e,t,r){"use strict";r.d(t,{Z:function(){return S}});var a=r(94312),n=r(79042),i=r(14978),o=r(53468),s=r(80683),l=r(84006),u=r(78673),d=r(48976),h=r(14059),p=r(23437),c=r(24004);let m=["className","component","disableGutters","fixed","maxWidth","classes"],g=(0,p.Z)(),f=(0,h.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`maxWidth${(0,u.Z)(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),x=e=>(0,d.Z)({props:e,name:"MuiContainer",defaultTheme:g}),v=(e,t)=>{let{classes:r,fixed:a,disableGutters:n,maxWidth:i}=e,o={root:["root",i&&`maxWidth${(0,u.Z)(String(i))}`,a&&"fixed",n&&"disableGutters"]};return(0,l.Z)(o,e=>(0,s.ZP)(t,e),r)};var b=r(81427),y=r(31608),Z=r(87286);let w=function(e={}){let{createStyledComponent:t=f,useThemeProps:r=x,componentName:s="MuiContainer"}=e,l=t(({theme:e,ownerState:t})=>(0,n.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,r)=>{let a=e.breakpoints.values[r];return 0!==a&&(t[e.breakpoints.up(r)]={maxWidth:`${a}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,n.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}`}})),u=i.forwardRef(function(e,t){let i=r(e),{className:u,component:d="div",disableGutters:h=!1,fixed:p=!1,maxWidth:g="lg"}=i,f=(0,a.Z)(i,m),x=(0,n.Z)({},i,{component:d,disableGutters:h,fixed:p,maxWidth:g}),b=v(x,s);return(0,c.jsx)(l,(0,n.Z)({as:d,ownerState:x,className:(0,o.Z)(b.root,u),ref:t},f))});return u}({createStyledComponent:(0,y.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`maxWidth${(0,b.Z)(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,Z.i)({props:e,name:"MuiContainer"})});var S=w},22689:function(e,t,r){"use strict";var a=r(79042),n=r(94312),i=r(14978),o=r(50774),s=r(77412),l=r(39468),u=r(37708),d=r(24004);let h=["onChange","maxRows","minRows","style","value"];function p(e){return parseInt(e,10)||0}let c={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}},m=i.forwardRef(function(e,t){let{onChange:r,maxRows:m,minRows:g=1,style:f,value:x}=e,v=(0,n.Z)(e,h),{current:b}=i.useRef(null!=x),y=i.useRef(null),Z=(0,o.Z)(t,y),w=i.useRef(null),S=i.useRef(null),C=i.useCallback(()=>{let t=y.current,r=(0,s.Z)(t),a=r.getComputedStyle(t);if("0px"===a.width)return{outerHeightStyle:0,overflowing:!1};let n=S.current;n.style.width=a.width,n.value=t.value||e.placeholder||"x","\n"===n.value.slice(-1)&&(n.value+=" ");let i=a.boxSizing,o=p(a.paddingBottom)+p(a.paddingTop),l=p(a.borderBottomWidth)+p(a.borderTopWidth),u=n.scrollHeight;n.value="x";let d=n.scrollHeight,h=u;g&&(h=Math.max(Number(g)*d,h)),m&&(h=Math.min(Number(m)*d,h)),h=Math.max(h,d);let c=h+("border-box"===i?o+l:0),f=1>=Math.abs(h-u);return{outerHeightStyle:c,overflowing:f}},[m,g,e.placeholder]),W=i.useCallback(()=>{let e=C();if(null==e||0===Object.keys(e).length||0===e.outerHeightStyle&&!e.overflowing)return;let t=e.outerHeightStyle,r=y.current;w.current!==t&&(w.current=t,r.style.height=`${t}px`),r.style.overflow=e.overflowing?"hidden":""},[C]);return(0,l.Z)(()=>{let e,t;let r=()=>{W()},a=(0,u.Z)(r),n=y.current,i=(0,s.Z)(n);return i.addEventListener("resize",a),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(r)).observe(n),()=>{a.clear(),cancelAnimationFrame(e),i.removeEventListener("resize",a),t&&t.disconnect()}},[C,W]),(0,l.Z)(()=>{W()}),(0,d.jsxs)(i.Fragment,{children:[(0,d.jsx)("textarea",(0,a.Z)({value:x,onChange:e=>{b||W(),r&&r(e)},ref:Z,rows:g,style:f},v)),(0,d.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:S,tabIndex:-1,style:(0,a.Z)({},c.shadow,f,{paddingTop:0,paddingBottom:0})})]})});t.Z=m},63147:function(e,t,r){"use strict";r.d(t,{Z:function(){return S}});var a=r(94312),n=r(79042),i=r(14978),o=r(53468),s=r(86251),l=r(84006),u=r(31608),d=r(87286),h=r(81427),p=r(60201),c=r(80683);function m(e){return(0,c.ZP)("MuiTypography",e)}(0,p.Z)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);var g=r(24004);let f=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],x=e=>{let{align:t,gutterBottom:r,noWrap:a,paragraph:n,variant:i,classes:o}=e,s={root:["root",i,"inherit"!==e.align&&`align${(0,h.Z)(t)}`,r&&"gutterBottom",a&&"noWrap",n&&"paragraph"]};return(0,l.Z)(s,m,o)},v=(0,u.ZP)("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],"inherit"!==r.align&&t[`align${(0,h.Z)(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>(0,n.Z)({margin:0},"inherit"===t.variant&&{font:"inherit"},"inherit"!==t.variant&&e.typography[t.variant],"inherit"!==t.align&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),b={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},y={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Z=e=>y[e]||e,w=i.forwardRef(function(e,t){let r=(0,d.i)({props:e,name:"MuiTypography"}),i=Z(r.color),l=(0,s.Z)((0,n.Z)({},r,{color:i})),{align:u="inherit",className:h,component:p,gutterBottom:c=!1,noWrap:m=!1,paragraph:y=!1,variant:w="body1",variantMapping:S=b}=l,C=(0,a.Z)(l,f),W=(0,n.Z)({},l,{align:u,color:i,className:h,component:p,gutterBottom:c,noWrap:m,paragraph:y,variant:w,variantMapping:S}),R=p||(y?"p":S[w]||b[w])||"span",k=x(W);return(0,g.jsx)(v,(0,n.Z)({as:R,ref:t,ownerState:W,className:(0,o.Z)(k.root,h)},C))});var S=w},8791:function(e,t,r){Promise.resolve().then(r.bind(r,92030))},92030:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return c}});var a=r(24004),n=r(14978),i=r(1445),o=r(40982),s=r(11520),l=r(67339),u=r(63147),d=r(38640),h=r.n(d),p=r(28891);function c(){let e=(0,p.useRouter)(),[t,r]=n.useState(""),[d,c]=n.useState(""),[m,g]=n.useState(""),[f,x]=n.useState(!1),[v,b]=n.useState(null),y=n.useCallback(async()=>{let{data:e}=await i.OQ.auth.refreshSession();e&&b(e.user)},[]);n.useEffect(()=>{y()},[y]);let Z=async r=>{if(x(!0),g(""),r.stopPropagation(),r.preventDefault(),!v){let{error:r}=await i.OQ.auth.signInWithPassword({email:t,password:d});r?g(r.message):e.push("/")}x(!1)};return v?(0,a.jsxs)("div",{style:{textAlign:"center"},children:["You're already logged in as ",v.email,"."]}):(0,a.jsxs)(s.Z,{component:"main",maxWidth:"xs",children:[(0,a.jsx)(u.Z,{component:"h1",variant:"h5",children:"Sign in"}),(0,a.jsx)("form",{children:!v&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,onChange:e=>r(e.target.value),value:t,error:!!m}),(0,a.jsx)(l.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:e=>c(e.target.value),value:d,error:!!m,helperText:m}),(0,a.jsx)(o.Z,{type:"submit",disabled:f,sx:{marginTop:"1em"},fullWidth:!0,variant:"contained",color:"primary",onClick:Z,children:"Sign In"}),(0,a.jsxs)("p",{children:["Don't have an account yet? ",(0,a.jsx)(h(),{href:"/auth/signup",children:"Sign up"})]})]})})]})}},1445:function(e,t,r){"use strict";r.d(t,{Ho:function(){return h},OQ:function(){return o},aC:function(){return l}});var a=r(24004),n=r(14978),i=r(12594);let o=(0,i.createClientComponentClient)(),s=(0,n.createContext)({}),l=()=>(0,n.useContext)(s),u=(e,t)=>o.auth.signInWithPassword({email:e,password:t}),d=()=>o.auth.signOut(),h=e=>{let{children:t}=e,[r,i]=(0,n.useState)(null),[l,h]=(0,n.useState)(!1),p=(0,n.useCallback)(async()=>{let{data:e}=await o.auth.refreshSession();e&&i(e.user)},[]);return(0,n.useEffect)(()=>{p();let{data:e}=o.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?h(!1):"SIGNED_IN"===e&&t?(i(t.user),h(!0)):"SIGNED_OUT"===e&&(h(!1),i(null))});return()=>{e.subscription.unsubscribe()}},[p]),(0,a.jsx)(s.Provider,{value:{loggedIn:l,user:r,login:u,logout:d},children:t})}}},function(e){e.O(0,[903,640,916,304,339,485,470,730,744],function(){return e(e.s=8791)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[271],{11520:function(e,t,r){"use strict";r.d(t,{Z:function(){return S}});var a=r(94312),n=r(79042),i=r(14978),o=r(53468),s=r(80683),l=r(84006),u=r(78673),d=r(48976),h=r(14059),p=r(23437),c=r(24004);let m=["className","component","disableGutters","fixed","maxWidth","classes"],g=(0,p.Z)(),f=(0,h.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`maxWidth${(0,u.Z)(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),x=e=>(0,d.Z)({props:e,name:"MuiContainer",defaultTheme:g}),v=(e,t)=>{let{classes:r,fixed:a,disableGutters:n,maxWidth:i}=e,o={root:["root",i&&`maxWidth${(0,u.Z)(String(i))}`,a&&"fixed",n&&"disableGutters"]};return(0,l.Z)(o,e=>(0,s.ZP)(t,e),r)};var b=r(81427),y=r(31608),Z=r(87286);let w=function(e={}){let{createStyledComponent:t=f,useThemeProps:r=x,componentName:s="MuiContainer"}=e,l=t(({theme:e,ownerState:t})=>(0,n.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,r)=>{let a=e.breakpoints.values[r];return 0!==a&&(t[e.breakpoints.up(r)]={maxWidth:`${a}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,n.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}`}})),u=i.forwardRef(function(e,t){let i=r(e),{className:u,component:d="div",disableGutters:h=!1,fixed:p=!1,maxWidth:g="lg"}=i,f=(0,a.Z)(i,m),x=(0,n.Z)({},i,{component:d,disableGutters:h,fixed:p,maxWidth:g}),b=v(x,s);return(0,c.jsx)(l,(0,n.Z)({as:d,ownerState:x,className:(0,o.Z)(b.root,u),ref:t},f))});return u}({createStyledComponent:(0,y.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`maxWidth${(0,b.Z)(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,Z.i)({props:e,name:"MuiContainer"})});var S=w},22689:function(e,t,r){"use strict";var a=r(79042),n=r(94312),i=r(14978),o=r(50774),s=r(77412),l=r(39468),u=r(37708),d=r(24004);let h=["onChange","maxRows","minRows","style","value"];function p(e){return parseInt(e,10)||0}let c={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}},m=i.forwardRef(function(e,t){let{onChange:r,maxRows:m,minRows:g=1,style:f,value:x}=e,v=(0,n.Z)(e,h),{current:b}=i.useRef(null!=x),y=i.useRef(null),Z=(0,o.Z)(t,y),w=i.useRef(null),S=i.useRef(null),C=i.useCallback(()=>{let t=y.current,r=(0,s.Z)(t),a=r.getComputedStyle(t);if("0px"===a.width)return{outerHeightStyle:0,overflowing:!1};let n=S.current;n.style.width=a.width,n.value=t.value||e.placeholder||"x","\n"===n.value.slice(-1)&&(n.value+=" ");let i=a.boxSizing,o=p(a.paddingBottom)+p(a.paddingTop),l=p(a.borderBottomWidth)+p(a.borderTopWidth),u=n.scrollHeight;n.value="x";let d=n.scrollHeight,h=u;g&&(h=Math.max(Number(g)*d,h)),m&&(h=Math.min(Number(m)*d,h)),h=Math.max(h,d);let c=h+("border-box"===i?o+l:0),f=1>=Math.abs(h-u);return{outerHeightStyle:c,overflowing:f}},[m,g,e.placeholder]),W=i.useCallback(()=>{let e=C();if(null==e||0===Object.keys(e).length||0===e.outerHeightStyle&&!e.overflowing)return;let t=e.outerHeightStyle,r=y.current;w.current!==t&&(w.current=t,r.style.height=`${t}px`),r.style.overflow=e.overflowing?"hidden":""},[C]);return(0,l.Z)(()=>{let e,t;let r=()=>{W()},a=(0,u.Z)(r),n=y.current,i=(0,s.Z)(n);return i.addEventListener("resize",a),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(r)).observe(n),()=>{a.clear(),cancelAnimationFrame(e),i.removeEventListener("resize",a),t&&t.disconnect()}},[C,W]),(0,l.Z)(()=>{W()}),(0,d.jsxs)(i.Fragment,{children:[(0,d.jsx)("textarea",(0,a.Z)({value:x,onChange:e=>{b||W(),r&&r(e)},ref:Z,rows:g,style:f},v)),(0,d.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:S,tabIndex:-1,style:(0,a.Z)({},c.shadow,f,{paddingTop:0,paddingBottom:0})})]})});t.Z=m},63147:function(e,t,r){"use strict";r.d(t,{Z:function(){return S}});var a=r(94312),n=r(79042),i=r(14978),o=r(53468),s=r(86251),l=r(84006),u=r(31608),d=r(87286),h=r(81427),p=r(60201),c=r(80683);function m(e){return(0,c.ZP)("MuiTypography",e)}(0,p.Z)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);var g=r(24004);let f=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],x=e=>{let{align:t,gutterBottom:r,noWrap:a,paragraph:n,variant:i,classes:o}=e,s={root:["root",i,"inherit"!==e.align&&`align${(0,h.Z)(t)}`,r&&"gutterBottom",a&&"noWrap",n&&"paragraph"]};return(0,l.Z)(s,m,o)},v=(0,u.ZP)("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],"inherit"!==r.align&&t[`align${(0,h.Z)(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>(0,n.Z)({margin:0},"inherit"===t.variant&&{font:"inherit"},"inherit"!==t.variant&&e.typography[t.variant],"inherit"!==t.align&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),b={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},y={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Z=e=>y[e]||e,w=i.forwardRef(function(e,t){let r=(0,d.i)({props:e,name:"MuiTypography"}),i=Z(r.color),l=(0,s.Z)((0,n.Z)({},r,{color:i})),{align:u="inherit",className:h,component:p,gutterBottom:c=!1,noWrap:m=!1,paragraph:y=!1,variant:w="body1",variantMapping:S=b}=l,C=(0,a.Z)(l,f),W=(0,n.Z)({},l,{align:u,color:i,className:h,component:p,gutterBottom:c,noWrap:m,paragraph:y,variant:w,variantMapping:S}),R=p||(y?"p":S[w]||b[w])||"span",k=x(W);return(0,g.jsx)(v,(0,n.Z)({as:R,ref:t,ownerState:W,className:(0,o.Z)(k.root,h)},C))});var S=w},93930:function(e,t,r){Promise.resolve().then(r.bind(r,78567))},78567:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return c}});var a=r(24004),n=r(14978),i=r(1445),o=r(40982),s=r(11520),l=r(67339),u=r(63147),d=r(38640),h=r.n(d),p=r(28891);function c(){let e=(0,p.useRouter)(),[t,r]=n.useState(""),[d,c]=n.useState(""),[m,g]=n.useState(""),[f,x]=n.useState(!1),[v,b]=n.useState(null),y=n.useCallback(async()=>{let{data:e
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[271],{11520:function(e,t,r){"use strict";r.d(t,{Z:function(){return S}});var a=r(94312),n=r(79042),i=r(14978),o=r(53468),s=r(80683),l=r(84006),u=r(78673),d=r(48976),h=r(14059),p=r(23437),c=r(24004);let m=["className","component","disableGutters","fixed","maxWidth","classes"],g=(0,p.Z)(),f=(0,h.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`maxWidth${(0,u.Z)(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),x=e=>(0,d.Z)({props:e,name:"MuiContainer",defaultTheme:g}),v=(e,t)=>{let{classes:r,fixed:a,disableGutters:n,maxWidth:i}=e,o={root:["root",i&&`maxWidth${(0,u.Z)(String(i))}`,a&&"fixed",n&&"disableGutters"]};return(0,l.Z)(o,e=>(0,s.ZP)(t,e),r)};var b=r(81427),y=r(31608),Z=r(87286);let w=function(e={}){let{createStyledComponent:t=f,useThemeProps:r=x,componentName:s="MuiContainer"}=e,l=t(({theme:e,ownerState:t})=>(0,n.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,r)=>{let a=e.breakpoints.values[r];return 0!==a&&(t[e.breakpoints.up(r)]={maxWidth:`${a}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,n.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}`}})),u=i.forwardRef(function(e,t){let i=r(e),{className:u,component:d="div",disableGutters:h=!1,fixed:p=!1,maxWidth:g="lg"}=i,f=(0,a.Z)(i,m),x=(0,n.Z)({},i,{component:d,disableGutters:h,fixed:p,maxWidth:g}),b=v(x,s);return(0,c.jsx)(l,(0,n.Z)({as:d,ownerState:x,className:(0,o.Z)(b.root,u),ref:t},f))});return u}({createStyledComponent:(0,y.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`maxWidth${(0,b.Z)(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,Z.i)({props:e,name:"MuiContainer"})});var S=w},22689:function(e,t,r){"use strict";var a=r(79042),n=r(94312),i=r(14978),o=r(50774),s=r(77412),l=r(39468),u=r(37708),d=r(24004);let h=["onChange","maxRows","minRows","style","value"];function p(e){return parseInt(e,10)||0}let c={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}},m=i.forwardRef(function(e,t){let{onChange:r,maxRows:m,minRows:g=1,style:f,value:x}=e,v=(0,n.Z)(e,h),{current:b}=i.useRef(null!=x),y=i.useRef(null),Z=(0,o.Z)(t,y),w=i.useRef(null),S=i.useRef(null),C=i.useCallback(()=>{let t=y.current,r=(0,s.Z)(t),a=r.getComputedStyle(t);if("0px"===a.width)return{outerHeightStyle:0,overflowing:!1};let n=S.current;n.style.width=a.width,n.value=t.value||e.placeholder||"x","\n"===n.value.slice(-1)&&(n.value+=" ");let i=a.boxSizing,o=p(a.paddingBottom)+p(a.paddingTop),l=p(a.borderBottomWidth)+p(a.borderTopWidth),u=n.scrollHeight;n.value="x";let d=n.scrollHeight,h=u;g&&(h=Math.max(Number(g)*d,h)),m&&(h=Math.min(Number(m)*d,h)),h=Math.max(h,d);let c=h+("border-box"===i?o+l:0),f=1>=Math.abs(h-u);return{outerHeightStyle:c,overflowing:f}},[m,g,e.placeholder]),W=i.useCallback(()=>{let e=C();if(null==e||0===Object.keys(e).length||0===e.outerHeightStyle&&!e.overflowing)return;let t=e.outerHeightStyle,r=y.current;w.current!==t&&(w.current=t,r.style.height=`${t}px`),r.style.overflow=e.overflowing?"hidden":""},[C]);return(0,l.Z)(()=>{let e,t;let r=()=>{W()},a=(0,u.Z)(r),n=y.current,i=(0,s.Z)(n);return i.addEventListener("resize",a),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(r)).observe(n),()=>{a.clear(),cancelAnimationFrame(e),i.removeEventListener("resize",a),t&&t.disconnect()}},[C,W]),(0,l.Z)(()=>{W()}),(0,d.jsxs)(i.Fragment,{children:[(0,d.jsx)("textarea",(0,a.Z)({value:x,onChange:e=>{b||W(),r&&r(e)},ref:Z,rows:g,style:f},v)),(0,d.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:S,tabIndex:-1,style:(0,a.Z)({},c.shadow,f,{paddingTop:0,paddingBottom:0})})]})});t.Z=m},63147:function(e,t,r){"use strict";r.d(t,{Z:function(){return S}});var a=r(94312),n=r(79042),i=r(14978),o=r(53468),s=r(86251),l=r(84006),u=r(31608),d=r(87286),h=r(81427),p=r(60201),c=r(80683);function m(e){return(0,c.ZP)("MuiTypography",e)}(0,p.Z)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);var g=r(24004);let f=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],x=e=>{let{align:t,gutterBottom:r,noWrap:a,paragraph:n,variant:i,classes:o}=e,s={root:["root",i,"inherit"!==e.align&&`align${(0,h.Z)(t)}`,r&&"gutterBottom",a&&"noWrap",n&&"paragraph"]};return(0,l.Z)(s,m,o)},v=(0,u.ZP)("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],"inherit"!==r.align&&t[`align${(0,h.Z)(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>(0,n.Z)({margin:0},"inherit"===t.variant&&{font:"inherit"},"inherit"!==t.variant&&e.typography[t.variant],"inherit"!==t.align&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),b={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},y={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Z=e=>y[e]||e,w=i.forwardRef(function(e,t){let r=(0,d.i)({props:e,name:"MuiTypography"}),i=Z(r.color),l=(0,s.Z)((0,n.Z)({},r,{color:i})),{align:u="inherit",className:h,component:p,gutterBottom:c=!1,noWrap:m=!1,paragraph:y=!1,variant:w="body1",variantMapping:S=b}=l,C=(0,a.Z)(l,f),W=(0,n.Z)({},l,{align:u,color:i,className:h,component:p,gutterBottom:c,noWrap:m,paragraph:y,variant:w,variantMapping:S}),R=p||(y?"p":S[w]||b[w])||"span",k=x(W);return(0,g.jsx)(v,(0,n.Z)({as:R,ref:t,ownerState:W,className:(0,o.Z)(k.root,h)},C))});var S=w},93930:function(e,t,r){Promise.resolve().then(r.bind(r,78567))},78567:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return c}});var a=r(24004),n=r(14978),i=r(1445),o=r(40982),s=r(11520),l=r(67339),u=r(63147),d=r(38640),h=r.n(d),p=r(28891);function c(){let e=(0,p.useRouter)(),[t,r]=n.useState(""),[d,c]=n.useState(""),[m,g]=n.useState(""),[f,x]=n.useState(!1),[v,b]=n.useState(null),y=n.useCallback(async()=>{let{data:e}=await i.OQ.auth.refreshSession();e&&b(e.user)},[]);n.useEffect(()=>{y()},[y]);let Z=async r=>{if(x(!0),g(""),r.stopPropagation(),r.preventDefault(),!v){let{error:r}=await i.OQ.auth.signUp({email:t,password:d,options:{emailRedirectTo:"".concat(location.origin,"/auth/callback")}});r?g(r.message):e.push("/")}x(!1)};return(0,a.jsxs)(s.Z,{component:"main",maxWidth:"xs",children:[(0,a.jsx)(u.Z,{component:"h1",variant:"h5",children:"Sign up"}),(0,a.jsx)("p",{children:(0,a.jsx)(u.Z,{variant:"body1",children:"An account helps you easily save, view, and share your evals."})}),(0,a.jsxs)("form",{children:[!v&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,onChange:e=>r(e.target.value),value:t,error:!!m}),(0,a.jsx)(l.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:e=>c(e.target.value),value:d,error:!!m,helperText:m}),(0,a.jsx)(o.Z,{type:"submit",disabled:f,sx:{marginTop:"1em"},fullWidth:!0,variant:"contained",color:"primary",onClick:Z,children:"Sign Up"})]}),(0,a.jsxs)("p",{children:["Already have an account? ",(0,a.jsx)(h(),{href:"/auth/login",children:"Sign in"})]})]})]})}},1445:function(e,t,r){"use strict";r.d(t,{Ho:function(){return h},OQ:function(){return o},aC:function(){return l}});var a=r(24004),n=r(14978),i=r(12594);let o=(0,i.createClientComponentClient)(),s=(0,n.createContext)({}),l=()=>(0,n.useContext)(s),u=(e,t)=>o.auth.signInWithPassword({email:e,password:t}),d=()=>o.auth.signOut(),h=e=>{let{children:t}=e,[r,i]=(0,n.useState)(null),[l,h]=(0,n.useState)(!1),p=(0,n.useCallback)(async()=>{let{data:e}=await o.auth.refreshSession();e&&i(e.user)},[]);return(0,n.useEffect)(()=>{p();let{data:e}=o.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?h(!1):"SIGNED_IN"===e&&t?(i(t.user),h(!0)):"SIGNED_OUT"===e&&(h(!1),i(null))});return()=>{e.subscription.unsubscribe()}},[p]),(0,a.jsx)(s.Provider,{value:{loggedIn:l,user:r,login:u,logout:d},children:t})}}},function(e){e.O(0,[903,640,916,304,339,485,470,730,744],function(){return e(e.s=93930)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[958],{5567:function(e,t,s){Promise.resolve().then(s.bind(s,41400))},49532:function(e,t,s){"use strict";let n,i;async function r(){if(n||(i||(i=fetch("/api/config").then(e=>e.json()).then(e=>n=e.apiBaseUrl)),await i),void 0===n)throw Error("API base URL is undefined");return n}s.d(t,{b:function(){return r}})},41400:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[958],{5567:function(e,t,s){Promise.resolve().then(s.bind(s,41400))},49532:function(e,t,s){"use strict";let n,i;async function r(){if(n||(i||(i=fetch("/api/config").then(e=>e.json()).then(e=>n=e.apiBaseUrl)),await i),void 0===n)throw Error("API base URL is undefined");return n}s.d(t,{b:function(){return r}})},41400:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return E}});var n=s(24004),i=s(14978),r=s(49532),l=s(49567),c=s(30469),a=s(65068),d=s(70417),o=s(21303),h=s(61451),u=s(26485),p=s(30021),x=s(19708),j=s(65969),v=s(38640),Z=s.n(v),m=s(28891),f=s(40982),w=s(29794),C=s(22701),y=s(51956),g=s(82669),I=s(22689),k=s(63147),P=s(34235);function b(e){var t,s,r,l;let{openDialog:h,handleClose:x,testCase:j}=e,[v,m]=(0,i.useState)(1);return(0,n.jsxs)(w.Z,{open:h,onClose:x,fullWidth:!0,maxWidth:"lg",children:[(0,n.jsxs)(g.Z,{children:["Dataset ",j.id.slice(0,6)]}),(0,n.jsxs)(y.Z,{children:[(0,n.jsx)(k.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Test cases"}),(0,n.jsx)(I.Z,{readOnly:!0,value:j&&P.default.dump(j.testCases),style:{width:"100%",padding:"0.75rem"},maxRows:15}),(0,n.jsx)(k.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Used in..."}),(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(u.Z,{children:(0,n.jsxs)(p.Z,{children:[(0,n.jsx)(o.Z,{children:"Eval ID"}),(0,n.jsx)(o.Z,{children:"Prompt ID"}),(0,n.jsx)(o.Z,{children:"Raw score"}),(0,n.jsx)(o.Z,{children:"Pass rate"}),(0,n.jsx)(o.Z,{children:"Pass count"}),(0,n.jsx)(o.Z,{children:"Fail count"}),(0,n.jsx)(o.Z,{children:"Prompt"})]})}),(0,n.jsx)(d.Z,{children:null==j?void 0:null===(t=j.prompts)||void 0===t?void 0:t.slice((v-1)*10,10*v).sort((e,t)=>t.evalId.localeCompare(e.evalId)).map((e,t)=>{var s,i,c,a,d;return(0,n.jsxs)(p.Z,{hover:!0,children:[(0,n.jsx)(o.Z,{children:(0,n.jsx)(Z(),{href:"/eval/?evalId=".concat(e.evalId),children:e.evalId})}),(0,n.jsx)(o.Z,{style:{minWidth:"8em"},children:(0,n.jsx)(Z(),{href:"/prompts/?id=".concat(e.id),children:e.id.slice(0,6)})}),(0,n.jsx)(o.Z,{children:"number"==typeof(null===(s=e.prompt.metrics)||void 0===s?void 0:s.score)?e.prompt.metrics.score.toFixed(2):"-"}),(0,n.jsx)(o.Z,{children:"number"==typeof(null===(i=e.prompt.metrics)||void 0===i?void 0:i.testPassCount)&&"number"==typeof(null===(c=e.prompt.metrics)||void 0===c?void 0:c.testFailCount)&&e.prompt.metrics.testPassCount+e.prompt.metrics.testFailCount>0?(e.prompt.metrics.testPassCount/(e.prompt.metrics.testPassCount+e.prompt.metrics.testFailCount)*100).toFixed(2)+"%":"-"}),(0,n.jsx)(o.Z,{children:null!==(r=null===(a=e.prompt.metrics)||void 0===a?void 0:a.testPassCount)&&void 0!==r?r:"-"}),(0,n.jsx)(o.Z,{children:null!==(l=null===(d=e.prompt.metrics)||void 0===d?void 0:d.testFailCount)&&void 0!==l?l:"-"}),(0,n.jsx)(o.Z,{children:e.prompt.raw.length>250?e.prompt.raw.slice(0,250)+"...":e.prompt.raw})]},t)})})]}),Math.ceil(((null==j?void 0:null===(s=j.prompts)||void 0===s?void 0:s.length)||0)/10)>1&&(0,n.jsx)(c.Z,{count:Math.ceil(j.prompts.length/10),page:v,onChange:(e,t)=>{m(t)}})]}),(0,n.jsx)(C.Z,{children:(0,n.jsx)(f.Z,{onClick:x,children:"Close"})})]})}function E(){let e=(0,m.useSearchParams)(),[t,s]=(0,i.useState)([]),[v,f]=(0,i.useState)("date"),[w,C]=(0,i.useState)("desc"),[y,g]=(0,i.useState)(1),[I,k]=(0,i.useState)(!1),[P,E]=(0,i.useState)(0),S=e=>{let t=v===e&&"asc"===w?"desc":"asc";f(e),C(t)};(0,i.useEffect)(()=>{(async()=>{fetch("".concat(await (0,r.b)(),"/api/datasets")).then(e=>e.json()).then(e=>{let t=[...e.data].sort((e,t)=>null===v?0:"asc"===w?e[v]>t[v]?1:-1:e[v]<t[v]?1:-1);s(t)})})()},[v,w,y]);let D=e=>{E(e),k(!0)};return(0,i.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]),(0,n.jsx)(l.Z,{paddingX:2,children:(0,n.jsxs)(h.Z,{children:[(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(u.Z,{children:(0,n.jsxs)(p.Z,{children:[(0,n.jsx)(o.Z,{style:{width:"10%"},children:"ID"}),(0,n.jsx)(o.Z,{style:{width:"20%"},children:(0,n.jsx)(x.Z,{active:"raw"===v,direction:"raw"===v?w:"asc",onClick:()=>S("raw"),children:"Info"})}),(0,n.jsx)(o.Z,{style:{width:"20%"},children:"Variables"}),(0,n.jsx)(o.Z,{style:{width:"10%"},children:(0,n.jsx)(x.Z,{active:"count"===v,direction:"count"===v?w:"asc",onClick:()=>S("count"),children:"Total # evals"})}),(0,n.jsx)(o.Z,{style:{width:"20%"},children:(0,n.jsx)(j.Z,{title:"The date of the most recent eval for this set of test cases",children:(0,n.jsx)(x.Z,{active:"date"===v,direction:"date"===v?w:"asc",onClick:()=>S("date"),children:"Most recent eval date"})})}),(0,n.jsx)(o.Z,{style:{width:"20%"},children:(0,n.jsx)(j.Z,{title:"The ID of the most recent eval for this set of test cases",children:(0,n.jsx)(x.Z,{active:"evalId"===v,direction:"evalId"===v?w:"asc",onClick:()=>S("evalId"),children:"Most recent eval ID"})})})]})}),(0,n.jsx)(d.Z,{children:t.slice((y-1)*10,10*y).map((e,t)=>(0,n.jsxs)(p.Z,{hover:!0,onClick:()=>D(t),style:{cursor:"pointer"},children:[(0,n.jsx)(o.Z,{children:e.id.slice(0,6)}),(0,n.jsxs)(o.Z,{style:{width:"20%",whiteSpace:"pre-wrap"},children:[e.testCases.length," test cases"]}),(0,n.jsx)(o.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,n.jsx)(o.Z,{style:{width:"10%"},children:e.count}),(0,n.jsx)(o.Z,{style:{width:"20%"},children:e.recentEvalDate||"Unknown"}),(0,n.jsx)(o.Z,{style:{width:"20%"},children:e.recentEvalId?(0,n.jsx)(Z(),{href:"/eval?evalId=".concat(e.recentEvalId),children:e.recentEvalId}):"Unknown"})]},t))})]}),Math.ceil(t.length/10)>1&&(0,n.jsx)(c.Z,{count:Math.ceil(t.length/10),page:y,onChange:(e,t)=>g(t)}),t[P]&&(0,n.jsx)(b,{openDialog:I,handleClose:()=>{k(!1)},testCase:t[P]})]})})}},28891:function(e,t,s){e.exports=s(98556)}},function(e){e.O(0,[903,640,493,374,969,235,322,470,730,744],function(){return e(e.s=5567)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[421],{63749:function(e,n,t){Promise.resolve().then(t.t.bind(t,16662,23)),Promise.resolve().then(t.t.bind(t,27924,23)),Promise.resolve().then(t.t.bind(t,30910,23)),Promise.resolve().then(t.t.bind(t,81885,23)),Promise.resolve().then(t.bind(t,55258)),Promise.resolve().then(t.t.bind(t,29820,23))},81885: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(69278),t(14978);let r=t(66995);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}},29820:function(){}},function(e){e.O(0,[583,903,640,916,493,304,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[421],{63749:function(e,n,t){Promise.resolve().then(t.t.bind(t,16662,23)),Promise.resolve().then(t.t.bind(t,27924,23)),Promise.resolve().then(t.t.bind(t,30910,23)),Promise.resolve().then(t.t.bind(t,81885,23)),Promise.resolve().then(t.bind(t,55258)),Promise.resolve().then(t.t.bind(t,29820,23))},81885: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(69278),t(14978);let r=t(66995);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}},29820:function(){}},function(e){e.O(0,[583,903,640,916,493,304,374,339,969,485,378,235,476,216,631,905,983,258,470,730,744],function(){return e(e.s=63749)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[11],{48362:function(e,n,s){Promise.resolve().then(s.t.bind(s,63512,23)),Promise.resolve().then(s.bind(s,55258))}},function(e){e.O(0,[583,903,640,916,493,304,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[11],{48362:function(e,n,s){Promise.resolve().then(s.t.bind(s,63512,23)),Promise.resolve().then(s.bind(s,55258))}},function(e){e.O(0,[583,903,640,916,493,304,374,339,969,485,378,235,476,216,631,905,983,258,470,730,744],function(){return e(e.s=48362)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{84173:function(e,t,r){Promise.resolve().then(r.bind(r,5071)),Promise.resolve().then(r.t.bind(r,5100,23)),Promise.resolve().then(r.t.bind(r,65246,23))},5071:function(e,t,r){"use strict";r.r(t),r.d(t,{PageShell:function(){return J}});var o=r(24004),n=r(14978),s=r(52428),i=r(86768),l=r(77656),a=r(32414),c=r(38640),u=r.n(c),d=r(28891),h=r(95707),f=r(80378);function p(e){let{darkMode:t,onToggleDarkMode:r}=e;return(0,o.jsx)("div",{className:"dark-mode-toggle",onClick:r,children:t?(0,o.jsx)(h.Z,{}):(0,o.jsx)(f.Z,{})})}r(32854);var x=r(56343),m=r(89335),g=r(9327),j=r(98629),b=r(16783),v=r(29794),k=r(82669),C=r(63147),Z=r(52062),S=r(51956),E=r(22701),O=r(40982);let _=[{icon:(0,o.jsx)(b.Z,{fontSize:"small"}),text:"Documentation",href:"https://www.promptfoo.dev/docs/intro"},{icon:(0,o.jsx)(j.Z,{fontSize:"small"}),text:"GitHub Repository",href:"https://github.com/promptfoo/promptfoo"},{icon:(0,o.jsx)(x.Z,{fontSize:"small"}),text:"File an Issue",href:"https://github.com/promptfoo/promptfoo/issues"},{icon:(0,o.jsx)(g.Z,{fontSize:"small"}),text:"Join Our Discord Community",href:"https://discord.gg/gHPS9jjfbs"},{icon:(0,o.jsx)(m.Z,{fontSize:"small"}),text:"Book a Meeting",href:"https://cal.com/team/promptfoo/intro"}];function P(e){let{open:t,onClose:r}=e;return(0,o.jsxs)(v.Z,{open:t,onClose:r,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"about-promptfoo-dialog-title",children:[(0,o.jsx)(k.Z,{id:"about-promptfoo-dialog-title",children:(0,o.jsxs)(a.Z,{children:[(0,o.jsx)(C.Z,{variant:"h6",children:"About Promptfoo"}),(0,o.jsx)(Z.Z,{href:"https://github.com/promptfoo/promptfoo/releases",underline:"none",sx:{color:"inherit"},target:"_blank",children:(0,o.jsxs)(C.Z,{variant:"subtitle2",children:["Version ","0.
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{84173:function(e,t,r){Promise.resolve().then(r.bind(r,5071)),Promise.resolve().then(r.t.bind(r,5100,23)),Promise.resolve().then(r.t.bind(r,65246,23))},5071:function(e,t,r){"use strict";r.r(t),r.d(t,{PageShell:function(){return J}});var o=r(24004),n=r(14978),s=r(52428),i=r(86768),l=r(77656),a=r(32414),c=r(38640),u=r.n(c),d=r(28891),h=r(95707),f=r(80378);function p(e){let{darkMode:t,onToggleDarkMode:r}=e;return(0,o.jsx)("div",{className:"dark-mode-toggle",onClick:r,children:t?(0,o.jsx)(h.Z,{}):(0,o.jsx)(f.Z,{})})}r(32854);var x=r(56343),m=r(89335),g=r(9327),j=r(98629),b=r(16783),v=r(29794),k=r(82669),C=r(63147),Z=r(52062),S=r(51956),E=r(22701),O=r(40982);let _=[{icon:(0,o.jsx)(b.Z,{fontSize:"small"}),text:"Documentation",href:"https://www.promptfoo.dev/docs/intro"},{icon:(0,o.jsx)(j.Z,{fontSize:"small"}),text:"GitHub Repository",href:"https://github.com/promptfoo/promptfoo"},{icon:(0,o.jsx)(x.Z,{fontSize:"small"}),text:"File an Issue",href:"https://github.com/promptfoo/promptfoo/issues"},{icon:(0,o.jsx)(g.Z,{fontSize:"small"}),text:"Join Our Discord Community",href:"https://discord.gg/gHPS9jjfbs"},{icon:(0,o.jsx)(m.Z,{fontSize:"small"}),text:"Book a Meeting",href:"https://cal.com/team/promptfoo/intro"}];function P(e){let{open:t,onClose:r}=e;return(0,o.jsxs)(v.Z,{open:t,onClose:r,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"about-promptfoo-dialog-title",children:[(0,o.jsx)(k.Z,{id:"about-promptfoo-dialog-title",children:(0,o.jsxs)(a.Z,{children:[(0,o.jsx)(C.Z,{variant:"h6",children:"About Promptfoo"}),(0,o.jsx)(Z.Z,{href:"https://github.com/promptfoo/promptfoo/releases",underline:"none",sx:{color:"inherit"},target:"_blank",children:(0,o.jsxs)(C.Z,{variant:"subtitle2",children:["Version ","0.77.0"]})})]})}),(0,o.jsxs)(S.Z,{children:[(0,o.jsx)(C.Z,{variant:"body2",gutterBottom:!0,children:"Promptfoo is a MIT licensed open-source tool for evaluating LLMs. We make it easy to track the performance of your models and prompts over time with automated support for dataset generation and grading."}),(0,o.jsx)(a.Z,{spacing:2,mt:2,children:_.map((e,t)=>(0,o.jsxs)(a.Z,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap","& .MuiSvgIcon-root":{color:"text.primary"}},children:[e.icon,(0,o.jsx)(Z.Z,{underline:"none",target:"_blank",href:e.href,sx:{color:"inherit"},children:(0,o.jsx)(C.Z,{variant:"body2",children:e.text})})]},t))})]}),(0,o.jsx)(E.Z,{children:(0,o.jsx)(O.Z,{onClick:r,children:"Close"})})]})}var y=r(1445),F=r(31657),N=r(36273),M=r(96976);function w(){let{user:e,logout:t}=(0,y.aC)(),[r,s]=n.useState(null),i=()=>{s(null)},a=async()=>{null==t||t(),i()};return e?(0,o.jsxs)("div",{children:[(0,o.jsx)(l.Z,{edge:"end","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:e=>{s(e.currentTarget)},color:"inherit",children:(0,o.jsx)(F.Z,{sx:{width:"1em",height:"1em",bgcolor:"#1976d2"}})}),(0,o.jsxs)(N.Z,{id:"menu-appbar",anchorEl:r,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:!!r,onClose:i,children:[(0,o.jsxs)(M.Z,{disabled:!0,children:["Logged in as ",e.email]}),(0,o.jsx)(M.Z,{onClick:a,children:"Logout"})]})]}):(0,o.jsx)(u(),{href:"/auth/signup/",children:(0,o.jsx)(l.Z,{edge:"end","aria-label":"User not logged in","aria-controls":"menu-appbar","aria-haspopup":"true",color:"inherit",children:(0,o.jsx)(F.Z,{sx:{width:"1em",height:"1em"}})})})}var I=r(49567),T=r(47051),R=r.n(T);function A(){return(0,o.jsx)(u(),{href:"https://promptfoo.dev",passHref:!0,children:(0,o.jsxs)(I.Z,{className:"logo",component:"a",children:[(0,o.jsx)(R(),{width:25,height:25,src:"/logo-panda.svg",alt:"Promptfoo logo"})," ",(0,o.jsx)("span",{children:"promptfoo"})]})})}r(17328),r(5008);var D=r(77580);function B(e){let{href:t,label:r}=e,n=(0,d.usePathname)()||"";return(0,o.jsx)(u(),{href:t,className:n.startsWith(t)?"active":"",children:r})}function L(e){let{darkMode:t,onToggleDarkMode:r}=e,[c,u]=(0,n.useState)(!1),d=()=>u(e=>!e),h=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(A,{}),!D.env.NEXT_PUBLIC_NO_BROWSING&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(B,{href:"/setup",label:"New Eval"}),(0,o.jsx)(B,{href:"/eval",label:"Evals"}),(0,o.jsx)(B,{href:"/prompts",label:"Prompts"}),(0,o.jsx)(B,{href:"/datasets",label:"Datasets"}),(0,o.jsx)(B,{href:"/progress",label:"Progress"})]}),(0,o.jsxs)("div",{className:"right-aligned",children:[s.Ox?(0,o.jsx)(w,{}):null,(0,o.jsx)(l.Z,{onClick:d,sx:{color:"#f0f0f0"},children:(0,o.jsx)(i.Z,{})}),(0,o.jsx)(p,{darkMode:t,onToggleDarkMode:r})]})]});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(P,{open:c,onClose:d}),(0,o.jsx)(a.Z,{direction:"row",spacing:2,className:"nav",children:h})]})}var W=r(51867),U=r(61191),z=r(38127);r(70894);let H=e=>(0,W.Z)({typography:{fontFamily:"inherit"},palette:{mode:e?"dark":"light",background:{default:"#ffffff"}},components:{MuiCard:{styleOverrides:{root:{backgroundColor:e?"#121212":"#fff",boxShadow:e?"none":"0 2px 3px rgba(0, 0, 0, 0.1)",borderRadius:"12px"}}},MuiTableContainer:{styleOverrides:{root:{backgroundColor:e?"#121212":"#fff",boxShadow:e?"none":"0 2px 3px rgba(0, 0, 0, 0.1)",borderRadius:"12px"}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:e?"#1E1E1E":"#F5F5F5"}}},MuiTableCell:{styleOverrides:{head:{backgroundColor:"inherit",color:e?"#FFFFFF":"#000000",fontWeight:"bold"},stickyHeader:{backgroundColor:e?"#1E1E1E":"#F5F5F5"}}},MuiInputBase:{styleOverrides:{root:{backgroundColor:e?"#333":"#fff"}}}}}),G=H(!1),V=H(!0);function X(e){let{children:t}=e;return(0,o.jsx)("div",{children:t})}function J(e){let{children:t}=e,r=(0,z.Z)("(prefers-color-scheme: dark)"),[s,i]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=localStorage.getItem("darkMode");i(null!==e?"true"===e:r)},[r]);let l=(0,n.useCallback)(()=>{i(e=>{let t=!e;return localStorage.setItem("darkMode",String(t)),t})},[]);return((0,n.useEffect)(()=>{null!==s&&(s?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme"))},[s]),null===s)?null:(0,o.jsx)(U.Z,{theme:s?V:G,children:(0,o.jsx)(y.Ho,{children:(0,o.jsxs)(X,{children:[(0,o.jsx)(L,{darkMode:s,onToggleDarkMode:l}),(0,o.jsx)("div",{children:t})]})})})}},52428:function(e,t,r){"use strict";r.d(t,{Ox:function(){return s},T8:function(){return n},eA:function(){return i}});var o=r(77580);let n=!o.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,s=!!o.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,i=""},1445:function(e,t,r){"use strict";r.d(t,{Ho:function(){return d},OQ:function(){return i},aC:function(){return a}});var o=r(24004),n=r(14978),s=r(12594);let i=(0,s.createClientComponentClient)(),l=(0,n.createContext)({}),a=()=>(0,n.useContext)(l),c=(e,t)=>i.auth.signInWithPassword({email:e,password:t}),u=()=>i.auth.signOut(),d=e=>{let{children:t}=e,[r,s]=(0,n.useState)(null),[a,d]=(0,n.useState)(!1),h=(0,n.useCallback)(async()=>{let{data:e}=await i.auth.refreshSession();e&&s(e.user)},[]);return(0,n.useEffect)(()=>{h();let{data:e}=i.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?d(!1):"SIGNED_IN"===e&&t?(s(t.user),d(!0)):"SIGNED_OUT"===e&&(d(!1),s(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,o.jsx)(l.Provider,{value:{loggedIn:a,user:r,login:c,logout:u},children:t})}},32854:function(){},17328:function(){},5008:function(){},70894:function(){},5100:function(){}},function(e){e.O(0,[903,640,916,374,485,325,470,730,744],function(){return e(e.s=84173)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[794],{9458:function(e,t,n){Promise.resolve().then(n.bind(n,73730))},49532:function(e,t,n){"use strict";let i,s;async function l(){if(i||(s||(s=fetch("/api/config").then(e=>e.json()).then(e=>i=e.apiBaseUrl)),await s),void 0===i)throw Error("API base URL is undefined");return i}n.d(t,{b:function(){return l}})},73730:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return P}});var i=n(24004),s=n(14978),l=n(49532),r=n(49567),c=n(30469),d=n(65068),a=n(70417),o=n(21303),h=n(61451),u=n(26485),x=n(30021),j=n(19708),Z=n(65969),v=n(38640),p=n.n(v),f=n(28891),m=n(40982),w=n(29794),y=n(22701),C=n(51956),g=n(82669),E=n(22689),k=n(63147),I=e=>{var t;let{openDialog:n,handleClose:s,selectedPrompt:l}=e;return(0,i.jsxs)(w.Z,{open:n,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,i.jsxs)(g.Z,{children:["Prompt ",l.id.slice(0,6)]}),(0,i.jsxs)(C.Z,{children:[(0,i.jsx)(k.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Prompt"}),(0,i.jsx)(E.Z,{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)(k.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Used in..."}),(0,i.jsxs)(d.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(o.Z,{children:"Eval ID"}),(0,i.jsx)(o.Z,{children:"Dataset ID"}),(0,i.jsx)(o.Z,{children:"Raw score"}),(0,i.jsx)(o.Z,{children:"Pass rate"}),(0,i.jsx)(o.Z,{children:"Pass count"}),(0,i.jsx)(o.Z,{children:"Fail count"})]})}),(0,i.jsx)(a.Z,{children:null==l?void 0:l.evals.sort((e,t)=>t.id.localeCompare(e.id)).map(e=>{var t,n,s,l,r,c,d;let a=null!==(r=null===(t=e.metrics)||void 0===t?void 0:t.testPassCount)&&void 0!==r?r:0,h=null!==(c=null===(n=e.metrics)||void 0===n?void 0:n.testFailCount)&&void 0!==c?c:0,u=a+h>0?(a/(a+h)*100).toFixed(2)+"%":"-";return(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(o.Z,{children:(0,i.jsx)(p(),{href:"/eval/?evalId=".concat(e.id),children:e.id})}),(0,i.jsx)(o.Z,{children:(0,i.jsx)(p(),{href:"/datasets/?id=".concat(e.datasetId),children:e.datasetId.slice(0,6)})}),(0,i.jsx)(o.Z,{children:null!==(d=null===(l=e.metrics)||void 0===l?void 0:null===(s=l.score)||void 0===s?void 0:s.toFixed(2))&&void 0!==d?d:"-"}),(0,i.jsx)(o.Z,{children:u}),(0,i.jsx)(o.Z,{children:a}),(0,i.jsx)(o.Z,{children:h})]},"eval-".concat(e.id))})})]})]}),(0,i.jsx)(y.Z,{children:(0,i.jsx)(m.Z,{onClick:s,children:"Close"})})]})};function P(){let e=(0,f.useSearchParams)(),[t,n]=(0,s.useState)([]),[v,m]=(0,s.useState)("date"),[w,y]=(0,s.useState)("desc"),[C,g]=(0,s.useState)(1),[E,k]=(0,s.useState)(!1),[P,S]=(0,s.useState)(0),D=e=>{let t=v===e&&"asc"===w?"desc":"asc";m(e),y(t)};(0,s.useEffect)(()=>{(async()=>{fetch("".concat(await (0,l.b)(),"/api/prompts")).then(e=>e.json()).then(e=>{let t=[...e.data].sort((e,t)=>null===v?0:"asc"===w?e[v]>t[v]?1:-1:e[v]<t[v]?1:-1);n(t)})})()},[v,w]);let b=e=>{k(!0),S(e)};return(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&&b(e)}},[t,e]),(0,i.jsx)(r.Z,{paddingX:2,children:(0,i.jsxs)(h.Z,{children:[(0,i.jsxs)(d.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(o.Z,{style:{width:"10%"},children:"ID"}),(0,i.jsx)(o.Z,{style:{width:"60%"},children:(0,i.jsx)(j.Z,{active:"raw"===v,direction:"raw"===v?w:"asc",onClick:()=>D("raw"),children:"Prompt"})}),(0,i.jsx)(o.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"===v,direction:"date"===v?w:"asc",onClick:()=>D("date"),children:"Most recent eval"})})}),(0,i.jsx)(o.Z,{style:{width:"10%"},children:(0,i.jsx)(j.Z,{active:"count"===v,direction:"count"===v?w:"asc",onClick:()=>D("count"),children:"# Evals"})})]})}),(0,i.jsx)(a.Z,{children:t.slice((C-1)*10,10*C).map((e,t)=>(0,i.jsxs)(x.Z,{hover:!0,children:[(0,i.jsx)(o.Z,{style:{width:"10%"},children:e.id.slice(0,6)}),(0,i.jsx)(o.Z,{style:{width:"60%",whiteSpace:"pre-wrap",cursor:"pointer"},onClick:()=>b(t),children:e.prompt.raw.length>500?e.prompt.raw.slice(0,500)+"...":e.prompt.raw}),(0,i.jsx)(o.Z,{style:{width:"20%"},children:e.recentEvalDate?(0,i.jsx)(p(),{href:"/eval?evalId=".concat(e.recentEvalId),children:e.recentEvalDate}):"Unknown"}),(0,i.jsx)(o.Z,{style:{width:"10%"},children:e.count})]},t))})]}),Math.ceil(t.length/10)>1&&(0,i.jsx)(c.Z,{count:Math.ceil(t.length/10),page:C,onChange:(e,t)=>g(t)}),t[P]&&(0,i.jsx)(I,{openDialog:E,handleClose:()=>{k(!1)},selectedPrompt:t[P]})]})})}},28891:function(e,t,n){e.exports=n(98556)}},function(e){e.O(0,[903,640,493,374,969,322,470,730,744],function(){return e(e.s=9458)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[420],{58004:function(e,t,i){Promise.resolve().then(i.bind(i,69914))},49532:function(e,t,i){"use strict";let a,s;async function n(){if(a||(s||(s=fetch("/api/config").then(e=>e.json()).then(e=>a=e.apiBaseUrl)),await s),void 0===a)throw Error("API base URL is undefined");return a}i.d(t,{b:function(){return n}})},69914:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return ed}});var a,s,n=i(24004),r=i(14978),l=i(49532),o=i(49567),c=i(80661),d=i(885),m=i(11520),u=i(32414),h=i(63147),p=i(49578);let g={"Brand Risk":["competitors","excessive-agency","hallucination","harmful:graphic-content","harmful:harassment-bullying","harmful:indiscriminate-weapons","harmful:insults","harmful:misinformation-disinformation","harmful:non-violent-crime","harmful:profanity","harmful:radicalization","harmful:unsafe-practices","imitation","overreliance","politics"],"Legal Risk":["contracts","harmful:child-exploitation","harmful:copyright-violations","harmful:cybercrime","harmful:hate","harmful:illegal-activities","harmful:illegal-drugs","harmful:intellectual-property","harmful:privacy","harmful:self-harm","harmful:sex-crime","harmful:sexual-content","harmful:specialized-advice","harmful:violent-crime"],"Technical Risk":["debug-access","hijacking","jailbreak","pii","prompt-injection","rbac","bola","bfla","ssrf","shell-injection","sql-injection"]},f={"Brand Risk":"Risks that can affect the brand reputation and trustworthiness.","Legal Risk":"Risks that can lead to legal consequences or violations.","Technical Risk":"Risks involving malicious activities targeting the system or users."};(a=s||(s={})).Critical="Critical",a.High="High",a.Medium="Medium",a.Low="Low";let v={"debug-access":s.High,"excessive-agency":s.Medium,"harmful:child-exploitation":s.Critical,"harmful:copyright-violations":s.Low,"harmful:cybercrime":s.Low,"harmful:graphic-content":s.Medium,"harmful:harassment-bullying":s.Low,"harmful:hate":s.Critical,"harmful:illegal-activities":s.Medium,"harmful:illegal-drugs":s.Medium,"harmful:indiscriminate-weapons":s.Medium,"harmful:insults":s.Low,"harmful:intellectual-property":s.Medium,"harmful:misinformation-disinformation":s.Medium,"harmful:non-violent-crime":s.Medium,"harmful:privacy":s.High,"harmful:profanity":s.Low,"harmful:radicalization":s.Low,"harmful:self-harm":s.Critical,"harmful:sex-crime":s.High,"harmful:sexual-content":s.Medium,"harmful:specialized-advice":s.Medium,"harmful:unsafe-practices":s.Low,"harmful:violent-crime":s.High,"prompt-injection":s.Medium,"shell-injection":s.High,"sql-injection":s.High,competitors:s.Low,contracts:s.Medium,hallucination:s.Medium,hijacking:s.High,imitation:s.Low,jailbreak:s.Medium,overreliance:s.Low,pii:s.High,politics:s.Low,rbac:s.High},x=Object.entries(g).reduce((e,t)=>{let[i,a]=t;return a.forEach(t=>{e[t]=i}),e},{});Object.keys(x);let j={bola:"BOLAEnforcement",bfla:"BFLAEnforcement",ssrf:"SSRFEnforcement","debug-access":"DebugAccess","excessive-agency":"ExcessiveAgency","harmful:child-exploitation":"Child Exploitation","harmful:cybercrime":"Cybercrime & Unauthorized Intrusion - Hacking and Malware","harmful:graphic-content":"Graphic & age-restricted content","harmful:harassment-bullying":"Harassment & Bullying","harmful:hate":"Hate","harmful:illegal-activities":"Illegal Activities - Fraud & scams","harmful:illegal-drugs":"Illegal Drugs","harmful:indiscriminate-weapons":"Indiscriminate Weapons","harmful:insults":"Insults and personal attacks","harmful:intellectual-property":"Intellectual Property violation","harmful:misinformation-disinformation":"Misinformation & Disinformation - Harmful lies and propaganda","harmful:non-violent-crime":"Non-Violent Crimes","harmful:privacy":"Privacy violations","harmful:profanity":"Requests containing profanity","harmful:radicalization":"Radicalization","harmful:self-harm":"Self-Harm","harmful:sex-crime":"Sex Crimes","harmful:sexual-content":"Sexual Content","harmful:specialized-advice":"Specialized Advice - Financial","harmful:unsafe-practices":"Promotion of unsafe practices","harmful:violent-crime":"Violent Crimes","harmful:chemical-biological-weapons":"Chemical & Biological Weapons","harmful:copyright-violations":"Copyright Violations - Copyrighted text","prompt-injection":"Harmful/Injection","shell-injection":"ShellInjection","sql-injection":"SqlInjection",competitors:"CompetitorEndorsement",contracts:"ContractualCommitment",hallucination:"Hallucination",hijacking:"Hijacking",imitation:"Imitation",jailbreak:"Harmful/Iterative",overreliance:"Overreliance",pii:"PIILeak",politics:"PoliticalStatement",rbac:"RbacEnforcement"},y=Object.entries(j).reduce((e,t)=>{let[i,a]=t;return e[a]=i,e},{}),b={bola:"Object-Level Authorization",bfla:"Function-Level Authorization",ssrf:"Server-Side Request Forgery","excessive-agency":"Excessive Agency","prompt-injection":"Prompt Injection",competitors:"Competitor Endorsements",contracts:"Unsupervised Contracts",jailbreak:"Jailbreak",pii:"PII Leaks",politics:"Political Opinions","shell-injection":"Shell Injection","sql-injection":"SQL Injection",rbac:"RBAC Enforcement","debug-access":"Debug Access","harmful:specialized-advice":"Specialized Advice","harmful:illegal-activities":"Illegal Activities","harmful:cybercrime":"Cybercrime","harmful:copyright-violations":"Copyright Violations","harmful:misinformation-disinformation":"Misinformation & disinformation"},w={default:"Includes common plugins",basic:"Raw attacks without any special attack strategies.",bola:"Broken Object Level Authorization (BOLA) tests.",bfla:"Broken Function Level Authorization (BFLA) tests.",ssrf:"Server-Side Request Forgery (SSRF) tests.","debug-access":"Attempts to access or use debugging commands.","excessive-agency":"Model taking excessive initiative or misunderstanding its capabilities.","harmful:chemical-biological-weapons":"Content related to chemical or biological weapons","harmful:child-exploitation":"Content exploiting or harming children.","harmful:copyright-violations":"Content violating copyright laws.","harmful:cybercrime":"Content related to cybercriminal activities.","harmful:graphic-content":"Displaying graphic or violent content.","harmful:harassment-bullying":"Content that harasses or bullies individuals.","harmful:hate":"Content that promotes hate or discrimination.","harmful:illegal-activities":"Content promoting illegal activities.","harmful:illegal-drugs":"Content related to illegal drug use or trade.","harmful:indiscriminate-weapons":"Content related to weapons without context.","harmful:insults":"Content that insults or demeans individuals.","harmful:intellectual-property":"Content violating intellectual property rights.","harmful:misinformation-disinformation":"Spreading false or misleading information.","harmful:non-violent-crime":"Content related to non-violent criminal activities.","harmful:privacy":"Content violating privacy rights.","harmful:profanity":"Content containing profane or inappropriate language.","harmful:radicalization":"Content that promotes radical or extremist views.","harmful:self-harm":"Content that encourages self-harm or suicide.","harmful:sex-crime":"Content related to sexual crimes.","harmful:sexual-content":"Explicit or inappropriate sexual content.","harmful:specialized-advice":"Providing advice in specialized fields without expertise.","harmful:unsafe-practices":"Content promoting unsafe or harmful practices.","harmful:violent-crime":"Content related to violent criminal activities.","jailbreak:tree":"Experimental: More expensive and time-consuming jailbreak technique for improved results.","pii:api-db":"PII exposed through API or database","pii:direct":"Direct exposure of PII","pii:session":"PII exposed in session data","pii:social":"PII exposed through social engineering","prompt-injection":"Malicious inputs designed to manipulate the model's behavior.","shell-injection":"Attempts to execute shell commands through the model.","sql-injection":"Attempts to perform SQL injection attacks to manipulate database queries.",base64:"Attempts to obfuscate malicious content using Base64 encoding.",competitors:"Competitor mentions and endorsements",contracts:"Enters business or legal commitments without supervision.",hallucination:"Model generating false or misleading information.",harmful:"All harmful categories",hijacking:"Unauthorized or off-topic resource use.",imitation:"Imitates people, brands, or organizations.",jailbreak:"Attempts to bypass security measures through iterative prompt refinement.",leetspeak:"Attempts to obfuscate malicious content using leetspeak.",overreliance:"Model susceptible to relying on an incorrect user assumption or input.",pii:"All PII categories",policy:"Violates a custom configured policy.",politics:"Makes political statements.",rbac:"Tests whether the model properly implements Role-Based Access Control (RBAC).",rot13:"Attempts to obfuscate malicious content using ROT13 encoding."};i(4309);var k=e=>{let{categoryStats:t}=e,i=[s.Critical,s.High,s.Medium,s.Low],a=i.reduce((e,i)=>(e[i]=Object.keys(t).reduce((e,t)=>v[t]===i?e+1:e,0),e),{});return(0,n.jsx)(u.Z,{spacing:2,direction:{xs:"column",sm:"row"},children:i.map(e=>(0,n.jsx)(o.Z,{flex:1,children:(0,n.jsx)(c.Z,{className:"severity-card card-".concat(e.toLowerCase()),children:(0,n.jsxs)(p.Z,{onClick:()=>window.location.hash="#table",children:[(0,n.jsx)(h.Z,{variant:"h6",gutterBottom:!0,children:e}),(0,n.jsx)(h.Z,{variant:"h4",color:"text.primary",children:a[e]}),(0,n.jsx)(h.Z,{variant:"body2",color:"text.secondary",children:"issues"})]})})},e))})},R=i(48931),Z=i(77656),C=i(65969),A=i(35193),I=i.n(A),P=i(21629),L=e=>{let{evalDescription:t}=e,i=async()=>{let e=document.documentElement,i=await I()(e,{height:Math.max(e.scrollHeight,e.offsetHeight),windowHeight:document.documentElement.scrollHeight}),a=i.toDataURL("image/png"),s=new P.ZP("p","pt",[i.width,i.height]);s.addImage(a,"PNG",0,0,i.width,i.height);let n=t?"report_".concat(t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),".pdf"):"report.pdf";s.save(n)};return(0,n.jsx)(C.Z,{title:"Download report as PDF",placement:"top",children:(0,n.jsx)(Z.Z,{onClick:i,sx:{mt:"4px"},"aria-label":"download report",children:(0,n.jsx)(R.Z,{})})})},S=i(75307),F=i(40982),M=i(29794),N=i(22701),H=i(51956),z=i(82669),E=i(97540),D=i(37204),O=i(79685),B=i(74595);let T={getItem:async e=>await (0,D.U2)(e)||null,setItem:async(e,t)=>{await (0,D.t8)(e,t)},removeItem:async e=>{await (0,D.IV)(e)}},U=(0,O.Ue)()((0,B.tJ)(e=>({showPercentagesOnRiskCards:!1,setShowPercentagesOnRiskCards:t=>e(()=>({showPercentagesOnRiskCards:t})),pluginPassRateThreshold:1,setPluginPassRateThreshold:t=>e(()=>({pluginPassRateThreshold:t}))}),{name:"ReportViewStorage",storage:(0,B.FL)(()=>T)}));var W=()=>{let{showPercentagesOnRiskCards:e,setShowPercentagesOnRiskCards:t,pluginPassRateThreshold:i,setPluginPassRateThreshold:a}=U(),[s,l]=r.useState(!1),o=()=>{l(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(C.Z,{title:"Report Settings",placement:"top",children:(0,n.jsx)(Z.Z,{onClick:()=>{l(!0)},"aria-label":"settings",children:(0,n.jsx)(S.Z,{})})}),(0,n.jsxs)(M.Z,{open:s,onClose:o,fullWidth:!0,maxWidth:"sm",children:[(0,n.jsx)(z.Z,{children:"Report Settings"}),(0,n.jsxs)(H.Z,{children:[(0,n.jsx)(h.Z,{component:"div",sx:{padding:"16px 0"},children:(0,n.jsxs)("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[(0,n.jsx)("input",{type:"checkbox",checked:e,onChange:e=>t(e.target.checked),style:{marginRight:"10px"}}),"Show percentages on risk cards"]})}),(0,n.jsxs)(h.Z,{component:"div",sx:{padding:"16px 0"},children:[(0,n.jsxs)("label",{children:["Plugin Pass Rate Threshold: ",(100*i).toFixed(0),"%"]}),(0,n.jsx)(h.Z,{variant:"body2",color:"textSecondary",sx:{mt:1},children:"Sets the threshold for considering a plugin as passed on the risk cards."}),(0,n.jsx)(E.ZP,{value:i,onChange:(e,t)=>a(t),"aria-labelledby":"plugin-pass-rate-threshold-slider",step:.05,marks:!0,min:0,max:1,valueLabelDisplay:"auto",valueLabelFormat:e=>"".concat((100*e).toFixed(0),"%")})]})]}),(0,n.jsx)(N.Z,{children:(0,n.jsx)(F.Z,{onClick:o,variant:"contained",color:"primary",children:"Close"})})]})]})},q=i(63362),V=i(18845),_=i(69555),G=i(93650),J=i(47908),K=i(85912),Q=i(94941),$=i(48670);i(46553);var X=e=>{let{title:t,subtitle:i,progressValue:a,numTestsPassed:s,numTestsFailed:r,testTypes:l}=e,{showPercentagesOnRiskCards:d,pluginPassRateThreshold:m}=U();return(0,n.jsx)(c.Z,{children:(0,n.jsx)(p.Z,{className:"risk-card-container",children:(0,n.jsxs)(G.ZP,{container:!0,spacing:3,children:[(0,n.jsxs)(G.ZP,{item:!0,xs:12,md:6,style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,n.jsx)(h.Z,{variant:"h5",className:"risk-card-title",children:t}),(0,n.jsx)(h.Z,{variant:"subtitle1",color:"textSecondary",mb:2,children:i}),(0,n.jsx)(o.Z,{sx:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:100,height:100},children:(0,n.jsx)($.a,{value:a,max:100,thickness:10,arc:{startAngle:-90,endAngle:90,color:"primary.main"},text:Number.isNaN(a)?"-":"".concat(Math.round(a),"%"),sx:{width:"100%",height:"100%"}})}),(0,n.jsxs)(h.Z,{variant:"h6",className:"risk-card-issues",children:[r," failed probes"]}),(0,n.jsxs)(h.Z,{variant:"subtitle1",color:"textSecondary",className:"risk-card-tests-passed",children:[s,"/",s+r," passed"]})]}),(0,n.jsx)(G.ZP,{item:!0,xs:6,md:4,children:(0,n.jsx)(J.Z,{dense:!0,children:l.map((e,t)=>(0,n.jsx)(C.Z,{title:w[e.name],placement:"left",arrow:!0,children:(0,n.jsxs)(K.ZP,{className:"risk-card-list-item",onClick:t=>{let i=new URLSearchParams(window.location.search),a=i.get("evalId"),s=j[e.name],n="/eval/?evalId=".concat(a,"&search=").concat(encodeURIComponent("(var=".concat(s,"|metric=").concat(s,")")));t.ctrlKey||t.metaKey?window.open(n,"_blank"):window.location.href=n},style:{cursor:"pointer"},children:[(0,n.jsx)(Q.Z,{primary:b[e.name]||j[e.name],primaryTypographyProps:{variant:"body2"}}),d?(0,n.jsx)(h.Z,{variant:"body2",className:"risk-card-percentage ".concat(e.percentage>=.8?"risk-card-percentage-high":e.percentage>=.5?"risk-card-percentage-medium":"risk-card-percentage-low"),children:"".concat(Math.round(100*e.percentage),"%")}):0===e.total?(0,n.jsx)(_.Z,{className:"risk-card-icon-no-tests"}):e.percentage>=m?(0,n.jsx)(V.Z,{className:"risk-card-icon-passed"}):(0,n.jsx)(q.Z,{className:"risk-card-icon-failed"})]})},t))})})]})})})};i(32991);var Y=e=>{let{categoryStats:t}=e,i=Object.keys(g).map(e=>({name:e,passed:g[e].every(e=>{var i,a;return(null===(i=t[e])||void 0===i?void 0:i.pass)===(null===(a=t[e])||void 0===a?void 0:a.total)})}));return(0,n.jsx)(u.Z,{spacing:4,children:i.map((e,i)=>{let a=e.name,s=g[a],r=s.reduce((e,i)=>{var a;return e+((null===(a=t[i])||void 0===a?void 0:a.pass)||0)},0),l=s.reduce((e,i)=>{var a;return e+((null===(a=t[i])||void 0===a?void 0:a.total)||0)},0);return(0,n.jsx)(X,{title:e.name,subtitle:f[a],progressValue:r/l*100,numTestsPassed:r,numTestsFailed:l-r,testTypes:s.map(e=>{var i,a,s,n,r;return{name:e,passed:(null===(i=t[e])||void 0===i?void 0:i.pass)===(null===(a=t[e])||void 0===a?void 0:a.total),percentage:((null===(s=t[e])||void 0===s?void 0:s.pass)||1)/((null===(n=t[e])||void 0===n?void 0:n.total)||1),total:(null===(r=t[e])||void 0===r?void 0:r.total)||0}})},i)})})},ee=i(65068),et=i(70417),ei=i(21303),ea=i(61451),es=i(26485),en=i(38592),er=i(30021),el=i(19708);i(93091);let eo=e=>{let t=[];for(let i of Object.values(g))for(let a of i)t.push({pluginName:a,type:j[a]||a,description:w[a]||"",passRate:e[a]?(e[a].pass/e[a].total*100).toFixed(1)+"%":"N/A",passRateWithFilter:e[a]?(e[a].passWithFilter/e[a].total*100).toFixed(1)+"%":"N/A",severity:v[a]||"Unknown"});return t.sort((e,t)=>"N/A"===e.passRate?1:"N/A"===t.passRate?-1:parseFloat(e.passRate)-parseFloat(t.passRate))};var ec=e=>{let{evalId:t,categoryStats:i}=e,a=eo(i).filter(e=>"N/A"!==e.passRate),[s,l]=r.useState(0),[c,d]=r.useState(10),[m,u]=r.useState("asc"),[p,g]=r.useState("default"),f=e=>{let t=p===e&&"asc"===m;u(t?"desc":"asc"),g(e)};return(0,n.jsxs)(o.Z,{children:[(0,n.jsx)(h.Z,{variant:"h5",gutterBottom:!0,id:"table",children:"Vulnerabilities and Mitigations"}),(0,n.jsxs)(ea.Z,{children:[(0,n.jsxs)(ee.Z,{children:[(0,n.jsx)(es.Z,{children:(0,n.jsxs)(er.Z,{children:[(0,n.jsx)(ei.Z,{children:"Type"}),(0,n.jsx)(ei.Z,{children:"Description"}),(0,n.jsx)(ei.Z,{children:(0,n.jsx)(el.Z,{active:"passRate"===p,direction:"passRate"===p?m:"asc",onClick:()=>f("passRate"),children:"Pass rate"})}),(0,n.jsx)(ei.Z,{children:(0,n.jsx)(el.Z,{active:"severity"===p,direction:"severity"===p?m:"asc",onClick:()=>f("severity"),children:"Severity"})}),(0,n.jsx)(ei.Z,{style:{minWidth:"275px"},children:"Actions"})]})}),(0,n.jsx)(et.Z,{children:a.sort((e,t)=>{if("passRate"===p)return"N/A"===e.passRate?1:"N/A"===t.passRate?-1:"asc"===m?parseFloat(e.passRate)-parseFloat(t.passRate):parseFloat(t.passRate)-parseFloat(e.passRate);if("severity"===p){if("N/A"===e.passRate)return 1;if("N/A"===t.passRate)return -1;let i={Critical:4,High:3,Medium:2,Low:1};return"asc"===m?i[e.severity]-i[t.severity]:i[t.severity]-i[e.severity]}{let i={Critical:4,High:3,Medium:2,Low:1};return e.severity===t.severity?parseFloat(e.passRate)-parseFloat(t.passRate):i[t.severity]-i[e.severity]}}).slice(s*c,s*c+c).map((e,t)=>{let i="";if("N/A"!==e.passRate){let t=parseFloat(e.passRate);i=t>=75?"pass-high":t>=50?"pass-medium":"pass-low"}return(0,n.jsxs)(er.Z,{children:[(0,n.jsx)(ei.Z,{children:(0,n.jsx)("span",{style:{fontWeight:500},children:b[e.pluginName]||e.type})}),(0,n.jsx)(ei.Z,{children:e.description}),(0,n.jsxs)(ei.Z,{className:i,children:[(0,n.jsx)("strong",{children:e.passRate}),e.passRateWithFilter!==e.passRate?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("br",{}),"(",e.passRateWithFilter," with mitigation)"]}):null]}),(0,n.jsx)(ei.Z,{className:"vuln-".concat(e.severity.toLowerCase()),children:e.severity}),(0,n.jsxs)(ei.Z,{style:{minWidth:270},children:[(0,n.jsx)(F.Z,{variant:"contained",size:"small",onClick:()=>{let t=new URLSearchParams(window.location.search),i=t.get("evalId");window.location.href="/eval/?evalId=".concat(i,"&search=").concat(encodeURIComponent("(var=".concat(e.type,"|metric=").concat(e.type,")")))},children:"View logs"}),(0,n.jsx)(C.Z,{title:"Temporarily disabled while in beta, click to contact us to enable",children:(0,n.jsx)(F.Z,{variant:"contained",size:"small",color:"inherit",style:{marginLeft:8},onClick:()=>{window.location.href="mailto:inquiries@promptfoo.dev?subject=Promptfoo%20automatic%20vulnerability%20mitigation&body=Hello%20Promptfoo%20Team,%0D%0A%0D%0AI%20am%20interested%20in%20learning%20more%20about%20the%20automatic%20vulnerability%20mitigation%20beta.%20Please%20provide%20me%20with%20more%20details.%0D%0A%0D%0A"},children:"Apply mitigation"})})]})]},t)})})]}),a.length>c&&(0,n.jsx)(en.Z,{rowsPerPageOptions:[10,25,50],component:"div",count:a.length,rowsPerPage:c,page:s,onPageChange:(e,t)=>{l(t)},onRowsPerPageChange:e=>{d(parseInt(e.target.value,10)),l(0)}})]})]})};i(67667);var ed=()=>{let[e,t]=r.useState(null),[i,a]=r.useState(null);if(r.useEffect(()=>{let e=async e=>{let t=await fetch("".concat(await (0,l.b)(),"/api/results/").concat(e),{cache:"no-store"}),i=await t.json();a(i.data)},i=new URLSearchParams(window.location.search);if(!i)return;let s=i.get("evalId");s&&(t(s),e(s))},[]),r.useEffect(()=>{document.title="Report: ".concat((null==i?void 0:i.config.description)||e||"Red Team"," | promptfoo")},[i,e]),!i||!e)return(0,n.jsx)(o.Z,{sx:{width:"100%",textAlign:"center"},children:"Loading..."});let s=i.results.table.head.prompts[0],p=i.results.table.body,g=i.results.results.reduce((e,t)=>{var i,a,s,n,r,l,o,c;let d=t.vars.harmCategory,m=(null===(a=t.gradingResult)||void 0===a?void 0:null===(i=a.componentResults)||void 0===i?void 0:i.map(e=>{var t;return null===(t=e.assertion)||void 0===t?void 0:t.metric}))||[],u=[d,...m].filter(e=>e);for(let i of u){if("string"!=typeof i)continue;let a=y[i.split("/")[0]];if(!a){console.log("Unknown harm category:",i);break}let d=null===(n=t.gradingResult)||void 0===n?void 0:null===(s=n.componentResults)||void 0===s?void 0:s.some(e=>{var t;let i=(null===(t=e.assertion)||void 0===t?void 0:t.type)==="moderation",a=e.pass;return i&&a}),m=null===(l=t.gradingResult)||void 0===l?void 0:null===(r=l.componentResults)||void 0===r?void 0:r.some(e=>{var t,i;let a=(null===(t=e.assertion)||void 0===t?void 0:t.type)==="llm-rubric"||(null===(i=e.assertion)||void 0===i?void 0:i.type.startsWith("promptfoo:redteam")),s=e.pass;return a&&s}),u=null===(c=t.gradingResult)||void 0===c?void 0:null===(o=c.componentResults)||void 0===o?void 0:o.some(e=>{var t;let i=(null===(t=e.assertion)||void 0===t?void 0:t.type)==="human",a=e.pass;return i&&a});e[a]=e[a]||{pass:0,total:0,passWithFilter:0},e[a].total++,m||u?(e[a].pass++,e[a].passWithFilter++):!d&&e[a].passWithFilter++}return e},{});return(0,n.jsx)(m.Z,{children:(0,n.jsxs)(u.Z,{spacing:4,pb:8,pt:2,children:[(0,n.jsxs)(c.Z,{className:"report-header",sx:{position:"relative"},children:[(0,n.jsxs)(o.Z,{sx:{position:"absolute",top:8,right:8,display:"flex"},children:[(0,n.jsx)(L,{evalDescription:i.config.description||e}),(0,n.jsx)(W,{})]}),(0,n.jsxs)(h.Z,{variant:"h4",children:[(0,n.jsx)("strong",{children:"LLM Risk Assessment"}),i.config.description&&": ".concat(i.config.description)]}),(0,n.jsx)(h.Z,{variant:"subtitle1",mb:2,children:new Date(i.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}),(0,n.jsxs)(o.Z,{className:"report-details",children:[(0,n.jsx)(d.Z,{size:"small",label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:"Model:"})," ",s.provider]})}),(0,n.jsx)(d.Z,{size:"small",label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:"Dataset:"})," ",p.length," probes"]})}),(0,n.jsx)(d.Z,{size:"small",label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:"Prompt:"}),' "',s.raw.length>40?"".concat(s.raw.substring(0,40),"..."):s.raw,'"']})})]})]}),(0,n.jsx)(k,{categoryStats:g}),(0,n.jsx)(Y,{categoryStats:g}),(0,n.jsx)(ec,{evalId:e,categoryStats:g})]})})}},4309:function(){},67667:function(){},46553:function(){},32991:function(){},93091:function(){}},function(e){e.O(0,[949,799,903,916,493,304,374,969,378,476,216,944,470,730,744],function(){return e(e.s=58004)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[413],{8458:function(e,t,n){Promise.resolve().then(n.bind(n,83013))},83013:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return eu}});var a=n(24004),r=n(14978),i=n(69179),l=n(47887),s=n(49567),o=n(40982),c=n(11520),d=n(29794),p=n(22701),u=n(51956),h=n(8541),x=n(82669),m=n(32414),f=n(63147),j=n(75307),v=n(63346),g=n(89235),Z=n(4078),b=n(67339),y=()=>{let{env:e,setEnv:t}=(0,l.o)(),[n,i]=(0,r.useState)(!1),[s,c]=(0,r.useState)(e),h=()=>{i(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Z,{variant:"outlined",startIcon:(0,a.jsx)(j.Z,{}),onClick:()=>{i(!0)},children:"API keys"}),(0,a.jsxs)(d.Z,{open:n,onClose:h,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Provider settings"}),(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(v.Z,{defaultExpanded:!0,children:[(0,a.jsx)(Z.Z,{children:"OpenAI"}),(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(b.Z,{label:"OpenAI API key",fullWidth:!0,margin:"normal",value:s.OPENAI_API_KEY,onChange:e=>c({...s,OPENAI_API_KEY:e.target.value})}),(0,a.jsx)(b.Z,{label:"OpenAI API host",fullWidth:!0,margin:"normal",value:s.OPENAI_API_HOST,onChange:e=>c({...s,OPENAI_API_HOST:e.target.value})}),(0,a.jsx)(b.Z,{label:"OpenAI organization",fullWidth:!0,margin:"normal",value:s.OPENAI_ORGANIZATION,onChange:e=>c({...s,OPENAI_ORGANIZATION:e.target.value})})]})]}),(0,a.jsxs)(v.Z,{children:[(0,a.jsx)(Z.Z,{children:"Azure"}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Azure API key",fullWidth:!0,margin:"normal",value:s.AZURE_OPENAI_API_KEY,onChange:e=>c({...s,AZURE_OPENAI_API_KEY:e.target.value})})})]}),(0,a.jsxs)(v.Z,{children:[(0,a.jsx)(Z.Z,{children:"Amazon Bedrock"}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Bedrock Region",fullWidth:!0,margin:"normal",value:s.AWS_BEDROCK_REGION,onChange:e=>c({...s,AWS_BEDROCK_REGION:e.target.value})})})]}),(0,a.jsxs)(v.Z,{children:[(0,a.jsx)(Z.Z,{children:"Anthropic"}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Anthropic API key",fullWidth:!0,margin:"normal",value:s.ANTHROPIC_API_KEY,onChange:e=>c({...s,ANTHROPIC_API_KEY:e.target.value})})})]}),(0,a.jsxs)(v.Z,{children:[(0,a.jsx)(Z.Z,{children:"Google Vertex AI"}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Vertex API Key",fullWidth:!0,margin:"normal",value:s.VERTEX_API_KEY,onChange:e=>c({...s,VERTEX_API_KEY:e.target.value})})}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Vertex Project ID",fullWidth:!0,margin:"normal",value:s.VERTEX_PROJECT_ID,onChange:e=>c({...s,VERTEX_PROJECT_ID:e.target.value})})}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Vertex Region",fullWidth:!0,margin:"normal",value:s.VERTEX_REGION,onChange:e=>c({...s,VERTEX_REGION:e.target.value})})})]}),(0,a.jsxs)(v.Z,{children:[(0,a.jsx)(Z.Z,{children:"Replicate"}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Replicate API key",fullWidth:!0,margin:"normal",value:s.REPLICATE_API_KEY,onChange:e=>c({...s,REPLICATE_API_KEY:e.target.value})})})]})]}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(o.Z,{onClick:h,color:"primary",children:"Cancel"}),(0,a.jsx)(o.Z,{onClick:()=>{t(s),h()},color:"primary",variant:"contained",children:"Save"})]})]})]})},_=n(35185),C=n(5592),A=n(14931),k=n(2185),E=n(77656),I=n(65068),O=n(70417),S=n(21303),P=n(61451),T=n(30021),w=n(65969),R=e=>{let{open:t,prompt:n,index:i,onAdd:l,onCancel:s}=e,[c,h]=r.useState(n),m=r.useRef(null);r.useEffect(()=>{h(n)},[n]);let f=e=>{l(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(i+1)}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(b.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)(o.Z,{onClick:f.bind(null,!0),color:"primary",variant:"contained",disabled:!c.length,children:"Add"}),(0,a.jsx)(o.Z,{onClick:f.bind(null,!1),color:"primary",variant:"contained",disabled:!c.length,children:"Add Another"}),(0,a.jsx)(o.Z,{onClick:s,color:"secondary",children:"Cancel"})]})]})};n(94499);var W=()=>{let[e,t]=(0,r.useState)(!1),[n,i]=(0,r.useState)(null),{prompts:s,setPrompts:c}=(0,l.o)(),d=(0,r.useRef)(null);(0,r.useEffect)(()=>{null!==n&&n>0&&d.current&&d.current.focus()},[n]);let p=e=>{i(e),t(!0)},u=(e,t)=>{e.stopPropagation();let n=s[t];c([...s,n])},h=(e,t)=>{c(s.map((n,a)=>a===e?t:n))},x=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to remove this prompt?")&&c(s.filter((e,n)=>n!==t))};return(0,a.jsxs)("div",{children:[(0,a.jsxs)(m.Z,{direction:"row",spacing:2,mb:2,justifyContent:"space-between",children:[(0,a.jsx)(f.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)(k.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&&c([...s,a])},e.readAsText(n)}},style:{display:"none"}})]})})}),(0,a.jsx)(o.Z,{color:"primary",onClick:()=>{t(!0)},variant:"contained",children:"Add Prompt"})]})]}),(0,a.jsx)(P.Z,{children:(0,a.jsx)(I.Z,{children:(0,a.jsx)(O.Z,{children:0===s.length?(0,a.jsx)(T.Z,{children:(0,a.jsx)(S.Z,{colSpan:2,align:"center",children:"No prompts added yet."})}):s.map((e,t)=>(0,a.jsxs)(T.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>p(t),children:[(0,a.jsx)(S.Z,{children:(0,a.jsxs)(f.Z,{variant:"body2",children:["Prompt #".concat(t+1,": "),(e.length>250?e.slice(0,250)+" ...":e).split(/({{\w+}})/g).map((e,t)=>/{{\s*(\w+)\s*}}/g.test(e)?(0,a.jsx)("span",{className:"prompt-var-highlight",children:e},t):e)]})}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>p(t),size:"small",children:(0,a.jsx)(A.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>u(e,t),size:"small",children:(0,a.jsx)(_.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(C.Z,{})})]})]},t))})})}),(0,a.jsx)(R,{open:e,prompt:null!==n?s[n]:"",index:null!==n?n:0,onAdd:e=>{null!==n?h(n,e):c([...s,e]),i(null)},onCancel:()=>{i(null),t(!1)}})]})},N=n(77155),z=n(885),F=e=>{let{onChange:t,...n}=e,[i,l]=r.useState(""),[s,o]=r.useState(!1);return(0,a.jsx)(b.Z,{...n,error:s,helperText:s?"Invalid JSON":"",value:i,onChange:e=>{let n=e.target.value;try{let e=JSON.parse(n);l(n),o(!1),t&&t(e)}catch(e){l(n),o(!0)}}})},V=e=>{let{open:t,providerId:n,config:i,onClose:l,onSave:c}=e,[h,m]=r.useState(i);return r.useEffect(()=>{m(i)},[i]),(0,a.jsxs)(d.Z,{open:t,onClose:l,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)(b.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)(F,{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)(o.Z,{onClick:l,children:"Cancel"}),(0,a.jsx)(o.Z,{onClick:()=>{c(h)},children:"Save"})]})]})};let L=[].concat(["openai:gpt-4o","openai:gpt-4o-2024-05-13","openai:gpt-4o-mini","openai:gpt-4o-mini-2024-07-18","openai:gpt-4-turbo","openai:gpt-4","openai:gpt-3.5-turbo"].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(["anthropic:messages:claude-3-5-sonnet-20240620","anthropic:messages:claude-3-haiku-20240307","anthropic:messages:claude-3-sonnet-20240229","anthropic:messages:claude-3-opus-20240229"].map(e=>({id:e,config:{max_tokens:1024,temperature:.5}}))).concat(["bedrock:anthropic.claude-3-haiku-20240307-v1:0","bedrock:anthropic.claude-3-sonnet-20240229-v1:0","bedrock:anthropic.claude-3-opus-20240307-v1:0"].map(e=>({id:e,config:{max_tokens_to_sample:256,temperature:.5}}))).concat(["azureopenai:gpt-4o-2024-05-13","azureopenai:gpt-4-turbo-2024-04-09","azureopenai:gpt-4-32k-0613","azureopenai:gpt-4-0613","azureopenai:gpt-35-turbo-0125"].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}}))).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_penalty:1,system_prompt:""}}))).concat(["replicate:mistralai/mistral-7b-v0.1","replicate:mistralai/mistral-7b-instruct-v0.2","replicate:mistralai/mixtral-8x7b-instruct-v0.1"].map(e=>({id:e,config:{temperature:.7,top_p:.9,top_k:-1,max_new_tokens:128,min_new_tokens:-1,repetition_penalty:1.15,prompt_template:"{prompt}"}}))).sort((e,t)=>e.id.localeCompare(t.id)),U={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)(N.Z,{multiple:!0,freeSolo:!0,options:L,value:t,groupBy:e=>(function(e){if(!e)return"Other";let t=e.split(":")[0];return U[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.length>2&&"anthropic"===n[0]?n[2]:n[1]:"Unknown provider"},renderTags:(e,t)=>e.map((e,n)=>{let a=o(e),i=c(e,n);return(0,r.createElement)(z.Z,{variant:"outlined",label:a,...t({index:n}),key:i,onClick:()=>d(e)})}),renderInput:e=>(0,a.jsx)(b.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)(V,{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)}}})]})},B=n(52428),K=n(11615),Y=n(28891),D=()=>{let e=(0,Y.useRouter)(),{defaultTest:t,description:n,env:i,evaluateOptions:s,prompts:c,providers:d,scenarios:p,testCases:u}=(0,l.o)(),[h,x]=(0,r.useState)(!1),[m,f]=(0,r.useState)(0),j=async()=>{x(!0);try{let a=await fetch("".concat(B.eA,"/api/eval/job/"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultTest:t,description:n,env:i,evaluateOptions:s,prompts:c,providers:d,scenarios:p,tests:u})});if(!a.ok)throw Error("HTTP error! status: ".concat(a.status));let r=await a.json(),l=setInterval(async()=>{let t=await fetch("".concat(B.eA,"/api/eval/job/").concat(r.id,"/"));if(!t.ok)throw clearInterval(l),Error("HTTP error! status: ".concat(t.status));let n=await t.json();if("complete"===n.status)clearInterval(l),x(!1),B.Ox?e.push("/eval/remote:".concat(encodeURIComponent(r.id))):e.push("/eval");else if("failed"===n.status)throw clearInterval(l),x(!1),Error("Job failed");else{let e=0===n.total?0:Math.round(n.progress/n.total*100);f(e)}},1e3)}catch(e){console.error(e),x(!1),alert("An error occurred: ".concat(e.message))}};return(0,a.jsx)(o.Z,{variant:"contained",color:"primary",onClick:j,disabled:h,children:h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(K.Z,{size:24,sx:{marginRight:2}}),m.toFixed(0),"% complete"]}):"Run Evaluation"})},J=n(15320),M=n(26485);let X=["equals","contains","icontains","contains-all","contains-any","starts-with","regex","is-json","contains-json","is-sql","contains-sql","similar","llm-rubric","model-graded-closedqa","factuality","webhook","rouge-n","rouge-s","rouge-l","not-equals","not-contains","not-icontains","not-contains-all","not-contains-any","not-starts-with","not-regex","not-is-json","not-contains-json","not-similar","not-webhook","not-rouge-n","not-rouge-s","not-rouge-l","is-valid-openai-function-call","is-valid-openai-tools-call","latency","perplexity","perplexity-score","cost","answer-relevance","context-faithfulness","context-recall","context-relevance","select-best","moderation"];var G=e=>{let{onAdd:t,initialValues:n}=e,[i,l]=(0,r.useState)(n||[]),c=e=>{let n=i.filter((t,n)=>n!==e);l(n),t(n)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.Z,{variant:"h6",children:"Asserts"}),(0,a.jsx)(s.Z,{my:i.length>0?2:0,children:(0,a.jsx)(m.Z,{direction:"column",spacing:2,children:i.map((e,n)=>(0,a.jsxs)(m.Z,{direction:"row",spacing:2,alignItems:"center",children:[(0,a.jsx)(N.Z,{value:e.type,options:X,sx:{minWidth:200},onChange:(e,a)=>{let r=i.map((e,t)=>t===n?{...e,type:a}:e);l(r),t(r)},renderInput:e=>(0,a.jsx)(b.Z,{...e,label:"Type"})}),(0,a.jsx)(b.Z,{label:"Value",value:e.value,fullWidth:!0,onChange:e=>{let a=e.target.value,r=i.map((e,t)=>t===n?{...e,value:a}:e);l(r),t(r)}}),(0,a.jsx)(E.Z,{onClick:()=>c(n),size:"small",children:(0,a.jsx)(C.Z,{})})]},n))})}),(0,a.jsx)(o.Z,{color:"primary",onClick:()=>{let e=[...i,{type:"equals",value:""}];l(e),t(e)},children:"Add Assert"})]})},H=e=>{let{onAdd:t,varsList:n,initialValues:i}=e,[l,o]=r.useState(i||{});return(0,r.useEffect)(()=>{let e={};n.forEach(t=>{e[t]=(null==i?void 0:i[t])||""}),o(e)},[n,i]),(0,a.jsxs)(s.Z,{my:2,children:[(0,a.jsx)(f.Z,{variant:"h6",mb:2,children:"Vars"}),n.length>0?(0,a.jsx)(m.Z,{direction:"row",spacing:2,alignItems:"center",children:Object.keys(l).map((e,n)=>(0,a.jsx)(m.Z,{direction:"row",spacing:2,alignItems:"center",children:(0,a.jsx)(b.Z,{placeholder:e,label:e,value:l[e],fullWidth:!0,onChange:n=>{let a=n.target.value,r={...l,[e]:a};o(r),t(r)}})},n))}):(0,a.jsxs)(f.Z,{variant:"subtitle1",gutterBottom:!0,children:["Add variables to your prompt using the ","{{varname}}"," syntax."]})]})},$=e=>{let{open:t,onAdd:n,varsList:i,initialValues:l,onCancel:c}=e,[h,m]=(0,r.useState)((null==l?void 0:l.description)||""),[f,j]=(0,r.useState)((null==l?void 0:l.vars)||{}),[v,g]=(0,r.useState)((null==l?void 0:l.assert)||[]),[Z,b]=(0,r.useState)(0);r.useEffect(()=>{l?(m(l.description||""),j(l.vars||{}),g(l.assert||[])):(m(""),j({}),g([]))},[l]);let y=e=>{n({description:h,vars:f,assert:v},e),e&&c(),m(""),j({}),g([]),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:l?"Edit Test Case":"Add Test Case"}),(0,a.jsx)(u.Z,{children:(0,a.jsxs)(s.Z,{children:[(0,a.jsx)(H,{onAdd:e=>j(e),varsList:i,initialValues:null==l?void 0:l.vars}),(0,a.jsx)(G,{onAdd:e=>g(e),initialValues:((null==l?void 0:l.assert)||[]).filter(e=>"assert-set"!==e.type)||[]},Z)]})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(o.Z,{onClick:y.bind(void 0,!0),color:"primary",variant:"contained",children:l?"Update Test Case":"Add Test Case"}),!l&&(0,a.jsx)(o.Z,{onClick:y.bind(void 0,!1),color:"primary",variant:"contained",children:"Add Another"}),(0,a.jsx)(o.Z,{onClick:c,color:"secondary",children:"Cancel"})]})]})},Q=e=>{let{varsList:t}=e,{testCases:i,setTestCases:s}=(0,l.o)(),[c,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?")&&s(i.filter((e,n)=>n!==t))},x=(e,t)=>{e.stopPropagation();let n=JSON.parse(JSON.stringify(i[t]));s([...i,n])};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(m.Z,{direction:"row",spacing:2,mb:2,justifyContent:"space-between",children:[(0,a.jsx)(f.Z,{variant:"h5",children:"Test Cases"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-test-case",children:(0,a.jsx)(w.Z,{title:"Upload test cases from csv",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(k.Z,{})}),(0,a.jsx)("input",{id:"file-input-add-test-case",type:"file",accept:".csv",onChange:e=>{var t;e.stopPropagation(),e.preventDefault();let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a){let e=new FileReader;e.onload=async e=>{var t,a;let r=null===(a=e.target)||void 0===a?void 0:null===(t=a.result)||void 0===t?void 0:t.toString();if(r){let{parse:e}=await Promise.all([n.e(631),n.e(887)]).then(n.bind(n,83887)),t=e(r,{columns:!0}),a=t.map(e=>(0,J.It)(e));s([...i,...a])}},e.readAsText(a)}},style:{display:"none"}})]})})}),(0,a.jsx)(o.Z,{color:"primary",onClick:()=>u(!0),variant:"contained",children:"Add Test Case"})]})]}),(0,a.jsx)(P.Z,{children:(0,a.jsxs)(I.Z,{children:[(0,a.jsx)(M.Z,{children:(0,a.jsxs)(T.Z,{children:[(0,a.jsx)(S.Z,{children:"Description"}),(0,a.jsx)(S.Z,{children:"Assertions"}),(0,a.jsx)(S.Z,{children:"Variables"}),(0,a.jsx)(S.Z,{align:"right"})]})}),(0,a.jsx)(O.Z,{children:0===i.length?(0,a.jsx)(T.Z,{children:(0,a.jsx)(S.Z,{colSpan:4,align:"center",children:"No test cases added yet."})}):i.map((e,t)=>{var n;return(0,a.jsxs)(T.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>{d(t),u(!0)},children:[(0,a.jsx)(S.Z,{children:(0,a.jsx)(f.Z,{variant:"body2",children:e.description||"Test Case #".concat(t+1)})}),(0,a.jsxs)(S.Z,{children:[(null===(n=e.assert)||void 0===n?void 0:n.length)||0," assertions"]}),(0,a.jsx)(S.Z,{children:Object.entries(e.vars||{}).map(e=>{let[t,n]=e;return t+"="+n}).join(", ")}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>{d(t),u(!0)},size:"small",children:(0,a.jsx)(A.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(_.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(C.Z,{})})]})]},t)})})]})}),(0,a.jsx)($,{open:p,onAdd:(e,t)=>{if(null===c)s([...i,e]);else{let t=i.map((t,n)=>n===c?e:t);s(t),d(null)}t&&u(!1)},varsList:t,initialValues:null!==c?i[c]:void 0,onCancel:()=>{d(null),u(!1)}})]})},ee=n(71911),et=n.n(ee),en=n(93522),ea=n(68833),er=n(92863),ei=n(34235),el=n(38640),es=n.n(el),eo=n(29270);n(54492),n(55096),n(93486);var ec=()=>{let e="dark"===(0,er.Z)().palette.mode,{defaultTest:t,setDefaultTest:n,description:i,setDescription:c,env:d,setEnv:p,evaluateOptions:u,setEvaluateOptions:h,prompts:x,setPrompts:m,providers:j,setProviders:v,scenarios:g,setScenarios:Z,testCases:b,setTestCases:y}=(0,l.o)(),[_,C]=r.useState(""),[k,E]=r.useState(!0),I=e=>{n(e.defaultTest||{}),c(e.description||""),p(e.env||{}),h(e.evaluateOptions||{}),m(e.prompts||[]),v(e.providers||[]),Z(e.scenarios||[]),y(e.tests||[])};return r.useEffect(()=>{C(ei.default.dump({defaultTest:t,description:i,env:d,evaluateOptions:u,prompts:x,providers:j,scenarios:g,tests:b}))},[t,i,d,u,x,j,g,b]),(0,a.jsxs)(s.Z,{mt:4,children:[(0,a.jsx)(f.Z,{variant:"h5",gutterBottom:!0,children:"Configuration"}),(0,a.jsxs)(f.Z,{variant:"body1",gutterBottom:!0,children:["This is the YAML config that defines the evaluation and is processed by promptfoo. See"," ",(0,a.jsx)(es(),{target:"_blank",href:"https://promptfoo.dev/docs/configuration/guide",children:"configuration docs"})," ","to learn more."]}),(0,a.jsxs)(s.Z,{display:"flex",gap:2,mb:2,children:[(0,a.jsx)(o.Z,{variant:"text",color:"primary",startIcon:k?(0,a.jsx)(A.Z,{}):(0,a.jsx)(en.Z,{}),onClick:()=>{if(!k)try{let e=ei.default.load(_,{json:!0});I(e)}catch(e){}E(!k)},children:k?"Edit YAML":"Save"}),(0,a.jsxs)(o.Z,{variant:"text",color:"primary",startIcon:(0,a.jsx)(ea.Z,{}),component:"label",children:["Upload YAML",(0,a.jsx)("input",{type:"file",hidden:!0,accept:".yaml,.yml",onChange:e=>{var t;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;let n=null===(t=e.target)||void 0===t?void 0:t.result;C(n);try{let e=ei.default.load(n,{json:!0});I(e)}catch(e){console.error("Error parsing uploaded YAML:",e)}},e.readAsText(n)}}})]})]}),(0,a.jsx)(et(),{autoCapitalize:"off",value:_,onValueChange:e=>{k||C(e)},highlight:e=>(0,eo.highlight)(e,eo.languages.yaml),padding:10,style:{backgroundColor:e?"#1e1e1e":"#fff",fontFamily:'"Fira code", "Fira Mono", monospace',fontSize:14},disabled:k,className:k?"":"glowing-border"})]})};n(7517);var ed=n(77580);function ep(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 eu=()=>{let[e,t]=(0,r.useState)(!1),{description:n,setDescription:j,providers:v,setProviders:g,prompts:Z,setPrompts:b,testCases:_,setTestCases:C}=(0,l.o)();if((0,r.useEffect)(()=>{l.o.persist.rehydrate()},[]),ed.env.NEXT_PUBLIC_NO_BROWSING)return null;let A=(e=>{let t=/{{\s*(\w+)\s*}}/g,n=new Set;return e.forEach(e=>{let a;for(;null!==(a=t.exec(e));)n.add(a[1])}),Array.from(n)})(Z);return(0,a.jsxs)(c.Z,{maxWidth:"lg",sx:{marginTop:"2rem"},children:[(0,a.jsxs)(m.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(f.Z,{variant:"h4",children:"Set up an evaluation"}),(0,a.jsxs)(m.Z,{direction:"row",spacing:2,children:[(0,a.jsx)(D,{}),(0,a.jsx)(y,{}),(0,a.jsx)(o.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)(i.SV,{FallbackComponent:ep,onReset:()=>{g([])},children:(0,a.jsxs)(m.Z,{direction:"column",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(f.Z,{variant:"h5",children:"Providers"}),(0,a.jsx)(q,{providers:v,onChange:g})]})})}),(0,a.jsx)(s.Z,{mt:4}),(0,a.jsx)(i.SV,{FallbackComponent:ep,onReset:()=>{b([])},children:(0,a.jsx)(W,{})}),(0,a.jsx)(s.Z,{mt:6}),(0,a.jsx)(i.SV,{FallbackComponent:ep,onReset:()=>{C([])},children:(0,a.jsx)(Q,{varsList:A})}),(0,a.jsx)(ec,{}),(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)(o.Z,{onClick:()=>t(!1),children:"Cancel"}),(0,a.jsx)(o.Z,{onClick:()=>{j(""),g([]),b([]),C([]),t(!1)},autoFocus:!0,children:"Reset"})]})]})]})}},52428:function(e,t,n){"use strict";n.d(t,{Ox:function(){return i},T8:function(){return r},eA:function(){return l}});var a=n(77580);let r=!a.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,i=!!a.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,l=""},47887:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var a=n(79685),r=n(74595);let i=(0,a.Ue)()((0,r.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],defaultTest:{},evaluateOptions:{},scenarios:[],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}),setDefaultTest:t=>e({defaultTest:t}),setEvaluateOptions:t=>e({evaluateOptions:t}),setScenarios:t=>e({scenarios: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=>"string"==typeof e&&!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),t.defaultTest&&(n.defaultTest=t.defaultTest),t.evaluateOptions&&(n.evaluateOptions=t.evaluateOptions),t.scenarios&&(n.scenarios=t.scenarios),e(n)},getTestSuite:()=>{let{description:e,testCases:n,providers:a,prompts:r,env:i,scenarios:l}=t();return{env:i,description:e,providers:a,prompts:r,tests:n,scenarios:l}}}),{name:"promptfoo",skipHydration:!0}))},94499:function(){},55096:function(){},7517:function(){},15320:function(e,t){"use strict";t.It=function(e){let t,n,a,r;let i={},l=[],s={};for(let[o,c]of Object.entries(e))o.startsWith("__expected")?""!==c.trim()&&l.push(function(e){if(e.startsWith("javascript:")||e.startsWith("fn:")||e.startsWith("eval:")){let t;e.startsWith("javascript:")&&(t=11),e.startsWith("fn:")&&(t=3),e.startsWith("eval:")&&(t=5);let n=e.slice(t).trim();return{type:"javascript",value:n}}if(e.startsWith("grade:")||e.startsWith("llm-rubric:"))return{type:"llm-rubric",value:e.slice(6)};if(e.startsWith("python:")){let t=e.slice(7).trim();return{type:"python",value:t}}let t=e.match(/^(not-)?(equals|contains-any|contains-all|icontains-any|icontains-all|contains-json|is-json|is-sql|regex|icontains|contains|webhook|rouge-n|similar|starts-with|levenshtein|classifier|model-graded-factuality|factuality|model-graded-closedqa|answer-relevance|context-recall|context-relevance|context-faithfulness|is-valid-openai-function-call|is-valid-openai-tools-call|latency|perplexity|perplexity-score|cost)(?:\((\d+(?:\.\d+)?)\))?(?::([\s\S]*))?$/);if(t){let[e,n,a,r,i]=t,l=n?`not-${a}`:a,s=parseFloat(r);return"contains-any"===a||"contains-all"===a||"icontains-any"===a||"icontains-all"===a?{type:l,value:i.split(",").map(e=>e.trim())}:"contains-json"===a||"is-json"===a?{type:l,value:i}:"rouge-n"===a||"similar"===a||"starts-with"===a||"levenshtein"===a||"classifier"===a||"answer-relevance"===a||"context-recall"===a||"context-relevance"===a||"context-faithfulness"===a||"latency"===a||"perplexity"===a||"perplexity-score"===a||"cost"===a?{type:l,value:i,threshold:s||("similar"===a?.8:.75)}:{type:l,value:i}}return{type:"equals",value:e}}(c)):"__prefix"===o?s.prefix=c:"__suffix"===o?s.suffix=c:"__description"===o?n=c:"__providerOutput"===o?t=c:"__metric"===o?a=c:"__threshold"===o?r=parseFloat(c):i[o]=c;for(let e of l)e.metric=a;return{vars:i,assert:l,options:s,...n?{description:n}:{},...t?{providerOutput:t}:{},...r?{threshold:r}:{}}}}},function(e){e.O(0,[903,640,916,493,304,281,339,969,378,235,476,905,155,902,470,730,744],function(){return e(e.s=8458)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[413],{8458:function(e,t,n){Promise.resolve().then(n.bind(n,83013))},83013:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return eu}});var a=n(24004),r=n(14978),i=n(69179),l=n(47887),s=n(49567),o=n(40982),c=n(11520),d=n(29794),p=n(22701),u=n(51956),h=n(8541),x=n(82669),m=n(32414),f=n(63147),j=n(75307),v=n(63346),g=n(89235),Z=n(4078),b=n(67339),y=()=>{let{env:e,setEnv:t}=(0,l.o)(),[n,i]=(0,r.useState)(!1),[s,c]=(0,r.useState)(e),h=()=>{i(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Z,{variant:"outlined",startIcon:(0,a.jsx)(j.Z,{}),onClick:()=>{i(!0)},children:"API keys"}),(0,a.jsxs)(d.Z,{open:n,onClose:h,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Provider settings"}),(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(v.Z,{defaultExpanded:!0,children:[(0,a.jsx)(Z.Z,{children:"OpenAI"}),(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(b.Z,{label:"OpenAI API key",fullWidth:!0,margin:"normal",value:s.OPENAI_API_KEY,onChange:e=>c({...s,OPENAI_API_KEY:e.target.value})}),(0,a.jsx)(b.Z,{label:"OpenAI API host",fullWidth:!0,margin:"normal",value:s.OPENAI_API_HOST,onChange:e=>c({...s,OPENAI_API_HOST:e.target.value})}),(0,a.jsx)(b.Z,{label:"OpenAI organization",fullWidth:!0,margin:"normal",value:s.OPENAI_ORGANIZATION,onChange:e=>c({...s,OPENAI_ORGANIZATION:e.target.value})})]})]}),(0,a.jsxs)(v.Z,{children:[(0,a.jsx)(Z.Z,{children:"Azure"}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Azure API key",fullWidth:!0,margin:"normal",value:s.AZURE_OPENAI_API_KEY,onChange:e=>c({...s,AZURE_OPENAI_API_KEY:e.target.value})})})]}),(0,a.jsxs)(v.Z,{children:[(0,a.jsx)(Z.Z,{children:"Amazon Bedrock"}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Bedrock Region",fullWidth:!0,margin:"normal",value:s.AWS_BEDROCK_REGION,onChange:e=>c({...s,AWS_BEDROCK_REGION:e.target.value})})})]}),(0,a.jsxs)(v.Z,{children:[(0,a.jsx)(Z.Z,{children:"Anthropic"}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Anthropic API key",fullWidth:!0,margin:"normal",value:s.ANTHROPIC_API_KEY,onChange:e=>c({...s,ANTHROPIC_API_KEY:e.target.value})})})]}),(0,a.jsxs)(v.Z,{children:[(0,a.jsx)(Z.Z,{children:"Google Vertex AI"}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Vertex API Key",fullWidth:!0,margin:"normal",value:s.VERTEX_API_KEY,onChange:e=>c({...s,VERTEX_API_KEY:e.target.value})})}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Vertex Project ID",fullWidth:!0,margin:"normal",value:s.VERTEX_PROJECT_ID,onChange:e=>c({...s,VERTEX_PROJECT_ID:e.target.value})})}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Vertex Region",fullWidth:!0,margin:"normal",value:s.VERTEX_REGION,onChange:e=>c({...s,VERTEX_REGION:e.target.value})})})]}),(0,a.jsxs)(v.Z,{children:[(0,a.jsx)(Z.Z,{children:"Replicate"}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(b.Z,{label:"Replicate API key",fullWidth:!0,margin:"normal",value:s.REPLICATE_API_KEY,onChange:e=>c({...s,REPLICATE_API_KEY:e.target.value})})})]})]}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(o.Z,{onClick:h,color:"primary",children:"Cancel"}),(0,a.jsx)(o.Z,{onClick:()=>{t(s),h()},color:"primary",variant:"contained",children:"Save"})]})]})]})},_=n(35185),C=n(5592),A=n(14931),k=n(2185),E=n(77656),I=n(65068),O=n(70417),S=n(21303),P=n(61451),T=n(30021),w=n(65969),R=e=>{let{open:t,prompt:n,index:i,onAdd:l,onCancel:s}=e,[c,h]=r.useState(n),m=r.useRef(null);r.useEffect(()=>{h(n)},[n]);let f=e=>{l(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(i+1)}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(b.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)(o.Z,{onClick:f.bind(null,!0),color:"primary",variant:"contained",disabled:!c.length,children:"Add"}),(0,a.jsx)(o.Z,{onClick:f.bind(null,!1),color:"primary",variant:"contained",disabled:!c.length,children:"Add Another"}),(0,a.jsx)(o.Z,{onClick:s,color:"secondary",children:"Cancel"})]})]})};n(94499);var W=()=>{let[e,t]=(0,r.useState)(!1),[n,i]=(0,r.useState)(null),{prompts:s,setPrompts:c}=(0,l.o)(),d=(0,r.useRef)(null);(0,r.useEffect)(()=>{null!==n&&n>0&&d.current&&d.current.focus()},[n]);let p=e=>{i(e),t(!0)},u=(e,t)=>{e.stopPropagation();let n=s[t];c([...s,n])},h=(e,t)=>{c(s.map((n,a)=>a===e?t:n))},x=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to remove this prompt?")&&c(s.filter((e,n)=>n!==t))};return(0,a.jsxs)("div",{children:[(0,a.jsxs)(m.Z,{direction:"row",spacing:2,mb:2,justifyContent:"space-between",children:[(0,a.jsx)(f.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)(k.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&&c([...s,a])},e.readAsText(n)}},style:{display:"none"}})]})})}),(0,a.jsx)(o.Z,{color:"primary",onClick:()=>{t(!0)},variant:"contained",children:"Add Prompt"})]})]}),(0,a.jsx)(P.Z,{children:(0,a.jsx)(I.Z,{children:(0,a.jsx)(O.Z,{children:0===s.length?(0,a.jsx)(T.Z,{children:(0,a.jsx)(S.Z,{colSpan:2,align:"center",children:"No prompts added yet."})}):s.map((e,t)=>(0,a.jsxs)(T.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>p(t),children:[(0,a.jsx)(S.Z,{children:(0,a.jsxs)(f.Z,{variant:"body2",children:["Prompt #".concat(t+1,": "),(e.length>250?e.slice(0,250)+" ...":e).split(/({{\w+}})/g).map((e,t)=>/{{\s*(\w+)\s*}}/g.test(e)?(0,a.jsx)("span",{className:"prompt-var-highlight",children:e},t):e)]})}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>p(t),size:"small",children:(0,a.jsx)(A.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>u(e,t),size:"small",children:(0,a.jsx)(_.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(C.Z,{})})]})]},t))})})}),(0,a.jsx)(R,{open:e,prompt:null!==n?s[n]:"",index:null!==n?n:0,onAdd:e=>{null!==n?h(n,e):c([...s,e]),i(null)},onCancel:()=>{i(null),t(!1)}})]})},N=n(77155),z=n(885),F=e=>{let{onChange:t,...n}=e,[i,l]=r.useState(""),[s,o]=r.useState(!1);return(0,a.jsx)(b.Z,{...n,error:s,helperText:s?"Invalid JSON":"",value:i,onChange:e=>{let n=e.target.value;try{let e=JSON.parse(n);l(n),o(!1),t&&t(e)}catch(e){l(n),o(!0)}}})},V=e=>{let{open:t,providerId:n,config:i,onClose:l,onSave:c}=e,[h,m]=r.useState(i);return r.useEffect(()=>{m(i)},[i]),(0,a.jsxs)(d.Z,{open:t,onClose:l,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)(b.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)(F,{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)(o.Z,{onClick:l,children:"Cancel"}),(0,a.jsx)(o.Z,{onClick:()=>{c(h)},children:"Save"})]})]})};let L=[].concat(["openai:gpt-4o","openai:gpt-4o-2024-05-13","openai:gpt-4o-mini","openai:gpt-4o-mini-2024-07-18","openai:gpt-4-turbo","openai:gpt-4","openai:gpt-3.5-turbo"].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(["anthropic:messages:claude-3-5-sonnet-20240620","anthropic:messages:claude-3-haiku-20240307","anthropic:messages:claude-3-sonnet-20240229","anthropic:messages:claude-3-opus-20240229"].map(e=>({id:e,config:{max_tokens:1024,temperature:.5}}))).concat(["bedrock:anthropic.claude-3-haiku-20240307-v1:0","bedrock:anthropic.claude-3-sonnet-20240229-v1:0","bedrock:anthropic.claude-3-opus-20240307-v1:0"].map(e=>({id:e,config:{max_tokens_to_sample:256,temperature:.5}}))).concat(["azureopenai:gpt-4o-2024-05-13","azureopenai:gpt-4-turbo-2024-04-09","azureopenai:gpt-4-32k-0613","azureopenai:gpt-4-0613","azureopenai:gpt-35-turbo-0125"].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}}))).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_penalty:1,system_prompt:""}}))).concat(["replicate:mistralai/mistral-7b-v0.1","replicate:mistralai/mistral-7b-instruct-v0.2","replicate:mistralai/mixtral-8x7b-instruct-v0.1"].map(e=>({id:e,config:{temperature:.7,top_p:.9,top_k:-1,max_new_tokens:128,min_new_tokens:-1,repetition_penalty:1.15,prompt_template:"{prompt}"}}))).sort((e,t)=>e.id.localeCompare(t.id)),U={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)(N.Z,{multiple:!0,freeSolo:!0,options:L,value:t,groupBy:e=>(function(e){if(!e)return"Other";let t=e.split(":")[0];return U[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.length>2&&"anthropic"===n[0]?n[2]:n[1]:"Unknown provider"},renderTags:(e,t)=>e.map((e,n)=>{let a=o(e),i=c(e,n);return(0,r.createElement)(z.Z,{variant:"outlined",label:a,...t({index:n}),key:i,onClick:()=>d(e)})}),renderInput:e=>(0,a.jsx)(b.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)(V,{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)}}})]})},B=n(52428),K=n(11615),Y=n(28891),D=()=>{let e=(0,Y.useRouter)(),{defaultTest:t,description:n,env:i,evaluateOptions:s,prompts:c,providers:d,scenarios:p,testCases:u}=(0,l.o)(),[h,x]=(0,r.useState)(!1),[m,f]=(0,r.useState)(0),j=async()=>{x(!0);try{let a=await fetch("".concat(B.eA,"/api/eval/job/"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultTest:t,description:n,env:i,evaluateOptions:s,prompts:c,providers:d,scenarios:p,tests:u})});if(!a.ok)throw Error("HTTP error! status: ".concat(a.status));let r=await a.json(),l=setInterval(async()=>{let t=await fetch("".concat(B.eA,"/api/eval/job/").concat(r.id,"/"));if(!t.ok)throw clearInterval(l),Error("HTTP error! status: ".concat(t.status));let n=await t.json();if("complete"===n.status)clearInterval(l),x(!1),B.Ox?e.push("/eval/remote:".concat(encodeURIComponent(r.id))):e.push("/eval");else if("failed"===n.status)throw clearInterval(l),x(!1),Error("Job failed");else{let e=0===n.total?0:Math.round(n.progress/n.total*100);f(e)}},1e3)}catch(e){console.error(e),x(!1),alert("An error occurred: ".concat(e.message))}};return(0,a.jsx)(o.Z,{variant:"contained",color:"primary",onClick:j,disabled:h,children:h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(K.Z,{size:24,sx:{marginRight:2}}),m.toFixed(0),"% complete"]}):"Run Evaluation"})},J=n(15320),M=n(26485);let X=["equals","contains","icontains","contains-all","contains-any","starts-with","regex","is-json","contains-json","is-sql","contains-sql","similar","llm-rubric","model-graded-closedqa","factuality","webhook","rouge-n","rouge-s","rouge-l","not-equals","not-contains","not-icontains","not-contains-all","not-contains-any","not-starts-with","not-regex","not-is-json","not-contains-json","not-similar","not-webhook","not-rouge-n","not-rouge-s","not-rouge-l","is-valid-openai-function-call","is-valid-openai-tools-call","latency","perplexity","perplexity-score","cost","answer-relevance","context-faithfulness","context-recall","context-relevance","select-best","moderation"];var G=e=>{let{onAdd:t,initialValues:n}=e,[i,l]=(0,r.useState)(n||[]),c=e=>{let n=i.filter((t,n)=>n!==e);l(n),t(n)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.Z,{variant:"h6",children:"Asserts"}),(0,a.jsx)(s.Z,{my:i.length>0?2:0,children:(0,a.jsx)(m.Z,{direction:"column",spacing:2,children:i.map((e,n)=>(0,a.jsxs)(m.Z,{direction:"row",spacing:2,alignItems:"center",children:[(0,a.jsx)(N.Z,{value:e.type,options:X,sx:{minWidth:200},onChange:(e,a)=>{let r=i.map((e,t)=>t===n?{...e,type:a}:e);l(r),t(r)},renderInput:e=>(0,a.jsx)(b.Z,{...e,label:"Type"})}),(0,a.jsx)(b.Z,{label:"Value",value:e.value,fullWidth:!0,onChange:e=>{let a=e.target.value,r=i.map((e,t)=>t===n?{...e,value:a}:e);l(r),t(r)}}),(0,a.jsx)(E.Z,{onClick:()=>c(n),size:"small",children:(0,a.jsx)(C.Z,{})})]},n))})}),(0,a.jsx)(o.Z,{color:"primary",onClick:()=>{let e=[...i,{type:"equals",value:""}];l(e),t(e)},children:"Add Assert"})]})},H=e=>{let{onAdd:t,varsList:n,initialValues:i}=e,[l,o]=r.useState(i||{});return(0,r.useEffect)(()=>{let e={};n.forEach(t=>{e[t]=(null==i?void 0:i[t])||""}),o(e)},[n,i]),(0,a.jsxs)(s.Z,{my:2,children:[(0,a.jsx)(f.Z,{variant:"h6",mb:2,children:"Vars"}),n.length>0?(0,a.jsx)(m.Z,{direction:"row",spacing:2,alignItems:"center",children:Object.keys(l).map((e,n)=>(0,a.jsx)(m.Z,{direction:"row",spacing:2,alignItems:"center",children:(0,a.jsx)(b.Z,{placeholder:e,label:e,value:l[e],fullWidth:!0,onChange:n=>{let a=n.target.value,r={...l,[e]:a};o(r),t(r)}})},n))}):(0,a.jsxs)(f.Z,{variant:"subtitle1",gutterBottom:!0,children:["Add variables to your prompt using the ","{{varname}}"," syntax."]})]})},$=e=>{let{open:t,onAdd:n,varsList:i,initialValues:l,onCancel:c}=e,[h,m]=(0,r.useState)((null==l?void 0:l.description)||""),[f,j]=(0,r.useState)((null==l?void 0:l.vars)||{}),[v,g]=(0,r.useState)((null==l?void 0:l.assert)||[]),[Z,b]=(0,r.useState)(0);r.useEffect(()=>{l?(m(l.description||""),j(l.vars||{}),g(l.assert||[])):(m(""),j({}),g([]))},[l]);let y=e=>{n({description:h,vars:f,assert:v},e),e&&c(),m(""),j({}),g([]),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:l?"Edit Test Case":"Add Test Case"}),(0,a.jsx)(u.Z,{children:(0,a.jsxs)(s.Z,{children:[(0,a.jsx)(H,{onAdd:e=>j(e),varsList:i,initialValues:null==l?void 0:l.vars}),(0,a.jsx)(G,{onAdd:e=>g(e),initialValues:((null==l?void 0:l.assert)||[]).filter(e=>"assert-set"!==e.type)||[]},Z)]})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(o.Z,{onClick:y.bind(void 0,!0),color:"primary",variant:"contained",children:l?"Update Test Case":"Add Test Case"}),!l&&(0,a.jsx)(o.Z,{onClick:y.bind(void 0,!1),color:"primary",variant:"contained",children:"Add Another"}),(0,a.jsx)(o.Z,{onClick:c,color:"secondary",children:"Cancel"})]})]})},Q=e=>{let{varsList:t}=e,{testCases:i,setTestCases:s}=(0,l.o)(),[c,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?")&&s(i.filter((e,n)=>n!==t))},x=(e,t)=>{e.stopPropagation();let n=JSON.parse(JSON.stringify(i[t]));s([...i,n])};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(m.Z,{direction:"row",spacing:2,mb:2,justifyContent:"space-between",children:[(0,a.jsx)(f.Z,{variant:"h5",children:"Test Cases"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-test-case",children:(0,a.jsx)(w.Z,{title:"Upload test cases from csv",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(k.Z,{})}),(0,a.jsx)("input",{id:"file-input-add-test-case",type:"file",accept:".csv",onChange:e=>{var t;e.stopPropagation(),e.preventDefault();let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a){let e=new FileReader;e.onload=async e=>{var t,a;let r=null===(a=e.target)||void 0===a?void 0:null===(t=a.result)||void 0===t?void 0:t.toString();if(r){let{parse:e}=await Promise.all([n.e(631),n.e(887)]).then(n.bind(n,83887)),t=e(r,{columns:!0}),a=t.map(e=>(0,J.It)(e));s([...i,...a])}},e.readAsText(a)}},style:{display:"none"}})]})})}),(0,a.jsx)(o.Z,{color:"primary",onClick:()=>u(!0),variant:"contained",children:"Add Test Case"})]})]}),(0,a.jsx)(P.Z,{children:(0,a.jsxs)(I.Z,{children:[(0,a.jsx)(M.Z,{children:(0,a.jsxs)(T.Z,{children:[(0,a.jsx)(S.Z,{children:"Description"}),(0,a.jsx)(S.Z,{children:"Assertions"}),(0,a.jsx)(S.Z,{children:"Variables"}),(0,a.jsx)(S.Z,{align:"right"})]})}),(0,a.jsx)(O.Z,{children:0===i.length?(0,a.jsx)(T.Z,{children:(0,a.jsx)(S.Z,{colSpan:4,align:"center",children:"No test cases added yet."})}):i.map((e,t)=>{var n;return(0,a.jsxs)(T.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>{d(t),u(!0)},children:[(0,a.jsx)(S.Z,{children:(0,a.jsx)(f.Z,{variant:"body2",children:e.description||"Test Case #".concat(t+1)})}),(0,a.jsxs)(S.Z,{children:[(null===(n=e.assert)||void 0===n?void 0:n.length)||0," assertions"]}),(0,a.jsx)(S.Z,{children:Object.entries(e.vars||{}).map(e=>{let[t,n]=e;return t+"="+n}).join(", ")}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>{d(t),u(!0)},size:"small",children:(0,a.jsx)(A.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(_.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(C.Z,{})})]})]},t)})})]})}),(0,a.jsx)($,{open:p,onAdd:(e,t)=>{if(null===c)s([...i,e]);else{let t=i.map((t,n)=>n===c?e:t);s(t),d(null)}t&&u(!1)},varsList:t,initialValues:null!==c?i[c]:void 0,onCancel:()=>{d(null),u(!1)}})]})},ee=n(71911),et=n.n(ee),en=n(93522),ea=n(68833),er=n(92863),ei=n(34235),el=n(38640),es=n.n(el),eo=n(29270);n(54492),n(55096),n(93486);var ec=()=>{let e="dark"===(0,er.Z)().palette.mode,{defaultTest:t,setDefaultTest:n,description:i,setDescription:c,env:d,setEnv:p,evaluateOptions:u,setEvaluateOptions:h,prompts:x,setPrompts:m,providers:j,setProviders:v,scenarios:g,setScenarios:Z,testCases:b,setTestCases:y}=(0,l.o)(),[_,C]=r.useState(""),[k,E]=r.useState(!0),I=e=>{n(e.defaultTest||{}),c(e.description||""),p(e.env||{}),h(e.evaluateOptions||{}),m(e.prompts||[]),v(e.providers||[]),Z(e.scenarios||[]),y(e.tests||[])};return r.useEffect(()=>{C(ei.default.dump({defaultTest:t,description:i,env:d,evaluateOptions:u,prompts:x,providers:j,scenarios:g,tests:b}))},[t,i,d,u,x,j,g,b]),(0,a.jsxs)(s.Z,{mt:4,children:[(0,a.jsx)(f.Z,{variant:"h5",gutterBottom:!0,children:"Configuration"}),(0,a.jsxs)(f.Z,{variant:"body1",gutterBottom:!0,children:["This is the YAML config that defines the evaluation and is processed by promptfoo. See"," ",(0,a.jsx)(es(),{target:"_blank",href:"https://promptfoo.dev/docs/configuration/guide",children:"configuration docs"})," ","to learn more."]}),(0,a.jsxs)(s.Z,{display:"flex",gap:2,mb:2,children:[(0,a.jsx)(o.Z,{variant:"text",color:"primary",startIcon:k?(0,a.jsx)(A.Z,{}):(0,a.jsx)(en.Z,{}),onClick:()=>{if(!k)try{let e=ei.default.load(_,{json:!0});I(e)}catch(e){}E(!k)},children:k?"Edit YAML":"Save"}),(0,a.jsxs)(o.Z,{variant:"text",color:"primary",startIcon:(0,a.jsx)(ea.Z,{}),component:"label",children:["Upload YAML",(0,a.jsx)("input",{type:"file",hidden:!0,accept:".yaml,.yml",onChange:e=>{var t;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;let n=null===(t=e.target)||void 0===t?void 0:t.result;C(n);try{let e=ei.default.load(n,{json:!0});I(e)}catch(e){console.error("Error parsing uploaded YAML:",e)}},e.readAsText(n)}}})]})]}),(0,a.jsx)(et(),{autoCapitalize:"off",value:_,onValueChange:e=>{k||C(e)},highlight:e=>(0,eo.highlight)(e,eo.languages.yaml),padding:10,style:{backgroundColor:e?"#1e1e1e":"#fff",fontFamily:'"Fira code", "Fira Mono", monospace',fontSize:14},disabled:k,className:k?"":"glowing-border"})]})};n(7517);var ed=n(77580);function ep(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 eu=()=>{let[e,t]=(0,r.useState)(!1),{setDescription:n,providers:j,setProviders:v,prompts:g,setPrompts:Z,setTestCases:b}=(0,l.o)();if((0,r.useEffect)(()=>{l.o.persist.rehydrate()},[]),ed.env.NEXT_PUBLIC_NO_BROWSING)return null;let _=(e=>{let t=/{{\s*(\w+)\s*}}/g,n=new Set;return e.forEach(e=>{let a;for(;null!==(a=t.exec(e));)n.add(a[1])}),Array.from(n)})(g);return(0,a.jsxs)(c.Z,{maxWidth:"lg",sx:{marginTop:"2rem"},children:[(0,a.jsxs)(m.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(f.Z,{variant:"h4",children:"Set up an evaluation"}),(0,a.jsxs)(m.Z,{direction:"row",spacing:2,children:[(0,a.jsx)(D,{}),(0,a.jsx)(y,{}),(0,a.jsx)(o.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)(i.SV,{FallbackComponent:ep,onReset:()=>{v([])},children:(0,a.jsxs)(m.Z,{direction:"column",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(f.Z,{variant:"h5",children:"Providers"}),(0,a.jsx)(q,{providers:j,onChange:v})]})})}),(0,a.jsx)(s.Z,{mt:4}),(0,a.jsx)(i.SV,{FallbackComponent:ep,onReset:()=>{Z([])},children:(0,a.jsx)(W,{})}),(0,a.jsx)(s.Z,{mt:6}),(0,a.jsx)(i.SV,{FallbackComponent:ep,onReset:()=>{b([])},children:(0,a.jsx)(Q,{varsList:_})}),(0,a.jsx)(ec,{}),(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)(o.Z,{onClick:()=>t(!1),children:"Cancel"}),(0,a.jsx)(o.Z,{onClick:()=>{n(""),v([]),Z([]),b([]),t(!1)},autoFocus:!0,children:"Reset"})]})]})]})}},52428:function(e,t,n){"use strict";n.d(t,{Ox:function(){return i},T8:function(){return r},eA:function(){return l}});var a=n(77580);let r=!a.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,i=!!a.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,l=""},47887:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var a=n(79685),r=n(74595);let i=(0,a.Ue)()((0,r.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],defaultTest:{},evaluateOptions:{},scenarios:[],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}),setDefaultTest:t=>e({defaultTest:t}),setEvaluateOptions:t=>e({evaluateOptions:t}),setScenarios:t=>e({scenarios: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=>"string"==typeof e&&!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),t.defaultTest&&(n.defaultTest=t.defaultTest),t.evaluateOptions&&(n.evaluateOptions=t.evaluateOptions),t.scenarios&&(n.scenarios=t.scenarios),e(n)},getTestSuite:()=>{let{description:e,testCases:n,providers:a,prompts:r,env:i,scenarios:l}=t();return{env:i,description:e,providers:a,prompts:r,tests:n,scenarios:l}}}),{name:"promptfoo",skipHydration:!0}))},94499:function(){},55096:function(){},7517:function(){},15320:function(e,t){"use strict";t.It=function(e){let t,n,a,r;let i={},l=[],s={};for(let[o,c]of Object.entries(e))o.startsWith("__expected")?""!==c.trim()&&l.push(function(e){if(e.startsWith("javascript:")||e.startsWith("fn:")||e.startsWith("eval:")){let t;e.startsWith("javascript:")&&(t=11),e.startsWith("fn:")&&(t=3),e.startsWith("eval:")&&(t=5);let n=e.slice(t).trim();return{type:"javascript",value:n}}if(e.startsWith("grade:")||e.startsWith("llm-rubric:"))return{type:"llm-rubric",value:e.slice(6)};if(e.startsWith("python:")){let t=e.slice(7).trim();return{type:"python",value:t}}let t=e.match(/^(not-)?(equals|contains-any|contains-all|icontains-any|icontains-all|contains-json|is-json|is-sql|regex|icontains|contains|webhook|rouge-n|similar|starts-with|levenshtein|classifier|model-graded-factuality|factuality|model-graded-closedqa|answer-relevance|context-recall|context-relevance|context-faithfulness|is-valid-openai-function-call|is-valid-openai-tools-call|latency|perplexity|perplexity-score|cost)(?:\((\d+(?:\.\d+)?)\))?(?::([\s\S]*))?$/);if(t){let[e,n,a,r,i]=t,l=n?`not-${a}`:a,s=parseFloat(r);return"contains-any"===a||"contains-all"===a||"icontains-any"===a||"icontains-all"===a?{type:l,value:i.split(",").map(e=>e.trim())}:"contains-json"===a||"is-json"===a?{type:l,value:i}:"rouge-n"===a||"similar"===a||"starts-with"===a||"levenshtein"===a||"classifier"===a||"answer-relevance"===a||"context-recall"===a||"context-relevance"===a||"context-faithfulness"===a||"latency"===a||"perplexity"===a||"perplexity-score"===a||"cost"===a?{type:l,value:i,threshold:s||("similar"===a?.8:.75)}:{type:l,value:i}}return{type:"equals",value:e}}(c)):"__prefix"===o?s.prefix=c:"__suffix"===o?s.suffix=c:"__description"===o?n=c:"__providerOutput"===o?t=c:"__metric"===o?a=c:"__threshold"===o?r=parseFloat(c):i[o]=c;for(let e of l)e.metric=a;return{vars:i,assert:l,options:s,...n?{description:n}:{},...t?{providerOutput:t}:{},...r?{threshold:r}:{}}}}},function(e){e.O(0,[903,640,916,493,304,374,339,969,378,235,476,905,155,856,470,730,744],function(){return e(e.s=8458)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{74397:function(e,n,t){Promise.resolve().then(t.t.bind(t,6020,23)),Promise.resolve().then(t.t.bind(t,83507,23)),Promise.resolve().then(t.t.bind(t,46785,23)),Promise.resolve().then(t.t.bind(t,27883,23)),Promise.resolve().then(t.t.bind(t,27382,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[470,730],function(){return n(11409),n(74397)}),_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/a34f9d1faa5f3315-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/de0307797e31a3e6.css" data-precedence="next"/><link rel="preload" href="/_next/static/chunks/webpack-22e0e23bc00c2c23.js" as="script"/><link rel="preload" href="/_next/static/chunks/b6261da7-e9d81a4364ddd0c0.js" as="script"/><link rel="preload" href="/_next/static/chunks/730-3eb7255cd813a727.js" as="script"/><link rel="preload" href="/_next/static/chunks/main-app-
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><link rel="preload" as="font" href="/_next/static/media/a34f9d1faa5f3315-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/de0307797e31a3e6.css" data-precedence="next"/><link rel="preload" href="/_next/static/chunks/webpack-22e0e23bc00c2c23.js" as="script"/><link rel="preload" href="/_next/static/chunks/b6261da7-e9d81a4364ddd0c0.js" as="script"/><link rel="preload" href="/_next/static/chunks/730-3eb7255cd813a727.js" as="script"/><link rel="preload" href="/_next/static/chunks/main-app-4398f7af7ad8387f.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_85e967"><script src="/_next/static/chunks/webpack-22e0e23bc00c2c23.js" async=""></script><script src="/_next/static/chunks/b6261da7-e9d81a4364ddd0c0.js" async=""></script><script src="/_next/static/chunks/730-3eb7255cd813a727.js" async=""></script><script src="/_next/static/chunks/main-app-4398f7af7ad8387f.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/a34f9d1faa5f3315-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/css/de0307797e31a3e6.css\",{\"as\":\"style\"}]\n0:\"$L3\"\n"])</script><script>self.__next_f.push([1,"4:I{\"id\":83507,\"chunks\":[\"272:static/chunks/webpack-22e0e23bc00c2c23.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\n6:I{\"id\":6020,\"chunks\":[\"272:static/chunks/webpack-22e0e23bc00c2c23.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"\",\"async\":false}\n7:I{\"id\":5071,\"chunks\":[\"903:static/chunks/903-7cc440d9f9e9f95d.js\",\"640:static/chunks/640-0f757e2fe135173d.js\",\"916:stati"])</script><script>self.__next_f.push([1,"c/chunks/916-b92fea2ab6136411.js\",\"374:static/chunks/374-45af52ed3050e856.js\",\"485:static/chunks/485-d94c512bab4204ef.js\",\"325:static/chunks/325-9b7b85306b746b1d.js\",\"185:static/chunks/app/layout-3e4716f7ebdd0dab.js\"],\"name\":\"PageShell\",\"async\":false}\n8:I{\"id\":27883,\"chunks\":[\"272:static/chunks/webpack-22e0e23bc00c2c23.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\n9:I{\"id\":46785,\"chunks\":[\"272:static/chunks/webpack-22e0e23bc"])</script><script>self.__next_f.push([1,"00c2c23.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\nb:I{\"id\":92030,\"chunks\":[\"903:static/chunks/903-7cc440d9f9e9f95d.js\",\"640:static/chunks/640-0f757e2fe135173d.js\",\"916:static/chunks/916-b92fea2ab6136411.js\",\"304:static/chunks/304-cf667fe8f06238b4.js\",\"339:static/chunks/339-79124d204fa988a3.js\",\"485:static/chunks/485-d94c512bab4204ef.js\",\"716:static/chunks/app/auth/login/page-7134c0901e4f0212.js\"],\"name\":\"\",\"async\":false}"])</script><script>self.__next_f.push([1,"\n"])</script><script>self.__next_f.push([1,"3:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/de0307797e31a3e6.css\",\"precedence\":\"next\"}]],[\"$\",\"$L4\",null,{\"buildId\":\"dLlNz9-V4NvRIcKyU_b89\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/auth/login/\",\"initialTree\":[\"\",{\"children\":[\"auth\",{\"children\":[\"login\",{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],\"initialHead\":\"$L5\",\"globalErrorComponent\":\"$6\",\"children\":[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_85e967\",\"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]}]]\n"])</script><script>self.__next_f.push([1,"5:[[\"$\",\"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,"a:null\n"])</script></body></html>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
1:HL["/_next/static/media/a34f9d1faa5f3315-s.p.woff2",{"as":"font","type":"font/woff2"}]
|
|
2
2
|
2:HL["/_next/static/css/de0307797e31a3e6.css",{"as":"style"}]
|
|
3
|
-
0:["
|
|
4
|
-
5:I{"id":5071,"chunks":["903:static/chunks/903-7cc440d9f9e9f95d.js","640:static/chunks/640-0f757e2fe135173d.js","916:static/chunks/916-b92fea2ab6136411.js","
|
|
3
|
+
0:["dLlNz9-V4NvRIcKyU_b89",[[["",{"children":["auth",{"children":["login",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],"$L3",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/de0307797e31a3e6.css","precedence":"next"}]],"$L4"]]]]
|
|
4
|
+
5:I{"id":5071,"chunks":["903:static/chunks/903-7cc440d9f9e9f95d.js","640:static/chunks/640-0f757e2fe135173d.js","916:static/chunks/916-b92fea2ab6136411.js","374:static/chunks/374-45af52ed3050e856.js","485:static/chunks/485-d94c512bab4204ef.js","325:static/chunks/325-9b7b85306b746b1d.js","185:static/chunks/app/layout-3e4716f7ebdd0dab.js"],"name":"PageShell","async":false}
|
|
5
5
|
6:I{"id":27883,"chunks":["272:static/chunks/webpack-22e0e23bc00c2c23.js","470:static/chunks/b6261da7-e9d81a4364ddd0c0.js","730:static/chunks/730-3eb7255cd813a727.js"],"name":"default","async":false}
|
|
6
6
|
7:I{"id":46785,"chunks":["272:static/chunks/webpack-22e0e23bc00c2c23.js","470:static/chunks/b6261da7-e9d81a4364ddd0c0.js","730:static/chunks/730-3eb7255cd813a727.js"],"name":"default","async":false}
|
|
7
|
-
9:I{"id":92030,"chunks":["903:static/chunks/903-7cc440d9f9e9f95d.js","640:static/chunks/640-0f757e2fe135173d.js","916:static/chunks/916-b92fea2ab6136411.js","304:static/chunks/304-cf667fe8f06238b4.js","339:static/chunks/339-79124d204fa988a3.js","
|
|
7
|
+
9:I{"id":92030,"chunks":["903:static/chunks/903-7cc440d9f9e9f95d.js","640:static/chunks/640-0f757e2fe135173d.js","916:static/chunks/916-b92fea2ab6136411.js","304:static/chunks/304-cf667fe8f06238b4.js","339:static/chunks/339-79124d204fa988a3.js","485:static/chunks/485-d94c512bab4204ef.js","716:static/chunks/app/auth/login/page-7134c0901e4f0212.js"],"name":"","async":false}
|
|
8
8
|
3:[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_85e967","children":["$","$L5",null,{"children":["$","$L6",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L7",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":["$","$L6",null,{"parallelRouterKey":"children","segmentPath":["children","auth","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L7",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$","$L6",null,{"parallelRouterKey":"children","segmentPath":["children","auth","children","login","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L7",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$L8",["$","$L9",null,{}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"login"},"styles":[]}],"segment":"auth"},"styles":[]}]}]}]}],null]
|
|
9
9
|
4:[["$","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"}]]
|
|
10
10
|
8:null
|