promptfoo 0.31.0 → 0.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +1 -1
- package/dist/src/main.js +2 -1
- package/dist/src/main.js.map +1 -1
- package/dist/src/util.d.ts.map +1 -1
- package/dist/src/util.js +6 -11
- package/dist/src/util.js.map +1 -1
- package/dist/src/web/nextui/404/index.html +1 -1
- package/dist/src/web/nextui/404.html +1 -1
- package/dist/src/web/nextui/_next/static/chunks/396-ddebcf106bb56e13.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/420-2e5cd10f16aeaa4f.js +2 -0
- package/dist/src/web/nextui/_next/static/chunks/756-1adee6171fcb68fb.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/860-778ebe3611fe9a05.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/datasets/page-8e6de69fb0c49d64.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/{page-51042a4400691368.js → page-3637ef4148e04c73.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/eval/{page-d1c49d6aeca14868.js → page-b6eefbda2b295d4e.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/layout-24c27b59c5b54fb3.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/prompts/page-d00bb3e4da795d59.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/setup/page-e64d0c0e3d40a466.js +1 -0
- package/dist/src/web/nextui/auth/login/index.html +1 -1
- package/dist/src/web/nextui/auth/login/index.txt +2 -2
- package/dist/src/web/nextui/auth/signup/index.html +1 -1
- package/dist/src/web/nextui/auth/signup/index.txt +2 -2
- 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/prompts/index.html +1 -1
- package/dist/src/web/nextui/prompts/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/src/web/server.d.ts +1 -1
- package/dist/src/web/server.d.ts.map +1 -1
- package/dist/src/web/server.js +6 -1
- package/dist/src/web/server.js.map +1 -1
- package/package.json +1 -1
- package/dist/src/web/nextui/_next/static/chunks/238-84a998be247f92e7.js +0 -2
- package/dist/src/web/nextui/_next/static/chunks/320-d41e321556b1b694.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/563-a961efef5193d79c.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/860-fd532a3130f1bd45.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/datasets/page-5d1f9b7d4686fe34.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/layout-2d69329b7d9c264a.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/prompts/page-b1f8e85f32a45c2a.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/setup/page-c19433000ee34b13.js +0 -1
- /package/dist/src/web/nextui/_next/static/{yobwYIjSlgTiHVK9Eo5hK → dcKJCGmf08M1awfK9vCQk}/_buildManifest.js +0 -0
- /package/dist/src/web/nextui/_next/static/{yobwYIjSlgTiHVK9Eo5hK → dcKJCGmf08M1awfK9vCQk}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[320],{984:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.createSvgIcon}});var o=r(3135)},2653:function(e,t,r){"use strict";r.d(t,{Z:function(){return R}});var o=r(791),n=r(3428),i=r(2265),a=r(7042),l=r(5600),u=r(9975),c=r(5843),s=r(7927),d=r(6659),p=r(8702),f=r(6520),v=r(5702);function Z(e){return(0,v.Z)("MuiIconButton",e)}let g=(0,f.Z)("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]);var m=r(7437);let b=["edge","children","className","color","disabled","disableFocusRipple","size"],h=e=>{let{classes:t,disabled:r,color:o,edge:n,size:i}=e,a={root:["root",r&&"disabled","default"!==o&&`color${(0,p.Z)(o)}`,n&&`edge${(0,p.Z)(n)}`,`size${(0,p.Z)(i)}`]};return(0,l.Z)(a,Z,t)},y=(0,c.ZP)(d.Z,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,"default"!==r.color&&t[`color${(0,p.Z)(r.color)}`],r.edge&&t[`edge${(0,p.Z)(r.edge)}`],t[`size${(0,p.Z)(r.size)}`]]}})(({theme:e,ownerState:t})=>(0,n.Z)({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,u.Fq)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12}),({theme:e,ownerState:t})=>{var r;let o=null==(r=(e.vars||e).palette)?void 0:r[t.color];return(0,n.Z)({},"inherit"===t.color&&{color:"inherit"},"inherit"!==t.color&&"default"!==t.color&&(0,n.Z)({color:null==o?void 0:o.main},!t.disableRipple&&{"&:hover":(0,n.Z)({},o&&{backgroundColor:e.vars?`rgba(${o.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,u.Fq)(o.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===t.size&&{padding:5,fontSize:e.typography.pxToRem(18)},"large"===t.size&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${g.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),k=i.forwardRef(function(e,t){let r=(0,s.Z)({props:e,name:"MuiIconButton"}),{edge:i=!1,children:l,className:u,color:c="default",disabled:d=!1,disableFocusRipple:p=!1,size:f="medium"}=r,v=(0,o.Z)(r,b),Z=(0,n.Z)({},r,{edge:i,color:c,disabled:d,disableFocusRipple:p,size:f}),g=h(Z);return(0,m.jsx)(y,(0,n.Z)({className:(0,a.Z)(g.root,u),centerRipple:!0,focusRipple:!p,disabled:d,ref:t,ownerState:Z},v,{children:l}))});var R=k},3457:function(e,t,r){"use strict";r.d(t,{Z:function(){return z}});var o=r(791),n=r(3428),i=r(2265),a=r(7042),l=r(5959),u=r(5600),c=r(5702),s=r(9190),d=r(8153),p=r(3381),f=r(4775),v=r(5425),Z=r(7508),g=r(7437);let m=["component","direction","spacing","divider","children","className","useFlexGap"],b=(0,f.Z)(),h=(0,s.Z)("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function y(e){return(0,d.Z)({props:e,name:"MuiStack",defaultTheme:b})}let k=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],R=({ownerState:e,theme:t})=>{let r=(0,n.Z)({display:"flex",flexDirection:"column"},(0,v.k9)({theme:t},(0,v.P$)({values:e.direction,breakpoints:t.breakpoints.values}),e=>({flexDirection:e})));if(e.spacing){let o=(0,Z.hB)(t),n=Object.keys(t.breakpoints.values).reduce((t,r)=>(("object"==typeof e.spacing&&null!=e.spacing[r]||"object"==typeof e.direction&&null!=e.direction[r])&&(t[r]=!0),t),{}),i=(0,v.P$)({values:e.direction,base:n}),a=(0,v.P$)({values:e.spacing,base:n});"object"==typeof i&&Object.keys(i).forEach((e,t,r)=>{let o=i[e];if(!o){let o=t>0?i[r[t-1]]:"column";i[e]=o}}),r=(0,l.Z)(r,(0,v.k9)({theme:t},a,(t,r)=>e.useFlexGap?{gap:(0,Z.NA)(o,t)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${k(r?i[r]:e.direction)}`]:(0,Z.NA)(o,t)}}))}return(0,v.dt)(t.breakpoints,r)};var S=r(5843),x=r(7927);let $=function(e={}){let{createStyledComponent:t=h,useThemeProps:r=y,componentName:l="MuiStack"}=e,s=()=>(0,u.Z)({root:["root"]},e=>(0,c.Z)(l,e),{}),d=t(R),f=i.forwardRef(function(e,t){let l=r(e),u=(0,p.Z)(l),{component:c="div",direction:f="column",spacing:v=0,divider:Z,children:b,className:h,useFlexGap:y=!1}=u,k=(0,o.Z)(u,m),R=s();return(0,g.jsx)(d,(0,n.Z)({as:c,ownerState:{direction:f,spacing:v,useFlexGap:y},ref:t,className:(0,a.Z)(R.root,h)},k,{children:Z?function(e,t){let r=i.Children.toArray(e).filter(Boolean);return r.reduce((e,o,n)=>(e.push(o),n<r.length-1&&e.push(i.cloneElement(t,{key:`separator-${n}`})),e),[])}(b,Z):b}))});return f}({createStyledComponent:(0,S.ZP)("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>(0,x.Z)({props:e,name:"MuiStack"})});var z=$},3135:function(e,t,r){"use strict";r.r(t),r.d(t,{capitalize:function(){return n.Z},createChainedFunction:function(){return i},createSvgIcon:function(){return a.Z},debounce:function(){return l.Z},deprecatedPropType:function(){return u},isMuiElement:function(){return c.Z},ownerDocument:function(){return s.Z},ownerWindow:function(){return d.Z},requirePropFactory:function(){return p},setRef:function(){return f},unstable_ClassNameGenerator:function(){return k},unstable_useEnhancedEffect:function(){return v.Z},unstable_useId:function(){return Z.Z},unsupportedProp:function(){return g},useControlled:function(){return m.Z},useEventCallback:function(){return b.Z},useForkRef:function(){return h.Z},useIsFocusVisible:function(){return y.Z}});var o=r(5097),n=r(8702),i=r(2940).Z,a=r(9782),l=r(494),u=function(e,t){return()=>null},c=r(673),s=r(3931),d=r(6649);r(3428);var p=function(e,t){return()=>null},f=r(3406).Z,v=r(8519),Z=r(419),g=function(e,t,r,o,n){return null},m=r(3292),b=r(96),h=r(7663),y=r(2143);let k={configure:e=>{o.Z.configure(e)}}},6314:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[563],{9864:function(e,t,r){"use strict";var n=r(6314);t.Z=void 0;var i=n(r(984)),o=r(7437),a=(0,i.default)((0,o.jsx)("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z"}),"DarkMode");t.Z=a},7028:function(e,t,r){"use strict";var n=r(6314);t.Z=void 0;var i=n(r(984)),o=r(7437),a=(0,i.default)((0,o.jsx)("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z"}),"LightMode");t.Z=a},3283:function(e,t,r){"use strict";r.d(t,{Z:function(){return _}});var n=r(791),i=r(3428),o=r(2265),a=r(7042),l=r(5600),s=r(5843),u=r(7927),c=r(9782),d=r(7437),f=(0,c.Z)((0,d.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person"),p=r(6520),m=r(5702);function g(e){return(0,m.Z)("MuiAvatar",e)}(0,p.Z)("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);let h=["alt","children","className","component","imgProps","sizes","src","srcSet","variant"],v=e=>{let{classes:t,variant:r,colorDefault:n}=e;return(0,l.Z)({root:["root",r,n&&"colorDefault"],img:["img"],fallback:["fallback"]},g,t)},y=(0,s.ZP)("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[r.variant],r.colorDefault&&t.colorDefault]}})(({theme:e,ownerState:t})=>(0,i.Z)({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},"rounded"===t.variant&&{borderRadius:(e.vars||e).shape.borderRadius},"square"===t.variant&&{borderRadius:0},t.colorDefault&&(0,i.Z)({color:(e.vars||e).palette.background.default},e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:"light"===e.palette.mode?e.palette.grey[400]:e.palette.grey[600]}))),b=(0,s.ZP)("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(e,t)=>t.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),w=(0,s.ZP)(f,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"75%",height:"75%"}),x=o.forwardRef(function(e,t){let r=(0,u.Z)({props:e,name:"MuiAvatar"}),{alt:l,children:s,className:c,component:f="div",imgProps:p,sizes:m,src:g,srcSet:x,variant:_="circular"}=r,S=(0,n.Z)(r,h),Z=null,C=function({crossOrigin:e,referrerPolicy:t,src:r,srcSet:n}){let[i,a]=o.useState(!1);return o.useEffect(()=>{if(!r&&!n)return;a(!1);let i=!0,o=new Image;return o.onload=()=>{i&&a("loaded")},o.onerror=()=>{i&&a("error")},o.crossOrigin=e,o.referrerPolicy=t,o.src=r,n&&(o.srcset=n),()=>{i=!1}},[e,t,r,n]),i}((0,i.Z)({},p,{src:g,srcSet:x})),M=g||x,j=M&&"error"!==C,P=(0,i.Z)({},r,{colorDefault:!j,component:f,variant:_}),O=v(P);return Z=j?(0,d.jsx)(b,(0,i.Z)({alt:l,src:g,srcSet:x,sizes:m,ownerState:P,className:O.img},p)):null!=s?s:M&&l?l[0]:(0,d.jsx)(w,{ownerState:P,className:O.fallback}),(0,d.jsx)(y,(0,i.Z)({as:f,ownerState:P,className:(0,a.Z)(O.root,c),ref:t},S,{children:Z}))});var _=x},6507:function(e,t,r){"use strict";r.d(t,{Z:function(){return y}});var n=r(3428),i=r(791),o=r(2265),a=r(7042),l=r(9613),s=r(7947),u=r(3381),c=r(5270),d=r(7437);let f=["className","component"];var p=r(5097),m=r(606),g=r(3469);let h=(0,m.Z)(),v=function(e={}){let{themeId:t,defaultTheme:r,defaultClassName:p="MuiBox-root",generateClassName:m}=e,g=(0,l.ZP)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(s.Z),h=o.forwardRef(function(e,o){let l=(0,c.Z)(r),s=(0,u.Z)(e),{className:h,component:v="div"}=s,y=(0,i.Z)(s,f);return(0,d.jsx)(g,(0,n.Z)({as:v,ref:o,className:(0,a.Z)(h,m?m(p):p),theme:t&&l[t]||l},y))});return h}({themeId:g.Z,defaultTheme:h,defaultClassName:"MuiBox-root",generateClassName:p.Z.generate});var y=v},9660:function(e,t,r){"use strict";r.d(t,{L:function(){return o}});var n=r(6520),i=r(5702);function o(e){return(0,i.Z)("MuiListItemText",e)}let a=(0,n.Z)("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);t.Z=a},5507:function(e,t,r){"use strict";r.d(t,{Z:function(){return j}});var n=r(791),i=r(3428),o=r(2265),a=r(7042),l=r(5600),s=r(9975),u=r(5843),c=r(7927),d=r(7820),f=r(6659),p=r(8519),m=r(7663),g=r(6520);let h=(0,g.Z)("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),v=(0,g.Z)("MuiListItemIcon",["root","alignItemsFlexStart"]);var y=r(9660),b=r(5702);function w(e){return(0,b.Z)("MuiMenuItem",e)}let x=(0,g.Z)("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]);var _=r(7437);let S=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],Z=e=>{let{disabled:t,dense:r,divider:n,disableGutters:o,selected:a,classes:s}=e,u=(0,l.Z)({root:["root",r&&"dense",t&&"disabled",!o&&"gutters",n&&"divider",a&&"selected"]},w,s);return(0,i.Z)({},s,u)},C=(0,u.ZP)(f.Z,{shouldForwardProp:e=>(0,u.FO)(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.dense&&t.dense,r.divider&&t.divider,!r.disableGutters&&t.gutters]}})(({theme:e,ownerState:t})=>(0,i.Z)({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${x.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,s.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${x.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,s.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${x.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,s.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,s.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${x.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${x.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${h.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${h.inset}`]:{marginLeft:52},[`& .${y.Z.root}`]:{marginTop:0,marginBottom:0},[`& .${y.Z.inset}`]:{paddingLeft:36},[`& .${v.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&(0,i.Z)({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${v.root} svg`]:{fontSize:"1.25rem"}}))),M=o.forwardRef(function(e,t){let r;let l=(0,c.Z)({props:e,name:"MuiMenuItem"}),{autoFocus:s=!1,component:u="li",dense:f=!1,divider:g=!1,disableGutters:h=!1,focusVisibleClassName:v,role:y="menuitem",tabIndex:b,className:w}=l,x=(0,n.Z)(l,S),M=o.useContext(d.Z),j=o.useMemo(()=>({dense:f||M.dense||!1,disableGutters:h}),[M.dense,f,h]),P=o.useRef(null);(0,p.Z)(()=>{s&&P.current&&P.current.focus()},[s]);let O=(0,i.Z)({},l,{dense:j.dense,divider:g,disableGutters:h}),k=Z(l),z=(0,m.Z)(P,t);return l.disabled||(r=void 0!==b?b:-1),(0,_.jsx)(d.Z.Provider,{value:j,children:(0,_.jsx)(C,(0,i.Z)({ref:z,role:y,tabIndex:r,component:u,focusVisibleClassName:(0,a.Z)(k.focusVisible,v),className:(0,a.Z)(k.root,w)},x,{ownerState:O,classes:k}))})});var j=M},5573:function(e,t,r){"use strict";r.d(t,{Z:function(){return b}});var n=r(3428),i=r(791),o=r(2265);let a=o.createContext(null);function l(){let e=o.useContext(a);return e}let s="function"==typeof Symbol&&Symbol.for;var u=s?Symbol.for("mui.nested"):"__THEME_NESTED__",c=r(7437),d=function(e){let{children:t,theme:r}=e,i=l(),s=o.useMemo(()=>{let e=null===i?r:function(e,t){if("function"==typeof t){let r=t(e);return r}return(0,n.Z)({},e,t)}(i,r);return null!=e&&(e[u]=null!==i),e},[r,i]);return(0,c.jsx)(a.Provider,{value:s,children:t})},f=r(6375),p=r(4809);let m={};function g(e,t,r,i=!1){return o.useMemo(()=>{let o=e&&t[e]||t;if("function"==typeof r){let a=r(o),l=e?(0,n.Z)({},t,{[e]:a}):a;return i?()=>l:l}return e?(0,n.Z)({},t,{[e]:r}):(0,n.Z)({},t,r)},[e,t,r,i])}var h=function(e){let{children:t,theme:r,themeId:n}=e,i=(0,p.Z)(m),o=l()||m,a=g(n,i,r),s=g(n,o,r,!0);return(0,c.jsx)(d,{theme:s,children:(0,c.jsx)(f.T.Provider,{value:a,children:t})})},v=r(3469);let y=["theme"];function b(e){let{theme:t}=e,r=(0,i.Z)(e,y),o=t[v.Z];return(0,c.jsx)(h,(0,n.Z)({},r,{themeId:o?v.Z:void 0,theme:o||t}))}},2135:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n,i=r(2265),o=r(4809),a=r(1529),l=r(8519);function s(e,t,r,n,o){let[a,s]=i.useState(()=>o&&r?r(e).matches:n?n(e).matches:t);return(0,l.Z)(()=>{let t=!0;if(!r)return;let n=r(e),i=()=>{t&&s(n.matches)};return i(),n.addListener(i),()=>{t=!1,n.removeListener(i)}},[e,r]),a}let u=(n||(n=r.t(i,2))).useSyncExternalStore;function c(e,t,r,n,o){let a=i.useCallback(()=>t,[t]),l=i.useMemo(()=>{if(o&&r)return()=>r(e).matches;if(null!==n){let{matches:t}=n(e);return()=>t}return a},[a,e,n,o,r]),[s,c]=i.useMemo(()=>{if(null===r)return[a,()=>()=>{}];let t=r(e);return[()=>t.matches,e=>(t.addListener(e),()=>{t.removeListener(e)})]},[a,r,e]),d=u(c,s,l);return d}function d(e,t={}){let r=(0,o.Z)(),n="undefined"!=typeof window&&void 0!==window.matchMedia,{defaultMatches:i=!1,matchMedia:l=n?window.matchMedia:null,ssrMatchMedia:d=null,noSsr:f=!1}=(0,a.Z)({name:"MuiUseMediaQuery",props:t,theme:r}),p="function"==typeof e?e(r):e;p=p.replace(/^@media( ?)/m,"");let m=(void 0!==u?c:s)(p,i,l,d,f);return m}},419:function(e,t,r){"use strict";var n=r(3449);t.Z=n.Z},2601:function(e,t,r){"use strict";var n,i;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(i=r.g.process)?void 0:i.env)?r.g.process:r(8960)},3222:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return y}});let n=r(1024),i=r(8533),o=i._(r(2265)),a=r(4887),l=n._(r(2912)),s=r(2301),u=r(7709),c=r(9469);r(7873);let d=r(2706),f=n._(r(6515)),p={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function m(e,t,r,n,i,o){let a=null==e?void 0:e.src;if(!e||e["data-loaded-src"]===a)return;e["data-loaded-src"]=a;let l="decode"in e?e.decode():Promise.resolve();l.catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("blur"===t&&i(!0),null==r?void 0:r.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,i=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>i,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{i=!0,t.stopPropagation()}})}(null==n?void 0:n.current)&&n.current(e)}})}function g(e){let[t,r]=o.version.split("."),n=parseInt(t,10),i=parseInt(r,10);return n>18||18===n&&i>=3?{fetchPriority:e}:{fetchpriority:e}}let h=(0,o.forwardRef)((e,t)=>{let{src:r,srcSet:n,sizes:i,height:a,width:l,decoding:s,className:u,style:c,fetchPriority:d,placeholder:f,loading:p,unoptimized:h,fill:v,onLoadRef:y,onLoadingCompleteRef:b,setBlurComplete:w,setShowAltText:x,onLoad:_,onError:S,...Z}=e;return o.default.createElement("img",{...Z,...g(d),loading:p,width:l,height:a,decoding:s,"data-nimg":v?"fill":"1",className:u,style:c,sizes:i,srcSet:n,src:r,ref:(0,o.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(S&&(e.src=e.src),e.complete&&m(e,f,y,b,w,h))},[r,f,y,b,w,S,h,t]),onLoad:e=>{let t=e.currentTarget;m(t,f,y,b,w,h)},onError:e=>{x(!0),"blur"===f&&w(!0),S&&S(e)}})});function v(e){let{isAppRouter:t,imgAttributes:r}=e,n={as:"image",imageSrcSet:r.srcSet,imageSizes:r.sizes,crossOrigin:r.crossOrigin,referrerPolicy:r.referrerPolicy,...g(r.fetchPriority)};return t?((0,a.preload)(r.src,n),null):o.default.createElement(l.default,null,o.default.createElement("link",{key:"__nimg-"+r.src+r.srcSet+r.sizes,rel:"preload",href:r.srcSet?void 0:r.src,...n}))}let y=(0,o.forwardRef)((e,t)=>{let r=(0,o.useContext)(d.RouterContext),n=(0,o.useContext)(c.ImageConfigContext),i=(0,o.useMemo)(()=>{let e=p||n||u.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r}},[n]),{onLoad:a,onLoadingComplete:l}=e,m=(0,o.useRef)(a);(0,o.useEffect)(()=>{m.current=a},[a]);let g=(0,o.useRef)(l);(0,o.useEffect)(()=>{g.current=l},[l]);let[y,b]=(0,o.useState)(!1),[w,x]=(0,o.useState)(!1),{props:_,meta:S}=(0,s.getImgProps)(e,{defaultLoader:f.default,imgConf:i,blurComplete:y,showAltText:w});return o.default.createElement(o.default.Fragment,null,o.default.createElement(h,{..._,unoptimized:S.unoptimized,placeholder:S.placeholder,fill:S.fill,onLoadRef:m,onLoadingCompleteRef:g,setBlurComplete:b,setShowAltText:x,ref:t}),S.priority?o.default.createElement(v,{isAppRouter:!r,imgAttributes:_}):null)});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5885:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return o}});let n=r(1024),i=n._(r(2265)),o=i.default.createContext({})},8551:function(e,t){"use strict";function r(e){let{ampFirst:t=!1,hybrid:r=!1,hasQuery:n=!1}=void 0===e?{}:e;return t||r&&n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return r}})},2301:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return l}}),r(7873);let n=r(9540),i=r(7709);function o(e){return void 0!==e.default}function a(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function l(e,t){var r;let l,s,u,{src:c,sizes:d,unoptimized:f=!1,priority:p=!1,loading:m,className:g,quality:h,width:v,height:y,fill:b=!1,style:w,onLoad:x,onLoadingComplete:_,placeholder:S="empty",blurDataURL:Z,fetchPriority:C,layout:M,objectFit:j,objectPosition:P,lazyBoundary:O,lazyRoot:k,...z}=e,{imgConf:I,showAltText:E,blurComplete:R,defaultLoader:T}=t,A=I||i.imageConfigDefault;if("allSizes"in A)l=A;else{let e=[...A.deviceSizes,...A.imageSizes].sort((e,t)=>e-t),t=A.deviceSizes.sort((e,t)=>e-t);l={...A,allSizes:e,deviceSizes:t}}let L=z.loader||T;delete z.loader,delete z.srcSet;let N="__next_img_default"in L;if(N){if("custom"===l.loader)throw Error('Image with src "'+c+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=L;L=t=>{let{config:r,...n}=t;return e(n)}}if(M){"fill"===M&&(b=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[M];e&&(w={...w,...e});let t={responsive:"100vw",fill:"100vw"}[M];t&&!d&&(d=t)}let $="",D=a(v),F=a(y);if("object"==typeof(r=c)&&(o(r)||void 0!==r.src)){let e=o(c)?c.default:c;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(!e.height||!e.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e));if(s=e.blurWidth,u=e.blurHeight,Z=Z||e.blurDataURL,$=e.src,!b){if(D||F){if(D&&!F){let t=D/e.width;F=Math.round(e.height*t)}else if(!D&&F){let t=F/e.height;D=Math.round(e.width*t)}}else D=e.width,F=e.height}}let B=!p&&("lazy"===m||void 0===m);(!(c="string"==typeof c?c:$)||c.startsWith("data:")||c.startsWith("blob:"))&&(f=!0,B=!1),l.unoptimized&&(f=!0),N&&c.endsWith(".svg")&&!l.dangerouslyAllowSVG&&(f=!0),p&&(C="high");let V=a(h),U=Object.assign(b?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:j,objectPosition:P}:{},E?{}:{color:"transparent"},w),G="blur"===S&&Z&&!R?{backgroundSize:U.objectFit||"cover",backgroundPosition:U.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:'url("data:image/svg+xml;charset=utf-8,'+(0,n.getImageBlurSvg)({widthInt:D,heightInt:F,blurWidth:s,blurHeight:u,blurDataURL:Z,objectFit:U.objectFit})+'")'}:{},H=function(e){let{config:t,src:r,unoptimized:n,width:i,quality:o,sizes:a,loader:l}=e;if(n)return{src:r,srcSet:void 0,sizes:void 0};let{widths:s,kind:u}=function(e,t,r){let{deviceSizes:n,allSizes:i}=e;if(r){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let n;n=e.exec(r);n)t.push(parseInt(n[2]));if(t.length){let e=.01*Math.min(...t);return{widths:i.filter(t=>t>=n[0]*e),kind:"w"}}return{widths:i,kind:"w"}}if("number"!=typeof t)return{widths:n,kind:"w"};let o=[...new Set([t,2*t].map(e=>i.find(t=>t>=e)||i[i.length-1]))];return{widths:o,kind:"x"}}(t,i,a),c=s.length-1;return{sizes:a||"w"!==u?a:"100vw",srcSet:s.map((e,n)=>l({config:t,src:r,quality:o,width:e})+" "+("w"===u?e:n+1)+u).join(", "),src:l({config:t,src:r,quality:o,width:s[c]})}}({config:l,src:c,unoptimized:f,width:D,quality:V,sizes:d,loader:L}),q={...z,loading:B?"lazy":m,fetchPriority:C,width:D,height:F,decoding:"async",className:g,style:{...U,...G},sizes:H.sizes,srcSet:H.srcSet,src:H.src},W={unoptimized:f,priority:p,placeholder:S,fill:b};return{props:q,meta:W}}},2912:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{defaultHead:function(){return c},default:function(){return m}});let n=r(1024),i=r(8533),o=i._(r(2265)),a=n._(r(3878)),l=r(5885),s=r(1330),u=r(8551);function c(e){void 0===e&&(e=!1);let t=[o.default.createElement("meta",{charSet:"utf-8"})];return e||t.push(o.default.createElement("meta",{name:"viewport",content:"width=device-width"})),t}function d(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}r(7873);let f=["name","httpEquiv","charSet","itemProp"];function p(e,t){let{inAmpMode:r}=t;return e.reduce(d,[]).reverse().concat(c(r).reverse()).filter(function(){let e=new Set,t=new Set,r=new Set,n={};return i=>{let o=!0,a=!1;if(i.key&&"number"!=typeof i.key&&i.key.indexOf("$")>0){a=!0;let t=i.key.slice(i.key.indexOf("$")+1);e.has(t)?o=!1:e.add(t)}switch(i.type){case"title":case"base":t.has(i.type)?o=!1:t.add(i.type);break;case"meta":for(let e=0,t=f.length;e<t;e++){let t=f[e];if(i.props.hasOwnProperty(t)){if("charSet"===t)r.has(t)?o=!1:r.add(t);else{let e=i.props[t],r=n[t]||new Set;("name"!==t||!a)&&r.has(e)?o=!1:(r.add(e),n[t]=r)}}}}return o}}()).reverse().map((e,t)=>{let n=e.key||t;if(!r&&"link"===e.type&&e.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(t=>e.props.href.startsWith(t))){let t={...e.props||{}};return t["data-href"]=t.href,t.href=void 0,t["data-optimized-fonts"]=!0,o.default.cloneElement(e,t)}return o.default.cloneElement(e,{key:n})})}let m=function(e){let{children:t}=e,r=(0,o.useContext)(l.AmpStateContext),n=(0,o.useContext)(s.HeadManagerContext);return o.default.createElement(a.default,{reduceComponentsToState:p,headManager:n,inAmpMode:(0,u.isInAmpMode)(r)},t)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9540:function(e,t){"use strict";function r(e){let{widthInt:t,heightInt:r,blurWidth:n,blurHeight:i,blurDataURL:o,objectFit:a}=e,l=n?40*n:t,s=i?40*i:r,u=l&&s?"viewBox='0 0 "+l+" "+s+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+u+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(u?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+o+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},9469:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return a}});let n=r(1024),i=n._(r(2265)),o=r(7709),a=i.default.createContext(o.imageConfigDefault)},7709:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{VALID_LOADERS:function(){return r},imageConfigDefault:function(){return n}});let r=["default","imgix","cloudinary","akamai","custom"],n={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"inline",remotePatterns:[],unoptimized:!1}},1295:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return u},unstable_getImgProps:function(){return s}});let n=r(1024),i=r(2301),o=r(7873),a=r(3222),l=n._(r(6515)),s=e=>{(0,o.warnOnce)("Warning: unstable_getImgProps() is experimental and may change or be removed at any time. Use at your own risk.");let{props:t}=(0,i.getImgProps)(e,{defaultLoader:l.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}},u=a.Image},6515:function(e,t){"use strict";function r(e){let{config:t,src:r,width:n,quality:i}=e;return t.path+"?url="+encodeURIComponent(r)+"&w="+n+"&q="+(i||75)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n}}),r.__next_img_default=!0;let n=r},3878:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return l}});let n=r(8533),i=n._(r(2265)),o=i.useLayoutEffect,a=i.useEffect;function l(e){let{headManager:t,reduceComponentsToState:r}=e;function n(){if(t&&t.mountedInstances){let n=i.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(n,e))}}return o(()=>{var r;return null==t||null==(r=t.mountedInstances)||r.add(e.children),()=>{var r;null==t||null==(r=t.mountedInstances)||r.delete(e.children)}}),o(()=>(t&&(t._pendingUpdate=n),()=>{t&&(t._pendingUpdate=n)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},7873:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},9362:function(e){e.exports={style:{fontFamily:"'__Roboto_979022', '__Roboto_Fallback_979022'",fontStyle:"normal"},className:"__className_979022"}},8960:function(e){!function(){var t={229:function(e){var t,r,n,i=e.exports={};function o(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function l(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s=[],u=!1,c=-1;function d(){u&&n&&(u=!1,n.length?s=n.concat(s):c=-1,s.length&&f())}function f(){if(!u){var e=l(d);u=!0;for(var t=s.length;t;){for(n=s,s=[];++c<t;)n&&n[c].run();c=-1,t=s.length}n=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];s.push(new p(e,t)),1!==s.length||u||l(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}},a=!0;try{t[e](o,o.exports,n),a=!1}finally{a&&delete r[e]}return o.exports}n.ab="//";var i=n(229);e.exports=i}()},6691:function(e,t,r){e.exports=r(1295)}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[860],{1860:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return ek}});var n=s(7437),l=s(2265),r=s(2130),a=s(6882),i=s(3388),o=s(4033),c=s(3082),d=s(5551),u=s(6507),p=s(7760),h=s(4081),x=s(182),m=s(819),j=s(8212),f=s(5507),g=s(923),v=s(654),y=s(33),b=s(3457),Z=s(8276),C=s(3226),S=s(2467),w=s(9605),k=s(3391),R=s(9190),N=s(6704),P=s(9394),E=s(1797),F=s(6337),V=s(1101),D=s(9872),I=s(2653),L=s(3533),M=s(4740),T=s(4660);let W=(0,T.Ue)(e=>({table:null,setTable:t=>e(()=>({table:t})),config:null,setConfig:t=>e(()=>({config:t}))})),O=["#fd7f6f","#7eb0d5","#b2e061","#bd7ebe","#ffb55a","#ffee65","#beb9db","#fdcce5","#8bd3c7"];function A(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;r.current&&r.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=(Math.ceil(Math.max(...e))-Math.floor(n))/10,a=Array.from({length:11},(e,t)=>parseFloat((Math.floor(n)+t*l).toFixed(2))),i=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s].score),r=a.map(e=>n.filter(t=>t>=e&&t<e+l).length);return{label:"Prompt ".concat(s+1),data:r,backgroundColor:O[s%O.length]}});r.current=new N.kL(s.current,{type:"bar",data:{labels:a,datasets:i},options:{animation:!1,plugins:{title:{display:!0,text:"Score Distribution"},legend:{display:!1},tooltip:{callbacks:{title:function(e){let t=e[0].datasetIndex;return"Prompt ".concat(t+1)},label:function(e){let t=e.dataIndex,s=a[t],n=a[t+1];return n?"".concat(s," <= score < ").concat(n):"".concat(s," <= score")}}}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function z(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;r.current&&r.current.destroy();let e=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s]),l=n.filter(e=>e.pass).length,r=l/n.length*100;return{label:"Prompt ".concat(s+1),data:[r],backgroundColor:O[s%O.length]}});r.current=new N.kL(s.current,{type:"bar",data:{labels:["Pass Rate (%)"],datasets:e},options:{animation:!1,plugins:{title:{display:!0,text:"Pass rate"},legend:{display:!0}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function U(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null),[a,i]=(0,l.useState)(0),[o,c]=(0,l.useState)(1),[d,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!s.current)return;r.current&&r.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=Math.max(...e),i=t.body.map(e=>{let t=e.outputs[a].score,s=e.outputs[o].score;return{x:t,y:s,backgroundColor:s>t?"green":s<t?"red":"gray"}});r.current=new N.kL(s.current,{type:"scatter",data:{datasets:[{data:i,backgroundColor:i.map(e=>e.backgroundColor)},{type:"line",data:[{x:n,y:n},{x:l,y:l}],borderColor:"gray",borderWidth:1,borderDash:[5,5],pointRadius:0}]},options:{animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(e){let s=t.body[e.dataIndex],n=s.outputs[0].text,l=s.outputs[1].text;return n.length>30&&(n=n.substring(0,30)+"..."),l.length>30&&(l=l.substring(0,30)+"..."),"Output 1: ".concat(n,"\nOutput 2: ").concat(l)}}}},scales:{x:{title:{display:!0,text:"Prompt ".concat(a+1," Score")}},y:{title:{display:!0,text:"Prompt ".concat(o+1," Score")}}}}})},[t,a,o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(P.Z,{open:d,onClose:()=>u(!1),children:[(0,n.jsx)(E.Z,{children:"Compare prompt outputs"}),(0,n.jsxs)(F.Z,{children:[(0,n.jsx)(h.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(v.Z,{value:a,onChange:e=>i(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(f.Z,{value:t,children:["Prompt ",t+1]},t))})}),(0,n.jsx)(h.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(v.Z,{value:o,onChange:e=>c(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(f.Z,{value:t,children:["Prompt ",t+1]},t))})})]})]}),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px",cursor:"pointer"},onClick:()=>u(!0)})]})}function _(e){let{columnVisibility:t}=e,s=(0,V.Z)();N.kL.defaults.color="dark"===s.palette.mode?"#aaa":"#666";let[r,a]=(0,l.useState)(!0),{table:i}=W();if(!i||!r||i.head.prompts.length<2)return null;let o=i.body.flatMap(e=>e.outputs.map(e=>e.score));return 1===new Set(o).size?null:(0,n.jsx)(M.SV,{fallback:null,children:(0,n.jsxs)(D.Z,{style:{position:"relative",padding:s.spacing(3)},children:[(0,n.jsx)(I.Z,{style:{position:"absolute",right:0,top:0},onClick:()=>a(!1),children:(0,n.jsx)(L.Z,{})}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(z,{table:i})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(A,{table:i})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(U,{table:i})})]})]})})}N.kL.register(N.vn,N.ST,N.ho,N.uw,N.f$,N.ZL,N.jn,N.od,N.u,N.wL);var H=s(9116);s(5777);var J=s(7660),B=s(3216),q=s(5391),G=s(1396),Y=s.n(G);s(8715);var X=e=>{let{lookup:t}=e;return(0,n.jsx)("div",{className:"custom-metric-container",children:Object.entries(t).map(e=>{let[t,s]=e;return(0,n.jsxs)("div",{children:[t,": ",s.toFixed(2)]},t)})})},$=s(2834),K=s(5446),Q=s(9329),ee=s(4719),et=s(3701),es=s(9279),en=s(666),el=s(5795),er=s(6988),ea=s(4147);function ei(e){let{gradingResults:t}=e;return t?(0,n.jsxs)(u.Z,{mt:2,children:[(0,n.jsx)(C.Z,{variant:"subtitle1",children:"Assertions"}),(0,n.jsx)(el.Z,{children:(0,n.jsxs)(et.Z,{children:[(0,n.jsx)(er.Z,{children:(0,n.jsxs)(ea.Z,{children:[(0,n.jsx)(en.Z,{style:{fontWeight:"bold"},children:"Pass"}),(0,n.jsx)(en.Z,{style:{fontWeight:"bold"},children:"Score"}),(0,n.jsx)(en.Z,{style:{fontWeight:"bold"},children:"Type"}),(0,n.jsx)(en.Z,{style:{fontWeight:"bold"},children:"Value"}),(0,n.jsx)(en.Z,{style:{fontWeight:"bold"},children:"Reason"})]})}),(0,n.jsx)(es.Z,{children:t.map((e,t)=>{var s,l;return(0,n.jsxs)(ea.Z,{children:[(0,n.jsx)(en.Z,{children:e.pass?"✅":"❌"}),(0,n.jsx)(en.Z,{children:e.score.toFixed(2)}),(0,n.jsx)(en.Z,{children:(null===(s=e.assertion)||void 0===s?void 0:s.type)||""}),(0,n.jsx)(en.Z,{style:{whiteSpace:"pre-wrap"},children:(null===(l=e.assertion)||void 0===l?void 0:l.value)?String(e.assertion.value):"-"}),(0,n.jsx)(en.Z,{style:{whiteSpace:"pre-wrap"},children:e.reason})]},t)})})]})})]}):null}function eo(e){let{open:t,onClose:s,prompt:r,provider:a,output:i,gradingResults:o}=e,[c,p]=(0,l.useState)(!1);(0,l.useEffect)(()=>{p(!1)},[r]);let h=async e=>{await navigator.clipboard.writeText(e),p(!0)};return(0,n.jsxs)(P.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,n.jsxs)(E.Z,{children:["Details",a&&": ".concat(a)]}),(0,n.jsxs)(F.Z,{children:[(0,n.jsxs)(u.Z,{mb:2,children:[(0,n.jsx)(C.Z,{variant:"subtitle1",style:{marginBottom:"1rem"},children:"Prompt"}),(0,n.jsx)(K.u,{readOnly:!0,value:r,style:{width:"100%",padding:"0.75rem"},maxRows:20}),(0,n.jsx)(I.Z,{onClick:()=>h(r),style:{position:"absolute",right:"10px",top:"10px"},children:c?(0,n.jsx)(ee.Z,{}):(0,n.jsx)(Q.Z,{})})]}),i&&(0,n.jsxs)(u.Z,{my:2,children:[(0,n.jsx)(C.Z,{variant:"subtitle1",style:{marginBottom:"1rem",marginTop:"1rem"},children:"Output"}),(0,n.jsx)(K.u,{readOnly:!0,maxRows:20,value:i,style:{width:"100%",padding:"0.75rem"}})]}),(0,n.jsx)(ei,{gradingResults:o})]}),(0,n.jsx)($.Z,{children:(0,n.jsx)(d.Z,{onClick:s,children:"Close"})})]})}function ec(e){return null===e||0===e||1===e?"":"(".concat(e.toFixed(2),")")}function ed(e){return"string"==typeof e||"number"==typeof e?e.toString().length:Array.isArray(e)?e.reduce((e,t)=>e+ed(t),0):l.isValidElement(e)&&e.props.children?l.Children.toArray(e.props.children).reduce((e,t)=>e+ed(t),0):0}function eu(e){let t,{text:s,maxLength:r}=e,[a,i]=l.useState(!0),o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("string"==typeof e||"number"==typeof e){let s=e.toString();return s.slice(0,r-t)}if(Array.isArray(e)){let s=[],n=t;for(let t of e){let e=ed(t);if(n+e>r){s.push(o(t,n));break}s.push(t),n+=e}return s}if(l.isValidElement(e)&&e.props.children){let s=ed(e.props.children);if(s>r-t)return l.cloneElement(e,{...e.props,children:o(e.props.children,t)})}return e};t=l.isValidElement(s)||"string"==typeof s?s:JSON.stringify(s);let c=a?o(t):t,d=ed(t)>r;return(0,n.jsxs)("div",{style:{cursor:d?"pointer":"normal"},onClick:()=>{i(!a)},children:[c,a&&ed(t)>r&&(0,n.jsx)("span",{children:"..."})]})}function ep(e){var t,s,r;let a,{output:i,maxTextLength:o,rowIndex:c,promptIndex:d,onRating:u,firstOutput:p,filterMode:h}=e,[x,m]=l.useState(!1),j="string"==typeof i.text?i.text:JSON.stringify(i.text),f=[];if(!i.pass&&j.includes("---")?j=(f=j.split("---")).slice(1).join("---"):f=[j],"different"===h&&p){let e,t="string"==typeof p.text?p.text:JSON.stringify(p.text);t.includes("---")&&(t=t.split("---").slice(1).join("---"));try{JSON.parse(t),JSON.parse(j),e=(0,H.CT)(t,j)}catch(s){e=t.includes(". ")&&j.includes(". ")?(0,H.SY)(t,j):(0,H.NV)(t,j)}a=(0,n.jsx)(n.Fragment,{children:e.map((e,t)=>e.added?(0,n.jsx)("ins",{children:e.value},t):e.removed?(0,n.jsx)("del",{children:e.value},t):(0,n.jsx)("span",{children:e.value},t))})}let g=e=>{u(c,d,e)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"cell",children:[i.pass&&(0,n.jsxs)("div",{className:"status pass",children:["PASS ",(0,n.jsx)("span",{className:"score",children:ec(i.score)}),i.namedScores?(0,n.jsx)(X,{lookup:i.namedScores}):null]}),!i.pass&&(0,n.jsxs)("div",{className:"status fail",children:["[FAIL ",(0,n.jsx)("span",{className:"score",children:ec(i.score)}),"]"," ",(0,n.jsx)("span",{children:f[0].trim().split("\n").map((e,t)=>(0,n.jsxs)(l.Fragment,{children:[e,(0,n.jsx)("br",{})]},t))}),i.namedScores?(0,n.jsx)(X,{lookup:i.namedScores}):null]})," ",(0,n.jsx)(eu,{text:a||j,maxLength:o})]}),(0,n.jsx)("div",{className:"cell-detail",children:(null===(t=i.tokenUsage)||void 0===t?void 0:t.cached)?(0,n.jsxs)("span",{children:[i.tokenUsage.cached," tokens (cached)"]}):(0,n.jsxs)(n.Fragment,{children:[(null===(s=i.tokenUsage)||void 0===s?void 0:s.total)&&(0,n.jsxs)("span",{children:[i.tokenUsage.total," tokens"]})," |"," ",(0,n.jsxs)("span",{children:[i.latencyMs," ms"]})]})}),(0,n.jsxs)("div",{className:"cell-actions",children:[i.prompt&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"action",onClick:()=>{m(!0)},children:(0,n.jsx)(Z.Z,{title:"View ouput and test details",children:(0,n.jsx)("span",{children:"\uD83D\uDD0E"})})}),(0,n.jsx)(eo,{open:x,onClose:()=>{m(!1)},prompt:i.prompt,provider:i.provider,gradingResults:null===(r=i.gradingResult)||void 0===r?void 0:r.componentResults,output:j})]}),(0,n.jsx)("span",{className:"action",onClick:()=>g(!0),children:(0,n.jsx)(Z.Z,{title:"Mark test passed (score 1.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4D"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>g(!1),children:(0,n.jsx)(Z.Z,{title:"Mark test failed (score 0.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4E"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>{let e=prompt("Set test score (0.0 - 1.0):");if(null!==e){let t=parseFloat(e);!isNaN(t)&&t>=0&&t<=1?u(c,d,!0,t):alert("Invalid score. Please enter a value between 0.0 and 1.0.")}},children:(0,n.jsx)(Z.Z,{title:"Set test score",children:(0,n.jsx)("span",{children:"✏️"})})})]})]})}function eh(e){let{text:t,maxLength:s,expandedText:r,resourceId:a}=e,[i,o]=l.useState(!1);return(0,n.jsxs)("div",{children:[(0,n.jsx)(eu,{text:t,maxLength:s}),r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Z.Z,{title:"View prompt",children:(0,n.jsx)("span",{className:"action",onClick:()=>{o(!0)},children:"\uD83D\uDD0E"})}),(0,n.jsx)(eo,{open:i,onClose:()=>{o(!1)},prompt:r}),a&&(0,n.jsx)(Z.Z,{title:"View other evals and datasets for this prompt",children:(0,n.jsx)("span",{className:"action",children:(0,n.jsx)(Y(),{href:"/prompts/?id=".concat(a),target:"_blank",children:(0,n.jsx)(q.Z,{fontSize:"small"})})})})]})]})}function ex(e){let{maxTextLength:t,columnVisibility:s,wordBreak:a,filterMode:i,failureFilter:o,onFailureFilterToggle:c}=e,{table:d,setTable:u}=W();(0,r.Z)(d,"Table should be defined");let{head:h,body:m}=d,j=h.prompts.map((e,t)=>m.reduce((e,s)=>e+(s.outputs[t].pass?1:0),0)),f=h.prompts.map((e,t)=>m.reduce((e,s)=>{var n,l;return e+((null===(l=s.outputs[t].gradingResult)||void 0===l?void 0:null===(n=l.componentResults)||void 0===n?void 0:n.length)||0)},0)),g=h.prompts.map((e,t)=>m.reduce((e,s)=>{var n;let l=null===(n=s.outputs[t].gradingResult)||void 0===n?void 0:n.componentResults;return e+(l?l.filter(e=>e.pass).length:0)},0)),v=(e,t,s,n)=>{let l=[...m],r={...l[e]},a=[...r.outputs];a[t].pass=s,a[t].score=void 0===n?s?1:0:n||0,r.outputs=a,l[e]=r,u({head:h,body:l})},y=j.reduce((e,t,s,n)=>t>n[e]?s:e,0),b=j[y],Z=(0,J.Cl)(),C=[];h.vars.length>0&&C.push(Z.group({id:"vars",header:()=>(0,n.jsx)("span",{children:"Variables"}),columns:h.vars.map((e,s)=>Z.accessor(e=>e.vars[s],{id:"Variable ".concat(s+1),header:()=>(0,n.jsx)(eh,{text:e,maxLength:t}),cell:e=>(0,n.jsx)(eu,{text:e.getValue(),maxLength:t}),size:50}))})),C.push(Z.group({id:"prompts",header:()=>(0,n.jsx)("span",{children:"Outputs"}),columns:h.prompts.map((e,s)=>Z.accessor(e=>(function(e){if("string"==typeof e){let t=e.startsWith("[PASS]"),s=e;return e.startsWith("[PASS]")?s=s.slice(6):e.startsWith("[FAIL]")&&(s=s.slice(6)),{text:s,pass:t,score:t?1:0}}return e})(e.outputs[s]),{id:"Prompt ".concat(s+1),header:()=>{var l,r,a,d,u,h;let v=j[s]&&m.length?(j[s]/m.length*100).toFixed(2):"0.00",y=j[s]===b&&0!==b,Z="Prompt ".concat(s+1),C=o[Z]||!1;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eh,{text:"string"==typeof e?e:e.display,expandedText:"string"==typeof e?void 0:e.raw,maxLength:t,resourceId:"string"==typeof e?void 0:e.id}),"failures"===i&&(0,n.jsx)(x.Z,{sx:{"& .MuiFormControlLabel-label":{fontSize:"0.75rem"}},control:(0,n.jsx)(p.Z,{checked:C,onChange:e=>c(Z,e.target.checked)}),label:"Show failures"}),(0,n.jsxs)("div",{className:"summary",children:[(0,n.jsxs)("span",{className:y?"highlight":"",children:["Passing: ",(0,n.jsxs)("strong",{children:[v,"%"]})," (",j[s],"/",m.length," cases",f[s]?(0,n.jsxs)("span",{children:[", ",g[s],"/",f[s]," asserts"]}):null,")"]}),((null===(l=e.metrics)||void 0===l?void 0:l.totalLatencyMs)||(null===(a=e.metrics)||void 0===a?void 0:null===(r=a.tokenUsage)||void 0===r?void 0:r.total))&&(0,n.jsx)("span",{children:" avg"}),(null===(d=e.metrics)||void 0===d?void 0:d.totalLatencyMs)?(0,n.jsxs)("span",{children:[" ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.totalLatencyMs/m.length),"ms"]}):null,(null===(h=e.metrics)||void 0===h?void 0:null===(u=h.tokenUsage)||void 0===u?void 0:u.total)?(0,n.jsxs)("span",{children:[" ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.total/m.length)," ","tokens"]}):null]})]})},cell:e=>(0,n.jsx)(ep,{output:e.getValue(),maxTextLength:t,rowIndex:e.row.index,promptIndex:s,onRating:v,firstOutput:w[e.row.index].outputs[0],filterMode:i})}))}));let S=m.some(e=>e.description);S&&C.splice(0,0,{accessorFn:e=>e.description||"",id:"description",header:()=>(0,n.jsx)("span",{children:"Description"}),cell:e=>(0,n.jsx)(eu,{text:String(e.getValue()),maxLength:t}),size:50});let w=l.useMemo(()=>"failures"===i?Object.values(o).every(e=>!e)?m:m.filter(e=>e.outputs.some((e,t)=>{let s=!e.pass;return o["Prompt ".concat(t+1)]&&s})):"different"===i?m.filter(e=>!e.outputs.every(t=>t.text===e.outputs[0].text)):m,[m,o,i]),k=(0,B.b7)({data:w,columns:C,columnResizeMode:"onChange",getCoreRowModel:(0,J.sC)(),state:{columnVisibility:s}});return(0,n.jsxs)("table",{className:"results-table ".concat(t<=25?"compact":""),style:{wordBreak:a},children:[(0,n.jsx)("thead",{children:k.getHeaderGroups().map(e=>(0,n.jsx)("tr",{className:"header",children:e.headers.map(e=>(0,n.jsxs)("th",{colSpan:e.colSpan,style:{width:e.getSize()},children:[e.isPlaceholder?null:(0,B.ie)(e.column.columnDef.header,e.getContext()),(0,n.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"resizer ".concat(e.column.getIsResizing()?"isResizing":"")})]},e.id))},e.id))}),(0,n.jsx)("tbody",{children:k.getRowModel().rows.map((e,t)=>{let s=!1;return(0,n.jsx)("tr",{children:e.getVisibleCells().map(e=>{let l=e.column.id.startsWith("Variable")||"description"===e.column.id,r=!l&&!s;return r&&(s=!0),(0,n.jsx)("td",{style:{width:e.column.getSize()},className:"".concat(l?"variable":""," ").concat(0!==t||l?"":"first-prompt-row"," ").concat(r?"first-prompt-col":""),children:(0,B.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)})})]})}s(2604);var em=s(7175);function ej(e){let{open:t,onClose:r}=e,{config:a}=W(),i=l.useRef(null),[o,c]=l.useState(!1),[p,h]=l.useState("");l.useEffect(()=>{t&&(async()=>{let{default:e}=await s.e(339).then(s.bind(s,8339));h(e.dump(a))})()},[t,a]);let x=()=>{c(!1),r()};return(0,n.jsxs)(P.Z,{open:t,onClose:x,"aria-labelledby":"config-dialog-title",maxWidth:"md",fullWidth:!0,children:[(0,n.jsx)(E.Z,{id:"config-dialog-title",children:(0,n.jsxs)(u.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,n.jsx)(C.Z,{variant:"h6",children:"Config"}),(0,n.jsx)(I.Z,{onClick:()=>{i.current&&(i.current.select(),document.execCommand("copy"),c(!0))},children:o?(0,n.jsx)(ee.Z,{}):(0,n.jsx)(em.Z,{})})]})}),(0,n.jsx)(F.Z,{children:(0,n.jsx)(C.Z,{variant:"body1",component:"div",children:(0,n.jsx)("textarea",{ref:i,readOnly:!0,value:p,style:{width:"100%",minHeight:"400px",fontFamily:"monospace",border:"1px solid #ccc"}})})}),(0,n.jsx)($.Z,{children:(0,n.jsx)(d.Z,{onClick:x,color:"primary",children:"Close"})})]})}var ef=s(4173),eg=s(1975),ev=e=>{let{open:t,onClose:s,shareUrl:r}=e,a=(0,l.useRef)(null),[i,o]=(0,l.useState)(!1),c=()=>{s(),o(!1)};return(0,n.jsxs)(P.Z,{open:t,onClose:c,PaperProps:{style:{minWidth:"min(660px, 100%)"}},children:[(0,n.jsx)(E.Z,{children:"Your eval is ready to share"}),(0,n.jsxs)(F.Z,{children:[(0,n.jsx)(eg.Z,{inputRef:a,value:r,fullWidth:!0,InputProps:{readOnly:!0,endAdornment:(0,n.jsx)(I.Z,{onClick:()=>{a.current&&(a.current.select(),document.execCommand("copy"),o(!0))},children:i?(0,n.jsx)(ee.Z,{}):(0,n.jsx)(em.Z,{})})}}),(0,n.jsx)(ef.Z,{sx:{fontSize:"0.75rem"},children:"Shared URLs are deleted after 1 week."})]}),(0,n.jsx)($.Z,{children:(0,n.jsx)(d.Z,{onClick:c,color:"primary",children:"Close"})})]})},ey=s(1938);let eb=(0,R.Z)(b.Z)(e=>{let{theme:t}=e;return{maxWidth:"100%",flexWrap:"wrap",[t.breakpoints.down("sm")]:{flexDirection:"column"}}});function eZ(e){let{recentEvals:t,onRecentEvalSelected:s,defaultEvalId:i}=e,c=(0,o.useRouter)(),{table:b,config:R}=W(),{setStateFromConfig:N}=(0,ey.o)(),[P,E]=l.useState(250),[F,V]=l.useState({}),[D,I]=l.useState([]),[L,M]=l.useState({}),[T,O]=l.useState("all"),[A,z]=l.useState("break-word"),[U,H]=l.useState(!1),[J,B]=l.useState(""),[q,G]=l.useState(!1),Y=async()=>{G(!0);try{let e=await fetch("https://api.promptfoo.dev/eval",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{version:2,createdAt:new Date().toISOString(),results:{table:b},config:R}})}),{id:t}=await e.json(),s="https://app.promptfoo.dev/eval/".concat(t);B(s),H(!0)}catch(e){alert("Sorry, something went wrong.")}finally{G(!1)}},[X,$]=l.useState(!1);(0,r.Z)(b,"Table data must be loaded before rendering ResultsView");let{head:K}=b,Q=[...K.vars.map((e,t)=>({value:"Variable ".concat(t+1),label:"Var ".concat(t+1,": ").concat(K.vars[t].length>100?K.vars[t].slice(0,97)+"...":K.vars[t]),group:"Variables"})),...K.prompts.map((e,t)=>({value:"Prompt ".concat(t+1),label:"Prompt ".concat(t+1,": ").concat(K.prompts[t].display.length>100?K.prompts[t].display.slice(0,97)+"...":K.prompts[t].display),group:"Prompts"}))];return l.useEffect(()=>{I(Q.map(e=>e.value))},[K]),(0,n.jsxs)("div",{style:{marginLeft:"1rem",marginRight:"1rem"},children:[(0,n.jsx)(u.Z,{py:"md",children:(0,n.jsxs)(eb,{direction:"row",spacing:4,alignItems:"center",children:[(0,n.jsx)(u.Z,{children:t&&t.length>0&&(0,n.jsxs)(h.Z,{sx:{m:1,minWidth:200},size:"small",children:[(0,n.jsx)(m.Z,{children:"View run"}),(0,n.jsx)(v.Z,{className:"recent-files",label:"Previous runs",defaultValue:i,onChange:e=>s(e.target.value),children:t.map(e=>(0,n.jsx)(f.Z,{value:e.id,children:e.label},e.id))},t.map(e=>e.id).join(","))]})}),(0,n.jsx)(u.Z,{children:(0,n.jsxs)(h.Z,{sx:{m:1,minWidth:200},size:"small",children:[(0,n.jsx)(m.Z,{id:"visible-columns-label",children:"Show columns"}),(0,n.jsx)(v.Z,{labelId:"visible-columns-label",id:"visible-columns",multiple:!0,value:D,onChange:e=>{let{target:{value:t}}=e;I("string"==typeof t?t.split(","):t);let s=[...K.vars.map((e,t)=>"Variable ".concat(t+1)),...K.prompts.map((e,t)=>"Prompt ".concat(t+1))],n={};s.forEach(e=>{n[e]=("string"==typeof t?t.split(","):t).includes(e)}),V(n)},input:(0,n.jsx)(g.Z,{label:"Visible columns"}),renderValue:e=>e.join(", "),children:Q.map(e=>(0,n.jsxs)(f.Z,{dense:!0,value:e.value,children:[(0,n.jsx)(p.Z,{checked:D.indexOf(e.value)>-1}),(0,n.jsx)(j.Z,{primary:e.label})]},e.value))})]})}),(0,n.jsx)(u.Z,{children:(0,n.jsxs)(h.Z,{sx:{minWidth:180},size:"small",children:[(0,n.jsx)(m.Z,{id:"failure-filter-mode-label",children:"Filter"}),(0,n.jsxs)(v.Z,{labelId:"filter-mode-label",id:"filter-mode",value:T,onChange:e=>{let t=e.target.value;O(t);let s={};K.prompts.forEach((e,n)=>{s["Prompt ".concat(n+1)]="failures"===t}),M(s)},label:"Filter",children:[(0,n.jsx)(f.Z,{value:"all",children:"Show all results"}),(0,n.jsx)(f.Z,{value:"failures",children:"Show failures only"}),(0,n.jsx)(f.Z,{value:"different",children:"Show different only"})]})]})}),(0,n.jsxs)(u.Z,{children:[(0,n.jsxs)(C.Z,{mt:2,children:["Max text length: ",P]}),(0,n.jsx)(y.ZP,{min:25,max:1e3,value:P,onChange:(e,t)=>E(t)})]}),(0,n.jsx)(u.Z,{children:(0,n.jsx)(Z.Z,{title:"Forcing line breaks makes it easier to adjust column widths to your liking",children:(0,n.jsx)(x.Z,{control:(0,n.jsx)(p.Z,{checked:"break-all"===A,onChange:e=>{z(e.target.checked?"break-all":"break-word")}}),label:"Force line breaks"})})}),(0,n.jsx)(u.Z,{flexGrow:1}),(0,n.jsx)(u.Z,{display:"flex",justifyContent:"flex-end",children:(0,n.jsxs)(eb,{direction:"row",spacing:2,children:[R&&(0,n.jsx)(Z.Z,{title:"View config",children:(0,n.jsx)(d.Z,{color:"primary",onClick:()=>$(!0),startIcon:(0,n.jsx)(w.Z,{}),children:"View Config"})}),R&&(0,n.jsx)(Z.Z,{title:"Edit eval",children:(0,n.jsx)(d.Z,{color:"primary",onClick:()=>{N(R),c.push("/setup/")},startIcon:(0,n.jsx)(k.Z,{}),children:"Edit Eval"})}),(null==R?void 0:R.sharing)&&(0,n.jsx)(Z.Z,{title:"Generate a unique URL that others can access",children:(0,n.jsx)(d.Z,{color:"primary",onClick:Y,disabled:q,startIcon:q?(0,n.jsx)(a.Z,{size:16}):(0,n.jsx)(S.Z,{}),children:"Share"})})]})})]})}),(0,n.jsx)(_,{columnVisibility:F}),(0,n.jsx)(ex,{maxTextLength:P,columnVisibility:F,wordBreak:A,filterMode:T,failureFilter:L,onFailureFilterToggle:(e,t)=>{M(s=>({...s,[e]:t}))}}),(0,n.jsx)(ej,{open:X,onClose:()=>$(!1)}),(0,n.jsx)(ev,{open:U,onClose:()=>H(!1),shareUrl:J})]})}var eC=s(279);async function eS(){let e=(0,c.createClientComponentClient)(),{data:{user:t}}=await e.auth.getUser();(0,r.Z)(t,"User not logged in");let{data:s,error:n}=await e.from("EvaluationResult").select("id, createdAt").eq("user_id",t.id).order("createdAt",{ascending:!1}).limit(100);return s||[]}async function ew(e){let t=(0,c.createClientComponentClient)(),{data:s,error:n}=await t.from("EvaluationResult").select("*").eq("id",e).single();return s}function ek(e){var t;let{fetchId:s,preloadedData:c,recentEvals:d,defaultEvalId:u}=e,p=(0,o.useRouter)(),{table:h,setTable:x,setConfig:m}=W(),[j,f]=l.useState(!1),[g,v]=l.useState(!1),[y,b]=l.useState(d||[]),Z=async()=>{(0,r.Z)(eC.T8,"Cannot fetch recent files when not running locally");let e=await fetch("".concat(eC.CT,"/results"),{cache:"no-store"}),t=await e.json();return b(t.data),t.data},C=async e=>{let t=await fetch("".concat(eC.CT,"/results/").concat(e),{cache:"no-store"}),s=await t.json();x(s.data.results.table),m(s.data.config)},S=async e=>{eC.T8?C(e):(f(!1),p.push("/eval/remote:".concat(encodeURIComponent(e))))},[w,k]=l.useState(u||(null===(t=y[0])||void 0===t?void 0:t.id)),R=(0,o.useSearchParams)(),N=R?R.get("file"):null;return(l.useEffect(()=>{if(N){let e=async()=>{await C(N),f(!0)};e()}else if(c){var e;x(null===(e=c.data.results)||void 0===e?void 0:e.table),m(c.data.config),f(!0)}else if(s){let e=async()=>{var e;let t=await fetch("https://api.promptfoo.dev/eval/".concat(s));if(!t.ok){v(!0);return}let n=await t.json();x(null===(e=n.data.results)||void 0===e?void 0:e.table),m(n.data.config),f(!0)};e()}else if(eC.T8){let e=(0,i.io)(eC.CT);return e.on("init",e=>{console.log("Initialized socket connection",e),f(!0),x(e.results.table),m(e.config),Z().then(e=>{var t;k(null===(t=e[0])||void 0===t?void 0:t.id)})}),e.on("update",e=>{console.log("Received data update",e),x(e.results.table),m(e.config),Z().then(e=>{var t;k(null===(t=e[0])||void 0===t?void 0:t.id)})}),()=>{e.disconnect()}}else eS().then(e=>{b(e.map(e=>({id:e.id,label:e.createdAt}))),e.length>0&&ew(e[0].id).then(t=>{(0,r.Z)(t,"Eval not found");let s=t.results,n=t.config;k(e[0].id),x(s.table),m(n),f(!0)})})},[s,x,m,c,k,N]),g)?(0,n.jsx)("div",{className:"loading",children:"404 Eval not found"}):j&&h?(0,n.jsx)(eZ,{defaultEvalId:w,recentEvals:y,onRecentEvalSelected:S}):(0,n.jsxs)("div",{className:"loading",children:[(0,n.jsx)("div",{children:(0,n.jsx)(a.Z,{size:22})}),(0,n.jsx)("div",{children:"Loading eval data"})]})}s(5038)},279:function(e,t,s){"use strict";s.d(t,{CT:function(){return r},T8:function(){return l},eA:function(){return a}});var n=s(2601);let l=!n.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,r="http://localhost:15500",a=""},1938:function(e,t,s){"use strict";s.d(t,{o:function(){return r}});var n=s(4660),l=s(4810);let r=(0,n.Ue)()((0,l.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setStateFromConfig:t=>{let s={};t.description&&(s.description=t.description||""),t.tests&&(s.testCases=t.tests),t.providers&&(s.providers=t.providers),t.prompts&&("string"==typeof t.prompts?s.prompts=[t.prompts]:Array.isArray(t.prompts)?s.prompts=t.prompts.filter(e=>!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),e(s)},getTestSuite:()=>{let{description:e,testCases:s,providers:n,prompts:l,env:r}=t();return{env:r,description:e,providers:n,prompts:l,tests:s}}}),{name:"promptfoo",skipHydration:!0}))},8715:function(){},5038:function(){},2604:function(){},5777:function(){}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[958],{4303:function(e,t,s){Promise.resolve().then(s.bind(s,4260))},4260:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return k}});var i=s(7437),l=s(2265),n=s(1396),r=s.n(n),c=s(6507),d=s(2492),a=s(3701),o=s(9279),h=s(666),u=s(6988),v=s(4147),x=s(5781),j=s(8276),p=s(4033),Z=s(8339),m=s(5551),f=s(9394),C=s(2834),w=s(6337),y=s(1797),g=s(3226),I=s(5446);function E(e){var t,s,n,c,x;let{openDialog:j,handleClose:p,testCase:E}=e,[S,k]=(0,l.useState)(1);return(0,i.jsxs)(f.Z,{open:j,onClose:p,fullWidth:!0,maxWidth:"lg",children:[(0,i.jsxs)(y.Z,{children:["Dataset ",E.id.slice(0,6)]}),(0,i.jsxs)(w.Z,{children:[(0,i.jsx)(g.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Test cases"}),(0,i.jsx)(I.u,{readOnly:!0,value:E&&Z.default.dump(E.testCases),style:{width:"100%",padding:"0.75rem"},maxRows:15}),(0,i.jsx)(g.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Used in..."}),(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(v.Z,{children:[(0,i.jsx)(h.Z,{children:"Eval ID"}),(0,i.jsx)(h.Z,{children:"Prompt ID"}),(0,i.jsx)(h.Z,{children:"Raw score"}),(0,i.jsx)(h.Z,{children:"Pass rate"}),(0,i.jsx)(h.Z,{children:"Pass count"}),(0,i.jsx)(h.Z,{children:"Fail count"}),(0,i.jsx)(h.Z,{children:"Prompt"})]})}),(0,i.jsx)(o.Z,{children:null==E?void 0:null===(t=E.prompts)||void 0===t?void 0:t.slice((S-1)*10,10*S).sort((e,t)=>t.evalId.localeCompare(e.evalId)).map((e,t)=>{var s,l,d,a,o,u,j,p;return(0,i.jsxs)(v.Z,{hover:!0,children:[(0,i.jsx)(h.Z,{children:(0,i.jsx)(r(),{href:"/eval/?file=".concat(e.evalFilepath),children:e.evalId.slice(0,6)})}),(0,i.jsx)(h.Z,{style:{minWidth:"8em"},children:(0,i.jsx)(r(),{href:"/prompts/?id=".concat(e.id),children:e.id.slice(0,6)})}),(0,i.jsx)(h.Z,{children:null!==(n=null===(s=e.prompt.metrics)||void 0===s?void 0:s.score.toFixed(2))&&void 0!==n?n:"-"}),(0,i.jsx)(h.Z,{children:(null===(l=e.prompt.metrics)||void 0===l?void 0:l.testPassCount)!==void 0&&(null===(d=e.prompt.metrics)||void 0===d?void 0:d.testFailCount)!==void 0?((null===(a=e.prompt.metrics)||void 0===a?void 0:a.testPassCount)/((null===(o=e.prompt.metrics)||void 0===o?void 0:o.testPassCount)+(null===(u=e.prompt.metrics)||void 0===u?void 0:u.testFailCount))*100).toFixed(2)+"%":"-"}),(0,i.jsx)(h.Z,{children:null!==(c=null===(j=e.prompt.metrics)||void 0===j?void 0:j.testPassCount)&&void 0!==c?c:"-"}),(0,i.jsx)(h.Z,{children:null!==(x=null===(p=e.prompt.metrics)||void 0===p?void 0:p.testFailCount)&&void 0!==x?x:"-"}),(0,i.jsx)(h.Z,{children:e.prompt.raw.length>250?e.prompt.raw.slice(0,250)+"...":e.prompt.raw})]},t)})})]}),Math.ceil(((null==E?void 0:null===(s=E.prompts)||void 0===s?void 0:s.length)||0)/10)>1&&(0,i.jsx)(d.Z,{count:Math.ceil(E.prompts.length/10),page:S,onChange:(e,t)=>{k(t)}})]}),(0,i.jsx)(C.Z,{children:(0,i.jsx)(m.Z,{onClick:p,children:"Close"})})]})}var S=s(279);function k(){let e=(0,p.useSearchParams)(),[t,s]=(0,l.useState)([]),[n,Z]=(0,l.useState)("date"),[m,f]=(0,l.useState)("desc"),[C,w]=(0,l.useState)(1),[y,g]=(0,l.useState)(10),[I,k]=(0,l.useState)(!1),[P,T]=(0,l.useState)(0),_=e=>{let t=n===e&&"asc"===m?"desc":"asc";Z(e),f(t)};(0,l.useEffect)(()=>{fetch("".concat(S.CT,"/api/datasets")).then(e=>e.json()).then(e=>{let t=[...e.data].sort((e,t)=>null===n?0:"asc"===m?e[n]>t[n]?1:-1:e[n]<t[n]?1:-1);s(t)})},[n,m]),(0,l.useEffect)(()=>{let s=null==e?void 0:e.get("id");if(s){let e=t.findIndex(e=>e.id.startsWith(s));-1!==e&&D(e)}},[t,e]);let D=e=>{T(e),k(!0)};return(0,i.jsxs)(c.Z,{paddingX:2,children:[(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(v.Z,{children:[(0,i.jsx)(h.Z,{style:{width:"10%"},children:"ID"}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(x.Z,{active:"raw"===n,direction:"raw"===n?m:"asc",onClick:()=>_("raw"),children:"Info"})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:"Variables"}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:(0,i.jsx)(x.Z,{active:"count"===n,direction:"count"===n?m:"asc",onClick:()=>_("count"),children:"Total # evals"})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(j.Z,{title:"The date of the most recent eval for this set of test cases",children:(0,i.jsx)(x.Z,{active:"date"===n,direction:"date"===n?m:"asc",onClick:()=>_("date"),children:"Most recent eval date"})})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(j.Z,{title:"The ID of the most recent eval for this set of test cases",children:(0,i.jsx)(x.Z,{active:"evalId"===n,direction:"evalId"===n?m:"asc",onClick:()=>_("evalId"),children:"Most recent eval ID"})})})]})}),(0,i.jsx)(o.Z,{children:t.slice((C-1)*y,C*y).map((e,t)=>(0,i.jsxs)(v.Z,{hover:!0,onClick:()=>D(t),style:{cursor:"pointer"},children:[(0,i.jsx)(h.Z,{children:e.id.slice(0,6)}),(0,i.jsxs)(h.Z,{style:{width:"20%",whiteSpace:"pre-wrap"},children:[e.testCases.length," test cases"]}),(0,i.jsx)(h.Z,{style:{width:"20%",whiteSpace:"pre-wrap"},children:(()=>{if(!Array.isArray(e.testCases)||"string"==typeof e.testCases[0])return"";let t=(e.testCases||[]).flatMap(e=>Object.keys(e.vars||{})),s=Array.from(new Set(t));return s.length>0?s.join(", "):"None"})()}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:e.count}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:e.recentEvalDate||"Unknown"}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:e.recentEvalId?(0,i.jsx)(r(),{href:"/eval?file=".concat(e.recentEvalFilepath),children:e.recentEvalId.slice(0,6)}):"Unknown"})]},t))})]}),Math.ceil(t.length/y)>1&&(0,i.jsx)(d.Z,{count:Math.ceil(t.length/y),page:C,onChange:(e,t)=>w(t)}),t[P]&&(0,i.jsx)(E,{openDialog:I,handleClose:()=>{k(!1)},testCase:t[P]})]})}},279:function(e,t,s){"use strict";s.d(t,{CT:function(){return n},T8:function(){return l},eA:function(){return r}});var i=s(2601);let l=!i.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,n="http://localhost:15500",r=""}},function(e){e.O(0,[293,808,238,339,21,971,596,744],function(){return e(e.s=4303)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{8845:function(e,t,n){Promise.resolve().then(n.bind(n,2112)),Promise.resolve().then(n.t.bind(n,9362,23)),Promise.resolve().then(n.t.bind(n,2471,23))},2112:function(e,t,n){"use strict";n.r(t),n.d(t,{PageShell:function(){return P}});var r=n(7437),s=n(2265),o=n(2135),i=n(606),a=n(5573),l=n(3571),u=n(1396),c=n.n(u),d=n(3457),h=n(4033),f=n(6691),m=n.n(f),x=n(6507);function g(){return(0,r.jsxs)(x.Z,{className:"logo",children:[(0,r.jsx)(m(),{width:25,height:25,src:"/logo.svg",alt:"Promptfoo logo"})," ",(0,r.jsx)("span",{children:"promptfoo"})]})}n(1320);var p=n(3283),j=n(3375),v=n(5507),b=n(2653);function k(){let{user:e,logout:t}=(0,l.aC)(),[n,o]=s.useState(null),i=async()=>{null==t||t(),a()},a=()=>{o(null)};return e?(0,r.jsxs)("div",{children:[(0,r.jsx)(b.Z,{edge:"end","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:e=>{o(e.currentTarget)},color:"inherit",children:(0,r.jsx)(p.Z,{sx:{width:"1em",height:"1em",bgcolor:"#1976d2"}})}),(0,r.jsxs)(j.Z,{id:"menu-appbar",anchorEl:n,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:!!n,onClose:a,children:[(0,r.jsxs)(v.Z,{disabled:!0,children:["Logged in as ",e.email]}),(0,r.jsx)(v.Z,{onClick:i,children:"Logout"})]})]}):(0,r.jsx)(c(),{href:"/auth/signup/",children:(0,r.jsx)(b.Z,{edge:"end","aria-label":"User not logged in","aria-controls":"menu-appbar","aria-haspopup":"true",color:"inherit",children:(0,r.jsx)(p.Z,{sx:{width:"1em",height:"1em"}})})})}var E=n(9864),C=n(7028);function N(e){let{darkMode:t,onToggleDarkMode:n}=e;return(0,r.jsx)("div",{className:"dark-mode-toggle",onClick:n,children:t?(0,r.jsx)(E.Z,{}):(0,r.jsx)(C.Z,{})})}n(2794);var _=n(279);n(5154);var O=n(2601);function S(e){let{href:t,label:n}=e,s=(0,h.usePathname)()||"";return(0,r.jsx)(c(),{href:t,className:s.startsWith(t)?"active":"",children:n})}function Z(e){let{darkMode:t,onToggleDarkMode:n}=e;return O.env.NEXT_PUBLIC_NO_BROWSING?(0,r.jsxs)(d.Z,{direction:"row",spacing:2,className:"nav",children:[(0,r.jsx)(g,{}),(0,r.jsx)(N,{darkMode:t,onToggleDarkMode:n})]}):(0,r.jsxs)(d.Z,{direction:"row",spacing:2,className:"nav",children:[(0,r.jsx)(g,{}),(0,r.jsx)(S,{href:"/setup",label:"New Eval"}),(0,r.jsx)(S,{href:"/eval",label:"Evals"}),(0,r.jsx)(S,{href:"/prompts",label:"Prompts"}),(0,r.jsx)(S,{href:"/datasets",label:"Datasets"}),(0,r.jsxs)("div",{className:"right-aligned",children:[_.T8?null:(0,r.jsx)(k,{}),(0,r.jsx)(N,{darkMode:t,onToggleDarkMode:n})]})]})}function P(e){let{children:t}=e,n=(0,o.Z)("(prefers-color-scheme: dark)"),[u,c]=s.useState(n),d=s.useMemo(()=>(0,i.Z)({typography:{fontFamily:"inherit"},palette:{mode:u||n?"dark":"light"}}),[u,n]);return s.useEffect(()=>{n&&document.documentElement.setAttribute("data-theme","dark")},[n]),(0,r.jsx)(s.StrictMode,{children:(0,r.jsx)(a.Z,{theme:d,children:(0,r.jsx)(l.Ho,{children:(0,r.jsxs)(T,{children:[(0,r.jsx)(Z,{darkMode:u,onToggleDarkMode:()=>{c(!u),u?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme","dark")}}),(0,r.jsx)("div",{children:t})]})})})})}function T(e){let{children:t}=e;return(0,r.jsx)("div",{children:t})}n(5587)},279:function(e,t,n){"use strict";n.d(t,{CT:function(){return o},T8:function(){return s},eA:function(){return i}});var r=n(2601);let s=!r.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,o="http://localhost:15500",i=""},3571:function(e,t,n){"use strict";n.d(t,{Ho:function(){return d},OQ:function(){return i},aC:function(){return l}});var r=n(7437),s=n(2265),o=n(3082);let i=(0,o.createClientComponentClient)(),a=(0,s.createContext)({}),l=()=>(0,s.useContext)(a),u=(e,t)=>i.auth.signInWithPassword({email:e,password:t}),c=()=>i.auth.signOut(),d=e=>{let{children:t}=e,[n,o]=(0,s.useState)(null),[l,d]=(0,s.useState)(!1),h=(0,s.useCallback)(async()=>{let{data:e,error:t}=await i.auth.refreshSession();e&&o(e.user)},[]);return(0,s.useEffect)(()=>{h();let{data:e}=i.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?d(!1):"SIGNED_IN"===e&&t?(o(t.user),d(!0)):"SIGNED_OUT"===e&&(d(!1),o(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,r.jsx)(a.Provider,{value:{loggedIn:l,user:n,login:u,logout:c},children:t})}},2794:function(){},1320:function(){},5154:function(){},5587:function(){},2471:function(){}},function(e){e.O(0,[293,548,82,320,563,971,596,744],function(){return e(e.s=8845)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[794],{8050:function(e,t,n){Promise.resolve().then(n.bind(n,176))},176:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return S}});var i=n(7437),s=n(2265),l=n(1396),r=n.n(l),c=n(6507),d=n(2492),a=n(3701),o=n(9279),h=n(666),u=n(6988),x=n(4147),j=n(5781),Z=n(8276),v=n(4033),p=n(279),f=n(9394),m=n(2834),w=n(6337),C=n(1797),E=n(5446),P=n(3226),g=n(5551),y=e=>{var t;let{openDialog:n,handleClose:s,selectedPrompt:l}=e;return(0,i.jsxs)(f.Z,{open:n,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,i.jsxs)(C.Z,{children:["Prompt ",l.id.slice(0,6)]}),(0,i.jsxs)(w.Z,{children:[(0,i.jsx)(P.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Prompt"}),(0,i.jsx)(E.u,{readOnly:!0,value:null==l?void 0:null===(t=l.prompt)||void 0===t?void 0:t.raw,style:{width:"100%",padding:"0.75rem"},maxRows:50}),(0,i.jsx)(P.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Used in..."}),(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(h.Z,{children:"Eval ID"}),(0,i.jsx)(h.Z,{children:"Dataset ID"}),(0,i.jsx)(h.Z,{children:"Raw score"}),(0,i.jsx)(h.Z,{children:"Pass rate"}),(0,i.jsx)(h.Z,{children:"Pass count"}),(0,i.jsx)(h.Z,{children:"Fail count"})]})}),(0,i.jsx)(o.Z,{children:null==l?void 0:l.evals.sort((e,t)=>t.id.localeCompare(e.id)).map(e=>{var t,n,s,l,c,d;let a=null!==(l=null===(t=e.metrics)||void 0===t?void 0:t.testPassCount)&&void 0!==l?l:0,o=null!==(c=null===(n=e.metrics)||void 0===n?void 0:n.testFailCount)&&void 0!==c?c:0,u=a+o>0?(a/(a+o)*100).toFixed(2)+"%":"-";return(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(h.Z,{children:(0,i.jsx)(r(),{href:"/eval/?file=".concat(e.filePath),children:e.id.slice(0,6)})}),(0,i.jsx)(h.Z,{children:(0,i.jsx)(r(),{href:"/datasets/?id=".concat(e.datasetId),children:e.datasetId.slice(0,6)})}),(0,i.jsx)(h.Z,{children:null!==(d=null===(s=e.metrics)||void 0===s?void 0:s.score.toFixed(2))&&void 0!==d?d:"-"}),(0,i.jsx)(h.Z,{children:u}),(0,i.jsx)(h.Z,{children:a}),(0,i.jsx)(h.Z,{children:o})]},"eval-".concat(e.id))})})]})]}),(0,i.jsx)(m.Z,{children:(0,i.jsx)(g.Z,{onClick:s,children:"Close"})})]})};function S(){let e=(0,v.useSearchParams)(),[t,n]=(0,s.useState)([]),[l,f]=(0,s.useState)("date"),[m,w]=(0,s.useState)("desc"),[C,E]=(0,s.useState)(1),[P,g]=(0,s.useState)(10),[S,_]=(0,s.useState)(!1),[k,D]=(0,s.useState)(0),I=e=>{let t=l===e&&"asc"===m?"desc":"asc";f(e),w(t)};(0,s.useEffect)(()=>{fetch("".concat(p.CT,"/api/prompts")).then(e=>e.json()).then(e=>{let t=[...e.data].sort((e,t)=>null===l?0:"asc"===m?e[l]>t[l]?1:-1:e[l]<t[l]?1:-1);n(t)})},[l,m]),(0,s.useEffect)(()=>{let n=null==e?void 0:e.get("id");if(n){let e=t.findIndex(e=>e.id.startsWith(n));-1!==e&&T(e)}},[t,e]);let T=e=>{_(!0),D(e)};return(0,i.jsxs)(c.Z,{paddingX:2,children:[(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(h.Z,{style:{width:"10%"},children:"ID"}),(0,i.jsx)(h.Z,{style:{width:"60%"},children:(0,i.jsx)(j.Z,{active:"raw"===l,direction:"raw"===l?m:"asc",onClick:()=>I("raw"),children:"Prompt"})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(Z.Z,{title:"The date of the most recent eval for this prompt",children:(0,i.jsx)(j.Z,{active:"date"===l,direction:"date"===l?m:"asc",onClick:()=>I("date"),children:"Most recent eval"})})}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:(0,i.jsx)(j.Z,{active:"count"===l,direction:"count"===l?m:"asc",onClick:()=>I("count"),children:"# Evals"})})]})}),(0,i.jsx)(o.Z,{children:t.slice((C-1)*P,C*P).map((e,t)=>(0,i.jsxs)(x.Z,{hover:!0,children:[(0,i.jsx)(h.Z,{style:{width:"10%"},children:e.id.slice(0,6)}),(0,i.jsx)(h.Z,{style:{width:"60%",whiteSpace:"pre-wrap",cursor:"pointer"},onClick:()=>T(t),children:e.prompt.raw.length>500?e.prompt.raw.slice(0,500)+"...":e.prompt.raw}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:e.recentEvalDate?(0,i.jsx)(r(),{href:"/eval?file=".concat(e.recentEvalId),children:e.recentEvalDate}):"Unknown"}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:e.count})]},t))})]}),Math.ceil(t.length/P)>1&&(0,i.jsx)(d.Z,{count:Math.ceil(t.length/P),page:C,onChange:(e,t)=>E(t)}),t[k]&&(0,i.jsx)(y,{openDialog:S,handleClose:()=>{_(!1)},selectedPrompt:t[k]})]})}},279:function(e,t,n){"use strict";n.d(t,{CT:function(){return l},T8:function(){return s},eA:function(){return r}});var i=n(2601);let s=!i.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,l="http://localhost:15500",r=""}},function(e){e.O(0,[293,808,238,21,971,596,744],function(){return e(e.s=8050)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[413],{3515:function(e,t,n){Promise.resolve().then(n.bind(n,2378))},2378:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ec}});var a=n(7437),r=n(2265),i=n(5551),l=n(8938),o=n(3226),s=n(6507),c=n(3457),d=n(9394),p=n(2834),u=n(6337),h=n(4173),x=n(1797),m=n(4740),j=n(4033),g=n(6882),f=n(1938),v=n(279),Z=()=>{let e=(0,j.useRouter)(),{env:t,description:n,providers:l,prompts:o,testCases:s}=(0,f.o)(),[c,d]=(0,r.useState)(!1),[p,u]=(0,r.useState)(0),h=async()=>{d(!0);try{let a=await fetch("".concat(v.eA,"/api/eval/"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t,description:n,providers:l,prompts:o,tests:s})});if(!a.ok)throw Error("HTTP error! status: ".concat(a.status));let r=await a.json(),i=setInterval(async()=>{let t=await fetch("".concat(v.eA,"/api/eval/").concat(r.id,"/"));if(!t.ok)throw clearInterval(i),Error("HTTP error! status: ".concat(t.status));let n=await t.json();if("complete"===n.status)clearInterval(i),d(!1),v.T8?e.push("/eval"):e.push("/eval/remote:".concat(encodeURIComponent(r.id)));else if("failed"===n.status)throw clearInterval(i),d(!1),Error("Job failed");else{let e=0===n.total?0:Math.round(n.progress/n.total*100);u(e)}},1e3)}catch(e){console.error(e),d(!1),alert("An error occurred: ".concat(e.message))}};return(0,a.jsx)(i.Z,{variant:"contained",color:"primary",onClick:h,disabled:c,children:c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.Z,{size:24,sx:{marginRight:2}}),p.toFixed(0),"% complete"]}):"Run Evaluation"})},b=n(2057),y=n(8768),C=n(5873),_=n(1975),k=n(3295),A=()=>{let{env:e,setEnv:t}=(0,f.o)(),[n,l]=(0,r.useState)(!1),[o,s]=(0,r.useState)(e),c=()=>{l(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Z,{variant:"outlined",startIcon:(0,a.jsx)(k.Z,{}),onClick:()=>{l(!0)},children:"API keys"}),(0,a.jsxs)(d.Z,{open:n,onClose:c,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Provider settings"}),(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(b.Z,{defaultExpanded:!0,children:[(0,a.jsx)(C.Z,{children:"OpenAI"}),(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(_.Z,{label:"OpenAI API key",fullWidth:!0,margin:"normal",value:o.OPENAI_API_KEY,onChange:e=>s({...o,OPENAI_API_KEY:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI API host",fullWidth:!0,margin:"normal",value:o.OPENAI_API_HOST,onChange:e=>s({...o,OPENAI_API_HOST:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI organization",fullWidth:!0,margin:"normal",value:o.OPENAI_ORGANIZATION,onChange:e=>s({...o,OPENAI_ORGANIZATION:e.target.value})})]})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Azure"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Azure API key",fullWidth:!0,margin:"normal",value:o.AZURE_OPENAI_API_KEY,onChange:e=>s({...o,AZURE_OPENAI_API_KEY:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Amazon Bedrock"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Bedrock Region",fullWidth:!0,margin:"normal",value:o.AWS_BEDROCK_REGION,onChange:e=>s({...o,AWS_BEDROCK_REGION:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Anthropic"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Anthropic API key",fullWidth:!0,margin:"normal",value:o.ANTHROPIC_API_KEY,onChange:e=>s({...o,ANTHROPIC_API_KEY:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Google Vertex AI"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex API Key",fullWidth:!0,margin:"normal",value:o.VERTEX_API_KEY,onChange:e=>s({...o,VERTEX_API_KEY:e.target.value})})}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex Project ID",fullWidth:!0,margin:"normal",value:o.VERTEX_PROJECT_ID,onChange:e=>s({...o,VERTEX_PROJECT_ID:e.target.value})})}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex Region",fullWidth:!0,margin:"normal",value:o.VERTEX_REGION,onChange:e=>s({...o,VERTEX_REGION:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Replicate"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Replicate API key",fullWidth:!0,margin:"normal",value:o.REPLICATE_API_KEY,onChange:e=>s({...o,REPLICATE_API_KEY:e.target.value})})})]})]}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:c,color:"primary",children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{t(o),c()},color:"primary",variant:"contained",children:"Save"})]})]})]})},E=n(2653),I=n(3701),S=n(9279),P=n(666),T=n(5795),O=n(4147),w=n(8276),R=n(3391),N=n(6446),W=n(1280),z=n(9329),V=e=>{let{open:t,prompt:n,index:l,onAdd:o,onCancel:s}=e,[c,h]=r.useState(n),m=r.useRef(null);r.useEffect(()=>{h(n)},[n]);let j=e=>{o(c),h(""),e?s():m.current&&m.current.focus()};return(0,a.jsxs)(d.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Edit Prompt ".concat(l+1)}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(_.Z,{value:c,onChange:e=>h(e.target.value),fullWidth:!0,margin:"normal",multiline:!0,placeholder:"The quick brown {{animal1}} jumps over the lazy {{animal2}}.",helperText:"Tip: use the {{varname}} syntax to add variables to your prompt.",inputRef:m})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:j.bind(null,!0),color:"primary",variant:"contained",disabled:!c.length,children:"Add"}),(0,a.jsx)(i.Z,{onClick:j.bind(null,!1),color:"primary",variant:"contained",disabled:!c.length,children:"Add Another"}),(0,a.jsx)(i.Z,{onClick:s,color:"secondary",children:"Cancel"})]})]})};n(2280);var F=()=>{let[e,t]=(0,r.useState)(!1),[n,l]=(0,r.useState)(null),{prompts:s,setPrompts:d}=(0,f.o)(),p=(0,r.useRef)(null);(0,r.useEffect)(()=>{null!==n&&n>0&&p.current&&p.current.focus()},[n]);let u=e=>{l(e),t(!0)},h=(e,t)=>{e.stopPropagation();let n=s[t];d([...s,n])},x=(e,t)=>{d(s.map((n,a)=>a===e?t:n))},m=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to remove this prompt?")&&d(s.filter((e,n)=>n!==t))};return(0,a.jsxs)("div",{children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(o.Z,{variant:"h5",children:"Prompts"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-prompt",children:(0,a.jsx)(w.Z,{title:"Upload prompt from file",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(W.Z,{})}),(0,a.jsx)("input",{id:"file-input-add-prompt",type:"file",accept:".txt,.md",onChange:e=>{var t;e.stopPropagation(),e.preventDefault();let n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(n){let e=new FileReader;e.onload=e=>{var t,n;let a=null===(n=e.target)||void 0===n?void 0:null===(t=n.result)||void 0===t?void 0:t.toString();a&&d([...s,a])},e.readAsText(n)}},style:{display:"none"}})]})})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>{t(!0)},variant:"contained",children:"Add Prompt"})]})]}),(0,a.jsx)(T.Z,{children:(0,a.jsx)(I.Z,{children:(0,a.jsx)(S.Z,{children:0===s.length?(0,a.jsx)(O.Z,{children:(0,a.jsx)(P.Z,{colSpan:2,align:"center",children:"No prompts added yet."})}):s.map((e,t)=>(0,a.jsxs)(O.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>u(t),children:[(0,a.jsx)(P.Z,{children:(0,a.jsxs)(o.Z,{variant:"body2",children:["Prompt #".concat(t+1,": "),(e.length>250?e.slice(0,250)+" ...":e).split(/({{\w+}})/g).map((e,t)=>/{{\w+}}/g.test(e)?(0,a.jsx)("span",{className:"prompt-var-highlight",children:e},t):e)]})}),(0,a.jsxs)(P.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>u(t),size:"small",children:(0,a.jsx)(R.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(z.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>m(e,t),size:"small",children:(0,a.jsx)(N.Z,{})})]})]},t))})})}),(0,a.jsx)(V,{open:e,prompt:null!==n?s[n]:"",index:null!==n?n:0,onAdd:e=>{null!==n?x(n,e):d([...s,e]),l(null)},onCancel:()=>{l(null),t(!1)}})]})},L=n(6988),K=e=>{let{onAdd:t,varsList:n,initialValues:i}=e,[l,d]=r.useState(i||{});return(0,r.useEffect)(()=>{let e={};n.forEach(t=>{e[t]=(null==i?void 0:i[t])||""}),d(e)},[n,i]),(0,a.jsxs)(s.Z,{my:2,children:[(0,a.jsx)(o.Z,{variant:"h6",mb:2,children:"Vars"}),n.length>0?(0,a.jsx)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:Object.keys(l).map((e,n)=>(0,a.jsx)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:(0,a.jsx)(_.Z,{placeholder:e,label:e,value:l[e],fullWidth:!0,onChange:n=>{let a=n.target.value,r={...l,[e]:a};d(r),t(r)}})},n))}):(0,a.jsxs)(o.Z,{variant:"subtitle1",gutterBottom:!0,children:["Add variables to your prompt using the ","{{varname}}"," syntax."]})]})},B=n(8440);let Y=["equals","contains","icontains","contains-all","contains-any","starts-with","regex","is-json","contains-json","similar","llm-rubric","model-graded-closedqa","model-graded-factuality","webhook","rouge-n","rouge-s","rouge-l","not-equals","not-contains","not-icontains","not-contains-all","not-contains-any","not-starts-with","not-regex","not-is-json","not-contains-json","not-similar","not-webhook","not-rouge-n","not-rouge-s","not-rouge-l"];var J=e=>{let{onAdd:t,initialValues:n}=e,[l,d]=(0,r.useState)(n||[]),p=e=>{let n=l.filter((t,n)=>n!==e);d(n),t(n)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Z,{variant:"h6",children:"Asserts"}),(0,a.jsx)(s.Z,{my:l.length>0?2:0,children:(0,a.jsx)(c.Z,{direction:"column",spacing:2,children:l.map((e,n)=>(0,a.jsxs)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:[(0,a.jsx)(B.Z,{value:e.type,options:Y,sx:{minWidth:200},onChange:(e,a)=>{let r=l.map((e,t)=>t===n?{...e,type:a}:e);d(r),t(r)},renderInput:e=>(0,a.jsx)(_.Z,{...e,label:"Type"})}),(0,a.jsx)(_.Z,{label:"Value",value:e.value,fullWidth:!0,onChange:e=>{let a=e.target.value,r=l.map((e,t)=>t===n?{...e,value:a}:e);d(r),t(r)}}),(0,a.jsx)(E.Z,{onClick:()=>p(n),size:"small",children:(0,a.jsx)(N.Z,{})})]},n))})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>{let e=[...l,{type:"equals",value:""}];d(e),t(e)},children:"Add Assert"})]})},U=e=>{let{open:t,onAdd:n,varsList:l,initialValues:o,onCancel:c}=e,[h,m]=(0,r.useState)((null==o?void 0:o.description)||""),[j,g]=(0,r.useState)((null==o?void 0:o.vars)||{}),[f,v]=(0,r.useState)((null==o?void 0:o.assert)||[]),[Z,b]=(0,r.useState)(0);r.useEffect(()=>{o?(m(o.description||""),g(o.vars||{}),v(o.assert||[])):(m(""),g({}),v([]))},[o]);let y=e=>{n({description:h,vars:j,assert:f},e),e&&c(),m(""),g({}),v([]),b(e=>e+1)};return(0,a.jsxs)(d.Z,{open:t,onClose:c,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:o?"Edit Test Case":"Add Test Case"}),(0,a.jsx)(u.Z,{children:(0,a.jsxs)(s.Z,{children:[(0,a.jsx)(K,{onAdd:e=>g(e),varsList:l,initialValues:null==o?void 0:o.vars}),(0,a.jsx)(J,{onAdd:e=>v(e),initialValues:(null==o?void 0:o.assert)||[]},Z)]})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:y.bind(void 0,!0),color:"primary",variant:"contained",children:o?"Update Test Case":"Add Test Case"}),!o&&(0,a.jsx)(i.Z,{onClick:y.bind(void 0,!1),color:"primary",variant:"contained",children:"Add Another"}),(0,a.jsx)(i.Z,{onClick:c,color:"secondary",children:"Cancel"})]})]})},D=e=>{let{varsList:t}=e,{testCases:n,setTestCases:l}=(0,f.o)(),[s,d]=r.useState(null),[p,u]=r.useState(!1),h=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to delete this test case?")&&l(n.filter((e,n)=>n!==t))},x=(e,t)=>{e.stopPropagation();let a=JSON.parse(JSON.stringify(n[t]));l([...n,a])};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(o.Z,{variant:"h5",children:"Test Cases"}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>u(!0),variant:"contained",children:"Add Test Case"})]}),(0,a.jsx)(T.Z,{children:(0,a.jsxs)(I.Z,{children:[(0,a.jsx)(L.Z,{children:(0,a.jsxs)(O.Z,{children:[(0,a.jsx)(P.Z,{children:"Description"}),(0,a.jsx)(P.Z,{children:"Assertions"}),(0,a.jsx)(P.Z,{children:"Variables"}),(0,a.jsx)(P.Z,{align:"right"})]})}),(0,a.jsx)(S.Z,{children:0===n.length?(0,a.jsx)(O.Z,{children:(0,a.jsx)(P.Z,{colSpan:4,align:"center",children:"No test cases added yet."})}):n.map((e,t)=>{var n;return(0,a.jsxs)(O.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>{d(t),u(!0)},children:[(0,a.jsx)(P.Z,{children:(0,a.jsx)(o.Z,{variant:"body2",children:e.description||"Test Case #".concat(t+1)})}),(0,a.jsxs)(P.Z,{children:[(null===(n=e.assert)||void 0===n?void 0:n.length)||0," assertions"]}),(0,a.jsx)(P.Z,{children:Object.entries(e.vars||{}).map(e=>{let[t,n]=e;return t+"="+n}).join(", ")}),(0,a.jsxs)(P.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>{d(t),u(!0)},size:"small",children:(0,a.jsx)(R.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(z.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(N.Z,{})})]})]},t)})})]})}),(0,a.jsx)(U,{open:p,onAdd:(e,t)=>{if(null===s)l([...n,e]);else{let t=n.map((t,n)=>n===s?e:t);l(t),d(null)}t&&u(!1)},varsList:t,initialValues:null!==s?n[s]:void 0,onCancel:()=>{d(null),u(!1)}})]})},q=n(7827),G=e=>{let{onChange:t,...n}=e,[i,l]=r.useState(""),[o,s]=r.useState(!1);return(0,a.jsx)(_.Z,{...n,error:o,helperText:o?"Invalid JSON":"",value:i,onChange:e=>{let n=e.target.value;try{let e=JSON.parse(n);l(n),s(!1),t&&t(e)}catch(e){l(n),s(!0)}}})},X=e=>{let{open:t,providerId:n,config:l,onClose:o,onSave:c}=e,[h,m]=r.useState(l);return r.useEffect(()=>{m(l)},[l]),(0,a.jsxs)(d.Z,{open:t,onClose:o,fullWidth:!0,maxWidth:"md",children:[(0,a.jsxs)(x.Z,{children:["Edit ",n.length>50?n.slice(0,50)+"...":n]}),(0,a.jsx)(u.Z,{children:Object.keys(h).map(e=>{let t;let n=h[e];return"number"==typeof n||"boolean"==typeof n||"string"==typeof n?(t="number"==typeof n?t=>m({...h,[e]:parseFloat(t.target.value)}):"boolean"==typeof n?t=>m({...h,[e]:"true"===t.target.value}):t=>{let n=t.target.value.trim();if(n.startsWith("{")||n.startsWith("["))try{m({...h,[e]:JSON.parse(n)})}catch(t){m({...h,[e]:n})}else"null"===n?m({...h,[e]:null}):"undefined"===n?m({...h,[e]:void 0}):m({...h,[e]:n})},(0,a.jsx)(s.Z,{my:2,children:(0,a.jsx)(_.Z,{label:e,value:n,onChange:t,fullWidth:!0,InputLabelProps:{shrink:!0},type:"number"==typeof n?"number":"text"})},e)):(0,a.jsx)(s.Z,{my:2,children:(0,a.jsx)(G,{label:e,defaultValue:JSON.stringify(n),onChange:t=>{m({...h,[e]:t})},fullWidth:!0,multiline:!0,minRows:2,InputLabelProps:{shrink:!0}})},e)})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:o,children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{c(h)},children:"Save"})]})]})};let H=[].concat(["replicate:replicate/flan-t5-small:69716ad8c34274043bf4a135b7315c7c569ec931d8f23d6826e249e1c142a264"].map(e=>({id:e,config:{temperature:.5,max_length:1024,repetition_penality:1}}))).concat(["replicate:replicate/codellama-7b-instruct:0103579e86fc75ba0d65912890fa19ef03c84a68554635319accf2e0ba93d3ae","replicate:replicate/codellama-13b-instruct:da5676342de1a5a335b848383af297f592b816b950a43d251a0a9edd0113604b","replicate:replicate/llama-2-70b-chat:2796ee9483c3fd7aa2e171d38f4ca12251a30609463dcfd4cd76703f22e96cdf"].map(e=>({id:e,config:{system_prompt:"",temperature:.75,top_p:.9,top_k:50,max_new_tokens:128,min_new_tokens:-1}}))).concat(["replicate:replicate/codellama-7b:6880b103613a9cd23950c5fd6c140197e519905bd0dd00e448c4858bdd06090a","replicate:replicate/codellama-13b-python:09b87c02dfa403e0c3289166dece62286b3bce49bae39a9c9204713cf94b8b7d","replicate:replicate/codellama-13b:1c914d844307b0588599b8393480a3ba917b660c7e9dfae681542b5325f228db","replicate:replicate/codellama-34b-python:9048743d22a7b19cd0abb018066809ea6af4f2b4717bef9aad3c5ae21ceac00d","replicate:replicate/codellama-34b:0666717e5ead8557dff55ee8f11924b5c0309f5f1ca52f64bb8eec405fdb38a7"].map(e=>({id:e,config:{temperature:.75,top_p:.9,top_k:50,max_new_tokens:128,min_new_tokens:-1}}))).concat(["replicate:a16z-infra/llama-2-7b-chat:7b0bfc9aff140d5b75bacbed23e91fd3c34b01a1e958d32132de6e0a19796e2c","replicate:a16z-infra/llama-2-13b-chat:2a7f981751ec7fdf87b5b91ad4db53683a98082e9ff7bfd12c8cd5ea85980a52"].map(e=>({id:e,config:{temperature:.95,top_p:.95,top_k:250,max_new_tokens:500,min_new_tokens:-1,repetition_penality:1,system_prompt:""}}))).concat(["anthropic:claude-1","anthropic:claude-1-100k","anthropic:claude-instant-1","anthropic:claude-instant-1-100k"].map(e=>({id:e,config:{max_tokens_to_sample:256,temperature:.5}}))).concat(["bedrock:anthropic.claude-instant-v1","bedrock:anthropic.claude-v1","bedrock:anthropic.claude-v2"].map(e=>({id:e,config:{max_tokens_to_sample:256,temperature:.5}}))).concat(["openai:gpt-3.5-turbo","openai:gpt-3.5-turbo-0301","openai:gpt-3.5-turbo-0613","openai:gpt-3.5-turbo-16k","openai:gpt-3.5-turbo-16k-0613","openai:gpt-4","openai:gpt-4-0314","openai:gpt-4-0613","openai:gpt-4-32k","openai:gpt-4-32k-0314"].map(e=>({id:e,config:{organization:"",temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0,function_call:void 0,functions:void 0,stop:void 0}}))).concat(["azureopenai:gpt-3.5-turbo","azureopenai:gpt-3.5-turbo-0301","azureopenai:gpt-3.5-turbo-0613","azureopenai:gpt-3.5-turbo-16k","azureopenai:gpt-3.5-turbo-16k-0613","azureopenai:gpt-4","azureopenai:gpt-4-0314","azureopenai:gpt-4-0613","azureopenai:gpt-4-32k","azureopenai:gpt-4-32k-0314"].map(e=>({id:e,config:{temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0,function_call:void 0,functions:void 0,stop:void 0}}))).concat(["vertex:chat-bison@001","vertex:chat-bison","vertex:chat-bison-32k","vertex:chat-bison-32k@001"].map(e=>({id:e,config:{context:void 0,examples:void 0,temperature:0,maxOutputTokens:1024,topP:.95,topK:40,safetySettings:void 0,stopSequence:void 0}}))).sort((e,t)=>e.id.localeCompare(t.id)),M={anthropic:"Anthropic",bedrock:"Amazon Web Services",azureopenai:"Azure",openai:"OpenAI",replicate:"Replicate"};var Q=e=>{let{providers:t,onChange:n}=e,[i,l]=r.useState(null),o=e=>"string"==typeof e?e:e.id||"Unknown provider",c=(e,t)=>"string"==typeof e?e:e.id||t,d=e=>{"string"==typeof e?alert("Cannot edit custom providers"):e.config?l(e):alert("There is no config for this provider")};return(0,a.jsxs)(s.Z,{mt:2,children:[(0,a.jsx)(B.Z,{multiple:!0,freeSolo:!0,options:H,value:t,groupBy:e=>(function(e){if(!e)return"Other";let t=e.split(":")[0];return M[t]||t})(e.id),onChange:(e,t)=>{n(t.map(e=>"string"==typeof e?{id:e}:e))},getOptionLabel:e=>{if(!e)return"";let t="";"string"==typeof e&&(t=e),e.id&&"string"==typeof e.id&&(t=e.id);let n=t.split(":");return n.length>1?n[1]:"Unknown provider"},renderTags:(e,t)=>e.map((e,n)=>{let a=o(e),i=c(e,n);return(0,r.createElement)(q.Z,{variant:"outlined",label:a,...t({index:n}),key:i,onClick:()=>d(e)})}),renderInput:e=>(0,a.jsx)(_.Z,{...e,variant:"outlined",placeholder:"Select LLM providers",helperText:t.length>0?"Click a provider to configure its settings.":null})}),i&&i.id&&(0,a.jsx)(X,{open:!!i,providerId:i.id,config:i.config,onClose:()=>l(null),onSave:e=>{if(i){let a=t.map(t=>t.id===i.id?{...t,config:e}:t);n(a),l(null)}}})]})},$=n(3425),ee=n.n($),et=n(4759);n(5341),n(7555);var en=n(8339),ea=n(9963),er=n(1396),ei=n.n(er);n(695);var el=()=>{let{env:e,setEnv:t,description:n,setDescription:l,providers:c,setProviders:d,prompts:p,setPrompts:u,testCases:h,setTestCases:x}=(0,f.o)(),[m,j]=r.useState(""),[g,v]=r.useState(!0);r.useEffect(()=>{j(en.default.dump({env:e,description:n,providers:c,prompts:p,tests:h}))},[e,n,c,p,h]);let Z=e=>{t(e.env||{}),l(e.description||""),d(e.providers||[]),u(e.prompts||[]),x(e.tests||[])};return(0,a.jsxs)(s.Z,{mt:4,children:[(0,a.jsx)(o.Z,{variant:"h5",gutterBottom:!0,children:"Configuration"}),(0,a.jsxs)(o.Z,{variant:"body1",gutterBottom:!0,children:["This is the YAML config that defines the evaluation and is processed by promptfoo. See"," ",(0,a.jsx)(ei(),{target:"_blank",href:"https://promptfoo.dev/docs/configuration/guide",children:"configuration docs"})," ","to learn more."]}),(0,a.jsx)(i.Z,{variant:"text",color:"primary",startIcon:g?(0,a.jsx)(R.Z,{}):(0,a.jsx)(ea.Z,{}),onClick:()=>{if(!g)try{let e=en.default.load(m,{json:!0});Z(e)}catch(e){}v(!g)},children:g?"Edit YAML":"Save"}),(0,a.jsx)(ee(),{autoCapitalize:"off",value:m,onValueChange:e=>{g||j(e)},highlight:e=>(0,et.highlight)(e,et.languages.yaml),padding:10,style:{fontFamily:'"Fira code", "Fira Mono", monospace',fontSize:14},disabled:g,className:g?"":"glowing-border"})]})};n(284);var eo=n(2601);function es(e){let{error:t,resetErrorBoundary:n}=e;return(0,a.jsxs)("div",{role:"alert",children:[(0,a.jsx)("p",{children:"Something went wrong:"}),(0,a.jsx)("pre",{children:t.message}),(0,a.jsx)("button",{onClick:n,children:"Try again"})]})}var ec=()=>{let[e,t]=(0,r.useState)(!1),{description:n,setDescription:j,providers:g,setProviders:v,prompts:b,setPrompts:y,testCases:C,setTestCases:_}=(0,f.o)();if((0,r.useEffect)(()=>{f.o.persist.rehydrate()},[]),eo.env.NEXT_PUBLIC_NO_BROWSING)return null;let k=(e=>{let t=/{{(\w+)}}/g,n=new Set;return e.forEach(e=>{let a;for(;null!==(a=t.exec(e));)n.add(a[1])}),Array.from(n)})(b);return(0,a.jsxs)(l.Z,{maxWidth:"lg",sx:{marginTop:"2rem"},children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(o.Z,{variant:"h4",children:"Set up an evaluation"}),(0,a.jsxs)(c.Z,{direction:"row",spacing:2,children:[(0,a.jsx)(Z,{}),(0,a.jsx)(A,{}),(0,a.jsx)(i.Z,{variant:"outlined",color:"primary",onClick:()=>t(!0),children:"Reset"})]})]}),(0,a.jsx)(s.Z,{mt:4}),(0,a.jsx)(s.Z,{mt:2,children:(0,a.jsx)(m.SV,{FallbackComponent:es,onReset:()=>{v([])},children:(0,a.jsxs)(c.Z,{direction:"column",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(o.Z,{variant:"h5",children:"Providers"}),(0,a.jsx)(Q,{providers:g,onChange:v})]})})}),(0,a.jsx)(s.Z,{mt:4}),(0,a.jsx)(m.SV,{FallbackComponent:es,onReset:()=>{y([])},children:(0,a.jsx)(F,{})}),(0,a.jsx)(s.Z,{mt:6}),(0,a.jsx)(m.SV,{FallbackComponent:es,onReset:()=>{_([])},children:(0,a.jsx)(D,{varsList:k})}),(0,a.jsx)(el,{}),(0,a.jsxs)(d.Z,{open:e,onClose:()=>t(!1),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,a.jsx)(x.Z,{id:"alert-dialog-title",children:"Confirm Reset"}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(h.Z,{id:"alert-dialog-description",children:"Are you sure you want to reset all the fields? This action cannot be undone."})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:()=>t(!1),children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{j(""),v([]),y([]),_([]),t(!1)},autoFocus:!0,children:"Reset"})]})]})]})}},279:function(e,t,n){"use strict";n.d(t,{CT:function(){return i},T8:function(){return r},eA:function(){return l}});var a=n(2601);let r=!a.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,i="http://localhost:15500",l=""},1938:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var a=n(4660),r=n(4810);let i=(0,a.Ue)()((0,r.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setStateFromConfig:t=>{let n={};t.description&&(n.description=t.description||""),t.tests&&(n.testCases=t.tests),t.providers&&(n.providers=t.providers),t.prompts&&("string"==typeof t.prompts?n.prompts=[t.prompts]:Array.isArray(t.prompts)?n.prompts=t.prompts.filter(e=>!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),e(n)},getTestSuite:()=>{let{description:e,testCases:n,providers:a,prompts:r,env:i}=t();return{env:i,description:e,providers:a,prompts:r,tests:n}}}),{name:"promptfoo",skipHydration:!0}))},2280:function(){},695:function(){},284:function(){}},function(e){e.O(0,[293,808,548,238,975,320,339,919,753,971,596,744],function(){return e(e.s=3515)}),_N_E=e.O()}]);
|
|
File without changes
|
|
File without changes
|