promptfoo 0.72.0 → 0.72.2
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/LICENSE +1 -1
- package/dist/package.json +3 -2
- package/dist/src/assertions/validateAssertions.d.ts +1 -1
- package/dist/src/assertions/validateAssertions.d.ts.map +1 -1
- package/dist/src/assertions/validateAssertions.js +7 -7
- package/dist/src/assertions/validateAssertions.js.map +1 -1
- package/dist/src/commands/eval.d.ts.map +1 -1
- package/dist/src/commands/eval.js +10 -0
- package/dist/src/commands/eval.js.map +1 -1
- package/dist/src/commands/generate/redteam.d.ts +43 -13
- package/dist/src/commands/generate/redteam.d.ts.map +1 -1
- package/dist/src/commands/generate/redteam.js +63 -22
- package/dist/src/commands/generate/redteam.js.map +1 -1
- package/dist/src/commands/redteam.d.ts +0 -7
- package/dist/src/commands/redteam.d.ts.map +1 -1
- package/dist/src/commands/redteam.js +72 -89
- package/dist/src/commands/redteam.js.map +1 -1
- package/dist/src/commands/share.d.ts.map +1 -1
- package/dist/src/commands/share.js +4 -1
- package/dist/src/commands/share.js.map +1 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +1 -20
- package/dist/src/config.js.map +1 -1
- package/dist/src/database.d.ts +1174 -3
- package/dist/src/database.d.ts.map +1 -1
- package/dist/src/matchers.d.ts.map +1 -1
- package/dist/src/matchers.js +6 -2
- package/dist/src/matchers.js.map +1 -1
- package/dist/src/onboarding.d.ts.map +1 -1
- package/dist/src/onboarding.js +23 -36
- package/dist/src/onboarding.js.map +1 -1
- package/dist/src/providers/bedrock.js +1 -1
- package/dist/src/providers/bedrock.js.map +1 -1
- package/dist/src/providers/cohere.d.ts.map +1 -1
- package/dist/src/providers/cohere.js +4 -1
- package/dist/src/providers/cohere.js.map +1 -1
- package/dist/src/providers/manualInput.d.ts.map +1 -1
- package/dist/src/providers/manualInput.js +3 -22
- package/dist/src/providers/manualInput.js.map +1 -1
- package/dist/src/providers/openai.d.ts.map +1 -1
- package/dist/src/providers/openai.js +7 -0
- package/dist/src/providers/openai.js.map +1 -1
- package/dist/src/providers.d.ts.map +1 -1
- package/dist/src/providers.js +8 -6
- package/dist/src/providers.js.map +1 -1
- package/dist/src/redteam/constants.d.ts +2 -2
- package/dist/src/redteam/constants.d.ts.map +1 -1
- package/dist/src/redteam/constants.js +13 -3
- package/dist/src/redteam/constants.js.map +1 -1
- package/dist/src/redteam/index.d.ts +4 -6
- package/dist/src/redteam/index.d.ts.map +1 -1
- package/dist/src/redteam/index.js +43 -37
- package/dist/src/redteam/index.js.map +1 -1
- package/dist/src/redteam/methods/injections.d.ts.map +1 -1
- package/dist/src/redteam/methods/injections.js +8 -10
- package/dist/src/redteam/methods/injections.js.map +1 -1
- package/dist/src/redteam/plugins/harmful.d.ts +1 -2
- package/dist/src/redteam/plugins/harmful.d.ts.map +1 -1
- package/dist/src/redteam/plugins/harmful.js +3 -4
- package/dist/src/redteam/plugins/harmful.js.map +1 -1
- package/dist/src/redteam/plugins/pii.d.ts +10 -10
- package/dist/src/redteam/plugins/pii.d.ts.map +1 -1
- package/dist/src/redteam/plugins/pii.js +40 -53
- package/dist/src/redteam/plugins/pii.js.map +1 -1
- package/dist/src/redteam/providers/iterative.d.ts.map +1 -1
- package/dist/src/redteam/providers/iterative.js +2 -1
- package/dist/src/redteam/providers/iterative.js.map +1 -1
- package/dist/src/types.d.ts +32108 -191
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +263 -3
- package/dist/src/types.js.map +1 -1
- package/dist/src/util/index.d.ts +539 -3
- package/dist/src/util/index.d.ts.map +1 -1
- package/dist/src/util/index.js +1 -3
- package/dist/src/util/index.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/737-943974fecba93f75.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/auth/login/{page-2e6452987650f232.js → page-2e2c0c725127ea2d.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/auth/signup/{page-d81a6cfb22f8b8a2.js → page-ccdb1f6890601666.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/datasets/page-642db4f4a8e8ba40.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/not-found-ce320e6d1e6d1d23.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/{page-81aa116b34ef4a6b.js → page-b548dd256b91e882.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/eval/page-32eaa14d2384c5b0.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/layout-0f40deeb4ea7726a.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/{page-122e9cfa52eb218a.js → page-e07a0ddbf3d6e21c.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/progress/{page-aa447776a6487d50.js → page-462526776efd6fd6.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/prompts/{page-ac63288a243a9872.js → page-0ae78bc0bf7c56bc.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/report/{page-be70065fb1472831.js → page-e4f7851d41eb0f92.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/app/setup/{page-b19fc52e084a3efe.js → page-6cde750ec428cd75.js} +1 -1
- package/dist/src/web/nextui/_next/static/chunks/main-app-b098e35d79d23e0a.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/{webpack-8a9bc9ee0defb756.js → webpack-c9f728822666f852.js} +1 -1
- package/dist/src/web/nextui/_next/static/css/5bd2f45de1f3ba83.css +1 -0
- package/dist/src/web/nextui/auth/login/index.html +1 -1
- package/dist/src/web/nextui/auth/login/index.txt +6 -6
- package/dist/src/web/nextui/auth/signup/index.html +1 -1
- package/dist/src/web/nextui/auth/signup/index.txt +6 -6
- package/dist/src/web/nextui/datasets/index.html +1 -1
- package/dist/src/web/nextui/datasets/index.txt +6 -6
- package/dist/src/web/nextui/eval/index.html +1 -1
- package/dist/src/web/nextui/eval/index.txt +6 -6
- package/dist/src/web/nextui/index.html +1 -1
- package/dist/src/web/nextui/index.txt +5 -5
- package/dist/src/web/nextui/progress/index.html +1 -1
- package/dist/src/web/nextui/progress/index.txt +6 -6
- package/dist/src/web/nextui/prompts/index.html +1 -1
- package/dist/src/web/nextui/prompts/index.txt +6 -6
- package/dist/src/web/nextui/report/index.html +1 -1
- package/dist/src/web/nextui/report/index.txt +6 -6
- package/dist/src/web/nextui/setup/index.html +1 -1
- package/dist/src/web/nextui/setup/index.txt +7 -7
- package/package.json +3 -2
- package/dist/src/web/nextui/_next/static/chunks/737-dbd25d447fbc5006.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/datasets/page-73b93abb6a46ca0e.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/not-found-fe10d5df88bc44ef.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/eval/page-56e122e6f2a64557.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/layout-ed6af4caf66026a5.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/main-app-7a1376166cb8b72e.js +0 -1
- package/dist/src/web/nextui/_next/static/css/106779eb64615639.css +0 -1
- /package/dist/src/web/nextui/_next/static/{9oVNcJw_yPT1Zu44NMAgc → 2HKOT6yPi-DjJn0Rmu9pY}/_buildManifest.js +0 -0
- /package/dist/src/web/nextui/_next/static/{9oVNcJw_yPT1Zu44NMAgc → 2HKOT6yPi-DjJn0Rmu9pY}/_ssgManifest.js +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
1:HL["/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2",{"as":"font","type":"font/woff2"}]
|
|
2
|
-
2:HL["/_next/static/css/
|
|
3
|
-
0:["
|
|
2
|
+
2:HL["/_next/static/css/5bd2f45de1f3ba83.css",{"as":"style"}]
|
|
3
|
+
0:["2HKOT6yPi-DjJn0Rmu9pY",[[["",{"children":["report",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L3",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/5bd2f45de1f3ba83.css","precedence":"next"}]],"$L4"]]]]
|
|
4
4
|
5:HL["/_next/static/css/dab5d695b3657d59.css",{"as":"style"}]
|
|
5
|
-
6:I{"id":5071,"chunks":["448:static/chunks/448-4da3bf74eae4996a.js","640:static/chunks/640-0f757e2fe135173d.js","620:static/chunks/620-7a5a7bf6e1fe49e5.js","374:static/chunks/374-d40afe599198abd3.js","163:static/chunks/163-e65e0f7f442a0c72.js","53:static/chunks/53-fae6e50ace6c83a1.js","185:static/chunks/app/layout-
|
|
6
|
-
7:I{"id":27883,"chunks":["272:static/chunks/webpack-
|
|
7
|
-
8:I{"id":46785,"chunks":["272:static/chunks/webpack-
|
|
5
|
+
6:I{"id":5071,"chunks":["448:static/chunks/448-4da3bf74eae4996a.js","640:static/chunks/640-0f757e2fe135173d.js","620:static/chunks/620-7a5a7bf6e1fe49e5.js","374:static/chunks/374-d40afe599198abd3.js","163:static/chunks/163-e65e0f7f442a0c72.js","53:static/chunks/53-fae6e50ace6c83a1.js","185:static/chunks/app/layout-0f40deeb4ea7726a.js"],"name":"PageShell","async":false}
|
|
6
|
+
7:I{"id":27883,"chunks":["272:static/chunks/webpack-c9f728822666f852.js","470:static/chunks/b6261da7-e9d81a4364ddd0c0.js","730:static/chunks/730-3eb7255cd813a727.js"],"name":"default","async":false}
|
|
7
|
+
8:I{"id":46785,"chunks":["272:static/chunks/webpack-c9f728822666f852.js","470:static/chunks/b6261da7-e9d81a4364ddd0c0.js","730:static/chunks/730-3eb7255cd813a727.js"],"name":"default","async":false}
|
|
8
8
|
3:[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c19315","children":["$","$L6",null,{"children":["$","$L7",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L8",null,{}],"templateStyles":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":"$undefined","childProp":{"current":["$","$L7",null,{"parallelRouterKey":"children","segmentPath":["children","report","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L8",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$L9","$La",null],"segment":"__PAGE__"},"styles":[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/dab5d695b3657d59.css","precedence":"next"}]]}],"segment":"report"},"styles":[]}]}]}]}],null]
|
|
9
9
|
4:[["$","meta","0",{"charSet":"utf-8"}],["$","title","1",{"children":"promptfoo"}],["$","meta","2",{"name":"description","content":"LLM testing and evaluation"}],["$","meta","3",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","4",{"property":"og:image","content":"https://www.promptfoo.dev/img/thumbnail.png"}],["$","meta","5",{"name":"twitter:card","content":"summary"}],["$","meta","6",{"name":"twitter:image","content":"https://www.promptfoo.dev/img/thumbnail.png"}],["$","meta","7",{"name":"next-size-adjust"}]]
|
|
10
|
-
b:I{"id":37493,"chunks":["448:static/chunks/448-4da3bf74eae4996a.js","620:static/chunks/620-7a5a7bf6e1fe49e5.js","973:static/chunks/973-ffe3726c956d08ef.js","304:static/chunks/304-9d57a2251034b801.js","995:static/chunks/995-803c74b81e7bf6cd.js","378:static/chunks/378-e22c8aeb8e031fad.js","180:static/chunks/180-46db19289d856800.js","420:static/chunks/app/report/page-
|
|
10
|
+
b:I{"id":37493,"chunks":["448:static/chunks/448-4da3bf74eae4996a.js","620:static/chunks/620-7a5a7bf6e1fe49e5.js","973:static/chunks/973-ffe3726c956d08ef.js","304:static/chunks/304-9d57a2251034b801.js","995:static/chunks/995-803c74b81e7bf6cd.js","378:static/chunks/378-e22c8aeb8e031fad.js","180:static/chunks/180-46db19289d856800.js","420:static/chunks/app/report/page-e4f7851d41eb0f92.js"],"name":"","async":false}
|
|
11
11
|
a:["$","$Lb",null,{}]
|
|
12
12
|
9:null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><link rel="preload" as="font" href="/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><link rel="preload" as="font" href="/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/5bd2f45de1f3ba83.css" data-precedence="next"/><link rel="preload" as="style" href="/_next/static/css/edcd6f0b6c902fde.css"/><link rel="preload" href="/_next/static/chunks/webpack-c9f728822666f852.js" as="script"/><link rel="preload" href="/_next/static/chunks/b6261da7-e9d81a4364ddd0c0.js" as="script"/><link rel="preload" href="/_next/static/chunks/730-3eb7255cd813a727.js" as="script"/><link rel="preload" href="/_next/static/chunks/main-app-b098e35d79d23e0a.js" as="script"/><title>promptfoo</title><meta name="description" content="LLM testing and evaluation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta property="og:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body class="__className_c19315"><script src="/_next/static/chunks/webpack-c9f728822666f852.js" async=""></script><script src="/_next/static/chunks/b6261da7-e9d81a4364ddd0c0.js" async=""></script><script src="/_next/static/chunks/730-3eb7255cd813a727.js" async=""></script><script src="/_next/static/chunks/main-app-b098e35d79d23e0a.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/css/5bd2f45de1f3ba83.css\",{\"as\":\"style\"}]\n0:\"$L3\"\n"])</script><script>self.__next_f.push([1,"4:HL[\"/_next/static/css/edcd6f0b6c902fde.css\",{\"as\":\"style\"}]\n"])</script><script>self.__next_f.push([1,"5:I{\"id\":83507,\"chunks\":[\"272:static/chunks/webpack-c9f728822666f852.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\n7:I{\"id\":6020,\"chunks\":[\"272:static/chunks/webpack-c9f728822666f852.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"\",\"async\":false}\n8:I{\"id\":5071,\"chunks\":[\"448:static/chunks/448-4da3bf74eae4996a.js\",\"640:static/chunks/640-0f757e2fe135173d.js\",\"620:stati"])</script><script>self.__next_f.push([1,"c/chunks/620-7a5a7bf6e1fe49e5.js\",\"374:static/chunks/374-d40afe599198abd3.js\",\"163:static/chunks/163-e65e0f7f442a0c72.js\",\"53:static/chunks/53-fae6e50ace6c83a1.js\",\"185:static/chunks/app/layout-0f40deeb4ea7726a.js\"],\"name\":\"PageShell\",\"async\":false}\n9:I{\"id\":27883,\"chunks\":[\"272:static/chunks/webpack-c9f728822666f852.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\na:I{\"id\":46785,\"chunks\":[\"272:static/chunks/webpack-c9f72882266"])</script><script>self.__next_f.push([1,"6f852.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\nc:I{\"id\":27382,\"chunks\":[\"272:static/chunks/webpack-c9f728822666f852.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\n"])</script><script>self.__next_f.push([1,"d:I{\"id\":83013,\"chunks\":[\"448:static/chunks/448-4da3bf74eae4996a.js\",\"640:static/chunks/640-0f757e2fe135173d.js\",\"620:static/chunks/620-7a5a7bf6e1fe49e5.js\",\"973:static/chunks/973-ffe3726c956d08ef.js\",\"304:static/chunks/304-9d57a2251034b801.js\",\"339:static/chunks/339-db5bd05e24dde905.js\",\"995:static/chunks/995-803c74b81e7bf6cd.js\",\"374:static/chunks/374-d40afe599198abd3.js\",\"378:static/chunks/378-e22c8aeb8e031fad.js\",\"235:static/chunks/235-2bbcbc3cd37eef0f.js\",\"578:static/chunks/578-8efe57f906f7573c.js\",\"932:static/chunks/932-75585b3be8ce494d.js\",\"258:static/chunks/258-4acb452fe85cff6f.js\",\"413:static/chunks/app/setup/page-6cde750ec428cd75.js\"],\"name\":\"\",\"async\":false}\n"])</script><script>self.__next_f.push([1,"3:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/5bd2f45de1f3ba83.css\",\"precedence\":\"next\"}]],[\"$\",\"$L5\",null,{\"buildId\":\"2HKOT6yPi-DjJn0Rmu9pY\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/setup/\",\"initialTree\":[\"\",{\"children\":[\"setup\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialHead\":\"$L6\",\"globalErrorComponent\":\"$7\",\"children\":[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_c19315\",\"children\":[\"$\",\"$L8\",null,{\"children\":[\"$\",\"$L9\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$La\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$\",\"$L9\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"setup\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$La\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$Lb\",[\"$\",\"$Lc\",null,{\"propsForComponent\":{\"params\":{}},\"Component\":\"$d\"}],null],\"segment\":\"__PAGE__\"},\"styles\":[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/edcd6f0b6c902fde.css\",\"precedence\":\"next\"}]]}],\"segment\":\"setup\"},\"styles\":[]}]}]}]}],null]}]]\n"])</script><script>self.__next_f.push([1,"6:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"1\",{\"children\":\"promptfoo\"}],[\"$\",\"meta\",\"2\",{\"name\":\"description\",\"content\":\"LLM testing and evaluation\"}],[\"$\",\"meta\",\"3\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"4\",{\"property\":\"og:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"5\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"6\",{\"name\":\"twitter:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"7\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"b:null\n"])</script></body></html>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
1:HL["/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2",{"as":"font","type":"font/woff2"}]
|
|
2
|
-
2:HL["/_next/static/css/
|
|
3
|
-
0:["
|
|
2
|
+
2:HL["/_next/static/css/5bd2f45de1f3ba83.css",{"as":"style"}]
|
|
3
|
+
0:["2HKOT6yPi-DjJn0Rmu9pY",[[["",{"children":["setup",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L3",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/5bd2f45de1f3ba83.css","precedence":"next"}]],"$L4"]]]]
|
|
4
4
|
5:HL["/_next/static/css/edcd6f0b6c902fde.css",{"as":"style"}]
|
|
5
|
-
6:I{"id":5071,"chunks":["448:static/chunks/448-4da3bf74eae4996a.js","640:static/chunks/640-0f757e2fe135173d.js","620:static/chunks/620-7a5a7bf6e1fe49e5.js","374:static/chunks/374-d40afe599198abd3.js","163:static/chunks/163-e65e0f7f442a0c72.js","53:static/chunks/53-fae6e50ace6c83a1.js","185:static/chunks/app/layout-
|
|
6
|
-
7:I{"id":27883,"chunks":["272:static/chunks/webpack-
|
|
7
|
-
8:I{"id":46785,"chunks":["272:static/chunks/webpack-
|
|
8
|
-
a:I{"id":27382,"chunks":["272:static/chunks/webpack-
|
|
9
|
-
b:I{"id":83013,"chunks":["448:static/chunks/448-4da3bf74eae4996a.js","640:static/chunks/640-0f757e2fe135173d.js","620:static/chunks/620-7a5a7bf6e1fe49e5.js","973:static/chunks/973-ffe3726c956d08ef.js","304:static/chunks/304-9d57a2251034b801.js","339:static/chunks/339-db5bd05e24dde905.js","995:static/chunks/995-803c74b81e7bf6cd.js","374:static/chunks/374-d40afe599198abd3.js","378:static/chunks/378-e22c8aeb8e031fad.js","235:static/chunks/235-2bbcbc3cd37eef0f.js","578:static/chunks/578-8efe57f906f7573c.js","932:static/chunks/932-75585b3be8ce494d.js","258:static/chunks/258-4acb452fe85cff6f.js","413:static/chunks/app/setup/page-
|
|
5
|
+
6:I{"id":5071,"chunks":["448:static/chunks/448-4da3bf74eae4996a.js","640:static/chunks/640-0f757e2fe135173d.js","620:static/chunks/620-7a5a7bf6e1fe49e5.js","374:static/chunks/374-d40afe599198abd3.js","163:static/chunks/163-e65e0f7f442a0c72.js","53:static/chunks/53-fae6e50ace6c83a1.js","185:static/chunks/app/layout-0f40deeb4ea7726a.js"],"name":"PageShell","async":false}
|
|
6
|
+
7:I{"id":27883,"chunks":["272:static/chunks/webpack-c9f728822666f852.js","470:static/chunks/b6261da7-e9d81a4364ddd0c0.js","730:static/chunks/730-3eb7255cd813a727.js"],"name":"default","async":false}
|
|
7
|
+
8:I{"id":46785,"chunks":["272:static/chunks/webpack-c9f728822666f852.js","470:static/chunks/b6261da7-e9d81a4364ddd0c0.js","730:static/chunks/730-3eb7255cd813a727.js"],"name":"default","async":false}
|
|
8
|
+
a:I{"id":27382,"chunks":["272:static/chunks/webpack-c9f728822666f852.js","470:static/chunks/b6261da7-e9d81a4364ddd0c0.js","730:static/chunks/730-3eb7255cd813a727.js"],"name":"default","async":false}
|
|
9
|
+
b:I{"id":83013,"chunks":["448:static/chunks/448-4da3bf74eae4996a.js","640:static/chunks/640-0f757e2fe135173d.js","620:static/chunks/620-7a5a7bf6e1fe49e5.js","973:static/chunks/973-ffe3726c956d08ef.js","304:static/chunks/304-9d57a2251034b801.js","339:static/chunks/339-db5bd05e24dde905.js","995:static/chunks/995-803c74b81e7bf6cd.js","374:static/chunks/374-d40afe599198abd3.js","378:static/chunks/378-e22c8aeb8e031fad.js","235:static/chunks/235-2bbcbc3cd37eef0f.js","578:static/chunks/578-8efe57f906f7573c.js","932:static/chunks/932-75585b3be8ce494d.js","258:static/chunks/258-4acb452fe85cff6f.js","413:static/chunks/app/setup/page-6cde750ec428cd75.js"],"name":"","async":false}
|
|
10
10
|
3:[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c19315","children":["$","$L6",null,{"children":["$","$L7",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L8",null,{}],"templateStyles":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":"$undefined","childProp":{"current":["$","$L7",null,{"parallelRouterKey":"children","segmentPath":["children","setup","children"],"error":"$undefined","errorStyles":"$undefined","loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"template":["$","$L8",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$L9",["$","$La",null,{"propsForComponent":{"params":{}},"Component":"$b"}],null],"segment":"__PAGE__"},"styles":[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/edcd6f0b6c902fde.css","precedence":"next"}]]}],"segment":"setup"},"styles":[]}]}]}]}],null]
|
|
11
11
|
4:[["$","meta","0",{"charSet":"utf-8"}],["$","title","1",{"children":"promptfoo"}],["$","meta","2",{"name":"description","content":"LLM testing and evaluation"}],["$","meta","3",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","4",{"property":"og:image","content":"https://www.promptfoo.dev/img/thumbnail.png"}],["$","meta","5",{"name":"twitter:card","content":"summary"}],["$","meta","6",{"name":"twitter:image","content":"https://www.promptfoo.dev/img/thumbnail.png"}],["$","meta","7",{"name":"next-size-adjust"}]]
|
|
12
12
|
9:null
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "promptfoo",
|
|
3
3
|
"description": "LLM eval & testing toolkit",
|
|
4
4
|
"author": "Ian Webster",
|
|
5
|
-
"version": "0.72.
|
|
5
|
+
"version": "0.72.2",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "commonjs",
|
|
8
8
|
"repository": {
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"build": "tsc && shx cp src/*.html dist/src && shx cp src/python/wrapper.py dist/src/python && shx rm -rf dist/drizzle && shx cp -r drizzle dist/drizzle && npm run build:nextui && shx chmod +x dist/src/main.js",
|
|
45
45
|
"test": "jest",
|
|
46
46
|
"test:watch": "jest --watch",
|
|
47
|
+
"test:webui": "npm run test --prefix src/web/nextui",
|
|
47
48
|
"format": "prettier -w .",
|
|
48
49
|
"format:check": "prettier --check .",
|
|
49
50
|
"db:migrate": "npx tsx src/migrate.ts",
|
|
@@ -134,7 +135,7 @@
|
|
|
134
135
|
"fast-xml-parser": "^4.4.0",
|
|
135
136
|
"fastest-levenshtein": "^1.0.16",
|
|
136
137
|
"glob": "^10.4.3",
|
|
137
|
-
"inquirer": "^
|
|
138
|
+
"inquirer": "^10.0.2",
|
|
138
139
|
"js-yaml": "^4.1.0",
|
|
139
140
|
"mathjs": "^13.0.2",
|
|
140
141
|
"node-fetch": "^2.6.7",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[737],{49532:function(e,t,n){"use strict";let s,l;async function a(){if(s||(l||(l=fetch("/api/config").then(e=>e.json()).then(e=>s=e.apiBaseUrl)),await l),void 0===s)throw Error("API base URL is undefined");return s}n.d(t,{b:function(){return a}})},15737:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return tl}});var s=n(24004),l=n(14978),a=n(77580);let r=a.env.NEXT_PUBLIC_PROMPTFOO_REMOTE_API_BASE_URL||a.env.NEXT_PUBLIC_PROMPTFOO_BASE_URL||a.env.PROMPTFOO_REMOTE_API_BASE_URL||"https://api.promptfoo.dev",i=a.env.NEXT_PUBLIC_PROMPTFOO_BASE_URL||a.env.PROMPTFOO_REMOTE_APP_BASE_URL||"https://app.promptfoo.dev";a?.stdout?.columns&&a?.stdout?.columns>10&&a?.stdout?.columns;var o=n(49532);let c=(0,l.createContext)(void 0),d=e=>{let{children:t}=e,[n,a]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=e=>{"Shift"===e.key&&a(!0)},t=e=>{"Shift"===e.key&&a(!1)};return window.addEventListener("keydown",e),window.addEventListener("keyup",t),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t)}},[]),(0,s.jsx)(c.Provider,{value:n,children:t})};var u=n(42671),h=n(6363);let p=(0,l.createContext)(void 0),m=()=>{let e=(0,l.useContext)(p);if(!e)throw Error("useToast must be used within a ToastProvider");return e},x=e=>{let{children:t}=e,[n,a]=(0,l.useState)({message:"",severity:"info",open:!1}),r=()=>{a(e=>({...e,open:!1}))};return(0,s.jsxs)(p.Provider,{value:{showToast:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";a({message:e,severity:t,open:!0})}},children:[t,(0,s.jsx)(u.Z,{open:n.open,autoHideDuration:6e3,onClose:r,children:(0,s.jsx)(h.Z,{onClose:r,severity:n.severity,children:n.message})})]})};var g=n(52428),v=n(11615),j=n(12594),f=n(28891),b=n(74997),y=n(93179),Z=n(47887),w=n(43205),C=n(5592),k=n(14931),S=n(75307),R=n(17178),I=n(42610),N=n(49567),E=n(40982),P=n(24362),F=n(885),T=n(39813),D=n(1852),M=n(57027),O=n(94941),L=n(36273),A=n(96976),U=n(8508),W=n(34304),z=n(32414),_=n(67339),V=n(65969),B=n(63147),J=n(14059),H=n(23223),K=n(94068),G=n(29794),X=n(22701),q=n(51956),Y=n(82669),$=n(37803),Q=n(65068),ee=n(70417),et=n(21303),en=n(61451),es=n(26485),el=n(30021),ea=n(32162),er=n.n(ea),ei=e=>{let{open:t,onClose:n,recentEvals:a,onRecentEvalSelected:r,title:i,description:o}=e,[c,d]=(0,l.useState)(""),[u,h]=(0,l.useState)(-1),p=l.useRef(null),m=l.useRef(null),x=()=>{n(),d(""),h(-1)},g=a.filter(e=>er()(c.toLowerCase(),e.label.toLowerCase())||"string"==typeof e.description&&er()(c.toLowerCase(),e.description.toLowerCase())),v=e=>{r(e),x()},j=l.useCallback(()=>{if(u>=0&&m.current){let e=m.current.querySelectorAll("tbody tr"),t=Math.min(u+3,e.length-1);e[t]&&e[t].scrollIntoView({behavior:"smooth",block:"nearest"})}},[u]);l.useEffect(()=>{j()},[j]),l.useEffect(()=>{t&&(h(0),setTimeout(()=>{var e;null===(e=p.current)||void 0===e||e.focus()},0))},[t]);let f=l.useId();return(0,s.jsxs)(G.Z,{open:t,onClose:x,maxWidth:"md",fullWidth:!0,children:[i?(0,s.jsx)(Y.Z,{children:i}):null,(0,s.jsxs)(q.Z,{children:[o?(0,s.jsx)(N.Z,{sx:{mb:4},children:o}):null,(0,s.jsxs)(N.Z,{sx:{width:"100%",mt:2},children:[(0,s.jsx)(_.Z,{fullWidth:!0,variant:"outlined",placeholder:"Search",value:c,onChange:e=>{d(e.target.value),h(0)},onKeyDown:e=>{if(e.stopPropagation(),t)switch(e.key){case"ArrowDown":e.preventDefault(),h(e=>Math.min(e+1,g.length-1));break;case"ArrowUp":e.preventDefault(),h(e=>Math.max(e-1,0));break;case"Enter":e.preventDefault(),u>=0&&u<g.length?v(g[u].evalId):g.length>0&&v(g[0].evalId);break;case"Escape":e.preventDefault(),x()}},sx:{mb:2},inputRef:p,id:"eval-selector-search-".concat(f)}),(0,s.jsx)(en.Z,{component:$.Z,sx:{height:"600px",overflow:"auto"},ref:m,children:(0,s.jsxs)(Q.Z,{stickyHeader:!0,children:[(0,s.jsx)(es.Z,{children:(0,s.jsxs)(el.Z,{children:[(0,s.jsx)(et.Z,{children:"Created"}),(0,s.jsx)(et.Z,{children:"Description"}),(0,s.jsx)(et.Z,{children:"# Tests"})]})}),(0,s.jsx)(ee.Z,{children:g.length>0?g.map((e,t)=>(0,s.jsxs)(el.Z,{hover:!0,onClick:()=>v(e.evalId),sx:{cursor:"pointer",backgroundColor:t===u?"rgba(255, 255, 0, 0.1)":"inherit"},children:[(0,s.jsx)(et.Z,{children:new Date(e.createdAt).toLocaleString()}),(0,s.jsx)(et.Z,{children:e.description||e.label}),(0,s.jsx)(et.Z,{children:e.numTests})]},e.evalId)):(0,s.jsx)(el.Z,{children:(0,s.jsx)(et.Z,{colSpan:3,align:"center",sx:{py:4},children:(0,s.jsxs)(N.Z,{sx:{textAlign:"center",color:"text.secondary"},children:[(0,s.jsx)(N.Z,{sx:{fontSize:"3rem",mb:2},children:"\uD83D\uDD0D"}),(0,s.jsx)(B.Z,{variant:"h6",gutterBottom:!0,children:"No evaluations found"}),(0,s.jsx)(B.Z,{variant:"body2",children:"Try adjusting your search or create a new evaluation"})]})})})})]})})]})]}),(0,s.jsx)(X.Z,{children:(0,s.jsx)(E.Z,{onClick:x,children:"Cancel"})})]})},eo=n(37204),ec=n(79685),ed=n(74595);let eu={getItem:async e=>await (0,eo.U2)(e)||null,setItem:async(e,t)=>{await (0,eo.t8)(e,t)},removeItem:async e=>{await (0,eo.IV)(e)}},eh=(0,ec.Ue)()((0,ed.tJ)((e,t)=>({evalId:null,setEvalId:t=>e(()=>({evalId:t})),author:null,setAuthor:t=>e(()=>({author:t})),table:null,setTable:t=>e(()=>({table:t})),config:null,setConfig:t=>e(()=>({config:t})),maxTextLength:250,setMaxTextLength:t=>e(()=>({maxTextLength:t})),wordBreak:"break-word",setWordBreak:t=>e(()=>({wordBreak:t})),showInferenceDetails:!0,setShowInferenceDetails:t=>e(()=>({showInferenceDetails:t})),renderMarkdown:!1,setRenderMarkdown:t=>e(()=>({renderMarkdown:t})),prettifyJson:!1,setPrettifyJson:t=>e(()=>({prettifyJson:t})),showPrompts:!1,setShowPrompts:t=>e(()=>({showPrompts:t})),showPassFail:!0,setShowPassFail:t=>e(()=>({showPassFail:t})),inComparisonMode:!1,setInComparisonMode:t=>e(()=>({inComparisonMode:t}))}),{name:"ResultsViewStorage",storage:(0,ed.FL)(()=>eu)}));var ep=function(e){let{initialEvals:t,onComparisonEvalSelected:n}=e,{evalId:a}=eh(),[r,i]=(0,l.useState)(!1),[c,d]=(0,l.useState)(t),u=async()=>{try{let e=await (0,o.b)(),n=a||t[0].evalId,s=await fetch("".concat(e,"/api/results/").concat(n),{cache:"no-store"}),l=await s.json(),r=l.data.datasetId;if(!r){console.error("No datasetId found for current eval "+n);return}let i=await fetch("".concat(e,"/api/results?datasetId=").concat(r),{cache:"no-store"}),c=await i.json();d(c.data.filter(e=>e.evalId!==n))}catch(e){console.error("Error fetching recent evals:",e)}},h=()=>{i(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.Z,{title:"Combine this eval with another eval run",placement:"left",children:(0,s.jsxs)(A.Z,{onClick:()=>{u(),i(!0)},children:[(0,s.jsx)(M.Z,{children:(0,s.jsx)(K.Z,{fontSize:"small"})}),(0,s.jsx)(O.Z,{children:"Compare with another eval"})]})}),(0,s.jsx)(ei,{open:r,onClose:h,recentEvals:c,onRecentEvalSelected:e=>{n(e),h()},title:"Select an eval to compare",description:"Only evals with the same dataset can be compared."})]})},em=n(26110),ex=n(48931),eg=n(99645),ev=n(77656);function ej(e){let{open:t,onClose:a}=e,{config:r}=eh(),i=l.useRef(null),[o,c]=l.useState(!1),[d,u]=l.useState("");l.useEffect(()=>{t&&(async()=>{let{default:e}=await Promise.resolve().then(n.bind(n,34235));u(e.dump(r))})()},[t,r]);let h=()=>{c(!1),a()};return(0,s.jsxs)(G.Z,{open:t,onClose:h,"aria-labelledby":"config-dialog-title",maxWidth:"md",fullWidth:!0,children:[(0,s.jsx)(Y.Z,{id:"config-dialog-title",children:(0,s.jsxs)(N.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,s.jsx)(B.Z,{variant:"h6",style:{flexGrow:1},children:"Config"}),(0,s.jsxs)(N.Z,{children:[(0,s.jsx)(V.Z,{title:"Copy to clipboard",children:(0,s.jsx)(ev.Z,{onClick:()=>{i.current&&(i.current.select(),document.execCommand("copy"),c(!0))},children:o?(0,s.jsx)(em.Z,{}):(0,s.jsx)(eg.Z,{})})}),(0,s.jsx)(V.Z,{title:"Download .yaml",children:(0,s.jsx)(ev.Z,{onClick:()=>{let e=new Blob([d],{type:"text/yaml;charset=utf-8"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download="config.yaml",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},children:(0,s.jsx)(ex.Z,{})})})]})]})}),(0,s.jsx)(q.Z,{children:(0,s.jsx)(B.Z,{variant:"body1",component:"div",children:(0,s.jsx)("textarea",{ref:i,readOnly:!0,value:d,style:{width:"100%",minHeight:"400px",fontFamily:"monospace",border:"1px solid #ccc"}})})}),(0,s.jsx)(X.Z,{children:(0,s.jsx)(E.Z,{onClick:h,color:"primary",children:"Close"})})]})}var ef=n(79715),eb=n(34235),ey=function(){let{table:e,config:t,evalId:n}=eh(),[a,r]=l.useState(!1),i=(e,t)=>{let n=URL.createObjectURL(e),s=document.createElement("a");s.href=n,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(n)},o=()=>{r(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(A.Z,{onClick:()=>{r(!0)},children:[(0,s.jsx)(M.Z,{children:(0,s.jsx)(ex.Z,{fontSize:"small"})}),(0,s.jsx)(O.Z,{children:"Download"})]}),(0,s.jsx)(G.Z,{onClose:o,open:a,children:(0,s.jsx)(q.Z,{children:(0,s.jsxs)(z.Z,{direction:"column",spacing:2,sx:{width:"100%"},children:[(0,s.jsx)(E.Z,{onClick:()=>{let e=eb.default.dump(t),n=new Blob([e],{type:"text/yaml;charset=utf-8"});i(n,"promptfooconfig.yaml"),o()},startIcon:(0,s.jsx)(ex.Z,{}),fullWidth:!0,sx:{justifyContent:"flex-start"},children:"Download YAML Config"}),(0,s.jsx)(E.Z,{onClick:()=>{if(!e){alert("No table data");return}let t=[],s=[...e.head.vars,...e.head.prompts.map(e=>"[".concat(e.provider,"] ").concat(e.label))];t.push(s),e.body.forEach(e=>{let n=[...e.vars,...e.outputs.map(e=>{let{pass:t,text:n}=e;return(t?"[PASS] ":"[FAIL] ")+n})];t.push(n)});let l=(0,ef.P)(t),a=new Blob([l],{type:"text/csv;charset=utf-8;"});i(a,"".concat(n,"-table.csv")),o()},startIcon:(0,s.jsx)(ex.Z,{}),fullWidth:!0,sx:{justifyContent:"flex-start"},children:"Download Table CSV"}),(0,s.jsx)(E.Z,{onClick:()=>{if(!e){alert("No table data");return}let t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"});i(t,"".concat(n,"-table.json")),o()},startIcon:(0,s.jsx)(ex.Z,{}),fullWidth:!0,sx:{justifyContent:"flex-start"},children:"Download Table JSON"}),(0,s.jsx)(E.Z,{onClick:()=>{if(!e){alert("No table data");return}let t=e.body.map((t,n)=>({chosen:t.outputs.filter(e=>e.pass).map(e=>e.text),rejected:t.outputs.filter(e=>!e.pass).map(e=>e.text),vars:t.test.vars,providers:e.head.prompts.map(e=>e.provider),prompts:e.head.prompts.map(e=>e.label||e.display||e.raw)})),s=new Blob([JSON.stringify(t,null,2)],{type:"application/json"});i(s,"".concat(n,"-dpo.json")),o()},startIcon:(0,s.jsx)(ex.Z,{}),fullWidth:!0,sx:{justifyContent:"flex-start"},children:"Download DPO JSON"})]})})})]})},eZ=n(49653),ew=e=>{let{recentEvals:t,onRecentEvalSelected:n,currentEval:a}=e,[r,i]=(0,l.useState)(!1),o="undefined"!=typeof navigator&&-1!==navigator.platform.toUpperCase().indexOf("MAC"),c=()=>{i(!0)};return l.useEffect(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),c())};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.Z,{title:o?"Search for Evals (⌘ + K)":"Search for Evals (Ctrl + K)",arrow:!0,children:(0,s.jsx)(ev.Z,{onClick:c,color:"primary",size:"small",children:(0,s.jsx)(eZ.Z,{})})}),(0,s.jsx)(ei,{title:"Open an Eval",open:r,onClose:()=>{i(!1)},recentEvals:t,onRecentEvalSelected:n})]})},eC=n(69179),ek=n(92715),eS=n(92863),eR=n(36001);let eI=["#fd7f6f","#7eb0d5","#b2e061","#bd7ebe","#ffb55a","#ffee65","#beb9db","#fdcce5","#8bd3c7"];function eN(e){let{table:t}=e,n=(0,l.useRef)(null),a=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!n.current)return;a.current&&a.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),s=Math.min(...e),l=(Math.ceil(Math.max(...e))-Math.floor(s))/10,r=Array.from({length:11},(e,t)=>parseFloat((Math.floor(s)+t*l).toFixed(2))),i=t.head.prompts.map((e,n)=>{let s=t.body.flatMap(e=>e.outputs[n].score),a=r.map(e=>s.filter(t=>t>=e&&t<e+l).length);return{label:"Column ".concat(n+1),data:a,backgroundColor:eI[n%eI.length]}});a.current=new eR.kL(n.current,{type:"bar",data:{labels:r,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"Column ".concat(t+1)},label:function(e){let t=e.dataIndex,n=r[t],s=r[t+1];return s?"".concat(n," <= score < ").concat(s):"".concat(n," <= score")}}}}}})},[t]),(0,s.jsx)("canvas",{ref:n,style:{maxHeight:"300px"}})}function eE(e){let{table:t}=e,n=(0,l.useRef)(null),a=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!n.current)return;a.current&&a.current.destroy();let e=t.head.prompts.map((e,n)=>{let s=t.body.flatMap(e=>e.outputs[n]),l=s.filter(e=>e.pass).length,a=l/s.length*100;return{label:"Column ".concat(n+1),data:[a],backgroundColor:eI[n%eI.length]}});a.current=new eR.kL(n.current,{type:"bar",data:{labels:["Pass Rate (%)"],datasets:e},options:{animation:!1,plugins:{title:{display:!0,text:"Pass rate"},legend:{display:!0}}}})},[t]),(0,s.jsx)("canvas",{ref:n,style:{maxHeight:"300px"}})}function eP(e){let{table:t}=e,n=(0,l.useRef)(null),a=(0,l.useRef)(null),[r,i]=(0,l.useState)(0),[o,c]=(0,l.useState)(1),[d,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!n.current)return;a.current&&a.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),s=Math.min(...e),l=Math.max(...e),i=t.body.map(e=>{let t=e.outputs[r].score,n=e.outputs[o].score;return{x:t,y:n,backgroundColor:n>t?"green":n<t?"red":"gray"}});a.current=new eR.kL(n.current,{type:"scatter",data:{datasets:[{data:i,backgroundColor:i.map(e=>e.backgroundColor)},{type:"line",data:[{x:s,y:s},{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 n=t.body[e.dataIndex],s=n.outputs[0].text,l=n.outputs[1].text;return s.length>30&&(s=s.substring(0,30)+"..."),l.length>30&&(l=l.substring(0,30)+"..."),"Output 1: ".concat(s,"\nOutput 2: ").concat(l)}}}},scales:{x:{title:{display:!0,text:"Prompt ".concat(r+1," Score")},ticks:{callback:function(e,t,n){let s=String(Math.round(100*Number(e)));return t===n.length-1&&(s+="%"),s}}},y:{title:{display:!0,text:"Prompt ".concat(o+1," Score")},ticks:{callback:function(e,t,n){let s=String(Math.round(100*Number(e)));return t===n.length-1&&(s+="%"),s}}}}}})},[t,r,o]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(G.Z,{open:d,onClose:()=>u(!1),children:[(0,s.jsx)(Y.Z,{children:"Compare prompt outputs"}),(0,s.jsxs)(q.Z,{children:[(0,s.jsx)(T.Z,{sx:{m:1,minWidth:120},children:(0,s.jsx)(W.Z,{value:r,onChange:e=>i(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,s.jsxs)(A.Z,{value:t,children:["Prompt ",t+1]},t))})}),(0,s.jsx)(T.Z,{sx:{m:1,minWidth:120},children:(0,s.jsx)(W.Z,{value:o,onChange:e=>c(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,s.jsxs)(A.Z,{value:t,children:["Prompt ",t+1]},t))})})]})]}),(0,s.jsx)("canvas",{ref:n,style:{maxHeight:"300px",cursor:"pointer"},onClick:()=>u(!0)})]})}function eF(e){let{table:t}=e,n=(0,l.useRef)(null),a=(0,l.useRef)(null);return(0,l.useEffect)(()=>{var e;if(!n.current)return;a.current&&a.current.destroy();let s=Object.keys((null===(e=t.head.prompts[0].metrics)||void 0===e?void 0:e.namedScores)||{}),l=t.head.prompts.map((e,n)=>{let l=s.map(n=>{var s;let l=(null===(s=e.metrics)||void 0===s?void 0:s.namedScores[n])||0,a=Math.max(...t.head.prompts.map(e=>{var t;return(null===(t=e.metrics)||void 0===t?void 0:t.namedScores[n])||0}));return l/a});return{label:"".concat(t.head.prompts[n].provider),data:l,backgroundColor:eI[n%eI.length]}});a.current=new eR.kL(n.current,{type:"bar",data:{labels:s,datasets:l},options:{scales:{x:{grid:{display:!1}},y:{ticks:{callback:function(e,t,n){let s=String(Math.round(100*Number(e)));return t===n.length-1&&(s+="%"),s}}}},plugins:{tooltip:{callbacks:{title:function(e){return e[0].dataset.label},label:function(e){let t=e.parsed.y;return"".concat(s[e.dataIndex],": ").concat((100*t).toFixed(2),"% pass rate")}}}}}})},[t]),(0,s.jsx)("canvas",{ref:n,style:{maxHeight:"300px"}})}eR.kL.register(eR.vn,eR.ST,eR.ho,eR.uw,eR.f$,eR.ZL,eR.jn,eR.od,eR.u,eR.wL);var eT=l.memo(function(e){var t;let{columnVisibility:n}=e,a=(0,eS.Z)();eR.kL.defaults.color="dark"===a.palette.mode?"#aaa":"#666";let[r,i]=(0,l.useState)(!0),{table:o}=eh();if(!o||!r||o.head.prompts.length<2)return null;let c=o.body.flatMap(e=>e.outputs.map(e=>e.score)),d=new Set(c);return 1===d.size?null:(0,s.jsx)(eC.SV,{fallback:null,children:(0,s.jsxs)($.Z,{style:{position:"relative",padding:a.spacing(3)},children:[(0,s.jsx)(ev.Z,{style:{position:"absolute",right:0,top:0},onClick:()=>i(!1),children:(0,s.jsx)(ek.Z,{})}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[(0,s.jsx)("div",{style:{width:"33%"},children:(0,s.jsx)(eE,{table:o})}),(0,s.jsx)("div",{style:{width:"33%"},children:d.size<=3&&Object.keys((null===(t=o.head.prompts[0].metrics)||void 0===t?void 0:t.namedScores)||{}).length>1?(0,s.jsx)(eF,{table:o}):(0,s.jsx)(eN,{table:o})}),(0,s.jsx)("div",{style:{width:"33%"},children:(0,s.jsx)(eP,{table:o})})]})]})})}),eD=n(36128),eM=n(9317),eO=n(20286);n(55974);var eL=e=>{let{lookup:t,metricTotals:n,onSearchTextChange:l}=e;return t&&Object.keys(t).length?(0,s.jsx)("div",{className:"custom-metric-container",children:Object.entries(t).map(e=>{let[t,a]=e;return t&&void 0!==a?(0,s.jsxs)("span",{onClick:()=>l&&l("metric=".concat(t,":[^0]")),className:l?"clickable":"",children:[t,":"," ",n&&n[t]?(0,s.jsxs)(s.Fragment,{children:[(a/n[t]*100).toFixed(2),"% (",a,"/",n[t],")"]}):a]},t):null})}):null},eA=n(35185),eU=n(613);function eW(e){let{gradingResults:t}=e;return t?(0,s.jsxs)(N.Z,{mt:2,children:[(0,s.jsx)(B.Z,{variant:"subtitle1",children:"Assertions"}),(0,s.jsx)(en.Z,{children:(0,s.jsxs)(Q.Z,{children:[(0,s.jsx)(es.Z,{children:(0,s.jsxs)(el.Z,{children:[(0,s.jsx)(et.Z,{style:{fontWeight:"bold"},children:"Pass"}),(0,s.jsx)(et.Z,{style:{fontWeight:"bold"},children:"Score"}),(0,s.jsx)(et.Z,{style:{fontWeight:"bold"},children:"Type"}),(0,s.jsx)(et.Z,{style:{fontWeight:"bold"},children:"Value"}),(0,s.jsx)(et.Z,{style:{fontWeight:"bold"},children:"Reason"})]})}),(0,s.jsx)(ee.Z,{children:t.map((e,t)=>{var n,l,a;return e?(0,s.jsxs)(el.Z,{children:[(0,s.jsx)(et.Z,{children:e.pass?"✅":"❌"}),(0,s.jsx)(et.Z,{children:null===(n=e.score)||void 0===n?void 0:n.toFixed(2)}),(0,s.jsx)(et.Z,{children:(null===(l=e.assertion)||void 0===l?void 0:l.type)||""}),(0,s.jsx)(et.Z,{style:{whiteSpace:"pre-wrap"},children:(null===(a=e.assertion)||void 0===a?void 0:a.value)?String(e.assertion.value):"-"}),(0,s.jsx)(et.Z,{style:{whiteSpace:"pre-wrap"},children:e.reason})]},t):null})})]})})]}):null}function ez(e){let{open:t,onClose:n,prompt:a,provider:r,output:i,gradingResults:o,metadata:c}=e,[d,u]=(0,l.useState)(!1);(0,l.useEffect)(()=>{u(!1)},[a]);let h=async e=>{await navigator.clipboard.writeText(e),u(!0)};return(0,s.jsxs)(G.Z,{open:t,onClose:n,fullWidth:!0,maxWidth:"lg",children:[(0,s.jsxs)(Y.Z,{children:["Details",r&&": ".concat(r)]}),(0,s.jsxs)(q.Z,{children:[(0,s.jsxs)(N.Z,{mb:2,children:[(0,s.jsx)(B.Z,{variant:"subtitle1",style:{marginBottom:"1rem"},children:"Prompt"}),(0,s.jsx)(eU.u,{readOnly:!0,value:a,style:{width:"100%",padding:"0.75rem"},maxRows:20}),(0,s.jsx)(ev.Z,{onClick:()=>h(a),style:{position:"absolute",right:"10px",top:"10px"},children:d?(0,s.jsx)(em.Z,{}):(0,s.jsx)(eA.Z,{})})]}),(null==c?void 0:c.redteamFinalPrompt)&&(0,s.jsxs)(N.Z,{my:2,children:[(0,s.jsx)(B.Z,{variant:"subtitle1",style:{marginBottom:"1rem",marginTop:"1rem"},children:"Modified User Input (Red Team)"}),(0,s.jsx)(eU.u,{readOnly:!0,maxRows:20,value:c.redteamFinalPrompt,style:{width:"100%",padding:"0.75rem"}})]}),i&&(0,s.jsxs)(N.Z,{my:2,children:[(0,s.jsx)(B.Z,{variant:"subtitle1",style:{marginBottom:"1rem",marginTop:"1rem"},children:"Output"}),(0,s.jsx)(eU.u,{readOnly:!0,maxRows:20,value:i,style:{width:"100%",padding:"0.75rem"}})]}),(0,s.jsx)(eW,{gradingResults:o})]}),(0,s.jsx)(X.Z,{children:(0,s.jsx)(E.Z,{onClick:n,children:"Close"})})]})}var e_=n(12431),eV=n(8541),eB=function(){let e=(0,eS.Z)(),[t,n]=l.useState(!1),a=()=>{n(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{style:{textAlign:"center",marginTop:20,marginBottom:40},children:(0,s.jsx)(E.Z,{variant:"text",color:"primary",startIcon:(0,s.jsx)(e_.Z,{}),onClick:()=>{n(!0)},children:"Generate test cases"})}),(0,s.jsxs)(G.Z,{open:t,onClose:a,children:[(0,s.jsx)(Y.Z,{children:"Run on Command Line"}),(0,s.jsx)(q.Z,{children:(0,s.jsxs)(eV.Z,{children:[(0,s.jsx)("p",{children:"This feature is in beta. UI coming soon."}),(0,s.jsxs)("p",{children:["Run"," ",(0,s.jsx)(N.Z,{component:"code",sx:{backgroundColor:"dark"===e.palette.mode?"#424242":"#f0f0f0",padding:"2px 4px",borderRadius:"4px"},children:"promptfoo generate dataset"}),"to generate test cases on the command line."]})]})}),(0,s.jsx)(X.Z,{children:(0,s.jsx)(E.Z,{onClick:a,color:"primary",children:"Close"})})]})]})};function eJ(e){return"string"==typeof e||"number"==typeof e?e.toString().length:Array.isArray(e)?e.reduce((e,t)=>e+eJ(t),0):l.isValidElement(e)&&e.props.children?l.Children.toArray(e.props.children).reduce((e,t)=>e+eJ(t),0):0}let eH=l.memo(function(e){let t,{text:n,maxLength:a}=e,[r,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 n=e.toString();return n.slice(0,a-t)}if(Array.isArray(e)){let n=[],s=t;for(let t of e){let e=eJ(t);if(s+e>a){n.push(o(t,s));break}n.push(t),s+=e}return n}if(l.isValidElement(e)&&e.props.children){let n=eJ(e.props.children);if(n>a-t)return l.cloneElement(e,{...e.props,children:o(e.props.children,t)})}return e};t=l.isValidElement(n)||"string"==typeof n?n:JSON.stringify(n);let c=r?o(t):t,d=eJ(t)>a;return(0,s.jsxs)("div",{style:{cursor:d?"pointer":"normal"},onClick:()=>{i(!r)},children:[c,r&&eJ(t)>a&&(0,s.jsx)("span",{children:"..."})]})});var eK=n(59682),eG=n(62268),eX=n(38640),eq=n.n(eX),eY=n(33352),e$=n(73490),eQ=n(24495);n(16658);var e0=e=>{let{failReasons:t}=e,[n,a]=(0,l.useState)(0);return t.length<1?null:(0,s.jsxs)("div",{className:"fail-reason",children:[t.length>1&&(0,s.jsxs)("span",{className:"fail-reason-carousel-controls",children:[(0,s.jsx)(ev.Z,{onClick:()=>{a(e=>e>0?e-1:t.length-1)},children:(0,s.jsx)(e$.Z,{sx:{fontSize:12}})}),(0,s.jsxs)("span",{children:[n+1,"/",t.length]}),(0,s.jsx)(ev.Z,{onClick:()=>{a(e=>e<t.length-1?e+1:0)},children:(0,s.jsx)(eQ.Z,{sx:{fontSize:12}})})]}),t[n].trim().split("\n").map((e,t)=>(0,s.jsxs)(l.Fragment,{children:[e,(0,s.jsx)("br",{})]},t))]})},e1=e=>{let{open:t,contextText:n,commentText:l,onClose:a,onSave:r,onChange:i}=e;return(0,s.jsxs)(G.Z,{open:t,onClose:a,fullWidth:!0,maxWidth:"sm",children:[(0,s.jsx)(Y.Z,{children:"Edit Comment"}),(0,s.jsxs)(q.Z,{children:[(0,s.jsx)(N.Z,{sx:{backgroundColor:"#f0f0f0",padding:2,marginBottom:2},children:n}),(0,s.jsx)(_.Z,{autoFocus:!0,margin:"dense",type:"text",fullWidth:!0,multiline:!0,rows:4,value:l,onChange:e=>i(e.target.value)})]}),(0,s.jsxs)(X.Z,{children:[(0,s.jsx)(E.Z,{onClick:r,color:"primary",variant:"contained",children:"Save"}),(0,s.jsx)(E.Z,{onClick:a,color:"primary",children:"Cancel"})]})]})};let e2=()=>{let e=(0,l.useContext)(c);if(void 0===e)throw Error("useShiftKey must be used within a ShiftKeyProvider");return e};var e3=n(19116);let e5=l.memo(function(e){var t,n,a,r,i,o,c,d,u,h,p,m,x;let g,v,j,f,b,y,{output:Z,maxTextLength:w,rowIndex:C,promptIndex:k,onRating:S,firstOutput:R,showDiffs:I,searchText:N,showStats:E}=e,{renderMarkdown:P,prettifyJson:F,showPrompts:T,showPassFail:D,inComparisonMode:M}=eh(),[O,L]=l.useState(!1),[A,U]=l.useState(!1),[W,z]=l.useState(null),_=e=>{z(e||null),U(!A)},[B,J]=l.useState(!1),[H,K]=l.useState((null===(t=Z.gradingResult)||void 0===t?void 0:t.comment)||""),G=()=>{J(!0)},X="string"==typeof Z.text?Z.text:JSON.stringify(Z.text),q=[];if(!Z.pass&&X.includes("---")&&(q=((null===(h=Z.gradingResult)||void 0===h?void 0:h.componentResults)||[]).filter(e=>!!e&&!e.pass).map(e=>e.reason),X=X.split("---").slice(1).join("---")),I&&R){let e,t="string"==typeof R.text?R.text:JSON.stringify(R.text);t.includes("---")&&(t=t.split("---").slice(1).join("---"));try{JSON.parse(t),JSON.parse(X),e=(0,e3.CT)(t,X)}catch(n){e=t.includes(". ")&&X.includes(". ")?(0,e3.SY)(t,X):(0,e3.NV)(t,X)}g=(0,s.jsx)(s.Fragment,{children:e.map((e,t)=>e.added?(0,s.jsx)("ins",{children:e.value},t):e.removed?(0,s.jsx)("del",{children:e.value},t):(0,s.jsx)("span",{children:e.value},t))})}if(N)try{let e;let t=RegExp(N,"gi"),n=[];for(;null!==(e=t.exec(X));)n.push({start:e.index,end:t.lastIndex});g=(0,s.jsx)(s.Fragment,{children:n.length>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:X.substring(0,n[0].start)},"text-before"),n.map((e,t)=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"search-highlight",children:X.substring(e.start,e.end)},"match-"+t),(0,s.jsx)("span",{children:X.substring(e.end,n[t+1]?n[t+1].start:X.length)},"text-after-"+t)]}))]}):(0,s.jsx)("span",{children:X},"no-match")})}catch(e){console.error("Invalid regular expression:",e.message)}else if(P&&!I)g=(0,s.jsx)(eO.U,{remarkPlugins:[eY.Z],components:{img:e=>{let{src:t,alt:n}=e;return(0,s.jsx)("img",{loading:"lazy",src:t,alt:n,onClick:()=>_(t),style:{cursor:"pointer"}})}},children:X});else if(F)try{g=(0,s.jsx)("pre",{children:JSON.stringify(JSON.parse(X),null,2)})}catch(e){}let Y=l.useCallback(e=>{var t;S(e,void 0,null===(t=Z.gradingResult)||void 0===t?void 0:t.comment)},[S,null===(n=Z.gradingResult)||void 0===n?void 0:n.comment]),$=l.useCallback(()=>{let e=prompt("Set test score (0.0 - 1.0):",String(Z.score));if(null!==e){let n=parseFloat(e);if(!isNaN(n)&&n>=0&&n<=1){var t;S(void 0,n,null===(t=Z.gradingResult)||void 0===t?void 0:t.comment)}else alert("Invalid score. Please enter a value between 0.0 and 1.0.")}},[S,Z.score,null===(a=Z.gradingResult)||void 0===a?void 0:a.comment]),[Q,ee]=l.useState(!1),et=l.useCallback(()=>{navigator.clipboard.writeText(Z.text),ee(!0)},[Z.text]);if(Z.latencyMs&&(j=(0,s.jsxs)("span",{children:[Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(Z.latencyMs)," ms"]})),null===(r=Z.tokenUsage)||void 0===r?void 0:r.completion){let e=Z.tokenUsage.completion/(Z.latencyMs/1e3);f=(0,s.jsx)("span",{children:Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e)})}if(Z.cost&&(b=(0,s.jsxs)("span",{children:["$",Z.cost.toPrecision(2)]})),null===(i=Z.tokenUsage)||void 0===i?void 0:i.cached)v=(0,s.jsxs)("span",{children:[Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(Z.tokenUsage.cached)," ","(cached)"]});else if(null===(o=Z.tokenUsage)||void 0===o?void 0:o.total){let e=Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(null!==(p=Z.tokenUsage.prompt)&&void 0!==p?p:0),t=Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(null!==(m=Z.tokenUsage.completion)&&void 0!==m?m:0),n=Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(Z.tokenUsage.total);v=(0,s.jsx)(V.Z,{title:"".concat(e," prompt tokens + ").concat(t," completion tokens = ").concat(n," total"),children:(0,s.jsxs)("span",{children:[n,("0"!==e||"0"!==t)&&" (".concat(e,"+").concat(t,")")]})})}let en=(null===(c=Z.gradingResult)||void 0===c?void 0:c.comment)&&"!highlight"!==Z.gradingResult.comment?(0,s.jsx)("div",{className:"comment",onClick:G,children:Z.gradingResult.comment}):null,es=E?(0,s.jsxs)("div",{className:"cell-detail",children:[v&&(0,s.jsxs)("div",{className:"stat-item",children:[(0,s.jsx)("strong",{children:"Tokens:"})," ",v]}),j&&(0,s.jsxs)("div",{className:"stat-item",children:[(0,s.jsx)("strong",{children:"Latency:"})," ",j]}),f&&(0,s.jsxs)("div",{className:"stat-item",children:[(0,s.jsx)("strong",{children:"Tokens/Sec:"})," ",f]}),b&&(0,s.jsxs)("div",{className:"stat-item",children:[(0,s.jsx)("strong",{children:"Cost:"})," ",b]})]}):null,el=e2(),ea=(0,s.jsxs)("div",{className:"cell-actions",children:[el&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"action",onClick:et,onMouseDown:e=>e.preventDefault(),children:(0,s.jsx)(V.Z,{title:"Copy output to clipboard",children:(0,s.jsx)("span",{children:Q?"✅":"\uD83D\uDCCB"})})}),(0,s.jsx)("span",{className:"action",onClick:()=>{let e;H.startsWith("!highlight")?S(void 0,void 0,e=H.slice(10).trim()):S(void 0,void 0,e=("!highlight "+H).trim()),K(e)},onMouseDown:e=>e.preventDefault(),children:(0,s.jsx)(V.Z,{title:"Toggle test highlight",children:(0,s.jsx)("span",{children:"\uD83C\uDF1F"})})})]}),Z.prompt&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"action",onClick:()=>{L(!0)},children:(0,s.jsx)(V.Z,{title:"View output and test details",children:(0,s.jsx)("span",{children:"\uD83D\uDD0E"})})}),(0,s.jsx)(ez,{open:O,onClose:()=>{L(!1)},prompt:Z.prompt,provider:Z.provider,gradingResults:null===(d=Z.gradingResult)||void 0===d?void 0:d.componentResults,output:X,metadata:Z.metadata})]}),(0,s.jsx)("span",{className:"action",onClick:()=>Y(!0),children:(0,s.jsx)(V.Z,{title:"Mark test passed (score 1.0)",children:(0,s.jsx)("span",{children:"\uD83D\uDC4D"})})}),(0,s.jsx)("span",{className:"action",onClick:()=>Y(!1),children:(0,s.jsx)(V.Z,{title:"Mark test failed (score 0.0)",children:(0,s.jsx)("span",{children:"\uD83D\uDC4E"})})}),(0,s.jsx)("span",{className:"action",onClick:$,children:(0,s.jsx)(V.Z,{title:"Set test score",children:(0,s.jsx)("span",{children:"\uD83D\uDD22"})})}),(0,s.jsx)("span",{className:"action",onClick:G,children:(0,s.jsx)(V.Z,{title:"Edit comment",children:(0,s.jsx)("span",{children:"✏️"})})})]}),er={};(null===(u=Z.gradingResult)||void 0===u?void 0:u.comment)==="!highlight"&&(er.backgroundColor="#ffffeb");let ei=0,eo=0,ec=Z.gradingResult;if(ec?ec.componentResults?ec.componentResults.forEach(e=>{(null==e?void 0:e.pass)?ei++:eo++}):(ei=ec.pass?1:0,eo=ec.pass?0:1):Z.pass?ei=1:Z.pass||(eo=1),1===eo&&1===ei)y=(0,s.jsxs)(s.Fragment,{children:["".concat(eo," FAIL")," ","".concat(ei," PASS")]});else{let e="";eo>1||ei>1&&eo>0?e="".concat(eo," FAIL"):1===eo&&(e="FAIL");let t="";ei>1||eo>1&&ei>0?t="".concat(ei," PASS"):1===ei&&0===eo&&(t="PASS");let n=e&&t?" ":"";y=(0,s.jsxs)(s.Fragment,{children:[e,n,t]})}let ed=null===(x=Z.score)||0===x||1===x?"":"(".concat(x.toFixed(2),")");return(0,s.jsxs)("div",{className:"cell",style:er,children:[D&&(0,s.jsx)(s.Fragment,{children:Z.pass?(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"status pass",children:[(0,s.jsxs)("div",{className:"pill",children:[y,ed&&(0,s.jsxs)("span",{className:"score",children:[" ",ed]})]}),(0,s.jsx)(eL,{lookup:Z.namedScores})]})}):(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"status fail",children:[(0,s.jsxs)("div",{className:"pill",children:[y,ed&&(0,s.jsxs)("span",{className:"score",children:[" ",ed]})]}),(0,s.jsx)(eL,{lookup:Z.namedScores}),(0,s.jsx)("span",{className:"fail-reason",children:(0,s.jsx)(e0,{failReasons:q})})]})})}),T&&R.prompt&&(0,s.jsxs)("div",{className:"prompt",children:[(0,s.jsx)("span",{className:"pill",children:"Prompt"}),Z.prompt]}),(0,s.jsx)(eH,{text:g||X,maxLength:w}),en,es,ea,A&&W&&(0,s.jsx)("div",{className:"lightbox",onClick:()=>_(),children:(0,s.jsx)("img",{src:W,alt:"Lightbox"})}),(0,s.jsx)(e1,{open:B,contextText:Z.text,commentText:H,onClose:()=>{J(!1)},onSave:()=>{S(void 0,void 0,H),J(!1)},onChange:K})]})});function e4(e){let{text:t,maxLength:n,expandedText:a,resourceId:r,className:i}=e,[o,c]=l.useState(!1);return(0,s.jsxs)("div",{className:"".concat(i||""),children:[(0,s.jsx)(eH,{text:t,maxLength:n}),a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.Z,{title:"View prompt",children:(0,s.jsx)("span",{className:"action",onClick:()=>{c(!0)},children:"\uD83D\uDD0E"})}),(0,s.jsx)(ez,{open:o,onClose:()=>{c(!1)},prompt:a}),r&&(0,s.jsx)(V.Z,{title:"View other evals and datasets for this prompt",children:(0,s.jsx)("span",{className:"action",children:(0,s.jsx)(eq(),{href:"/prompts/?id=".concat(r),target:"_blank",children:(0,s.jsx)(eK.Z,{fontSize:"small"})})})})]})]})}n(93207);var e7=l.memo(function(e){let{maxTextLength:t,columnVisibility:n,wordBreak:a,filterMode:r,failureFilter:i,searchText:c,showStats:d,onFailureFilterToggle:u,onSearchTextChange:h}=e,{evalId:p,table:x,setTable:g,inComparisonMode:v}=eh(),{showToast:j}=m();(0,y.Z)(x,"Table should be defined");let{head:f,body:b}=x,Z=l.useCallback(async(e,t,n,s,l)=>{var a,r;let i=[...b],c={...i[e]},d=[...c.outputs],u=null!=n?n:d[t].pass,h=void 0===s?n?1:0:s||0;d[t].pass=u,d[t].score=h;let m=(null===(a=d[t].gradingResult)||void 0===a?void 0:a.componentResults)||[];if(void 0!==n){let e=m.findIndex(e=>{var t;return(null===(t=e.assertion)||void 0===t?void 0:t.type)==="human"}),t={pass:u,score:h,reason:"Manual result (overrides all other grading results)",comment:l,assertion:{type:"human"}};-1!==e?m[e]=t:m.push(t)}let x={...d[t].gradingResult||{},pass:u,score:h,reason:"Manual result (overrides all other grading results)",comment:l,assertion:(null===(r=d[t].gradingResult)||void 0===r?void 0:r.assertion)||null,componentResults:m};d[t].gradingResult=x,c.outputs=d,i[e]=c;let y={head:f,body:i};if(g(y),v)j("Ratings are not saved in comparison mode","warning");else try{let e=await fetch("".concat(await (0,o.b)(),"/api/eval/").concat(p),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({table:y})});if(!e.ok)throw Error("Network response was not ok")}catch(e){console.error("Failed to update table:",e)}},[b,f,g,p,v,j]),w=Object.keys(n).length>0,C=l.useMemo(()=>{try{return RegExp(c,"i")}catch(e){return console.error("Invalid regular expression:",e.message),null}},[c]),k=l.useMemo(()=>{try{return b.map((e,t)=>({...e,outputs:e.outputs.map((e,n)=>({...e,originalRowIndex:t,originalPromptIndex:n}))})).filter(e=>{let t=!0;return"failures"===r?t=e.outputs.some((e,t)=>{let s="Prompt ".concat(t+1);return i[s]&&!e.pass&&(!w||n[s])}):"different"===r?t=!e.outputs.every(t=>t.text===e.outputs[0].text):"highlights"===r&&(console.log(e.outputs[0].text),t=e.outputs.some(e=>{var t,n;return null===(n=e.gradingResult)||void 0===n?void 0:null===(t=n.comment)||void 0===t?void 0:t.startsWith("!highlight")})),!!t&&(!c||!C||e.outputs.some(t=>{var n,s;let l=e.vars.map(e=>"var=".concat(e)).join(" "),a="".concat(t.text," ").concat(Object.keys(t.namedScores).map(e=>"metric=".concat(e,":").concat(t.namedScores[e])).join(" ")," ").concat((null===(n=t.gradingResult)||void 0===n?void 0:n.reason)||""," ").concat((null===(s=t.gradingResult)||void 0===s?void 0:s.comment)||""),r="".concat(l," ").concat(a);return C.test(r)}))})}catch(e){return console.error("Invalid regular expression:",e.message),b}},[b,i,r,c,n,w,C]),[S,R]=l.useState({pageIndex:0,pageSize:50});l.useEffect(()=>{R(e=>({...e,pageIndex:0}))},[i,r,c]);let I=l.useMemo(()=>f.prompts.map((e,t)=>b.reduce((e,n)=>e+(n.outputs[t].pass?1:0),0)),[f.prompts,b]),F=l.useMemo(()=>f.prompts.map((e,t)=>b.reduce((e,n)=>{var s,l;return e+((null===(l=n.outputs[t].gradingResult)||void 0===l?void 0:null===(s=l.componentResults)||void 0===s?void 0:s.length)||0)},0)),[f.prompts,b]),T=l.useMemo(()=>f.prompts.map((e,t)=>b.reduce((e,n)=>{var s;let l=null===(s=n.outputs[t].gradingResult)||void 0===s?void 0:s.componentResults;return e+(l?l.filter(e=>null==e?void 0:e.pass).length:0)},0)),[f.prompts,b]),D=l.useMemo(()=>I.reduce((e,t,n,s)=>t>s[e]?n:e,0),[I]),M=I[D],O=l.useMemo(()=>(0,eD.Cl)(),[]),{renderMarkdown:L}=eh(),U=l.useMemo(()=>f.vars.length>0?[O.group({id:"vars",header:()=>(0,s.jsx)("span",{className:"font-bold",children:"Variables"}),columns:f.vars.map((e,n)=>O.accessor(e=>e.vars[n],{id:"Variable ".concat(n+1),header:()=>(0,s.jsx)(e4,{text:e,maxLength:t,className:"font-bold"}),cell:e=>{let n=e.getValue();return(0,s.jsx)("div",{className:"cell",children:L?(0,s.jsx)(eO.U,{remarkPlugins:[eY.Z],children:n}):(0,s.jsx)(eH,{text:n,maxLength:t})})},size:50}))})]:[],[O,f.vars,t,L]),z=l.useCallback((e,t)=>k[e].outputs[t],[k]),V=l.useCallback(e=>k[e].outputs[0],[k]),J=l.useMemo(()=>{let e={};return null==x||x.body.forEach(t=>{var n;null===(n=t.test.assert)||void 0===n||n.forEach(t=>{t.metric&&(e[t.metric]=(e[t.metric]||0)+1),"assert"in t&&Array.isArray(t.assert)&&t.assert.forEach(t=>{"metric"in t&&t.metric&&(e[t.metric]=(e[t.metric]||0)+1)})})}),e},[x]),H=l.useMemo(()=>[O.group({id:"prompts",header:()=>(0,s.jsx)("span",{className:"font-bold",children:"Outputs"}),columns:f.prompts.map((e,n)=>O.accessor(e=>(function(e){if("string"==typeof e){let t=e.startsWith("[PASS]"),n=e;return e.startsWith("[PASS]")?n=n.slice(6):e.startsWith("[FAIL]")&&(n=n.slice(6)),{text:n,pass:t,score:t?1:0}}return e})(e.outputs[n]),{id:"Prompt ".concat(n+1),header:()=>{var l,a,o,c,p,m,x,g;let v=I[n]&&b.length?(I[n]/b.length*100).toFixed(2):"0.00",j=I[n]===M&&0!==M,f="Prompt ".concat(n+1),y=i[f]||!1,Z=d?(0,s.jsxs)("div",{className:"prompt-detail",children:[F[n]?(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Asserts:"})," ",T[n],"/",F[n]," passed"]}):null,(null===(l=e.metrics)||void 0===l?void 0:l.totalLatencyMs)?(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Avg Latency:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.totalLatencyMs/b.length)," ","ms"]}):null,(null===(o=e.metrics)||void 0===o?void 0:null===(a=o.tokenUsage)||void 0===a?void 0:a.total)?(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Avg Tokens:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.total/b.length)]}):null,(null===(c=e.metrics)||void 0===c?void 0:c.totalLatencyMs)&&(null===(m=e.metrics)||void 0===m?void 0:null===(p=m.tokenUsage)||void 0===p?void 0:p.completion)?(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Tokens/Sec:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.completion/(e.metrics.totalLatencyMs/1e3))]}):null,(null===(x=e.metrics)||void 0===x?void 0:x.cost)?(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Cost:"})," $",e.metrics.cost.toPrecision(2)]}):null]}):null,w=e.provider?e.provider.split(":"):[],C=w.length>1?(0,s.jsxs)(s.Fragment,{children:[w[0],":",(0,s.jsx)("strong",{children:w.slice(1).join(":")})]}):(0,s.jsx)("strong",{children:e.provider});return(0,s.jsxs)("div",{className:"output-header",children:[(0,s.jsxs)("div",{className:"pills",children:[e.provider?(0,s.jsx)("div",{className:"provider",children:C}):null,(0,s.jsx)("div",{className:"summary",children:(0,s.jsxs)("div",{className:"highlight ".concat(j?"success":""),children:[(0,s.jsxs)("strong",{children:[v,"% passing"]})," (",I[n],"/",b.length," cases)"]})}),(null===(g=e.metrics)||void 0===g?void 0:g.namedScores)&&Object.keys(e.metrics.namedScores).length>0?(0,s.jsx)(eL,{lookup:e.metrics.namedScores,metricTotals:J,onSearchTextChange:h}):null]}),(0,s.jsx)(e4,{className:"prompt-container",text:e.label||e.display||e.raw,expandedText:e.raw,maxLength:t,resourceId:e.id}),Z,"failures"===r&&(0,s.jsx)(eG.Z,{sx:{"& .MuiFormControlLabel-label":{fontSize:"0.75rem"}},control:(0,s.jsx)(P.Z,{checked:y,onChange:e=>u(f,e.target.checked)}),label:"Show failures"})]})},cell:e=>{var l,a;let i=z(e.row.index,n);return(0,s.jsx)(e5,{output:i,maxTextLength:t,rowIndex:e.row.index,promptIndex:n,onRating:Z.bind(null,null!==(l=i.originalRowIndex)&&void 0!==l?l:e.row.index,null!==(a=i.originalPromptIndex)&&void 0!==a?a:n),firstOutput:V(e.row.index),showDiffs:"different"===r,searchText:c,showStats:d})}}))})],[b.length,O,i,r,V,z,Z,f.prompts,M,t,J,F,T,I,u,h,c,d]),K=l.useMemo(()=>{let e=b.some(e=>e.description);return e?{accessorFn:e=>e.description||"",id:"description",header:()=>(0,s.jsx)("span",{className:"font-bold",children:"Description"}),cell:e=>(0,s.jsx)("div",{className:"cell",children:(0,s.jsx)(eH,{text:String(e.getValue()),maxLength:t})}),size:50}:null},[b,t]),G=l.useMemo(()=>{let e=[];return K&&e.push(K),e.push(...U,...H),e},[K,U,H]),X=(0,eM.b7)({data:k,columns:G,columnResizeMode:"onChange",getCoreRowModel:(0,eD.sC)(),getPaginationRowModel:(0,eD.G_)(),state:{columnVisibility:n,pagination:S}});return(0,s.jsxs)("div",{children:[(0,s.jsxs)("table",{className:"results-table firefox-fix ".concat(t<=25?"compact":""),style:{wordBreak:a},children:[(0,s.jsx)("thead",{children:X.getHeaderGroups().map(e=>(0,s.jsx)("tr",{className:"header",children:e.headers.map(e=>(0,s.jsxs)("th",{colSpan:e.colSpan,style:{width:e.getSize()},children:[e.isPlaceholder?null:(0,eM.ie)(e.column.columnDef.header,e.getContext()),(0,s.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"resizer ".concat(e.column.getIsResizing()?"isResizing":"")})]},e.id))},e.id))}),(0,s.jsx)("tbody",{children:X.getRowModel().rows.map((e,t)=>{let n=!1;return(0,s.jsx)("tr",{children:e.getVisibleCells().map(e=>{let l=e.column.id.startsWith("Variable")||"description"===e.column.id,a=!l&&!n;return a&&(n=!0),(0,s.jsx)("td",{style:{width:e.column.getSize()},className:"".concat(l?"variable":""," ").concat(0!==t||l?"":"first-prompt-row"," ").concat(a?"first-prompt-col":""),children:(0,eM.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)})})]}),X.getPageCount()>1&&(0,s.jsxs)(N.Z,{className:"pagination",mx:1,sx:{display:"flex",alignItems:"center",gap:2},children:[(0,s.jsx)(E.Z,{onClick:()=>{R(e=>({...e,pageIndex:Math.max(e.pageIndex-1,0)})),window.scrollTo(0,0)},disabled:0===X.getState().pagination.pageIndex,variant:"contained",children:"Previous"}),(0,s.jsxs)(B.Z,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:["Page",(0,s.jsx)(_.Z,{size:"small",type:"number",value:X.getState().pagination.pageIndex+1,onChange:e=>{let t=e.target.value?Number(e.target.value)-1:0;R(e=>({...e,pageIndex:Math.min(Math.max(t,0),X.getPageCount()-1)}))},InputProps:{style:{width:"60px",textAlign:"center"}},variant:"outlined"}),(0,s.jsxs)("span",{children:["of ",X.getPageCount()]})]}),(0,s.jsx)(E.Z,{onClick:()=>{R(e=>({...e,pageIndex:Math.min(e.pageIndex+1,X.getPageCount()-1)})),window.scrollTo(0,0)},disabled:X.getState().pagination.pageIndex+1>=X.getPageCount(),variant:"contained",children:"Next"}),(0,s.jsxs)(B.Z,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsxs)(W.Z,{value:S.pageSize,onChange:e=>{R({pageIndex:0,pageSize:Number(e.target.value)}),window.scrollTo(0,0)},displayEmpty:!0,inputProps:{"aria-label":"Results per page"},size:"small",sx:{m:1,minWidth:80},children:[(0,s.jsx)(A.Z,{value:10,children:"10"}),(0,s.jsx)(A.Z,{value:50,children:"50"}),(0,s.jsx)(A.Z,{value:100,children:"100"}),(0,s.jsx)(A.Z,{value:500,children:"500"}),(0,s.jsx)(A.Z,{value:1e3,children:"1000"})]}),(0,s.jsx)("span",{children:"results per page"})]})]}),(0,s.jsx)(eB,{})]})}),e6=n(22695),e8=e=>{let{open:t,onClose:n}=e,{maxTextLength:l,setMaxTextLength:a,wordBreak:r,setWordBreak:i,showInferenceDetails:o,setShowInferenceDetails:c,renderMarkdown:d,setRenderMarkdown:u,prettifyJson:h,setPrettifyJson:p,showPrompts:m,setShowPrompts:x,showPassFail:g,setShowPassFail:v}=eh();return(0,s.jsxs)(G.Z,{open:t,onClose:n,fullWidth:!0,maxWidth:"sm",children:[(0,s.jsx)(Y.Z,{children:"Table View Settings"}),(0,s.jsxs)(q.Z,{children:[(0,s.jsx)(N.Z,{children:(0,s.jsx)(V.Z,{title:"Forcing line breaks makes it easier to adjust column widths to your liking",placement:"right",children:(0,s.jsx)(eG.Z,{control:(0,s.jsx)(P.Z,{checked:"break-all"===r,onChange:e=>i(e.target.checked?"break-all":"break-word")}),label:"Force line breaks"})})}),(0,s.jsx)(N.Z,{children:(0,s.jsx)(eG.Z,{control:(0,s.jsx)(P.Z,{checked:d,onChange:e=>u(e.target.checked)}),label:"Render model outputs as Markdown"})}),(0,s.jsx)(N.Z,{children:(0,s.jsx)(eG.Z,{control:(0,s.jsx)(P.Z,{checked:h,onChange:e=>p(e.target.checked)}),label:"Prettify JSON outputs"})}),(0,s.jsx)(N.Z,{children:(0,s.jsx)(V.Z,{title:"Show the final prompt that produced the output in each cell.",placement:"right",children:(0,s.jsx)(eG.Z,{control:(0,s.jsx)(P.Z,{checked:m,onChange:e=>x(e.target.checked)}),label:"Show full prompt in output cell"})})}),(0,s.jsx)(N.Z,{children:(0,s.jsx)(V.Z,{title:"Show pass/fail status for each output.",placement:"right",children:(0,s.jsx)(eG.Z,{control:(0,s.jsx)(P.Z,{checked:g,onChange:e=>v(e.target.checked)}),label:"Show pass/fail status"})})}),(0,s.jsx)(N.Z,{children:(0,s.jsx)(V.Z,{title:"Show detailed inference statistics such as latency, tokens used, cost, etc.",placement:"right",children:(0,s.jsx)(eG.Z,{control:(0,s.jsx)(P.Z,{checked:o,onChange:e=>c(e.target.checked)}),label:"Show inference details"})})}),(0,s.jsxs)(N.Z,{maxWidth:"sm",children:[(0,s.jsxs)(B.Z,{mt:2,children:["Max text length: ",l]}),(0,s.jsx)(e6.ZP,{min:25,max:1e3,value:l,onChange:(e,t)=>a(t)})]})]}),(0,s.jsx)(X.Z,{children:(0,s.jsx)(E.Z,{onClick:n,children:"Close"})})]})},e9=e=>{let{open:t,onClose:n,shareUrl:a}=e,r=(0,l.useRef)(null),[i,o]=(0,l.useState)(!1),c=()=>{n(),o(!1)};return(0,s.jsxs)(G.Z,{open:t,onClose:c,PaperProps:{style:{minWidth:"min(660px, 100%)"}},children:[(0,s.jsx)(Y.Z,{children:"Your eval is ready to share"}),(0,s.jsxs)(q.Z,{children:[(0,s.jsx)(_.Z,{inputRef:r,value:a,fullWidth:!0,InputProps:{readOnly:!0,endAdornment:(0,s.jsx)(ev.Z,{onClick:()=>{r.current&&(r.current.select(),document.execCommand("copy"),o(!0))},children:i?(0,s.jsx)(em.Z,{}):(0,s.jsx)(eg.Z,{})})}}),(0,s.jsx)(eV.Z,{sx:{fontSize:"0.75rem"},children:"Shared URLs are deleted after 2 weeks."})]}),(0,s.jsx)(X.Z,{children:(0,s.jsx)(E.Z,{onClick:c,color:"primary",children:"Close"})})]})};n(58022);let te=(0,J.Z)(z.Z)(e=>{let{theme:t}=e;return{maxWidth:"100%",flexWrap:"wrap",[t.breakpoints.down("sm")]:{flexDirection:"column"}}});function tt(e){var t;let{recentEvals:n,onRecentEvalSelected:a,defaultEvalId:c}=e,d=(0,f.useRouter)(),h=(0,f.useSearchParams)(),{author:p,table:m,setTable:x,config:g,setConfig:j,maxTextLength:b,wordBreak:z,showInferenceDetails:J,evalId:K,inComparisonMode:G,setInComparisonMode:X}=eh(),{setStateFromConfig:q}=(0,Z.o)(),[Y,$]=l.useState((null==h?void 0:h.get("search"))||""),[Q]=(0,H.Nr)(Y,1e3),ee=e=>{$(e)},[et,en]=l.useState({}),es=l.useCallback((e,t)=>{en(n=>({...n,[e]:t}))},[en]);(0,y.Z)(m,"Table data must be loaded before rendering ResultsView");let{head:el}=m,[ea,er]=l.useState("all"),[ei,eo]=l.useState(!1),[ec,ed]=l.useState(""),[eu,em]=l.useState(!1),[ex,eg]=l.useState(null),ev=async()=>{em(!0);try{let e=await fetch("".concat(r,"/api/eval"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{version:2,createdAt:new Date().toISOString(),results:{table:m},config:g}})}),{id:t}=await e.json(),n="".concat(i,"/eval/").concat(t);ed(n),eo(!0)}catch(e){alert("Sorry, something went wrong.")}finally{em(!1)}},ef=async e=>{eg(null);try{var t;let s=await fetch("".concat(await (0,o.b)(),"/api/results/").concat(e),{cache:"no-store"}),l=await s.json(),a=l.data.results.table,r={head:{prompts:[...m.head.prompts.map(e=>{var t;return{...e,label:"[".concat(K||c||(null===(t=n[0])||void 0===t?void 0:t.evalId)||"Eval A","] ").concat(e.label||"")}}),...a.head.prompts.map(t=>({...t,label:"[".concat(e,"] ").concat(t.label||"")}))],vars:m.head.vars},body:m.body.map((e,t)=>{var n;return{...e,outputs:[...e.outputs,...(null===(n=a.body[t])||void 0===n?void 0:n.outputs)||[]]}})};x(r),j({...g,...l.data.config,description:'Combined: "'.concat((null==g?void 0:g.description)||"Eval A",'" and "').concat((null===(t=l.data.config)||void 0===t?void 0:t.description)||"Eval B",'"')}),X(!0)}catch(e){console.error("Error fetching comparison eval:",e),alert("Failed to load comparison eval. Please try again.")}},eb=l.useMemo(()=>m.body.some(e=>e.description),[m.body]),eZ=l.useMemo(()=>[...eb?[{value:"description",label:"Description"}]:[],...el.vars.map((e,t)=>({value:"Variable ".concat(t+1),label:"Var ".concat(t+1,": ").concat(el.vars[t].length>100?el.vars[t].slice(0,97)+"...":el.vars[t]),group:"Variables"})),...el.prompts.map((e,t)=>{let n=el.prompts[t],s=n.label||n.display||n.raw;return{value:"Prompt ".concat(t+1),label:"Prompt ".concat(t+1,": ").concat(s.length>100?s.slice(0,97)+"...":s),group:"Prompts"}})],[el.vars,el.prompts,eb]),[eC,ek]=l.useState(!1),[eS,eR]=l.useState(!1),[eI,eN]=l.useState({}),[eE,eP]=l.useState(eZ.map(e=>e.value)),eF=async()=>{(0,y.Z)(g,"Config must be loaded before clicking its description");let e=window.prompt("Enter new description:",g.description);if(null!==e&&e!==g.description){let t={...g,description:e};try{let e=await fetch("".concat(await (0,o.b)(),"/api/eval/").concat(K),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:t})});if(!e.ok)throw Error("Network response was not ok");j(t)}catch(e){console.error("Failed to update table:",e)}}},eD=async()=>{if(window.confirm("Are you sure you want to delete this evaluation?"))try{let e=await fetch("".concat(await (0,o.b)(),"/api/eval/").concat(K),{method:"DELETE"});if(!e.ok)throw Error("Network response was not ok");d.push("/")}catch(e){console.error("Failed to delete evaluation:",e),alert("Failed to delete evaluation")}},[eM,eO]=l.useState(!1),eL=async()=>{K&&(await navigator.clipboard.writeText(K),eO(!0),setTimeout(()=>{eO(!1)},1e3))};return(0,s.jsxs)("div",{style:{marginLeft:"1rem",marginRight:"1rem"},children:[(0,s.jsxs)(te,{direction:"row",mb:2,spacing:1,alignItems:"center",className:"eval-header",children:[n&&n.length>0&&(0,s.jsx)(ew,{recentEvals:n,onRecentEvalSelected:a,currentEval:n.find(e=>e.evalId===K)||null}),!G&&(0,s.jsx)(B.Z,{variant:"h5",sx:{display:"flex",alignItems:"center"},children:(0,s.jsx)(V.Z,{title:"Click to edit description",children:(0,s.jsx)("span",{className:"description",onClick:eF,children:(null==g?void 0:g.description)||K})})}),(null==g?void 0:g.description)&&K&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.Z,{title:"Click to copy",children:(0,s.jsx)(F.Z,{size:"small",label:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("strong",{children:"ID:"})," ",K]}),sx:{opacity:.7,cursor:"pointer"},onClick:eL})}),(0,s.jsx)(u.Z,{open:eM,autoHideDuration:1e3,onClose:()=>eO(!1),message:"Eval id copied to clipboard"})]}),(0,s.jsx)(V.Z,{title:p?"":"Set eval author with `promptfoo config set email`",children:(0,s.jsx)(F.Z,{size:"small",label:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("strong",{children:"Author:"})," ",p||"Unknown"]}),sx:{opacity:.7}})})]}),(0,s.jsxs)(te,{direction:"row",spacing:4,alignItems:"center",children:[(0,s.jsx)(N.Z,{children:(0,s.jsxs)(T.Z,{sx:{m:1,minWidth:200,maxWidth:350},size:"small",children:[(0,s.jsx)(D.Z,{id:"visible-columns-label",children:"Columns"}),(0,s.jsx)(W.Z,{labelId:"visible-columns-label",id:"visible-columns",multiple:!0,value:eE,onChange:e=>{let{target:{value:t}}=e;eP("string"==typeof t?t.split(","):t);let n=[...eb?["description"]:[],...el.vars.map((e,t)=>"Variable ".concat(t+1)),...el.prompts.map((e,t)=>"Prompt ".concat(t+1))],s={};n.forEach(e=>{s[e]=("string"==typeof t?t.split(","):t).includes(e)}),eN(s)},input:(0,s.jsx)(U.Z,{label:"Visible columns"}),renderValue:e=>e.join(", "),children:eZ.map(e=>(0,s.jsxs)(A.Z,{dense:!0,value:e.value,children:[(0,s.jsx)(P.Z,{checked:eE.indexOf(e.value)>-1}),(0,s.jsx)(O.Z,{primary:e.label})]},e.value))})]})}),(0,s.jsx)(N.Z,{children:(0,s.jsxs)(T.Z,{sx:{minWidth:180},size:"small",children:[(0,s.jsx)(D.Z,{id:"failure-filter-mode-label",children:"Display"}),(0,s.jsxs)(W.Z,{labelId:"filter-mode-label",id:"filter-mode",value:ea,onChange:e=>{let t=e.target.value;er(t);let n={};el.prompts.forEach((e,s)=>{n["Prompt ".concat(s+1)]="failures"===t}),en(n)},label:"Filter",children:[(0,s.jsx)(A.Z,{value:"all",children:"Show all results"}),(0,s.jsx)(A.Z,{value:"failures",children:"Show failures only"}),(0,s.jsx)(A.Z,{value:"different",children:"Show different only"}),(0,s.jsx)(A.Z,{value:"highlights",children:"Show highlights only"})]})]})}),(0,s.jsx)(N.Z,{children:(0,s.jsx)(_.Z,{sx:{minWidth:180},size:"small",label:"Search",placeholder:"Text or regex",value:Y,onChange:e=>ee(e.target.value)})}),(0,s.jsx)(N.Z,{flexGrow:1}),(0,s.jsx)(N.Z,{display:"flex",justifyContent:"flex-end",children:(0,s.jsxs)(te,{direction:"row",spacing:2,children:[(0,s.jsx)(E.Z,{color:"primary",onClick:e=>{eg(e.currentTarget)},startIcon:(0,s.jsx)(w.Z,{}),children:"Eval actions"}),g&&(0,s.jsxs)(L.Z,{id:"eval-actions-menu",anchorEl:ex,keepMounted:!0,open:!!ex,onClose:()=>{eg(null)},children:[(0,s.jsx)(ep,{initialEvals:n,onComparisonEvalSelected:ef}),(0,s.jsx)(V.Z,{title:"View the configuration that defines this eval",placement:"left",children:(0,s.jsxs)(A.Z,{onClick:()=>ek(!0),children:[(0,s.jsx)(M.Z,{children:(0,s.jsx)(I.Z,{fontSize:"small"})}),"View YAML"]})}),(0,s.jsx)(V.Z,{title:"Edit this eval in the web UI",placement:"left",children:(0,s.jsxs)(A.Z,{onClick:()=>{q(g),d.push("/setup/")},children:[(0,s.jsx)(M.Z,{children:(0,s.jsx)(k.Z,{fontSize:"small"})}),"Edit Eval"]})}),(0,s.jsx)(ey,{}),(null==g?void 0:g.sharing)&&(0,s.jsx)(V.Z,{title:"Generate a unique URL that others can access",placement:"left",children:(0,s.jsxs)(A.Z,{onClick:ev,disabled:eu,children:[(0,s.jsx)(M.Z,{children:eu?(0,s.jsx)(v.Z,{size:16}):(0,s.jsx)(R.Z,{fontSize:"small"})}),"Share"]})}),(0,s.jsx)(V.Z,{title:"Delete this eval",placement:"left",children:(0,s.jsxs)(A.Z,{onClick:eD,children:[(0,s.jsx)(M.Z,{children:(0,s.jsx)(C.Z,{fontSize:"small"})}),"Delete"]})})]}),(0,s.jsx)(V.Z,{title:"Edit table view settings",placement:"bottom",children:(0,s.jsx)(E.Z,{color:"primary",onClick:()=>eR(!0),startIcon:(0,s.jsx)(S.Z,{}),children:"Table Settings"})}),(null==g?void 0:null===(t=g.metadata)||void 0===t?void 0:t.redteam)&&(0,s.jsx)(V.Z,{title:"View vulnerability scan report",placement:"bottom",children:(0,s.jsx)(E.Z,{color:"primary",startIcon:(0,s.jsx)(I.Z,{}),onClick:()=>{var e;return d.push("/report/?evalId=".concat(K||c||(null===(e=n[0])||void 0===e?void 0:e.evalId)))},children:"Vulnerability Report"})})]})})]}),(0,s.jsx)(eT,{columnVisibility:eI}),(0,s.jsx)(e7,{maxTextLength:b,columnVisibility:eI,wordBreak:z,showStats:J,filterMode:ea,failureFilter:et,searchText:Q,onFailureFilterToggle:es,onSearchTextChange:ee}),(0,s.jsx)(ej,{open:eC,onClose:()=>ek(!1)}),(0,s.jsx)(e9,{open:ei,onClose:()=>eo(!1),shareUrl:ec}),(0,s.jsx)(e8,{open:eS,onClose:()=>eR(!1)})]})}async function tn(){let e=(0,j.createClientComponentClient)(),{data:{user:t}}=await e.auth.getUser();(0,y.Z)(t,"User not logged in");let{data:n,error:s}=await e.from("EvaluationResult").select("id, createdAt").eq("user_id",t.id).order("createdAt",{ascending:!1}).limit(100);return n||[]}async function ts(e){let t=(0,j.createClientComponentClient)(),{data:n,error:s}=await t.from("EvaluationResult").select("*").eq("id",e).single();return n}function tl(e){var t;let{fetchId:n,preloadedData:a,recentEvals:i,defaultEvalId:c}=e,u=(0,f.useRouter)(),{table:h,setTable:p,setConfig:m,setEvalId:j,setAuthor:Z,setInComparisonMode:w}=eh(),[C,k]=l.useState(!1),[S,R]=l.useState(!1),[I,N]=l.useState(i||[]),E=async()=>{let e=await fetch("".concat(await (0,o.b)(),"/api/results"),{cache:"no-store"}),t=await e.json();return N(t.data),t.data},P=l.useCallback(async e=>{let t=await fetch("".concat(await (0,o.b)(),"/api/results/").concat(e),{cache:"no-store"}),n=await t.json();p(n.data.results.table),m(n.data.config),Z(n.data.author),j(e)},[p,m,j,Z]),F=async e=>{g.Ox?(k(!1),u.push("/eval/remote:".concat(encodeURIComponent(e)))):u.push("/eval/?evalId=".concat(encodeURIComponent(e)))},[T,D]=l.useState(c||(null===(t=I[0])||void 0===t?void 0:t.evalId)),M=(0,f.useSearchParams)(),O=M?M.get("evalId"):null;return(l.useEffect(()=>{if(O){let e=async()=>{await P(O),k(!0),D(O),E()};e()}else if(a){var e;p(null===(e=a.data.results)||void 0===e?void 0:e.table),m(a.data.config),Z(a.data.author||null),k(!0)}else if(n){let e=async()=>{var e;let t="".concat(r,"/api/eval/").concat(n);console.log("Fetching eval from remote server",t);let s=await fetch(t);if(!s.ok){R(!0);return}let l=await s.json();p(null===(e=l.data.results)||void 0===e?void 0:e.table),m(l.data.config),Z(l.data.author||null),k(!0)};e()}else if(g.T8)(0,o.b)().then(e=>{let t=(0,b.io)(e);return t.on("init",e=>{console.log("Initialized socket connection",e),k(!0),p(null==e?void 0:e.results.table),m(null==e?void 0:e.config),Z((null==e?void 0:e.author)||null),E().then(e=>{var t,n;D(null===(t=e[0])||void 0===t?void 0:t.id),j(null===(n=e[0])||void 0===n?void 0:n.id)})}),t.on("update",e=>{console.log("Received data update",e),p(e.results.table),m(e.config),Z(e.author||null),E().then(e=>{var t;let n=null===(t=e[0])||void 0===t?void 0:t.id;n&&(D(n),j(n))})}),()=>{t.disconnect()}});else if(g.Ox)tn().then(e=>{N(e.map(e=>({evalId:e.id,datasetId:null,label:e.createdAt,createdAt:new Date(e.createdAt).getTime(),description:"None",numTests:-1}))),e.length>0&&ts(e[0].id).then(t=>{(0,y.Z)(t,"Eval not found");let n=t.results,s=t.config;D(e[0].id),p(n.table),m(s),Z(null),k(!0)})});else{let e=async()=>{let e=await E();if(!(e.length>0))return(0,s.jsx)("div",{className:"notice",children:"No evals yet. Share some evals to this server and they will appear here."});{let t=await (0,o.b)(),n=e[0].id,s=await fetch("".concat(t,"/api/results/").concat(n)),l=await s.json();p(l.data.results.table),m(l.data.config),Z(l.data.author||null),k(!0),D(n),j(n)}};e()}w(!1)},[n,p,m,Z,j,P,a,D,O,w]),S)?(0,s.jsx)("div",{className:"notice",children:"404 Eval not found"}):C&&h?(0,s.jsx)(x,{children:(0,s.jsx)(d,{children:(0,s.jsx)(tt,{defaultEvalId:T,recentEvals:I,onRecentEvalSelected:F})})}):(0,s.jsxs)("div",{className:"notice",children:[(0,s.jsx)("div",{children:(0,s.jsx)(v.Z,{size:22})}),(0,s.jsx)("div",{children:"Waiting for eval data"})]})}n(94455)},52428:function(e,t,n){"use strict";n.d(t,{Ox:function(){return a},T8:function(){return l},eA:function(){return r}});var s=n(77580);let l=!s.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,a=!!s.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,r=""},47887:function(e,t,n){"use strict";n.d(t,{o:function(){return a}});var s=n(79685),l=n(74595);let a=(0,s.Ue)()((0,l.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],defaultTest:{},evaluateOptions:{},scenarios:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setDefaultTest:t=>e({defaultTest:t}),setEvaluateOptions:t=>e({evaluateOptions:t}),setScenarios:t=>e({scenarios:t}),setStateFromConfig:t=>{let n={};t.description&&(n.description=t.description||""),t.tests&&(n.testCases=t.tests),t.providers&&(n.providers=t.providers),t.prompts&&("string"==typeof t.prompts?n.prompts=[t.prompts]:Array.isArray(t.prompts)?n.prompts=t.prompts.filter(e=>"string"==typeof e&&!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),t.defaultTest&&(n.defaultTest=t.defaultTest),t.evaluateOptions&&(n.evaluateOptions=t.evaluateOptions),t.scenarios&&(n.scenarios=t.scenarios),e(n)},getTestSuite:()=>{let{description:e,testCases:n,providers:s,prompts:l,env:a,scenarios:r}=t();return{env:a,description:e,providers:s,prompts:l,tests:n,scenarios:r}}}),{name:"promptfoo",skipHydration:!0}))},55974:function(){},94455:function(){},16658:function(){},93207:function(){},58022:function(){}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[958],{99166:function(e,t,s){Promise.resolve().then(s.bind(s,41400))},49532:function(e,t,s){"use strict";let n,i;async function r(){if(n||(i||(i=fetch("/api/config").then(e=>e.json()).then(e=>n=e.apiBaseUrl)),await i),void 0===n)throw Error("API base URL is undefined");return n}s.d(t,{b:function(){return r}})},41400:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return S}});var n=s(24004),i=s(14978),r=s(49532),l=s(49567),c=s(30469),a=s(65068),d=s(70417),o=s(21303),h=s(26485),u=s(30021),p=s(19708),x=s(65969),j=s(38640),v=s.n(j),m=s(28891),Z=s(40982),f=s(29794),w=s(22701),C=s(51956),y=s(82669),g=s(613),I=s(63147),k=s(34235);function P(e){var t,s,r,l;let{openDialog:p,handleClose:x,testCase:j}=e,[m,P]=(0,i.useState)(1);return(0,n.jsxs)(f.Z,{open:p,onClose:x,fullWidth:!0,maxWidth:"lg",children:[(0,n.jsxs)(y.Z,{children:["Dataset ",j.id.slice(0,6)]}),(0,n.jsxs)(C.Z,{children:[(0,n.jsx)(I.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Test cases"}),(0,n.jsx)(g.u,{readOnly:!0,value:j&&k.default.dump(j.testCases),style:{width:"100%",padding:"0.75rem"},maxRows:15}),(0,n.jsx)(I.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Used in..."}),(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(h.Z,{children:(0,n.jsxs)(u.Z,{children:[(0,n.jsx)(o.Z,{children:"Eval ID"}),(0,n.jsx)(o.Z,{children:"Prompt ID"}),(0,n.jsx)(o.Z,{children:"Raw score"}),(0,n.jsx)(o.Z,{children:"Pass rate"}),(0,n.jsx)(o.Z,{children:"Pass count"}),(0,n.jsx)(o.Z,{children:"Fail count"}),(0,n.jsx)(o.Z,{children:"Prompt"})]})}),(0,n.jsx)(d.Z,{children:null==j?void 0:null===(t=j.prompts)||void 0===t?void 0:t.slice((m-1)*10,10*m).sort((e,t)=>t.evalId.localeCompare(e.evalId)).map((e,t)=>{var s,i,c,a,d;return(0,n.jsxs)(u.Z,{hover:!0,children:[(0,n.jsx)(o.Z,{children:(0,n.jsx)(v(),{href:"/eval/?evalId=".concat(e.evalId),children:e.evalId})}),(0,n.jsx)(o.Z,{style:{minWidth:"8em"},children:(0,n.jsx)(v(),{href:"/prompts/?id=".concat(e.id),children:e.id.slice(0,6)})}),(0,n.jsx)(o.Z,{children:"number"==typeof(null===(s=e.prompt.metrics)||void 0===s?void 0:s.score)?e.prompt.metrics.score.toFixed(2):"-"}),(0,n.jsx)(o.Z,{children:"number"==typeof(null===(i=e.prompt.metrics)||void 0===i?void 0:i.testPassCount)&&"number"==typeof(null===(c=e.prompt.metrics)||void 0===c?void 0:c.testFailCount)&&e.prompt.metrics.testPassCount+e.prompt.metrics.testFailCount>0?(e.prompt.metrics.testPassCount/(e.prompt.metrics.testPassCount+e.prompt.metrics.testFailCount)*100).toFixed(2)+"%":"-"}),(0,n.jsx)(o.Z,{children:null!==(r=null===(a=e.prompt.metrics)||void 0===a?void 0:a.testPassCount)&&void 0!==r?r:"-"}),(0,n.jsx)(o.Z,{children:null!==(l=null===(d=e.prompt.metrics)||void 0===d?void 0:d.testFailCount)&&void 0!==l?l:"-"}),(0,n.jsx)(o.Z,{children:e.prompt.raw.length>250?e.prompt.raw.slice(0,250)+"...":e.prompt.raw})]},t)})})]}),Math.ceil(((null==j?void 0:null===(s=j.prompts)||void 0===s?void 0:s.length)||0)/10)>1&&(0,n.jsx)(c.Z,{count:Math.ceil(j.prompts.length/10),page:m,onChange:(e,t)=>{P(t)}})]}),(0,n.jsx)(w.Z,{children:(0,n.jsx)(Z.Z,{onClick:x,children:"Close"})})]})}function S(){let e=(0,m.useSearchParams)(),[t,s]=(0,i.useState)([]),[j,Z]=(0,i.useState)("date"),[f,w]=(0,i.useState)("desc"),[C,y]=(0,i.useState)(1),[g,I]=(0,i.useState)(10),[k,S]=(0,i.useState)(!1),[b,E]=(0,i.useState)(0),D=e=>{let t=j===e&&"asc"===f?"desc":"asc";Z(e),w(t)};(0,i.useEffect)(()=>{(async()=>{fetch("".concat(await (0,r.b)(),"/api/datasets")).then(e=>e.json()).then(e=>{let t=[...e.data].sort((e,t)=>null===j?0:"asc"===f?e[j]>t[j]?1:-1:e[j]<t[j]?1:-1);s(t)})})()},[j,f,C,g]);let F=e=>{E(e),S(!0)};return(0,i.useEffect)(()=>{let s=null==e?void 0:e.get("id");if(s){let e=t.findIndex(e=>e.id.startsWith(s));-1!==e&&F(e)}},[t,e]),(0,n.jsxs)(l.Z,{paddingX:2,children:[(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(h.Z,{children:(0,n.jsxs)(u.Z,{children:[(0,n.jsx)(o.Z,{style:{width:"10%"},children:"ID"}),(0,n.jsx)(o.Z,{style:{width:"20%"},children:(0,n.jsx)(p.Z,{active:"raw"===j,direction:"raw"===j?f:"asc",onClick:()=>D("raw"),children:"Info"})}),(0,n.jsx)(o.Z,{style:{width:"20%"},children:"Variables"}),(0,n.jsx)(o.Z,{style:{width:"10%"},children:(0,n.jsx)(p.Z,{active:"count"===j,direction:"count"===j?f:"asc",onClick:()=>D("count"),children:"Total # evals"})}),(0,n.jsx)(o.Z,{style:{width:"20%"},children:(0,n.jsx)(x.Z,{title:"The date of the most recent eval for this set of test cases",children:(0,n.jsx)(p.Z,{active:"date"===j,direction:"date"===j?f:"asc",onClick:()=>D("date"),children:"Most recent eval date"})})}),(0,n.jsx)(o.Z,{style:{width:"20%"},children:(0,n.jsx)(x.Z,{title:"The ID of the most recent eval for this set of test cases",children:(0,n.jsx)(p.Z,{active:"evalId"===j,direction:"evalId"===j?f:"asc",onClick:()=>D("evalId"),children:"Most recent eval ID"})})})]})}),(0,n.jsx)(d.Z,{children:t.slice((C-1)*g,C*g).map((e,t)=>(0,n.jsxs)(u.Z,{hover:!0,onClick:()=>F(t),style:{cursor:"pointer"},children:[(0,n.jsx)(o.Z,{children:e.id.slice(0,6)}),(0,n.jsxs)(o.Z,{style:{width:"20%",whiteSpace:"pre-wrap"},children:[e.testCases.length," test cases"]}),(0,n.jsx)(o.Z,{style:{width:"20%",whiteSpace:"pre-wrap"},children:(()=>{if(!Array.isArray(e.testCases)||"string"==typeof e.testCases[0])return"";let t=(e.testCases||[]).flatMap(e=>Object.keys(e.vars||{})),s=Array.from(new Set(t));return s.length>0?s.join(", "):"None"})()}),(0,n.jsx)(o.Z,{style:{width:"10%"},children:e.count}),(0,n.jsx)(o.Z,{style:{width:"20%"},children:e.recentEvalDate||"Unknown"}),(0,n.jsx)(o.Z,{style:{width:"20%"},children:e.recentEvalId?(0,n.jsx)(v(),{href:"/eval?evalId=".concat(e.recentEvalId),children:e.recentEvalId}):"Unknown"})]},t))})]}),Math.ceil(t.length/g)>1&&(0,n.jsx)(c.Z,{count:Math.ceil(t.length/g),page:C,onChange:(e,t)=>y(t)}),t[b]&&(0,n.jsx)(P,{openDialog:k,handleClose:()=>{S(!1)},testCase:t[b]})]})}}},function(e){e.O(0,[448,640,973,995,374,235,322,470,730,744],function(){return e(e.s=99166)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[466],{96144:function(n,e,u){Promise.resolve().then(u.t.bind(u,29820,23))},29820:function(){}},function(n){n.O(0,[470,730,744],function(){return n(n.s=96144)}),_N_E=n.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[11],{26189:function(e,n,s){Promise.resolve().then(s.t.bind(s,63512,23)),Promise.resolve().then(s.bind(s,15737))}},function(e){e.O(0,[583,448,640,620,973,304,339,995,374,163,378,235,578,631,905,737,470,730,744],function(){return e(e.s=26189)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{55769:function(e,t,n){Promise.resolve().then(n.bind(n,5071)),Promise.resolve().then(n.t.bind(n,65246,23)),Promise.resolve().then(n.t.bind(n,5100,23))},5071:function(e,t,n){"use strict";n.r(t),n.d(t,{PageShell:function(){return J}});var r=n(24004),o=n(14978),s=n(52428),i=n(86768),l=n(77656),a=n(32414),c=n(38640),u=n.n(c),h=n(28891),d=n(95707),f=n(80378);function m(e){let{darkMode:t,onToggleDarkMode:n}=e;return(0,r.jsx)("div",{className:"dark-mode-toggle",onClick:n,children:t?(0,r.jsx)(d.Z,{}):(0,r.jsx)(f.Z,{})})}n(32854);var p=n(56343),x=n(89335),g=n(9327),j=n(98629),b=n(16783),v=n(29794),Z=n(82669),S=n(63147),k=n(52062),C=n(51956),E=n(22701),P=n(40982);let _=[{icon:(0,r.jsx)(b.Z,{fontSize:"small"}),text:"Documentation",href:"https://www.promptfoo.dev/docs/intro"},{icon:(0,r.jsx)(j.Z,{fontSize:"small"}),text:"GitHub Repository",href:"https://github.com/promptfoo/promptfoo"},{icon:(0,r.jsx)(p.Z,{fontSize:"small"}),text:"File an Issue",href:"https://github.com/promptfoo/promptfoo/issues"},{icon:(0,r.jsx)(g.Z,{fontSize:"small"}),text:"Join Our Discord Community",href:"https://discord.gg/gHPS9jjfbs"},{icon:(0,r.jsx)(x.Z,{fontSize:"small"}),text:"Book a Meeting",href:"https://cal.com/team/promptfoo/intro"}];function O(e){let{open:t,onClose:n}=e;return(0,r.jsxs)(v.Z,{open:t,onClose:n,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"about-promptfoo-dialog-title",children:[(0,r.jsx)(Z.Z,{id:"about-promptfoo-dialog-title",children:(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(S.Z,{variant:"h6",children:"About Promptfoo"}),(0,r.jsx)(k.Z,{href:"https://github.com/promptfoo/promptfoo/releases",underline:"none",sx:{color:"inherit"},children:(0,r.jsxs)(S.Z,{variant:"subtitle2",children:["Version ","0.72.0"]})})]})}),(0,r.jsxs)(C.Z,{children:[(0,r.jsx)(S.Z,{variant:"body2",gutterBottom:!0,children:"Promptfoo is a MIT licensed open-source tool for evaluating LLMs. We make it easy to track the performance of your models and prompts over time with automated support for dataset generation and grading."}),(0,r.jsx)(a.Z,{spacing:2,mt:2,children:_.map((e,t)=>(0,r.jsxs)(a.Z,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap","& .MuiSvgIcon-root":{color:"text.primary"}},children:[e.icon,(0,r.jsx)(k.Z,{underline:"none",target:"_blank",href:e.href,sx:{color:"inherit"},children:(0,r.jsx)(S.Z,{variant:"body2",children:e.text})})]},t))})]}),(0,r.jsx)(E.Z,{children:(0,r.jsx)(P.Z,{onClick:n,children:"Close"})})]})}var N=n(1445),w=n(31657),I=n(36273),y=n(96976);function M(){let{user:e,logout:t}=(0,N.aC)(),[n,s]=o.useState(null),i=()=>{s(null)},a=async()=>{null==t||t(),i()};return e?(0,r.jsxs)("div",{children:[(0,r.jsx)(l.Z,{edge:"end","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:e=>{s(e.currentTarget)},color:"inherit",children:(0,r.jsx)(w.Z,{sx:{width:"1em",height:"1em",bgcolor:"#1976d2"}})}),(0,r.jsxs)(I.Z,{id:"menu-appbar",anchorEl:n,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:!!n,onClose:i,children:[(0,r.jsxs)(y.Z,{disabled:!0,children:["Logged in as ",e.email]}),(0,r.jsx)(y.Z,{onClick:a,children:"Logout"})]})]}):(0,r.jsx)(u(),{href:"/auth/signup/",children:(0,r.jsx)(l.Z,{edge:"end","aria-label":"User not logged in","aria-controls":"menu-appbar","aria-haspopup":"true",color:"inherit",children:(0,r.jsx)(w.Z,{sx:{width:"1em",height:"1em"}})})})}var T=n(49567),A=n(47051),D=n.n(A);function L(){return(0,r.jsxs)(T.Z,{className:"logo",children:[(0,r.jsx)(D(),{width:25,height:25,src:"/logo.svg",alt:"Promptfoo logo"})," ",(0,r.jsx)("span",{children:"promptfoo"})]})}n(17328),n(5008);var R=n(77580);function B(e){let{href:t,label:n}=e,o=(0,h.usePathname)()||"";return(0,r.jsx)(u(),{href:t,className:o.startsWith(t)?"active":"",children:n})}function U(e){let{darkMode:t,onToggleDarkMode:n}=e,[c,u]=(0,o.useState)(!1),h=()=>u(e=>!e),d=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(L,{}),!R.env.NEXT_PUBLIC_NO_BROWSING&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(B,{href:"/setup",label:"New Eval"}),(0,r.jsx)(B,{href:"/eval",label:"Evals"}),(0,r.jsx)(B,{href:"/prompts",label:"Prompts"}),(0,r.jsx)(B,{href:"/datasets",label:"Datasets"}),(0,r.jsx)(B,{href:"/progress",label:"Progress"})]}),(0,r.jsxs)("div",{className:"right-aligned",children:[s.Ox?(0,r.jsx)(M,{}):null,(0,r.jsx)(l.Z,{onClick:h,color:"inherit",children:(0,r.jsx)(i.Z,{})}),(0,r.jsx)(m,{darkMode:t,onToggleDarkMode:n})]})]});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(O,{open:c,onClose:h}),(0,r.jsx)(a.Z,{direction:"row",spacing:2,className:"nav",children:d})]})}var W=n(51867),z=n(61191),F=n(38127);n(70894);let G=e=>(0,W.Z)({typography:{fontFamily:"inherit"},palette:{mode:e?"dark":"light"}}),H=G(!1),V=G(!0);function X(e){let{children:t}=e;return(0,r.jsx)("div",{children:t})}function J(e){let{children:t}=e,n=(0,F.Z)("(prefers-color-scheme: dark)"),[s,i]=(0,o.useState)(null);(0,o.useEffect)(()=>{let e=localStorage.getItem("darkMode");i(null!==e?"true"===e:n)},[n]);let l=(0,o.useCallback)(()=>{i(e=>{let t=!e;return localStorage.setItem("darkMode",String(t)),t})},[]);return((0,o.useEffect)(()=>{null!==s&&(s?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme"))},[s]),null===s)?null:(0,r.jsx)(z.Z,{theme:s?V:H,children:(0,r.jsx)(N.Ho,{children:(0,r.jsxs)(X,{children:[(0,r.jsx)(U,{darkMode:s,onToggleDarkMode:l}),(0,r.jsx)("div",{children:t})]})})})}},52428:function(e,t,n){"use strict";n.d(t,{Ox:function(){return s},T8:function(){return o},eA:function(){return i}});var r=n(77580);let o=!r.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,s=!!r.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,i=""},1445:function(e,t,n){"use strict";n.d(t,{Ho:function(){return h},OQ:function(){return i},aC:function(){return a}});var r=n(24004),o=n(14978),s=n(12594);let i=(0,s.createClientComponentClient)(),l=(0,o.createContext)({}),a=()=>(0,o.useContext)(l),c=(e,t)=>i.auth.signInWithPassword({email:e,password:t}),u=()=>i.auth.signOut(),h=e=>{let{children:t}=e,[n,s]=(0,o.useState)(null),[a,h]=(0,o.useState)(!1),d=(0,o.useCallback)(async()=>{let{data:e,error:t}=await i.auth.refreshSession();e&&s(e.user)},[]);return(0,o.useEffect)(()=>{d();let{data:e}=i.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?h(!1):"SIGNED_IN"===e&&t?(s(t.user),h(!0)):"SIGNED_OUT"===e&&(h(!1),s(null))});return()=>{e.subscription.unsubscribe()}},[d]),(0,r.jsx)(l.Provider,{value:{loggedIn:a,user:n,login:c,logout:u},children:t})}},32854:function(){},17328:function(){},5008:function(){},70894:function(){},5100:function(){}},function(e){e.O(0,[448,640,620,374,163,53,470,730,744],function(){return e(e.s=55769)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{47299:function(e,n,t){Promise.resolve().then(t.t.bind(t,6020,23)),Promise.resolve().then(t.t.bind(t,83507,23)),Promise.resolve().then(t.t.bind(t,27883,23)),Promise.resolve().then(t.t.bind(t,46785,23)),Promise.resolve().then(t.t.bind(t,27382,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[470,730],function(){return n(11409),n(47299)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.dark-mode-toggle{display:flex;background-color:transparent;border:none;color:var(--text-color);cursor:pointer;font-size:16px;padding:8px;transition:color .3s}.dark-mode-toggle:hover{color:var(--pass-color)}.logo{display:flex;font-family:monospace,monospace;font-size:.8rem;align-items:center;gap:8px;background-color:#f0f0f0;padding:0 2rem 0 0;border-radius:.5rem}[data-theme=dark] .logo{background-color:#333;border-color:#444}.logo img{width:25px;margin-top:2px}[data-theme=dark] .logo img{filter:invert(1)}.logo span{color:var(--text-color)}[data-theme=dark] .logo span{color:#f0f0f0}.nav{padding:.25rem 0 .25rem 1rem;gap:1rem;background-color:#eee;margin-bottom:1rem}[data-theme=dark] .nav{background-color:#333}.nav a{text-decoration:none;color:#000;align-self:center}.nav .active{font-weight:700}[data-theme=dark] .nav a{color:#f0f0f0}.nav .right-aligned{display:flex;align-items:center;gap:1rem;margin-left:auto;margin-right:.5rem}.nav a:hover{text-decoration:underline}[data-theme=dark] .nav a:hover{color:#ddd}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:400;font-display:swap;src:url(/_next/static/media/ec159349637c90ad-s.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:400;font-display:swap;src:url(/_next/static/media/513657b02c5c193f-s.woff2) format("woff2");unicode-range:U+0301,U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:400;font-display:swap;src:url(/_next/static/media/fd4db3eb5472fc27-s.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:400;font-display:swap;src:url(/_next/static/media/51ed15f9841b9f9d-s.woff2) format("woff2");unicode-range:U+0370-0377,U+037a-037f,U+0384-038a,U+038c,U+038e-03a1,U+03a3-03ff}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:400;font-display:swap;src:url(/_next/static/media/05a31a2ca4975f99-s.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1ea0-1ef9,U+20ab}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:400;font-display:swap;src:url(/_next/static/media/d6b16ce4a6175f26-s.woff2) format("woff2");unicode-range:U+0100-02af,U+0304,U+0308,U+0329,U+1e00-1e9f,U+1ef2-1eff,U+2020,U+20a0-20ab,U+20ad-20c0,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:400;font-display:swap;src:url(/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+0304,U+0308,U+0329,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:500;font-display:swap;src:url(/_next/static/media/ec159349637c90ad-s.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:500;font-display:swap;src:url(/_next/static/media/513657b02c5c193f-s.woff2) format("woff2");unicode-range:U+0301,U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:500;font-display:swap;src:url(/_next/static/media/fd4db3eb5472fc27-s.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:500;font-display:swap;src:url(/_next/static/media/51ed15f9841b9f9d-s.woff2) format("woff2");unicode-range:U+0370-0377,U+037a-037f,U+0384-038a,U+038c,U+038e-03a1,U+03a3-03ff}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:500;font-display:swap;src:url(/_next/static/media/05a31a2ca4975f99-s.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1ea0-1ef9,U+20ab}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:500;font-display:swap;src:url(/_next/static/media/d6b16ce4a6175f26-s.woff2) format("woff2");unicode-range:U+0100-02af,U+0304,U+0308,U+0329,U+1e00-1e9f,U+1ef2-1eff,U+2020,U+20a0-20ab,U+20ad-20c0,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:500;font-display:swap;src:url(/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+0304,U+0308,U+0329,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:700;font-display:swap;src:url(/_next/static/media/ec159349637c90ad-s.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:700;font-display:swap;src:url(/_next/static/media/513657b02c5c193f-s.woff2) format("woff2");unicode-range:U+0301,U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:700;font-display:swap;src:url(/_next/static/media/fd4db3eb5472fc27-s.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:700;font-display:swap;src:url(/_next/static/media/51ed15f9841b9f9d-s.woff2) format("woff2");unicode-range:U+0370-0377,U+037a-037f,U+0384-038a,U+038c,U+038e-03a1,U+03a3-03ff}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:700;font-display:swap;src:url(/_next/static/media/05a31a2ca4975f99-s.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1ea0-1ef9,U+20ab}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:700;font-display:swap;src:url(/_next/static/media/d6b16ce4a6175f26-s.woff2) format("woff2");unicode-range:U+0100-02af,U+0304,U+0308,U+0329,U+1e00-1e9f,U+1ef2-1eff,U+2020,U+20a0-20ab,U+20ad-20c0,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:__Inter_c19315;font-style:normal;font-weight:700;font-display:swap;src:url(/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+0304,U+0308,U+0329,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:__Inter_Fallback_c19315;src:local("Arial");ascent-override:90.20%;descent-override:22.48%;line-gap-override:0.00%;size-adjust:107.40%}.__className_c19315{font-family:__Inter_c19315,__Inter_Fallback_c19315;font-style:normal}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;--background-color:#fff;--text-color:#404040;--link-color:#2e6585;--border-color:#d3d3d3;--table-border-color:#d3d3d3;--pass-color:green;--fail-color:#ad0000;--success-background-color:#d1ffd7;--fail-background-color:#ffd1d1;--neutral-background-color:#eee;--variable-background-color:#f7f7f7;--header-background-color:#fffdf7;--insert-highlight-color:#d4fcbc;--delete-highlight-color:#fbb6c2;--prompt-highlight-color:linen;--textarea-background-color:#fff;--textarea-color:#404040;--search-highlight-color:#ff0;--search-text-color:inherit}[data-theme=dark]{--background-color:#1a1a1a;--text-color:#f0f0f0;--link-color:#6fcaff;--border-color:#444;--table-border-color:#444;--pass-color:#b1e9b3;--fail-color:#ee726a;--success-background-color:#216d2b;--fail-background-color:#6d2121;--neutral-background-color:#424242;--variable-background-color:#333;--header-background-color:#333;--insert-highlight-color:#4f8a34;--delete-highlight-color:#8a3434;--prompt-highlight-color:#67605a;--textarea-background-color:#2d2d2d;--textarea-color:#fff;--search-highlight-color:#ff0;--search-text-color:#404040}html{font-size:16px;background-color:var(--background-color);color:var(--text-color)}body{margin:0}a{color:var(--link-color);text-decoration:none}a:hover{text-decoration:underline}textarea{background-color:var(--textarea-background-color);color:var(--textarea-color);padding:.5em;border:1px solid var(--border-color);border-radius:.25em;resize:vertical}*{box-sizing:border-box}
|
|
File without changes
|
|
File without changes
|