promptfoo 0.25.0 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +18 -7
  2. package/dist/package.json +1 -1
  3. package/dist/src/assertions.js +2 -2
  4. package/dist/src/assertions.js.map +1 -1
  5. package/dist/src/evaluator.d.ts.map +1 -1
  6. package/dist/src/evaluator.js +43 -15
  7. package/dist/src/evaluator.js.map +1 -1
  8. package/dist/src/index.d.ts.map +1 -1
  9. package/dist/src/index.js +6 -1
  10. package/dist/src/index.js.map +1 -1
  11. package/dist/src/main.js +7 -2
  12. package/dist/src/main.js.map +1 -1
  13. package/dist/src/matchers.d.ts.map +1 -1
  14. package/dist/src/matchers.js +9 -4
  15. package/dist/src/matchers.js.map +1 -1
  16. package/dist/src/providers/scriptCompletion.d.ts.map +1 -1
  17. package/dist/src/providers/scriptCompletion.js +8 -1
  18. package/dist/src/providers/scriptCompletion.js.map +1 -1
  19. package/dist/src/testCases.d.ts.map +1 -1
  20. package/dist/src/testCases.js +6 -8
  21. package/dist/src/testCases.js.map +1 -1
  22. package/dist/src/types.d.ts +2 -2
  23. package/dist/src/types.d.ts.map +1 -1
  24. package/dist/src/util.d.ts +1 -0
  25. package/dist/src/util.d.ts.map +1 -1
  26. package/dist/src/util.js +7 -1
  27. package/dist/src/util.js.map +1 -1
  28. package/dist/src/web/nextui/404/index.html +1 -1
  29. package/dist/src/web/nextui/404.html +1 -1
  30. package/dist/src/web/nextui/_next/static/chunks/891-db3298c071ff636f.js +1 -0
  31. package/dist/src/web/nextui/_next/static/chunks/app/datasets/{page-84286ffe4467c5db.js → page-5d1f9b7d4686fe34.js} +1 -1
  32. package/dist/src/web/nextui/auth/login/index.html +1 -1
  33. package/dist/src/web/nextui/auth/login/index.txt +1 -1
  34. package/dist/src/web/nextui/auth/signup/index.html +1 -1
  35. package/dist/src/web/nextui/auth/signup/index.txt +1 -1
  36. package/dist/src/web/nextui/datasets/index.html +1 -1
  37. package/dist/src/web/nextui/datasets/index.txt +2 -2
  38. package/dist/src/web/nextui/eval/index.html +1 -1
  39. package/dist/src/web/nextui/eval/index.txt +2 -2
  40. package/dist/src/web/nextui/index.html +1 -1
  41. package/dist/src/web/nextui/index.txt +1 -1
  42. package/dist/src/web/nextui/prompts/index.html +1 -1
  43. package/dist/src/web/nextui/prompts/index.txt +1 -1
  44. package/dist/src/web/nextui/setup/index.html +1 -1
  45. package/dist/src/web/nextui/setup/index.txt +1 -1
  46. package/package.json +1 -1
  47. package/dist/src/web/nextui/_next/static/chunks/891-0286b3010dc452ac.js +0 -1
  48. /package/dist/src/web/nextui/_next/static/{u3pdaLciuOlCvOMUz3jbc → JnpeELqmFYxCBGqEmtjGz}/_buildManifest.js +0 -0
  49. /package/dist/src/web/nextui/_next/static/{u3pdaLciuOlCvOMUz3jbc → JnpeELqmFYxCBGqEmtjGz}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><link rel="preload" as="font" href="/_next/static/media/0e4fe491bf84089c-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/627622453ef56b0d-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/934c4b7cb736f2a3-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="style" href="/_next/static/css/2e8afc839fdb6c80.css"/><link rel="preload" href="/_next/static/chunks/webpack-cb669abeb3132738.js" as="script"/><link rel="preload" href="/_next/static/chunks/fd9d1056-fba4b53a2f01213b.js" as="script"/><link rel="preload" href="/_next/static/chunks/596-297f7ff4a0436e87.js" as="script"/><link rel="preload" href="/_next/static/chunks/main-app-581ccf0003955b21.js" as="script"/><title>promptfoo</title><meta name="description" content="LLM testing and evaluation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta property="og:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body><script src="/_next/static/chunks/webpack-cb669abeb3132738.js" async=""></script><script src="/_next/static/chunks/fd9d1056-fba4b53a2f01213b.js" async=""></script><script src="/_next/static/chunks/596-297f7ff4a0436e87.js" async=""></script><script src="/_next/static/chunks/main-app-581ccf0003955b21.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/0e4fe491bf84089c-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/627622453ef56b0d-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/934c4b7cb736f2a3-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/css/2e8afc839fdb6c80.css\",{\"as\":\"style\"}]\n0:\"$L5\"\n"])</script><script>self.__next_f.push([1,"6:I{\"id\":7948,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\n8:I{\"id\":6628,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"\",\"async\":false}\n9:I{\"id\":2112,\"chunks\":[\"293:static/chunks/293-f7537306415679fd.js\",\"548:static/chunks/548-46c7c1d35ca1bc02.js\",\"82:static/"])</script><script>self.__next_f.push([1,"chunks/82-ca0360e473d81167.js\",\"320:static/chunks/320-d41e321556b1b694.js\",\"563:static/chunks/563-a961efef5193d79c.js\",\"185:static/chunks/app/layout-48c7b442dc5873a7.js\"],\"name\":\"PageShell\",\"async\":false}\na:I{\"id\":7767,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\nb:I{\"id\":7920,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2"])</script><script>self.__next_f.push([1,"f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\nd:I{\"id\":176,\"chunks\":[\"293:static/chunks/293-f7537306415679fd.js\",\"808:static/chunks/808-90426be34a5d9784.js\",\"238:static/chunks/238-84a998be247f92e7.js\",\"21:static/chunks/21-8a2c661f5df627d6.js\",\"794:static/chunks/app/prompts/page-b1f8e85f32a45c2a.js\"],\"name\":\"\",\"async\":false}\n"])</script><script>self.__next_f.push([1,"5:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/2e8afc839fdb6c80.css\",\"precedence\":\"next\"}]],[\"$\",\"$L6\",null,{\"buildId\":\"u3pdaLciuOlCvOMUz3jbc\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/prompts/\",\"initialTree\":[\"\",{\"children\":[\"prompts\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialHead\":\"$L7\",\"globalErrorComponent\":\"$8\",\"children\":[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_979022\",\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"prompts\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$Lc\",[\"$\",\"div\",null,{\"children\":[\"$\",\"$Ld\",null,{}]}],null],\"segment\":\"__PAGE__\"},\"styles\":[]}],\"segment\":\"prompts\"},\"styles\":[]}]}]}]}],null]}]]\n"])</script><script>self.__next_f.push([1,"7:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"1\",{\"children\":\"promptfoo\"}],[\"$\",\"meta\",\"2\",{\"name\":\"description\",\"content\":\"LLM testing and evaluation\"}],[\"$\",\"meta\",\"3\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"4\",{\"property\":\"og:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"5\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"6\",{\"name\":\"twitter:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"7\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"c:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><link rel="preload" as="font" href="/_next/static/media/0e4fe491bf84089c-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/627622453ef56b0d-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/934c4b7cb736f2a3-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="style" href="/_next/static/css/2e8afc839fdb6c80.css"/><link rel="preload" href="/_next/static/chunks/webpack-cb669abeb3132738.js" as="script"/><link rel="preload" href="/_next/static/chunks/fd9d1056-fba4b53a2f01213b.js" as="script"/><link rel="preload" href="/_next/static/chunks/596-297f7ff4a0436e87.js" as="script"/><link rel="preload" href="/_next/static/chunks/main-app-581ccf0003955b21.js" as="script"/><title>promptfoo</title><meta name="description" content="LLM testing and evaluation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta property="og:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body><script src="/_next/static/chunks/webpack-cb669abeb3132738.js" async=""></script><script src="/_next/static/chunks/fd9d1056-fba4b53a2f01213b.js" async=""></script><script src="/_next/static/chunks/596-297f7ff4a0436e87.js" async=""></script><script src="/_next/static/chunks/main-app-581ccf0003955b21.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/0e4fe491bf84089c-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/627622453ef56b0d-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/934c4b7cb736f2a3-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/css/2e8afc839fdb6c80.css\",{\"as\":\"style\"}]\n0:\"$L5\"\n"])</script><script>self.__next_f.push([1,"6:I{\"id\":7948,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\n8:I{\"id\":6628,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"\",\"async\":false}\n9:I{\"id\":2112,\"chunks\":[\"293:static/chunks/293-f7537306415679fd.js\",\"548:static/chunks/548-46c7c1d35ca1bc02.js\",\"82:static/"])</script><script>self.__next_f.push([1,"chunks/82-ca0360e473d81167.js\",\"320:static/chunks/320-d41e321556b1b694.js\",\"563:static/chunks/563-a961efef5193d79c.js\",\"185:static/chunks/app/layout-48c7b442dc5873a7.js\"],\"name\":\"PageShell\",\"async\":false}\na:I{\"id\":7767,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\nb:I{\"id\":7920,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2"])</script><script>self.__next_f.push([1,"f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\nd:I{\"id\":176,\"chunks\":[\"293:static/chunks/293-f7537306415679fd.js\",\"808:static/chunks/808-90426be34a5d9784.js\",\"238:static/chunks/238-84a998be247f92e7.js\",\"21:static/chunks/21-8a2c661f5df627d6.js\",\"794:static/chunks/app/prompts/page-b1f8e85f32a45c2a.js\"],\"name\":\"\",\"async\":false}\n"])</script><script>self.__next_f.push([1,"5:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/2e8afc839fdb6c80.css\",\"precedence\":\"next\"}]],[\"$\",\"$L6\",null,{\"buildId\":\"JnpeELqmFYxCBGqEmtjGz\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/prompts/\",\"initialTree\":[\"\",{\"children\":[\"prompts\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialHead\":\"$L7\",\"globalErrorComponent\":\"$8\",\"children\":[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_979022\",\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"prompts\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$Lc\",[\"$\",\"div\",null,{\"children\":[\"$\",\"$Ld\",null,{}]}],null],\"segment\":\"__PAGE__\"},\"styles\":[]}],\"segment\":\"prompts\"},\"styles\":[]}]}]}]}],null]}]]\n"])</script><script>self.__next_f.push([1,"7:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"1\",{\"children\":\"promptfoo\"}],[\"$\",\"meta\",\"2\",{\"name\":\"description\",\"content\":\"LLM testing and evaluation\"}],[\"$\",\"meta\",\"3\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"4\",{\"property\":\"og:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"5\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"6\",{\"name\":\"twitter:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"7\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"c:null\n"])</script></body></html>
@@ -2,7 +2,7 @@
2
2
  2:HL["/_next/static/media/627622453ef56b0d-s.p.woff2",{"as":"font","type":"font/woff2"}]
3
3
  3:HL["/_next/static/media/934c4b7cb736f2a3-s.p.woff2",{"as":"font","type":"font/woff2"}]
4
4
  4:HL["/_next/static/css/2e8afc839fdb6c80.css",{"as":"style"}]
5
- 0:["u3pdaLciuOlCvOMUz3jbc",[[["",{"children":["prompts",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L5",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2e8afc839fdb6c80.css","precedence":"next"}]],"$L6"]]]]
5
+ 0:["JnpeELqmFYxCBGqEmtjGz",[[["",{"children":["prompts",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L5",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2e8afc839fdb6c80.css","precedence":"next"}]],"$L6"]]]]
6
6
  7:I{"id":2112,"chunks":["293:static/chunks/293-f7537306415679fd.js","548:static/chunks/548-46c7c1d35ca1bc02.js","82:static/chunks/82-ca0360e473d81167.js","320:static/chunks/320-d41e321556b1b694.js","563:static/chunks/563-a961efef5193d79c.js","185:static/chunks/app/layout-48c7b442dc5873a7.js"],"name":"PageShell","async":false}
7
7
  8:I{"id":7767,"chunks":["272:static/chunks/webpack-cb669abeb3132738.js","971:static/chunks/fd9d1056-fba4b53a2f01213b.js","596:static/chunks/596-297f7ff4a0436e87.js"],"name":"default","async":false}
8
8
  9:I{"id":7920,"chunks":["272:static/chunks/webpack-cb669abeb3132738.js","971:static/chunks/fd9d1056-fba4b53a2f01213b.js","596:static/chunks/596-297f7ff4a0436e87.js"],"name":"default","async":false}
@@ -24,4 +24,4 @@
24
24
  color: transparent !important;
25
25
  }
26
26
  }
27
- </style></div></div></div></div></div><script src="/_next/static/chunks/webpack-cb669abeb3132738.js" async=""></script><script src="/_next/static/chunks/fd9d1056-fba4b53a2f01213b.js" async=""></script><script src="/_next/static/chunks/596-297f7ff4a0436e87.js" async=""></script><script src="/_next/static/chunks/main-app-581ccf0003955b21.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/0e4fe491bf84089c-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/627622453ef56b0d-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/934c4b7cb736f2a3-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/css/2e8afc839fdb6c80.css\",{\"as\":\"style\"}]\n0:\"$L5\"\n"])</script><script>self.__next_f.push([1,"6:HL[\"/_next/static/css/16c1dd82fc87c9d7.css\",{\"as\":\"style\"}]\n"])</script><script>self.__next_f.push([1,"7:I{\"id\":7948,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\n9:I{\"id\":6628,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"\",\"async\":false}\na:I{\"id\":2112,\"chunks\":[\"293:static/chunks/293-f7537306415679fd.js\",\"548:static/chunks/548-46c7c1d35ca1bc02.js\",\"82:static/"])</script><script>self.__next_f.push([1,"chunks/82-ca0360e473d81167.js\",\"320:static/chunks/320-d41e321556b1b694.js\",\"563:static/chunks/563-a961efef5193d79c.js\",\"185:static/chunks/app/layout-48c7b442dc5873a7.js\"],\"name\":\"PageShell\",\"async\":false}\nb:I{\"id\":7767,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\nc:I{\"id\":7920,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2"])</script><script>self.__next_f.push([1,"f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\ne:I{\"id\":4839,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\nf:I{\"id\":2378,\"chunks\":[\"293:static/chunks/293-f7537306415679fd.js\",\"808:static/chunks/808-90426be34a5d9784.js\",\"548:static/chunks/548-46c7c1d35ca1bc02.js\",\"238:static/chunks/238-84a998be247f92e7.js\",\"975:static/chunks/975-38"])</script><script>self.__next_f.push([1,"0318b3b26ba688.js\",\"320:static/chunks/320-d41e321556b1b694.js\",\"339:static/chunks/339-501c32916b785ef1.js\",\"919:static/chunks/919-d71c386cf4a86911.js\",\"753:static/chunks/753-f62bfa32dbd9ff14.js\",\"413:static/chunks/app/setup/page-c0ba4386b34893c6.js\"],\"name\":\"\",\"async\":false}\n"])</script><script>self.__next_f.push([1,"5:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/2e8afc839fdb6c80.css\",\"precedence\":\"next\"}]],[\"$\",\"$L7\",null,{\"buildId\":\"u3pdaLciuOlCvOMUz3jbc\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/setup/\",\"initialTree\":[\"\",{\"children\":[\"setup\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialHead\":\"$L8\",\"globalErrorComponent\":\"$9\",\"children\":[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_979022\",\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$Lb\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lc\",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\":[\"$\",\"$Lb\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"setup\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lc\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$Ld\",[\"$\",\"$Le\",null,{\"propsForComponent\":{\"params\":{}},\"Component\":\"$f\"}],null],\"segment\":\"__PAGE__\"},\"styles\":[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/16c1dd82fc87c9d7.css\",\"precedence\":\"next\"}]]}],\"segment\":\"setup\"},\"styles\":[]}]}]}]}],null]}]]\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"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,"d:null\n"])</script></body></html>
27
+ </style></div></div></div></div></div><script src="/_next/static/chunks/webpack-cb669abeb3132738.js" async=""></script><script src="/_next/static/chunks/fd9d1056-fba4b53a2f01213b.js" async=""></script><script src="/_next/static/chunks/596-297f7ff4a0436e87.js" async=""></script><script src="/_next/static/chunks/main-app-581ccf0003955b21.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/0e4fe491bf84089c-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/627622453ef56b0d-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/934c4b7cb736f2a3-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/css/2e8afc839fdb6c80.css\",{\"as\":\"style\"}]\n0:\"$L5\"\n"])</script><script>self.__next_f.push([1,"6:HL[\"/_next/static/css/16c1dd82fc87c9d7.css\",{\"as\":\"style\"}]\n"])</script><script>self.__next_f.push([1,"7:I{\"id\":7948,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\n9:I{\"id\":6628,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"\",\"async\":false}\na:I{\"id\":2112,\"chunks\":[\"293:static/chunks/293-f7537306415679fd.js\",\"548:static/chunks/548-46c7c1d35ca1bc02.js\",\"82:static/"])</script><script>self.__next_f.push([1,"chunks/82-ca0360e473d81167.js\",\"320:static/chunks/320-d41e321556b1b694.js\",\"563:static/chunks/563-a961efef5193d79c.js\",\"185:static/chunks/app/layout-48c7b442dc5873a7.js\"],\"name\":\"PageShell\",\"async\":false}\nb:I{\"id\":7767,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\nc:I{\"id\":7920,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2"])</script><script>self.__next_f.push([1,"f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\ne:I{\"id\":4839,\"chunks\":[\"272:static/chunks/webpack-cb669abeb3132738.js\",\"971:static/chunks/fd9d1056-fba4b53a2f01213b.js\",\"596:static/chunks/596-297f7ff4a0436e87.js\"],\"name\":\"default\",\"async\":false}\nf:I{\"id\":2378,\"chunks\":[\"293:static/chunks/293-f7537306415679fd.js\",\"808:static/chunks/808-90426be34a5d9784.js\",\"548:static/chunks/548-46c7c1d35ca1bc02.js\",\"238:static/chunks/238-84a998be247f92e7.js\",\"975:static/chunks/975-38"])</script><script>self.__next_f.push([1,"0318b3b26ba688.js\",\"320:static/chunks/320-d41e321556b1b694.js\",\"339:static/chunks/339-501c32916b785ef1.js\",\"919:static/chunks/919-d71c386cf4a86911.js\",\"753:static/chunks/753-f62bfa32dbd9ff14.js\",\"413:static/chunks/app/setup/page-c0ba4386b34893c6.js\"],\"name\":\"\",\"async\":false}\n"])</script><script>self.__next_f.push([1,"5:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/2e8afc839fdb6c80.css\",\"precedence\":\"next\"}]],[\"$\",\"$L7\",null,{\"buildId\":\"JnpeELqmFYxCBGqEmtjGz\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/setup/\",\"initialTree\":[\"\",{\"children\":[\"setup\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialHead\":\"$L8\",\"globalErrorComponent\":\"$9\",\"children\":[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_979022\",\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$Lb\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lc\",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\":[\"$\",\"$Lb\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"setup\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Lc\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$Ld\",[\"$\",\"$Le\",null,{\"propsForComponent\":{\"params\":{}},\"Component\":\"$f\"}],null],\"segment\":\"__PAGE__\"},\"styles\":[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/16c1dd82fc87c9d7.css\",\"precedence\":\"next\"}]]}],\"segment\":\"setup\"},\"styles\":[]}]}]}]}],null]}]]\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"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,"d:null\n"])</script></body></html>
@@ -2,7 +2,7 @@
2
2
  2:HL["/_next/static/media/627622453ef56b0d-s.p.woff2",{"as":"font","type":"font/woff2"}]
3
3
  3:HL["/_next/static/media/934c4b7cb736f2a3-s.p.woff2",{"as":"font","type":"font/woff2"}]
4
4
  4:HL["/_next/static/css/2e8afc839fdb6c80.css",{"as":"style"}]
5
- 0:["u3pdaLciuOlCvOMUz3jbc",[[["",{"children":["setup",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L5",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2e8afc839fdb6c80.css","precedence":"next"}]],"$L6"]]]]
5
+ 0:["JnpeELqmFYxCBGqEmtjGz",[[["",{"children":["setup",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L5",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2e8afc839fdb6c80.css","precedence":"next"}]],"$L6"]]]]
6
6
  7:HL["/_next/static/css/16c1dd82fc87c9d7.css",{"as":"style"}]
7
7
  8:I{"id":2112,"chunks":["293:static/chunks/293-f7537306415679fd.js","548:static/chunks/548-46c7c1d35ca1bc02.js","82:static/chunks/82-ca0360e473d81167.js","320:static/chunks/320-d41e321556b1b694.js","563:static/chunks/563-a961efef5193d79c.js","185:static/chunks/app/layout-48c7b442dc5873a7.js"],"name":"PageShell","async":false}
8
8
  9:I{"id":7767,"chunks":["272:static/chunks/webpack-cb669abeb3132738.js","971:static/chunks/fd9d1056-fba4b53a2f01213b.js","596:static/chunks/596-297f7ff4a0436e87.js"],"name":"default","async":false}
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.25.0",
5
+ "version": "0.25.1",
6
6
  "license": "MIT",
7
7
  "type": "commonjs",
8
8
  "repository": "promptfoo/promptfoo",
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[891],{6891:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return eS}});var n=s(7437),l=s(2265),r=s(2130),a=s(6882),i=s(3388),o=s(4033),c=s(3082),d=s(5551),u=s(6507),p=s(7760),h=s(4081),x=s(182),m=s(819),j=s(8212),f=s(5507),g=s(923),v=s(654),y=s(33),b=s(3457),Z=s(8276),C=s(3226),S=s(2467),w=s(9605),k=s(3391),R=s(9190),P=s(6704),N=s(9394),T=s(1797),E=s(6337),I=s(1101),M=s(9872),L=s(2653),V=s(3533),D=s(4740),W=s(4660);let F=(0,W.Ue)(e=>({table:null,setTable:t=>e(()=>({table:t})),config:null,setConfig:t=>e(()=>({config:t}))})),O=["#fd7f6f","#7eb0d5","#b2e061","#bd7ebe","#ffb55a","#ffee65","#beb9db","#fdcce5","#8bd3c7"];function z(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;r.current&&r.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=(Math.ceil(Math.max(...e))-Math.floor(n))/10,a=Array.from({length:11},(e,t)=>parseFloat((Math.floor(n)+t*l).toFixed(2))),i=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s].score),r=a.map(e=>n.filter(t=>t>=e&&t<e+l).length);return{label:"Prompt ".concat(s+1),data:r,backgroundColor:O[s%O.length]}});r.current=new P.kL(s.current,{type:"bar",data:{labels:a,datasets:i},options:{animation:!1,plugins:{title:{display:!0,text:"Score Distribution"},legend:{display:!1},tooltip:{callbacks:{title:function(e){let t=e[0].datasetIndex;return"Prompt ".concat(t+1)},label:function(e){let t=e.dataIndex,s=a[t],n=a[t+1];return n?"".concat(s," <= score < ").concat(n):"".concat(s," <= score")}}}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function _(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;r.current&&r.current.destroy();let e=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s]),l=n.filter(e=>e.pass).length,r=l/n.length*100;return{label:"Prompt ".concat(s+1),data:[r],backgroundColor:O[s%O.length]}});r.current=new P.kL(s.current,{type:"bar",data:{labels:["Pass Rate (%)"],datasets:e},options:{animation:!1,plugins:{title:{display:!0,text:"Pass rate"},legend:{display:!0}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function A(e){let{table:t}=e,s=(0,l.useRef)(null),r=(0,l.useRef)(null),[a,i]=(0,l.useState)(0),[o,c]=(0,l.useState)(1),[d,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!s.current)return;r.current&&r.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=Math.max(...e),i=t.body.map(e=>{let t=e.outputs[a].score,s=e.outputs[o].score;return{x:t,y:s,backgroundColor:s>t?"green":s<t?"red":"gray"}});r.current=new P.kL(s.current,{type:"scatter",data:{datasets:[{data:i,backgroundColor:i.map(e=>e.backgroundColor)},{type:"line",data:[{x:n,y:n},{x:l,y:l}],borderColor:"gray",borderWidth:1,borderDash:[5,5],pointRadius:0}]},options:{animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(e){let s=t.body[e.dataIndex],n=s.outputs[0].text,l=s.outputs[1].text;return n.length>30&&(n=n.substring(0,30)+"..."),l.length>30&&(l=l.substring(0,30)+"..."),"Output 1: ".concat(n,"\nOutput 2: ").concat(l)}}}},scales:{x:{title:{display:!0,text:"Prompt ".concat(a+1," Score")}},y:{title:{display:!0,text:"Prompt ".concat(o+1," Score")}}}}})},[t,a,o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(N.Z,{open:d,onClose:()=>u(!1),children:[(0,n.jsx)(T.Z,{children:"Compare prompt outputs"}),(0,n.jsxs)(E.Z,{children:[(0,n.jsx)(h.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(v.Z,{value:a,onChange:e=>i(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(f.Z,{value:t,children:["Prompt ",t+1]},t))})}),(0,n.jsx)(h.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(v.Z,{value:o,onChange:e=>c(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(f.Z,{value:t,children:["Prompt ",t+1]},t))})})]})]}),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px",cursor:"pointer"},onClick:()=>u(!0)})]})}function U(e){let{columnVisibility:t}=e,s=(0,I.Z)();P.kL.defaults.color="dark"===s.palette.mode?"#aaa":"#666";let[r,a]=(0,l.useState)(!0),{table:i}=F();if(!i||!r||i.head.prompts.length<2)return null;let o=i.body.flatMap(e=>e.outputs.map(e=>e.score));return 1===new Set(o).size?null:(0,n.jsx)(D.SV,{fallback:null,children:(0,n.jsxs)(M.Z,{style:{position:"relative",padding:s.spacing(3)},children:[(0,n.jsx)(L.Z,{style:{position:"absolute",right:0,top:0},onClick:()=>a(!1),children:(0,n.jsx)(V.Z,{})}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(_,{table:i})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(z,{table:i})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(A,{table:i})})]})]})})}P.kL.register(P.vn,P.ST,P.ho,P.uw,P.f$,P.ZL,P.jn,P.od,P.u,P.wL);var H=s(9116);s(5777);var J=s(7660),B=s(3216),q=s(5391),G=s(1396),Y=s.n(G),X=s(2834),$=s(5446),K=s(9329),Q=s(4719),ee=s(3701),et=s(9279),es=s(666),en=s(5795),el=s(6988),er=s(4147);function ea(e){let{gradingResults:t}=e;return t?(0,n.jsxs)(u.Z,{mt:2,children:[(0,n.jsx)(C.Z,{variant:"subtitle1",children:"Assertions"}),(0,n.jsx)(en.Z,{children:(0,n.jsxs)(ee.Z,{children:[(0,n.jsx)(el.Z,{children:(0,n.jsxs)(er.Z,{children:[(0,n.jsx)(es.Z,{style:{fontWeight:"bold"},children:"Pass"}),(0,n.jsx)(es.Z,{style:{fontWeight:"bold"},children:"Score"}),(0,n.jsx)(es.Z,{style:{fontWeight:"bold"},children:"Type"}),(0,n.jsx)(es.Z,{style:{fontWeight:"bold"},children:"Value"}),(0,n.jsx)(es.Z,{style:{fontWeight:"bold"},children:"Reason"})]})}),(0,n.jsx)(et.Z,{children:t.map((e,t)=>{var s,l;return(0,n.jsxs)(er.Z,{children:[(0,n.jsx)(es.Z,{children:e.pass?"✅":"❌"}),(0,n.jsx)(es.Z,{children:e.score}),(0,n.jsx)(es.Z,{children:(null===(s=e.assertion)||void 0===s?void 0:s.type)||""}),(0,n.jsx)(es.Z,{style:{whiteSpace:"pre-wrap"},children:(null===(l=e.assertion)||void 0===l?void 0:l.value)?String(e.assertion.value):"-"}),(0,n.jsx)(es.Z,{style:{whiteSpace:"pre-wrap"},children:e.reason})]},t)})})]})})]}):null}function ei(e){let{open:t,onClose:s,prompt:r,provider:a,output:i,gradingResults:o}=e,[c,p]=(0,l.useState)(!1);(0,l.useEffect)(()=>{p(!1)},[r]);let h=async e=>{await navigator.clipboard.writeText(e),p(!0)};return(0,n.jsxs)(N.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,n.jsxs)(T.Z,{children:["Details",a&&": ".concat(a)]}),(0,n.jsxs)(E.Z,{children:[(0,n.jsxs)(u.Z,{mb:2,children:[(0,n.jsx)(C.Z,{variant:"subtitle1",style:{marginBottom:"1rem"},children:"Prompt"}),(0,n.jsx)($.u,{readOnly:!0,value:r,style:{width:"100%",padding:"0.75rem"},maxRows:20}),(0,n.jsx)(L.Z,{onClick:()=>h(r),style:{position:"absolute",right:"10px",top:"10px"},children:c?(0,n.jsx)(Q.Z,{}):(0,n.jsx)(K.Z,{})})]}),i&&(0,n.jsxs)(u.Z,{my:2,children:[(0,n.jsx)(C.Z,{variant:"subtitle1",style:{marginBottom:"1rem",marginTop:"1rem"},children:"Output"}),(0,n.jsx)($.u,{readOnly:!0,maxRows:20,value:i,style:{width:"100%",padding:"0.75rem"}})]}),(0,n.jsx)(ea,{gradingResults:o})]}),(0,n.jsx)(X.Z,{children:(0,n.jsx)(d.Z,{onClick:s,children:"Close"})})]})}function eo(e){return 0===e||1===e?"":"(".concat(e.toFixed(2),")")}function ec(e){let{text:t,maxLength:s}=e,[r,a]=l.useState(!0),i="string"==typeof t?t:JSON.stringify(t);i=i.replace(/\n/g,"<br>");let o=()=>{a(!r)};return i.length<=s?(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:i}}):r?(0,n.jsxs)("span",{style:{cursor:"pointer"},onClick:o,children:[(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:i.substring(0,s)}})," ..."]}):(0,n.jsx)("span",{style:{cursor:"pointer"},onClick:o,children:(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:i}})})}function ed(e){var t,s,r;let{output:a,maxTextLength:i,rowIndex:o,promptIndex:c,onRating:d,firstOutput:u,filterMode:p}=e,[h,x]=l.useState(!1),m="string"==typeof a.text?a.text:JSON.stringify(a.text),j=[];if(!a.pass&&m.includes("---")?m=(j=m.split("---")).slice(1).join("---"):j=[m],"different"===p&&u){let e,t="string"==typeof u.text?u.text:JSON.stringify(u.text);t.includes("---")&&(t=t.split("---").slice(1).join("---"));try{JSON.parse(t),JSON.parse(m),e=(0,H.CT)(t,m)}catch(s){e=t.includes(". ")&&m.includes(". ")?(0,H.SY)(t,m):(0,H.NV)(t,m)}m=e.map(e=>e.added?"<ins>".concat(e.value,"</ins>"):e.removed?"<del>".concat(e.value,"</del>"):e.value).join("")}let f=e=>{d(o,c,e)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"cell",children:[a.pass&&(0,n.jsxs)("div",{className:"status pass",children:["PASS ",(0,n.jsx)("span",{className:"score",children:eo(a.score)})]}),!a.pass&&(0,n.jsxs)("div",{className:"status fail",children:["[FAIL",(0,n.jsx)("span",{className:"score",children:eo(a.score)}),"]"," ",(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:j[0].replace(/\n/g,"<br>")}})]})," ",(0,n.jsx)(ec,{text:m,maxLength:i})]}),(0,n.jsx)("div",{className:"cell-detail",children:(null===(t=a.tokenUsage)||void 0===t?void 0:t.cached)?(0,n.jsxs)("span",{children:[a.tokenUsage.cached," tokens (cached)"]}):(0,n.jsxs)(n.Fragment,{children:[(null===(s=a.tokenUsage)||void 0===s?void 0:s.total)&&(0,n.jsxs)("span",{children:[a.tokenUsage.total," tokens"]})," |"," ",(0,n.jsxs)("span",{children:[a.latencyMs," ms"]})]})}),(0,n.jsxs)("div",{className:"cell-actions",children:[a.prompt&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"action",onClick:()=>{x(!0)},children:(0,n.jsx)(Z.Z,{title:"View ouput and test details",children:(0,n.jsx)("span",{children:"\uD83D\uDD0E"})})}),(0,n.jsx)(ei,{open:h,onClose:()=>{x(!1)},prompt:a.prompt,provider:a.provider,gradingResults:null===(r=a.gradingResult)||void 0===r?void 0:r.componentResults,output:m})]}),(0,n.jsx)("span",{className:"action",onClick:()=>f(!0),children:(0,n.jsx)(Z.Z,{title:"Mark test passed (score 1.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4D"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>f(!1),children:(0,n.jsx)(Z.Z,{title:"Mark test failed (score 0.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4E"})})})]})]})}function eu(e){let{text:t,maxLength:s,smallText:r,expandedText:a,resourceId:i}=e,[o,c]=l.useState(!1);return(0,n.jsxs)("div",{children:[(0,n.jsx)(ec,{text:t,maxLength:s}),a&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Z.Z,{title:"View prompt",children:(0,n.jsx)("span",{className:"action",onClick:()=>{c(!0)},children:"\uD83D\uDD0E"})}),(0,n.jsx)(ei,{open:o,onClose:()=>{c(!1)},prompt:a}),i&&(0,n.jsx)(Z.Z,{title:"View other evals and datasets for this prompt",children:(0,n.jsx)("span",{className:"action",children:(0,n.jsx)(Y(),{href:"/prompts/?id=".concat(i),target:"_blank",children:(0,n.jsx)(q.Z,{fontSize:"small"})})})})]}),(0,n.jsx)("div",{className:"smalltext",children:r})]})}function ep(e){let{maxTextLength:t,columnVisibility:s,wordBreak:a,filterMode:i,failureFilter:o,onFailureFilterToggle:c}=e,{table:d,setTable:u}=F();(0,r.Z)(d,"Table should be defined");let{head:h,body:m}=d,j=h.prompts.map((e,t)=>m.reduce((e,s)=>e+(s.outputs[t].pass?1:0),0)),f=h.prompts.map((e,t)=>m.reduce((e,s)=>{var n,l;return e+((null===(l=s.outputs[t].gradingResult)||void 0===l?void 0:null===(n=l.componentResults)||void 0===n?void 0:n.length)||0)},0)),g=h.prompts.map((e,t)=>m.reduce((e,s)=>{var n;let l=null===(n=s.outputs[t].gradingResult)||void 0===n?void 0:n.componentResults;return e+(l?l.filter(e=>e.pass).length:0)},0)),v=(e,t,s)=>{let n=[...m],l={...n[e]},r=[...l.outputs];r[t].pass=s,r[t].score=s?1:0,l.outputs=r,n[e]=l,u({head:h,body:n})},y=j.reduce((e,t,s,n)=>t>n[e]?s:e,0),b=j[y],Z=(0,J.Cl)(),C=[Z.group({id:"vars",header:()=>(0,n.jsx)("span",{children:"Variables"}),columns:h.vars.map((e,s)=>Z.accessor(e=>e.vars[s],{id:"Variable ".concat(s+1),header:()=>(0,n.jsx)(eu,{smallText:"Variable ".concat(s+1),text:e,maxLength:t}),cell:e=>(0,n.jsx)(ec,{text:e.getValue(),maxLength:t}),size:50}))}),Z.group({id:"prompts",header:()=>(0,n.jsx)("span",{children:"Outputs"}),columns:h.prompts.map((e,s)=>Z.accessor(e=>(function(e){if("string"==typeof e){let t=e.startsWith("[PASS]"),s=e;return e.startsWith("[PASS]")?s=s.slice(6):e.startsWith("[FAIL]")&&(s=s.slice(6)),{text:s,pass:t,score:t?1:0}}return e})(e.outputs[s]),{id:"Prompt ".concat(s+1),header:()=>{let l=(j[s]/m.length*100).toFixed(2),r=j[s]===b&&0!==b,a="Prompt ".concat(s+1),d=o[a]||!1;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eu,{smallText:"Prompt ".concat(s+1),text:"string"==typeof e?e:e.display,expandedText:"string"==typeof e?void 0:e.raw,maxLength:t,resourceId:"string"==typeof e?void 0:e.id}),"failures"===i&&(0,n.jsx)(x.Z,{sx:{"& .MuiFormControlLabel-label":{fontSize:"0.75rem"}},control:(0,n.jsx)(p.Z,{checked:d,onChange:e=>c(a,e.target.checked)}),label:"Show failures"}),(0,n.jsxs)("div",{className:"summary ".concat(r?"highlight":""),children:["Passing: ",(0,n.jsxs)("strong",{children:[l,"%"]})," (",j[s],"/",m.length," cases",f[s]?(0,n.jsxs)("span",{children:[", ",g[s],"/",f[s]," asserts"]}):null,")"]})]})},cell:e=>(0,n.jsx)(ed,{output:e.getValue(),maxTextLength:t,rowIndex:e.row.index,promptIndex:s,onRating:v,firstOutput:S[e.row.index].outputs[0],filterMode:i})}))})],S=l.useMemo(()=>"failures"===i?Object.values(o).every(e=>!e)?m:m.filter(e=>e.outputs.some((e,t)=>{let s=!e.pass;return o["Prompt ".concat(t+1)]&&s})):"different"===i?m.filter(e=>!e.outputs.every(t=>t.text===e.outputs[0].text)):m,[m,o,i]),w=(0,B.b7)({data:S,columns:C,columnResizeMode:"onChange",getCoreRowModel:(0,J.sC)(),state:{columnVisibility:s}});return(0,n.jsxs)("table",{className:"results-table",style:{wordBreak:a},children:[(0,n.jsx)("thead",{children:w.getHeaderGroups().map(e=>(0,n.jsx)("tr",{className:"header",children:e.headers.map(e=>(0,n.jsxs)("th",{colSpan:e.colSpan,style:{width:e.getSize()},children:[e.isPlaceholder?null:(0,B.ie)(e.column.columnDef.header,e.getContext()),(0,n.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"resizer ".concat(e.column.getIsResizing()?"isResizing":"")})]},e.id))},e.id))}),(0,n.jsx)("tbody",{children:w.getRowModel().rows.map((e,t)=>{let s=!1;return(0,n.jsx)("tr",{children:e.getVisibleCells().map(e=>{let l=e.column.id.startsWith("Variable"),r=!l&&!s;return r&&(s=!0),(0,n.jsx)("td",{style:{width:e.column.getSize()},className:"".concat(l?"variable":""," ").concat(0!==t||l?"":"first-prompt-row"," ").concat(r?"first-prompt-col":""),children:(0,B.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)})})]})}s(2604);var eh=s(7175);function ex(e){let{open:t,onClose:r}=e,{config:a}=F(),i=l.useRef(null),[o,c]=l.useState(!1),[p,h]=l.useState("");l.useEffect(()=>{t&&(async()=>{let{default:e}=await s.e(339).then(s.bind(s,8339));h(e.dump(a))})()},[t,a]);let x=()=>{c(!1),r()};return(0,n.jsxs)(N.Z,{open:t,onClose:x,"aria-labelledby":"config-dialog-title",maxWidth:"md",fullWidth:!0,children:[(0,n.jsx)(T.Z,{id:"config-dialog-title",children:(0,n.jsxs)(u.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,n.jsx)(C.Z,{variant:"h6",children:"Config"}),(0,n.jsx)(L.Z,{onClick:()=>{i.current&&(i.current.select(),document.execCommand("copy"),c(!0))},children:o?(0,n.jsx)(Q.Z,{}):(0,n.jsx)(eh.Z,{})})]})}),(0,n.jsx)(E.Z,{children:(0,n.jsx)(C.Z,{variant:"body1",component:"div",children:(0,n.jsx)("textarea",{ref:i,readOnly:!0,value:p,style:{width:"100%",minHeight:"400px",fontFamily:"monospace",border:"1px solid #ccc"}})})}),(0,n.jsx)(X.Z,{children:(0,n.jsx)(d.Z,{onClick:x,color:"primary",children:"Close"})})]})}var em=s(4173),ej=s(1975),ef=e=>{let{open:t,onClose:s,shareUrl:r}=e,a=(0,l.useRef)(null),[i,o]=(0,l.useState)(!1),c=()=>{s(),o(!1)};return(0,n.jsxs)(N.Z,{open:t,onClose:c,PaperProps:{style:{minWidth:"min(660px, 100%)"}},children:[(0,n.jsx)(T.Z,{children:"Your eval is ready to share"}),(0,n.jsxs)(E.Z,{children:[(0,n.jsx)(ej.Z,{inputRef:a,value:r,fullWidth:!0,InputProps:{readOnly:!0,endAdornment:(0,n.jsx)(L.Z,{onClick:()=>{a.current&&(a.current.select(),document.execCommand("copy"),o(!0))},children:i?(0,n.jsx)(Q.Z,{}):(0,n.jsx)(eh.Z,{})})}}),(0,n.jsx)(em.Z,{sx:{fontSize:"0.75rem"},children:"Shared URLs are deleted after 1 week."})]}),(0,n.jsx)(X.Z,{children:(0,n.jsx)(d.Z,{onClick:c,color:"primary",children:"Close"})})]})},eg=s(1938);let ev=(0,R.Z)(b.Z)(e=>{let{theme:t}=e;return{maxWidth:"100%",flexWrap:"wrap",[t.breakpoints.down("sm")]:{flexDirection:"column"}}});function ey(e){let{recentEvals:t,onRecentEvalSelected:s,defaultEvalId:i}=e,c=(0,o.useRouter)(),{table:b,config:R}=F(),{setStateFromConfig:P}=(0,eg.o)(),[N,T]=l.useState(250),[E,I]=l.useState({}),[M,L]=l.useState([]),[V,D]=l.useState({}),[W,O]=l.useState("all"),[z,_]=l.useState("break-word"),[A,H]=l.useState(!1),[J,B]=l.useState(""),[q,G]=l.useState(!1),Y=async()=>{G(!0);try{let e=await fetch("https://api.promptfoo.dev/eval",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{version:2,createdAt:new Date().toISOString(),results:{table:b},config:R}})}),{id:t}=await e.json(),s="https://app.promptfoo.dev/eval/".concat(t);B(s),H(!0)}catch(e){alert("Sorry, something went wrong.")}finally{G(!1)}},[X,$]=l.useState(!1);(0,r.Z)(b,"Table data must be loaded before rendering ResultsView");let{head:K}=b,Q=[...K.vars.map((e,t)=>({value:"Variable ".concat(t+1),label:"Variable ".concat(t+1),group:"Variables"})),...K.prompts.map((e,t)=>({value:"Prompt ".concat(t+1),label:"Prompt ".concat(t+1),group:"Prompts"}))];return l.useEffect(()=>{L([...K.vars.map((e,t)=>"Variable ".concat(t+1)),...K.prompts.map((e,t)=>"Prompt ".concat(t+1))])},[K]),(0,n.jsxs)("div",{style:{marginLeft:"1rem",marginRight:"1rem"},children:[(0,n.jsx)(u.Z,{py:"md",children:(0,n.jsxs)(ev,{direction:"row",spacing:4,alignItems:"center",children:[(0,n.jsx)(u.Z,{children:t&&t.length>0&&(0,n.jsxs)(h.Z,{sx:{m:1,minWidth:200},size:"small",children:[(0,n.jsx)(m.Z,{children:"View run"}),(0,n.jsx)(v.Z,{className:"recent-files",label:"Previous runs",defaultValue:i,onChange:e=>s(e.target.value),children:t.map(e=>(0,n.jsx)(f.Z,{value:e.id,children:e.label},e.id))},t.map(e=>e.id).join(","))]})}),(0,n.jsx)(u.Z,{children:(0,n.jsxs)(h.Z,{sx:{m:1,minWidth:200},size:"small",children:[(0,n.jsx)(m.Z,{id:"visible-columns-label",children:"Show columns"}),(0,n.jsx)(v.Z,{labelId:"visible-columns-label",id:"visible-columns",multiple:!0,value:M,onChange:e=>{let{target:{value:t}}=e;L("string"==typeof t?t.split(","):t);let s=[...K.vars.map((e,t)=>"Variable ".concat(t+1)),...K.prompts.map((e,t)=>"Prompt ".concat(t+1))],n={};s.forEach(e=>{n[e]=("string"==typeof t?t.split(","):t).includes(e)}),I(n)},input:(0,n.jsx)(g.Z,{label:"Visible columns"}),renderValue:e=>e.join(", "),children:Q.map(e=>(0,n.jsxs)(f.Z,{dense:!0,value:e.value,children:[(0,n.jsx)(p.Z,{checked:M.indexOf(e.value)>-1}),(0,n.jsx)(j.Z,{primary:e.label})]},e.value))})]})}),(0,n.jsx)(u.Z,{children:(0,n.jsxs)(h.Z,{sx:{minWidth:180},size:"small",children:[(0,n.jsx)(m.Z,{id:"failure-filter-mode-label",children:"Filter"}),(0,n.jsxs)(v.Z,{labelId:"filter-mode-label",id:"filter-mode",value:W,onChange:e=>{let t=e.target.value;O(t);let s={};K.prompts.forEach((e,n)=>{s["Prompt ".concat(n+1)]="failures"===t}),D(s)},label:"Filter",children:[(0,n.jsx)(f.Z,{value:"all",children:"Show all results"}),(0,n.jsx)(f.Z,{value:"failures",children:"Show failures only"}),(0,n.jsx)(f.Z,{value:"different",children:"Show different only"})]})]})}),(0,n.jsxs)(u.Z,{children:[(0,n.jsxs)(C.Z,{mt:2,children:["Max text length: ",N]}),(0,n.jsx)(y.ZP,{min:25,max:1e3,value:N,onChange:(e,t)=>T(t)})]}),(0,n.jsx)(u.Z,{children:(0,n.jsx)(Z.Z,{title:"Forcing line breaks makes it easier to adjust column widths to your liking",children:(0,n.jsx)(x.Z,{control:(0,n.jsx)(p.Z,{checked:"break-all"===z,onChange:e=>{_(e.target.checked?"break-all":"break-word")}}),label:"Force line breaks"})})}),(0,n.jsx)(u.Z,{flexGrow:1}),(0,n.jsx)(u.Z,{display:"flex",justifyContent:"flex-end",children:(0,n.jsxs)(ev,{direction:"row",spacing:2,children:[R&&(0,n.jsx)(Z.Z,{title:"View config",children:(0,n.jsx)(d.Z,{color:"primary",onClick:()=>$(!0),startIcon:(0,n.jsx)(w.Z,{}),children:"View Config"})}),R&&(0,n.jsx)(Z.Z,{title:"Edit eval",children:(0,n.jsx)(d.Z,{color:"primary",onClick:()=>{P(R),c.push("/setup/")},startIcon:(0,n.jsx)(k.Z,{}),children:"Edit Eval"})}),(null==R?void 0:R.sharing)&&(0,n.jsx)(Z.Z,{title:"Generate a unique URL that others can access",children:(0,n.jsx)(d.Z,{color:"primary",onClick:Y,disabled:q,startIcon:q?(0,n.jsx)(a.Z,{size:16}):(0,n.jsx)(S.Z,{}),children:"Share"})})]})})]})}),(0,n.jsx)(U,{columnVisibility:E}),(0,n.jsx)(ep,{maxTextLength:N,columnVisibility:E,wordBreak:z,filterMode:W,failureFilter:V,onFailureFilterToggle:(e,t)=>{D(s=>({...s,[e]:t}))}}),(0,n.jsx)(ex,{open:X,onClose:()=>$(!1)}),(0,n.jsx)(ef,{open:A,onClose:()=>H(!1),shareUrl:J})]})}var eb=s(279);async function eZ(){let e=(0,c.createClientComponentClient)(),{data:{user:t}}=await e.auth.getUser();(0,r.Z)(t,"User not logged in");let{data:s,error:n}=await e.from("EvaluationResult").select("id, createdAt").eq("user_id",t.id).order("createdAt",{ascending:!1}).limit(100);return s||[]}async function eC(e){let t=(0,c.createClientComponentClient)(),{data:s,error:n}=await t.from("EvaluationResult").select("*").eq("id",e).single();return s}function eS(e){var t;let{fetchId:s,preloadedData:c,recentEvals:d,defaultEvalId:u}=e,p=(0,o.useRouter)(),{table:h,setTable:x,setConfig:m}=F(),[j,f]=l.useState(!1),[g,v]=l.useState(!1),[y,b]=l.useState(d||[]),Z=async()=>{(0,r.Z)(eb.T8,"Cannot fetch recent files when not running locally");let e=await fetch("".concat(eb.CT,"/results"),{cache:"no-store"}),t=await e.json();return b(t.data),t.data},C=async e=>{let t=await fetch("".concat(eb.CT,"/results/").concat(e),{cache:"no-store"}),s=await t.json();x(s.data.results.table),m(s.data.config)},S=async e=>{eb.T8?C(e):(f(!1),p.push("/eval/remote:".concat(encodeURIComponent(e))))},[w,k]=l.useState(u||(null===(t=y[0])||void 0===t?void 0:t.id)),R=(0,o.useSearchParams)(),P=R?R.get("file"):null;return(l.useEffect(()=>{if(P){let e=async()=>{await C(P),f(!0)};e()}else if(c){var e;x(null===(e=c.data.results)||void 0===e?void 0:e.table),m(c.data.config),f(!0)}else if(s){let e=async()=>{var e;let t=await fetch("https://api.promptfoo.dev/eval/".concat(s));if(!t.ok){v(!0);return}let n=await t.json();x(null===(e=n.data.results)||void 0===e?void 0:e.table),m(n.data.config),f(!0)};e()}else if(eb.T8){let e=(0,i.io)(eb.CT);return e.on("init",e=>{console.log("Initialized socket connection",e),f(!0),x(e.results.table),m(e.config),Z().then(e=>{var t;k(null===(t=e[0])||void 0===t?void 0:t.id)})}),e.on("update",e=>{console.log("Received data update",e),x(e.results.table),m(e.config),Z().then(e=>{var t;k(null===(t=e[0])||void 0===t?void 0:t.id)})}),()=>{e.disconnect()}}else eZ().then(e=>{b(e.map(e=>({id:e.id,label:e.createdAt}))),e.length>0&&eC(e[0].id).then(t=>{(0,r.Z)(t,"Eval not found");let s=t.results,n=t.config;k(e[0].id),x(s.table),m(n),f(!0)})})},[s,x,m,c,k,P]),g)?(0,n.jsx)("div",{className:"loading",children:"404 Eval not found"}):j&&h?(0,n.jsx)(ey,{defaultEvalId:w,recentEvals:y,onRecentEvalSelected:S}):(0,n.jsxs)("div",{className:"loading",children:[(0,n.jsx)("div",{children:(0,n.jsx)(a.Z,{size:22})}),(0,n.jsx)("div",{children:"Loading eval data"})]})}s(5038)},279:function(e,t,s){"use strict";s.d(t,{CT:function(){return r},T8:function(){return l},eA:function(){return a}});var n=s(2601);let l=!n.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,r="http://localhost:15500",a=""},1938:function(e,t,s){"use strict";s.d(t,{o:function(){return r}});var n=s(4660),l=s(4810);let r=(0,n.Ue)()((0,l.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setStateFromConfig:t=>{let s={};t.description&&(s.description=t.description||""),t.tests&&(s.testCases=t.tests),t.providers&&(s.providers=t.providers),t.prompts&&("string"==typeof t.prompts?s.prompts=[t.prompts]:Array.isArray(t.prompts)?s.prompts=t.prompts.filter(e=>!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),e(s)},getTestSuite:()=>{let{description:e,testCases:s,providers:n,prompts:l,env:r}=t();return{env:r,description:e,providers:n,prompts:l,tests:s}}}),{name:"promptfoo",skipHydration:!0}))},5038:function(){},2604:function(){},5777:function(){}}]);