promptfoo 0.120.25 → 0.120.26
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/README.md +35 -22
- package/dist/src/{ListApp-CYTAaS6A.js → ListApp-D3DG0F8h.js} +1 -1
- package/dist/src/{accounts-CwqY22lU.cjs → accounts-BzEY8H3v.cjs} +4 -4
- package/dist/src/{accounts-Bzx8GnL6.js → accounts-DHHiXsy6.js} +5 -5
- package/dist/src/{accounts-BSwMxhY3.js → accounts-R3gfCR_g.js} +4 -4
- package/dist/src/{agentic-utils-5K7LzooV.js → agentic-utils-D6_gzOUF.js} +2 -2
- package/dist/src/{agents-B8RWrA68.cjs → agents-C7BiinFI.cjs} +6 -6
- package/dist/src/{agents-zHyWnnQ2.js → agents-Cao4i7AX.js} +7 -7
- package/dist/src/{agents-KZxXwlyn.cjs → agents-CwM7re15.cjs} +2 -2
- package/dist/src/{agents-DleC7rb4.js → agents-DETIQHqF.js} +6 -6
- package/dist/src/{agents-CkA9l77-.js → agents-DYIT-hQy.js} +5 -5
- package/dist/src/{agents-B20gl7hH.js → agents-GiUianme.js} +2 -2
- package/dist/src/{aimlapi-DgbFGPTX.js → aimlapi-CMJpKK-B.js} +9 -9
- package/dist/src/{aimlapi-DILJovhN.js → aimlapi-DMF6v_vb.js} +14 -14
- package/dist/src/{aimlapi-DIdWBHtH.cjs → aimlapi-DoGLcQW_.cjs} +9 -9
- package/dist/src/app/assets/index-BOgkICuY.css +1 -0
- package/dist/src/app/assets/index-CSgqn_Vd.js +428 -0
- package/dist/src/app/assets/{vendor-charts-DnwydkkY.js → vendor-charts-CYyo8R8v.js} +1 -1
- package/dist/src/app/assets/{vendor-markdown-DjKAU15k.js → vendor-markdown-DSmzq4Jh.js} +1 -1
- package/dist/src/app/assets/vendor-react-AtKqiNEf.js +4 -0
- package/dist/src/app/assets/{vendor-syntax-Dc86c4Bu.js → vendor-syntax-D06x6TQF.js} +1 -1
- package/dist/src/app/index.html +6 -6
- package/dist/src/app/tsconfig.app.tsbuildinfo +1 -1
- package/dist/src/{audio-BoR9KZV8.cjs → audio-BWjyvHn9.cjs} +3 -3
- package/dist/src/{audio-nUSOpXY7.js → audio-BrJBFN2b.js} +3 -3
- package/dist/src/{audio-BDrAkpVc.js → audio-DUH4q0Xq.js} +4 -4
- package/dist/src/{base-DumUXbOH.js → base-BaXmtXYp.js} +2 -2
- package/dist/src/{base-CwCV0t8r.js → base-Dtp8b4_N.js} +2 -2
- package/dist/src/{base-D8VQYhNQ.cjs → base-f71xxWai.cjs} +2 -2
- package/dist/src/{blobs-_kNRY6vU.cjs → blobs-673H0jCl.cjs} +2 -2
- package/dist/src/{blobs-Dnt2rxpc.js → blobs-C9J2mVgo.js} +2 -2
- package/dist/src/{blobs-DlB5fwyF.js → blobs-kt8v3UyH.js} +2 -2
- package/dist/src/{cache-S9MAoF9H.cjs → cache-7xULbvt3.cjs} +34 -7
- package/dist/src/{cache-C4A4H4Xb.js → cache-BLLayYEN.js} +23 -8
- package/dist/src/{cache-B2oIvf92.js → cache-BUPcq0Ad.js} +2 -2
- package/dist/src/cache-CVfRb-HD.cjs +6 -0
- package/dist/src/{cache-DofebEnH.js → cache-O4EuX2JV.js} +3 -3
- package/dist/src/{cache-Bg1Wpvzq.js → cache-mIszOnuz.js} +4 -21
- package/dist/src/{chat-DTCPbuld.cjs → chat-C4zqjObh.cjs} +6 -6
- package/dist/src/{chat-noXtEAh5.js → chat-C8Ei4f87.js} +6 -6
- package/dist/src/{chat-BiImdLJf.js → chat-CgyGj2hC.js} +8 -8
- package/dist/src/{chat-DQ6Z5Cbn.js → chat-Cpz3O-Xl.js} +13 -13
- package/dist/src/{chat-D_cro0wd.js → chat-DIywASPG.js} +10 -10
- package/dist/src/{chat-BR2x1dG_.cjs → chat-Fl6TZJRS.cjs} +8 -8
- package/dist/src/{chatkit-TnC1YoVi.js → chatkit-DEls11hE.js} +3 -3
- package/dist/src/{claude-agent-sdk-CBpAZV5h.js → claude-agent-sdk-6-xTaLwM.js} +45 -16
- package/dist/src/{claude-agent-sdk-uHLgAUZj.cjs → claude-agent-sdk-BzxF6NIJ.cjs} +45 -16
- package/dist/src/{claude-agent-sdk-qxE5mGVi.js → claude-agent-sdk-CmkTnKGH.js} +48 -19
- package/dist/src/{claude-agent-sdk-DyPvrj-1.js → claude-agent-sdk-rXCBLK_o.js} +38 -9
- package/dist/src/{cloud-lRosK6Nk.js → cloud-BMbRVJFw.js} +2 -2
- package/dist/src/{cloud-DHWE-9nj.js → cloud-CZ4hytdm.js} +1 -1
- package/dist/src/{cloudflare-ai-D0OtFY6g.cjs → cloudflare-ai-BAQ0u_dg.cjs} +9 -9
- package/dist/src/{cloudflare-ai-BprwSD6d.js → cloudflare-ai-CUg4BTcj.js} +9 -9
- package/dist/src/{cloudflare-ai-CB7OWRAP.js → cloudflare-ai-CobxMTR4.js} +14 -14
- package/dist/src/{cloudflare-gateway-C29gWj5O.cjs → cloudflare-gateway-C0sgfr_z.cjs} +10 -10
- package/dist/src/{cloudflare-gateway-BaVwoBjE.js → cloudflare-gateway-D2_yi-Fh.js} +15 -15
- package/dist/src/{cloudflare-gateway-BjoxwqUw.js → cloudflare-gateway-_itGuXry.js} +10 -10
- package/dist/src/{codex-sdk-DNkCbb7c.js → codex-sdk-dSnGdgIp.js} +3 -3
- package/dist/src/{cometapi-BGxGZ7VA.js → cometapi-B01btbfb.js} +15 -15
- package/dist/src/{cometapi-xiTQZp8R.js → cometapi-ChAaRjg5.js} +10 -10
- package/dist/src/{cometapi-DalITP94.cjs → cometapi-JbvOJSCO.cjs} +10 -10
- package/dist/src/{completion-BTbouQDz.js → completion-BBJ6zmG3.js} +5 -5
- package/dist/src/{completion-HYrX5gEL.js → completion-D9_MDlnd.js} +4 -4
- package/dist/src/{completion-DV0Ys99K.cjs → completion-DDyL3Cb2.cjs} +4 -4
- package/dist/src/{docker-Dx_FN1ag.js → docker-BuButc4D.js} +14 -14
- package/dist/src/{docker-zUAnbYTM.cjs → docker-Ckw-j7Rr.cjs} +9 -9
- package/dist/src/{docker-BAYnlbAW.js → docker-JAAubMw3.js} +9 -9
- package/dist/src/errors-DnGCbnx8.js +36 -0
- package/dist/src/{esm-79BpbQzg.js → esm-CYhseqj4.js} +1 -1
- package/dist/src/eval-CKHWqG9f.js +16 -0
- package/dist/src/{eval-Cxb9alW8.js → eval-CYrbG57o.js} +45 -13
- package/dist/src/{evalResult-B8LbgWMA.js → evalResult-6JaUIStC.js} +6 -6
- package/dist/src/{evalResult-CJNSpa3q.js → evalResult-COsVttMA.js} +6 -6
- package/dist/src/evalResult-CxTP-LMm.cjs +11 -0
- package/dist/src/evalResult-CzLURDcP.js +13 -0
- package/dist/src/{evalResult-hI1mhi_g.cjs → evalResult-DlRfu_Rq.cjs} +6 -6
- package/dist/src/evalResult-DyttNQ_G.js +11 -0
- package/dist/src/evaluator-0PvfeBYh.js +38 -0
- package/dist/src/{evaluator-1Tkdu8MK.js → evaluator-3EJCMTs0.js} +74 -48
- package/dist/src/{extractor-BPBlLyOn.cjs → extractor-DbhlYEeo.cjs} +22 -5
- package/dist/src/{extractor-CuUWqwrE.js → extractor-Hs7la_19.js} +22 -5
- package/dist/src/{extractor-BFoThUOa.js → extractor-LSYjrhK0.js} +22 -5
- package/dist/src/{fetch-zJuFPxN1.js → fetch-18MuNu9i.js} +4 -4
- package/dist/src/{fetch-BdiCecAv.js → fetch-Bi0o-fdp.js} +1 -1
- package/dist/src/fetch-CMptBDVg.cjs +4 -0
- package/dist/src/{fetch-BQgz6x7S.js → fetch-DAZkv3gV.js} +2 -2
- package/dist/src/{fetch-BuP-gm0E.js → fetch-SRsE6Ctl.js} +4 -4
- package/dist/src/{fetch-Dy2YML9G.cjs → fetch-ZMn_oemb.cjs} +4 -4
- package/dist/src/{fileExtensions-CzcPkiKZ.js → fileExtensions-BpuMmaFL.js} +1 -1
- package/dist/src/{formatDuration-CGa0ZDQ8.js → formatDuration-Doo0xq-z.js} +1 -1
- package/dist/src/{genaiTracer-foKtbVa2.js → genaiTracer-CqNnnXrE.js} +1 -1
- package/dist/src/graders-BCytzXrb.js +34 -0
- package/dist/src/{graders-DMAzEgEF.js → graders-BaMCwIKp.js} +211 -91
- package/dist/src/graders-CGZQShfJ.cjs +33 -0
- package/dist/src/{graders-NBsuYeMx.cjs → graders-DzUUnUjC.cjs} +206 -86
- package/dist/src/{graders-CtvuaC8D.js → graders-QsALpIdy.js} +206 -86
- package/dist/src/graders-spkuVC-E.js +36 -0
- package/dist/src/{image-Bf8RiJ2g.js → image-BXt_7u0v.js} +3 -3
- package/dist/src/{image-LhLO5KCW.js → image-BiEVdpdP.js} +4 -4
- package/dist/src/{image-CaVWfZub.cjs → image-C3BjJUAU.cjs} +4 -4
- package/dist/src/{image-BnF25Osq.cjs → image-D10zEe1f.cjs} +3 -3
- package/dist/src/{image-DIn_AW1Z.js → image-DB4sHxdJ.js} +4 -4
- package/dist/src/{image-DFwp1aAV.js → image-mhAGP07h.js} +6 -6
- package/dist/src/index.cjs +152 -69
- package/dist/src/index.d.cts +20 -3
- package/dist/src/index.d.ts +20 -3
- package/dist/src/index.js +152 -69
- package/dist/src/{interactiveCheck-Dmm9vjpx.js → interactiveCheck-DU-MAhp5.js} +1 -1
- package/dist/src/{knowledgeBase-Bf57PI7g.cjs → knowledgeBase-Bnb00xKs.cjs} +6 -6
- package/dist/src/{knowledgeBase-DZw2L9kf.js → knowledgeBase-CMvMlLZR.js} +8 -8
- package/dist/src/{knowledgeBase-CfOvyF2s.js → knowledgeBase-XJQ0Qyez.js} +6 -6
- package/dist/src/{litellm-Ds8YmO1b.js → litellm-BECdjOTx.js} +3 -3
- package/dist/src/{litellm-ByNRN2Vh.cjs → litellm-BrnZhMcL.cjs} +11 -11
- package/dist/src/{litellm-fU-xV6T4.js → litellm-CHrRmPAe.js} +16 -16
- package/dist/src/{litellm-DexU8FFp.js → litellm-CrLJrPIm.js} +11 -11
- package/dist/src/{luma-ray-y26EHFO8.js → luma-ray-BOeX-h0M.js} +8 -8
- package/dist/src/{luma-ray-BIe5ctI4.cjs → luma-ray-C0RkI3lt.cjs} +8 -8
- package/dist/src/{luma-ray-vvE-O9EA.js → luma-ray-DgKLS0BF.js} +10 -10
- package/dist/src/main.js +1011 -404
- package/dist/src/{messages-Bg2ekFPc.js → messages-CDZYGNlS.js} +7 -7
- package/dist/src/{messages-DpoCLD_8.js → messages-D61tPFQo.js} +9 -9
- package/dist/src/{messages-16jb9LP7.cjs → messages-DXV3Qh8_.cjs} +7 -7
- package/dist/src/{meteor-DLCdreag.js → meteor-P2rUE-Uz.js} +1 -1
- package/dist/src/{nova-reel-BM0snD2m.js → nova-reel-Bk5npr2q.js} +10 -10
- package/dist/src/{nova-reel-CvXCVn3f.cjs → nova-reel-D9FXq3Mt.cjs} +8 -8
- package/dist/src/{nova-reel-CJLpBKSI.js → nova-reel-DtCjbD5O.js} +8 -8
- package/dist/src/{nova-sonic-CklvraBd.js → nova-sonic-BXRfQyF-.js} +7 -7
- package/dist/src/{nova-sonic-DEx_FdFW.cjs → nova-sonic-BoRSY_U6.cjs} +5 -5
- package/dist/src/{nova-sonic-Cjh_qopr.js → nova-sonic-CgaWLDM1.js} +5 -5
- package/dist/src/{openai-jNIREoAW.js → openai-CT5fwbve.js} +1 -1
- package/dist/src/{openclaw-CnAwBfPO.js → openclaw-B6XY2kUf.js} +14 -14
- package/dist/src/{openclaw-DBSSY4SP.js → openclaw-CpPrXwf6.js} +9 -9
- package/dist/src/{openclaw-CbHtt3B8.cjs → openclaw-DDSfq5fp.cjs} +9 -9
- package/dist/src/{opencode-sdk-CqxTHrk0.js → opencode-sdk-CImWVqy9.js} +6 -6
- package/dist/src/{opencode-sdk-xUrRk5Jx.js → opencode-sdk-CuCztr4P.js} +4 -4
- package/dist/src/{opencode-sdk-DdmtRB6D.cjs → opencode-sdk-mqF-Oj3f.cjs} +4 -4
- package/dist/src/{otlpReceiver-th2zHwjZ.cjs → otlpReceiver-B6Xo4KZM.cjs} +4 -4
- package/dist/src/{otlpReceiver-uytrRKdo.js → otlpReceiver-BO0rbDzh.js} +4 -4
- package/dist/src/{otlpReceiver-C-1cdVDr.js → otlpReceiver-Dg817agV.js} +5 -5
- package/dist/src/{providerRegistry-DAZoFmGv.js → providerRegistry-Xf0qdqGQ.js} +1 -1
- package/dist/src/providers-BMZZmPBJ.cjs +32 -0
- package/dist/src/{providers-CpUrPa8s.cjs → providers-BNKVY53V.cjs} +94 -64
- package/dist/src/{providers-D3lk_R7Q.js → providers-BiNq_Iyc.js} +94 -64
- package/dist/src/{providers-BOvl9qv5.js → providers-BlEhY5mi.js} +110 -79
- package/dist/src/providers-CQQrNaJk.js +32 -0
- package/dist/src/providers-Ck8HyrC-.js +34 -0
- package/dist/src/{pythonUtils-CUPlf1H0.js → pythonUtils-r1uBuA0n.js} +2 -2
- package/dist/src/{quiverai-BNGJOQym.cjs → quiverai-BNfIwKCO.cjs} +8 -8
- package/dist/src/{quiverai-Y7Is4wah.js → quiverai-BQigKdIH.js} +13 -13
- package/dist/src/{quiverai-DthRqZs9.js → quiverai-Bfy2WnE2.js} +8 -8
- package/dist/src/{render-kFatbqG6.js → render-CAZvKKkB.js} +3 -3
- package/dist/src/{responses-BtU_i-R0.js → responses-DLLjADw5.js} +5 -5
- package/dist/src/{responses-B85halqh.js → responses-TsdODUpm.js} +8 -8
- package/dist/src/{responses-CXJACENh.cjs → responses-zOtKtnY_.cjs} +5 -5
- package/dist/src/{rubyUtils-DYKoa7Ze.js → rubyUtils-BtjlqyXt.js} +2 -2
- package/dist/src/{rubyUtils-BA4D4gMX.js → rubyUtils-D7--T12C.js} +2 -2
- package/dist/src/{sagemaker-hRS_Jj3-.js → sagemaker-BcgLu0U4.js} +17 -17
- package/dist/src/{sagemaker-DI6IOTjT.js → sagemaker-CLdUAv5z.js} +11 -11
- package/dist/src/{sagemaker-BUagsrJ-.cjs → sagemaker-DwNnEVYt.cjs} +11 -11
- package/dist/src/{scanner-C6QXA9Pn.js → scanner-Dyw21Wg_.js} +10 -10
- package/dist/src/server/index.js +1376 -486
- package/dist/src/server-BUbS0Qfh.js +6 -0
- package/dist/src/{server-BPC37wlX.js → server-CbMTRQkg.js} +3 -3
- package/dist/src/{server-C_O6-VE4.cjs → server-CgUQ25qW.cjs} +3 -3
- package/dist/src/{server-HQtz_gUy.js → server-DWmZLfCy.js} +4 -4
- package/dist/src/server-XpGXFHkS.cjs +6 -0
- package/dist/src/server-gfOx5Zrk.js +8 -0
- package/dist/src/{signal-D4VhSJOY.js → signal-Bl32q42d.js} +2 -2
- package/dist/src/{slack-DTUSadx4.js → slack-BfdBx2tO.js} +1 -1
- package/dist/src/{store-BTdkdmK9.js → store-2ocbYY9D.js} +2 -2
- package/dist/src/store-5u2yriTV.js +7 -0
- package/dist/src/{store-F-KTiqfb.cjs → store-BqwfFEyF.cjs} +2 -2
- package/dist/src/{store-rueRdzcm.js → store-D4gdn9ih.js} +2 -2
- package/dist/src/store-D_lq_8oQ.js +6 -0
- package/dist/src/store-m5KT6Ly7.cjs +6 -0
- package/dist/src/{tables-w-r-abWq.cjs → tables-B9E1kRp-.cjs} +2 -2
- package/dist/src/{tables-ChjAuVAR.js → tables-C7TT2XVn.js} +2 -2
- package/dist/src/{tables-dNaVPyDr.js → tables-D-NSwNIb.js} +2 -2
- package/dist/src/telemetry-5RHFoCJh.js +6 -0
- package/dist/src/{telemetry-wXyCQ1Nz.js → telemetry-BXyVqyAg.js} +3 -3
- package/dist/src/{telemetry-Y1esJM0v.cjs → telemetry-D0_yFdtU.cjs} +3 -3
- package/dist/src/{telemetry-Dai7PdlR.js → telemetry-DZ_7PaVq.js} +3 -3
- package/dist/src/telemetry-Do8wMnA-.js +8 -0
- package/dist/src/telemetry-LojxPoFq.cjs +6 -0
- package/dist/src/{text-C1cXk9ij.js → text-DgMr_tiM.js} +1 -1
- package/dist/src/{tokenUsageUtils-D2ko2eFQ.js → tokenUsageUtils-DmZSD2eU.js} +1 -1
- package/dist/src/{transcription-i6EfSMie.js → transcription-CYuY5sFO.js} +6 -6
- package/dist/src/{transcription-CcYTL4wi.js → transcription-Ch7S-LWw.js} +10 -10
- package/dist/src/{transcription-C-K2hDJX.cjs → transcription-FNIz3YOe.cjs} +6 -6
- package/dist/src/{transform-gpzlPrwG.js → transform-CoP2bJ7P.js} +43 -4
- package/dist/src/{transform-B86_0IIb.js → transform-CqTFr7KR.js} +4 -4
- package/dist/src/{transform-DosdxVdh.js → transform-DMaxQwDx.js} +43 -4
- package/dist/src/{transform-DwsntMEQ.js → transform-GybT0X0u.js} +3 -3
- package/dist/src/{transform-CCSNqTI-.cjs → transform-ivxEY4f7.cjs} +54 -3
- package/dist/src/{transformersAvailability-DM54tWzt.js → transformersAvailability-DwmezkVe.js} +1 -1
- package/dist/src/{types-Brw5kggg.cjs → types-BIfttHrT.cjs} +13 -1
- package/dist/src/{types-CslP2TyG.js → types-DMVjYLpx.js} +13 -1
- package/dist/src/{types-CMDs7Kzu.js → types-t52w-XsS.js} +16 -2
- package/dist/src/{util-BECSJ0T_.js → util-BSh4a_Q8.js} +6 -6
- package/dist/src/{util-D8z5QOy8.cjs → util-C08Kns6-.cjs} +3 -3
- package/dist/src/{util-CttPoePn.js → util-CUEt0Vum.js} +3 -3
- package/dist/src/{util-CfPdWQJX.js → util-Cl0zfT3V.js} +3 -3
- package/dist/src/{util-Dab5xp2E.cjs → util-DUYOvxAy.cjs} +3 -3
- package/dist/src/{util-CY_XguB9.js → util-DiCePfDu.js} +3 -3
- package/dist/src/{util-CBAXTxfy.cjs → util-DkFTvieG.cjs} +3 -3
- package/dist/src/{util-Dft1RxsL.js → util-mJ58qbbw.js} +3 -3
- package/dist/src/{util-Ba18wQ8e.js → util-vjscpUzy.js} +3 -3
- package/dist/src/{utils-BTeLHwiH.js → utils-CVzb4YiI.js} +2 -2
- package/dist/src/{utils-Db5KwiXp.cjs → utils-DFaZa6Rf.cjs} +2 -2
- package/dist/src/{utils-ICP7kLcY.js → utils-JaY9veb5.js} +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +43 -42
- package/dist/src/app/assets/index-COIipVf1.css +0 -1
- package/dist/src/app/assets/index-ClD64gUa.js +0 -428
- package/dist/src/app/assets/vendor-react-DHoaNLma.js +0 -4
- package/dist/src/cache-BJ31KhNT.cjs +0 -6
- package/dist/src/eval-DgiEH2xe.js +0 -16
- package/dist/src/evalResult-Boel8xoS.js +0 -13
- package/dist/src/evalResult-DGx1-Ela.js +0 -11
- package/dist/src/evalResult-DzRxYLDH.cjs +0 -11
- package/dist/src/evaluator-B4qKt437.js +0 -38
- package/dist/src/fetch-DwhKew9e.cjs +0 -4
- package/dist/src/graders-BpEqZT2Q.js +0 -34
- package/dist/src/graders-DTGI-hHE.cjs +0 -33
- package/dist/src/graders-DgMr-E4I.js +0 -36
- package/dist/src/providers-DVsoSup2.js +0 -34
- package/dist/src/providers-D_tJatIk.js +0 -32
- package/dist/src/providers-wpMPsMZ7.cjs +0 -32
- package/dist/src/server-BeqUuSvj.js +0 -6
- package/dist/src/server-CwQsQ6dl.cjs +0 -6
- package/dist/src/server-Dhbq83-d.js +0 -8
- package/dist/src/store-C7U17qcu.js +0 -6
- package/dist/src/store-CuDU_jDN.js +0 -7
- package/dist/src/store-awdDxuiD.cjs +0 -6
- package/dist/src/telemetry-ClcYTCOG.js +0 -8
- package/dist/src/telemetry-DEWuLu_s.js +0 -6
- package/dist/src/telemetry-tADmeX6E.cjs +0 -6
package/dist/src/index.d.cts
CHANGED
|
@@ -364,7 +364,7 @@ interface ProviderResponse {
|
|
|
364
364
|
http?: {
|
|
365
365
|
status: number;
|
|
366
366
|
statusText: string;
|
|
367
|
-
headers
|
|
367
|
+
headers?: Record<string, string>;
|
|
368
368
|
requestHeaders?: Record<string, string>;
|
|
369
369
|
};
|
|
370
370
|
[key: string]: any;
|
|
@@ -418,6 +418,12 @@ interface ProviderResponse {
|
|
|
418
418
|
aspectRatio?: string;
|
|
419
419
|
resolution?: string;
|
|
420
420
|
};
|
|
421
|
+
images?: ImageOutput[];
|
|
422
|
+
}
|
|
423
|
+
interface ImageOutput {
|
|
424
|
+
data?: string;
|
|
425
|
+
blobRef?: BlobRef;
|
|
426
|
+
mimeType?: string;
|
|
421
427
|
}
|
|
422
428
|
interface ProviderEmbeddingResponse {
|
|
423
429
|
cached?: boolean;
|
|
@@ -778,7 +784,7 @@ type PIIPlugin = (typeof PII_PLUGINS)[number];
|
|
|
778
784
|
type BiasPlugin = (typeof BIAS_PLUGINS)[number];
|
|
779
785
|
declare const BASE_PLUGINS: readonly ["contracts", "excessive-agency", "hallucination", "hijacking", "politics"];
|
|
780
786
|
type BasePlugin = (typeof BASE_PLUGINS)[number];
|
|
781
|
-
declare const ADDITIONAL_PLUGINS: readonly ["aegis", "ascii-smuggling", "beavertails", "bfla", "bola", "cca", "competitors", "coppa", "cross-session-leak", "cyberseceval", "data-exfil", "debug-access", "divergent-repetition", "donotanswer", "ferpa", "harmbench", "toxic-chat", "imitation", "indirect-prompt-injection", "mcp", "medical:anchoring-bias", "medical:hallucination", "medical:incorrect-knowledge", "medical:off-label-use", "medical:prioritization-error", "medical:sycophancy", "financial:calculation-error", "financial:compliance-violation", "financial:confidential-disclosure", "financial:counterfactual", "financial:data-leakage", "financial:defamation", "financial:hallucination", "financial:impartiality", "financial:misconduct", "financial:sycophancy", "ecommerce:compliance-bypass", "ecommerce:order-fraud", "ecommerce:pci-dss", "ecommerce:price-manipulation", "goal-misalignment", "insurance:coverage-discrimination", "insurance:network-misinformation", "insurance:phi-disclosure", "off-topic", "overreliance", "pharmacy:controlled-substance-compliance", "pharmacy:dosage-calculation", "pharmacy:drug-interaction", "telecom:cpni-disclosure", "telecom:location-disclosure", "telecom:account-takeover", "telecom:e911-misinformation", "telecom:tcpa-violation", "telecom:unauthorized-changes", "telecom:fraud-enablement", "telecom:porting-misinformation", "telecom:billing-misinformation", "telecom:coverage-misinformation", "telecom:law-enforcement-request-handling", "telecom:accessibility-violation", "realestate:fair-housing-discrimination", "realestate:steering", "realestate:discriminatory-listings", "realestate:lending-discrimination", "realestate:valuation-bias", "realestate:accessibility-discrimination", "realestate:advertising-discrimination", "realestate:source-of-income", "pliny", "prompt-extraction", "rag-document-exfiltration", "rag-poisoning", "rag-source-attribution", "rbac", "reasoning-dos", "religion", "shell-injection", "special-token-injection", "sql-injection", "ssrf", "system-prompt-override", "tool-discovery", "unsafebench", "unverifiable-claims", "vlguard", "vlsu", "wordplay", "xstest"];
|
|
787
|
+
declare const ADDITIONAL_PLUGINS: readonly ["aegis", "ascii-smuggling", "beavertails", "bfla", "bola", "cca", "competitors", "coppa", "cross-session-leak", "cyberseceval", "data-exfil", "debug-access", "divergent-repetition", "donotanswer", "ferpa", "harmbench", "toxic-chat", "imitation", "indirect-prompt-injection", "mcp", "model-identification", "medical:anchoring-bias", "medical:hallucination", "medical:incorrect-knowledge", "medical:off-label-use", "medical:prioritization-error", "medical:sycophancy", "financial:calculation-error", "financial:compliance-violation", "financial:confidential-disclosure", "financial:counterfactual", "financial:data-leakage", "financial:defamation", "financial:hallucination", "financial:impartiality", "financial:misconduct", "financial:sox-compliance", "financial:sycophancy", "ecommerce:compliance-bypass", "ecommerce:order-fraud", "ecommerce:pci-dss", "ecommerce:price-manipulation", "goal-misalignment", "insurance:coverage-discrimination", "insurance:network-misinformation", "insurance:phi-disclosure", "off-topic", "overreliance", "pharmacy:controlled-substance-compliance", "pharmacy:dosage-calculation", "pharmacy:drug-interaction", "telecom:cpni-disclosure", "telecom:location-disclosure", "telecom:account-takeover", "telecom:e911-misinformation", "telecom:tcpa-violation", "telecom:unauthorized-changes", "telecom:fraud-enablement", "telecom:porting-misinformation", "telecom:billing-misinformation", "telecom:coverage-misinformation", "telecom:law-enforcement-request-handling", "telecom:accessibility-violation", "realestate:fair-housing-discrimination", "realestate:steering", "realestate:discriminatory-listings", "realestate:lending-discrimination", "realestate:valuation-bias", "realestate:accessibility-discrimination", "realestate:advertising-discrimination", "realestate:source-of-income", "pliny", "prompt-extraction", "rag-document-exfiltration", "rag-poisoning", "rag-source-attribution", "rbac", "reasoning-dos", "religion", "shell-injection", "special-token-injection", "sql-injection", "ssrf", "system-prompt-override", "tool-discovery", "unsafebench", "unverifiable-claims", "vlguard", "vlsu", "wordplay", "xstest"];
|
|
782
788
|
type AdditionalPlugin = (typeof ADDITIONAL_PLUGINS)[number];
|
|
783
789
|
declare const CONFIG_REQUIRED_PLUGINS: readonly ["intent", "policy"];
|
|
784
790
|
type ConfigRequiredPlugin = (typeof CONFIG_REQUIRED_PLUGINS)[number];
|
|
@@ -1502,6 +1508,7 @@ interface EvaluateTableOutput {
|
|
|
1502
1508
|
aspectRatio?: string;
|
|
1503
1509
|
resolution?: string;
|
|
1504
1510
|
};
|
|
1511
|
+
images?: ImageOutput[];
|
|
1505
1512
|
}
|
|
1506
1513
|
interface EvaluateTableRow {
|
|
1507
1514
|
description?: string;
|
|
@@ -17991,6 +17998,8 @@ interface PluginFactory {
|
|
|
17991
17998
|
interface Strategy {
|
|
17992
17999
|
id: string;
|
|
17993
18000
|
action: (testCases: TestCaseWithPlugin[], injectVar: string, config: Record<string, any>, strategyId?: string) => Promise<TestCase[]>;
|
|
18001
|
+
/** Whether this strategy requires pre-extracted intent/goal metadata on test cases. */
|
|
18002
|
+
requiresGoalExtraction?: boolean;
|
|
17994
18003
|
}
|
|
17995
18004
|
//#endregion
|
|
17996
18005
|
//#region src/external/matchers/deepeval.d.ts
|
|
@@ -18355,6 +18364,14 @@ declare class Eval {
|
|
|
18355
18364
|
* This may be higher than getResultsCount() when there are multiple prompts/providers.
|
|
18356
18365
|
*/
|
|
18357
18366
|
getTotalResultRowCount(): Promise<number>;
|
|
18367
|
+
/**
|
|
18368
|
+
* Find a non-transient HTTP error status from evaluation results.
|
|
18369
|
+
* Returns the first non-transient status (401, 403, 404, 500, 501) found, or undefined.
|
|
18370
|
+
*
|
|
18371
|
+
* For persisted evals: Uses efficient O(1) database query with LIMIT 1.
|
|
18372
|
+
* For non-persisted evals: Falls back to scanning in-memory results.
|
|
18373
|
+
*/
|
|
18374
|
+
findTargetErrorStatus(): Promise<number | undefined>;
|
|
18358
18375
|
fetchResultsByTestIdx(testIdx: number): Promise<EvalResult[]>;
|
|
18359
18376
|
/**
|
|
18360
18377
|
* CRITICAL: Builds the WHERE SQL clause for filtering results.
|
|
@@ -18713,5 +18730,5 @@ declare const _default$1: {
|
|
|
18713
18730
|
};
|
|
18714
18731
|
};
|
|
18715
18732
|
//#endregion
|
|
18716
|
-
export { type AfterAllExtensionHookContext, type AfterEachExtensionHookContext, AgentCancelledPayload, AgentErrorPayload, ApiClassificationProvider, ApiEmbeddingProvider, ApiModerationProvider, ApiProvider, ApiSimilarityProvider, Assertion, AssertionOrSet, AssertionOrSetSchema, AssertionParams, AssertionSchema, AssertionSet, AssertionSetSchema, AssertionType, AssertionTypeSchema, AssertionValue, AssertionValueFunction, AssertionValueFunctionContext, AssertionValueFunctionResult, AtomicTestCase, AtomicTestCaseSchema, AudioGradingConfig, BaseAssertionTypes, BaseAssertionTypesSchema, BaseRedteamMetadata, BaseTokenUsage, BaseTokenUsageSchema, type BeforeAllExtensionHookContext, type BeforeEachExtensionHookContext, CallApiContextParams, CallApiFunction, CallApiOptionsParams, ChatMessage, CommandLineOptions, CommandLineOptionsSchema, CompletedPrompt, CompletedPromptSchema, CompletionTokenDetails, CompletionTokenDetailsSchema, ConversationMessage, ConversationMessageSchema, CsvRow, DefaultProviders, DerivedMetric, DerivedMetricSchema, type EnvOverrides, EvalConversations, EvalRegisters, EvalResultsFilterMode, EvalSummary, EvalTableDTO, EvalWithMetadata, EvaluateOptions, EvaluateOptionsSchema, EvaluateResult, EvaluateStats, EvaluateSummaryV2, EvaluateSummaryV3, EvaluateTable, EvaluateTableOutput, EvaluateTableRow, EvaluateTestSuite, EvaluateTestSuiteWithEvaluateOptions, type ExtensionHookContextMap, FailedPluginInfo, FilePath, GradingConfig, GradingConfigSchema, GradingResult, GuardrailResponse, InferSchema, type Inputs, InputsSchema, Intent, Job, LoadApiProviderContext, ModerationFlag, Modifier, NotPrefixedAssertionTypesSchema, NunjucksFilterMap, OutputConfig, OutputConfigSchema, OutputFile, OutputFileExtension, OutputMetadata, PartialGenerationError, PluginActionParams, PluginConfig, PluginConfigSchema, PoliciesById, Policy, PolicyObject, PolicyObjectSchema, Prompt, PromptConfig, PromptContent, PromptFunction, PromptFunctionContext, PromptFunctionResult, PromptMetrics, PromptWithMetadata, ProviderClassificationResponse, ProviderEmbeddingResponse, ProviderFunction, ProviderId, ProviderLabel, ProviderModerationResponse, ProviderOptions, ProviderOptionsMap, ProviderResponse, ProviderSimilarityResponse, ProviderTestResponse, ProviderType, ProviderTypeMap, ProvidersSchema, RateLimitRegistryRef, RedteamAssertionTypes, RedteamCliGenerateOptions, RedteamContext, RedteamFileConfig, RedteamGenerateOptions, RedteamHistoryEntry, RedteamMediaData, RedteamObjectConfig, RedteamPlugin, RedteamPluginObject, RedteamRunOptions, RedteamStrategy, RedteamStrategyObject, ResultFailureReason, ResultLightweight, ResultLightweightWithLabel, ResultSuggestion, ResultsFile, RunEvalOptions, SavedRedteamConfig, Scenario, ScenarioSchema, ScoringFunction, ServerPromptWithMetadata, SharedResults, SpecialAssertionTypes, SpecialAssertionTypesSchema, StrategyConfig, StrategyConfigSchema, SynthesizeOptions, TestCase, TestCaseSchema, TestCaseWithPlugin, TestCaseWithVarsFile, TestCaseWithVarsFileSchema, TestCasesWithMetadata, TestCasesWithMetadataPrompt, TestCasesWithMetadataPromptSchema, TestCasesWithMetadataSchema, TestGeneratorConfig, TestGeneratorConfigSchema, TestSuite, TestSuiteConfig, TestSuiteConfigSchema, TestSuiteSchema, type TokenUsage, TraceData, TraceSpan, TracingConfig, UnifiedConfig, UnifiedConfigSchema, VarMapping, type VarValue, Vars, VarsSchema, ZodLikeSchema, _default as assertions, cache_d_exports as cache, _default$1 as default, evaluate, generateTable, guardrails, isApiProvider, isGradingResult, isProviderOptions, isResultFailureReason, loadApiProvider, redteam };
|
|
18733
|
+
export { type AfterAllExtensionHookContext, type AfterEachExtensionHookContext, AgentCancelledPayload, AgentErrorPayload, ApiClassificationProvider, ApiEmbeddingProvider, ApiModerationProvider, ApiProvider, ApiSimilarityProvider, Assertion, AssertionOrSet, AssertionOrSetSchema, AssertionParams, AssertionSchema, AssertionSet, AssertionSetSchema, AssertionType, AssertionTypeSchema, AssertionValue, AssertionValueFunction, AssertionValueFunctionContext, AssertionValueFunctionResult, AtomicTestCase, AtomicTestCaseSchema, AudioGradingConfig, BaseAssertionTypes, BaseAssertionTypesSchema, BaseRedteamMetadata, BaseTokenUsage, BaseTokenUsageSchema, type BeforeAllExtensionHookContext, type BeforeEachExtensionHookContext, CallApiContextParams, CallApiFunction, CallApiOptionsParams, ChatMessage, CommandLineOptions, CommandLineOptionsSchema, CompletedPrompt, CompletedPromptSchema, CompletionTokenDetails, CompletionTokenDetailsSchema, ConversationMessage, ConversationMessageSchema, CsvRow, DefaultProviders, DerivedMetric, DerivedMetricSchema, type EnvOverrides, EvalConversations, EvalRegisters, EvalResultsFilterMode, EvalSummary, EvalTableDTO, EvalWithMetadata, EvaluateOptions, EvaluateOptionsSchema, EvaluateResult, EvaluateStats, EvaluateSummaryV2, EvaluateSummaryV3, EvaluateTable, EvaluateTableOutput, EvaluateTableRow, EvaluateTestSuite, EvaluateTestSuiteWithEvaluateOptions, type ExtensionHookContextMap, FailedPluginInfo, FilePath, GradingConfig, GradingConfigSchema, GradingResult, GuardrailResponse, ImageOutput, InferSchema, type Inputs, InputsSchema, Intent, Job, LoadApiProviderContext, ModerationFlag, Modifier, NotPrefixedAssertionTypesSchema, NunjucksFilterMap, OutputConfig, OutputConfigSchema, OutputFile, OutputFileExtension, OutputMetadata, PartialGenerationError, PluginActionParams, PluginConfig, PluginConfigSchema, PoliciesById, Policy, PolicyObject, PolicyObjectSchema, Prompt, PromptConfig, PromptContent, PromptFunction, PromptFunctionContext, PromptFunctionResult, PromptMetrics, PromptWithMetadata, ProviderClassificationResponse, ProviderEmbeddingResponse, ProviderFunction, ProviderId, ProviderLabel, ProviderModerationResponse, ProviderOptions, ProviderOptionsMap, ProviderResponse, ProviderSimilarityResponse, ProviderTestResponse, ProviderType, ProviderTypeMap, ProvidersSchema, RateLimitRegistryRef, RedteamAssertionTypes, RedteamCliGenerateOptions, RedteamContext, RedteamFileConfig, RedteamGenerateOptions, RedteamHistoryEntry, RedteamMediaData, RedteamObjectConfig, RedteamPlugin, RedteamPluginObject, RedteamRunOptions, RedteamStrategy, RedteamStrategyObject, ResultFailureReason, ResultLightweight, ResultLightweightWithLabel, ResultSuggestion, ResultsFile, RunEvalOptions, SavedRedteamConfig, Scenario, ScenarioSchema, ScoringFunction, ServerPromptWithMetadata, SharedResults, SpecialAssertionTypes, SpecialAssertionTypesSchema, StrategyConfig, StrategyConfigSchema, SynthesizeOptions, TestCase, TestCaseSchema, TestCaseWithPlugin, TestCaseWithVarsFile, TestCaseWithVarsFileSchema, TestCasesWithMetadata, TestCasesWithMetadataPrompt, TestCasesWithMetadataPromptSchema, TestCasesWithMetadataSchema, TestGeneratorConfig, TestGeneratorConfigSchema, TestSuite, TestSuiteConfig, TestSuiteConfigSchema, TestSuiteSchema, type TokenUsage, TraceData, TraceSpan, TracingConfig, UnifiedConfig, UnifiedConfigSchema, VarMapping, type VarValue, Vars, VarsSchema, ZodLikeSchema, _default as assertions, cache_d_exports as cache, _default$1 as default, evaluate, generateTable, guardrails, isApiProvider, isGradingResult, isProviderOptions, isResultFailureReason, loadApiProvider, redteam };
|
|
18717
18734
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/src/index.d.ts
CHANGED
|
@@ -361,7 +361,7 @@ interface ProviderResponse {
|
|
|
361
361
|
http?: {
|
|
362
362
|
status: number;
|
|
363
363
|
statusText: string;
|
|
364
|
-
headers
|
|
364
|
+
headers?: Record<string, string>;
|
|
365
365
|
requestHeaders?: Record<string, string>;
|
|
366
366
|
};
|
|
367
367
|
[key: string]: any;
|
|
@@ -415,6 +415,12 @@ interface ProviderResponse {
|
|
|
415
415
|
aspectRatio?: string;
|
|
416
416
|
resolution?: string;
|
|
417
417
|
};
|
|
418
|
+
images?: ImageOutput[];
|
|
419
|
+
}
|
|
420
|
+
interface ImageOutput {
|
|
421
|
+
data?: string;
|
|
422
|
+
blobRef?: BlobRef;
|
|
423
|
+
mimeType?: string;
|
|
418
424
|
}
|
|
419
425
|
interface ProviderEmbeddingResponse {
|
|
420
426
|
cached?: boolean;
|
|
@@ -775,7 +781,7 @@ type PIIPlugin = (typeof PII_PLUGINS)[number];
|
|
|
775
781
|
type BiasPlugin = (typeof BIAS_PLUGINS)[number];
|
|
776
782
|
declare const BASE_PLUGINS: readonly ["contracts", "excessive-agency", "hallucination", "hijacking", "politics"];
|
|
777
783
|
type BasePlugin = (typeof BASE_PLUGINS)[number];
|
|
778
|
-
declare const ADDITIONAL_PLUGINS: readonly ["aegis", "ascii-smuggling", "beavertails", "bfla", "bola", "cca", "competitors", "coppa", "cross-session-leak", "cyberseceval", "data-exfil", "debug-access", "divergent-repetition", "donotanswer", "ferpa", "harmbench", "toxic-chat", "imitation", "indirect-prompt-injection", "mcp", "medical:anchoring-bias", "medical:hallucination", "medical:incorrect-knowledge", "medical:off-label-use", "medical:prioritization-error", "medical:sycophancy", "financial:calculation-error", "financial:compliance-violation", "financial:confidential-disclosure", "financial:counterfactual", "financial:data-leakage", "financial:defamation", "financial:hallucination", "financial:impartiality", "financial:misconduct", "financial:sycophancy", "ecommerce:compliance-bypass", "ecommerce:order-fraud", "ecommerce:pci-dss", "ecommerce:price-manipulation", "goal-misalignment", "insurance:coverage-discrimination", "insurance:network-misinformation", "insurance:phi-disclosure", "off-topic", "overreliance", "pharmacy:controlled-substance-compliance", "pharmacy:dosage-calculation", "pharmacy:drug-interaction", "telecom:cpni-disclosure", "telecom:location-disclosure", "telecom:account-takeover", "telecom:e911-misinformation", "telecom:tcpa-violation", "telecom:unauthorized-changes", "telecom:fraud-enablement", "telecom:porting-misinformation", "telecom:billing-misinformation", "telecom:coverage-misinformation", "telecom:law-enforcement-request-handling", "telecom:accessibility-violation", "realestate:fair-housing-discrimination", "realestate:steering", "realestate:discriminatory-listings", "realestate:lending-discrimination", "realestate:valuation-bias", "realestate:accessibility-discrimination", "realestate:advertising-discrimination", "realestate:source-of-income", "pliny", "prompt-extraction", "rag-document-exfiltration", "rag-poisoning", "rag-source-attribution", "rbac", "reasoning-dos", "religion", "shell-injection", "special-token-injection", "sql-injection", "ssrf", "system-prompt-override", "tool-discovery", "unsafebench", "unverifiable-claims", "vlguard", "vlsu", "wordplay", "xstest"];
|
|
784
|
+
declare const ADDITIONAL_PLUGINS: readonly ["aegis", "ascii-smuggling", "beavertails", "bfla", "bola", "cca", "competitors", "coppa", "cross-session-leak", "cyberseceval", "data-exfil", "debug-access", "divergent-repetition", "donotanswer", "ferpa", "harmbench", "toxic-chat", "imitation", "indirect-prompt-injection", "mcp", "model-identification", "medical:anchoring-bias", "medical:hallucination", "medical:incorrect-knowledge", "medical:off-label-use", "medical:prioritization-error", "medical:sycophancy", "financial:calculation-error", "financial:compliance-violation", "financial:confidential-disclosure", "financial:counterfactual", "financial:data-leakage", "financial:defamation", "financial:hallucination", "financial:impartiality", "financial:misconduct", "financial:sox-compliance", "financial:sycophancy", "ecommerce:compliance-bypass", "ecommerce:order-fraud", "ecommerce:pci-dss", "ecommerce:price-manipulation", "goal-misalignment", "insurance:coverage-discrimination", "insurance:network-misinformation", "insurance:phi-disclosure", "off-topic", "overreliance", "pharmacy:controlled-substance-compliance", "pharmacy:dosage-calculation", "pharmacy:drug-interaction", "telecom:cpni-disclosure", "telecom:location-disclosure", "telecom:account-takeover", "telecom:e911-misinformation", "telecom:tcpa-violation", "telecom:unauthorized-changes", "telecom:fraud-enablement", "telecom:porting-misinformation", "telecom:billing-misinformation", "telecom:coverage-misinformation", "telecom:law-enforcement-request-handling", "telecom:accessibility-violation", "realestate:fair-housing-discrimination", "realestate:steering", "realestate:discriminatory-listings", "realestate:lending-discrimination", "realestate:valuation-bias", "realestate:accessibility-discrimination", "realestate:advertising-discrimination", "realestate:source-of-income", "pliny", "prompt-extraction", "rag-document-exfiltration", "rag-poisoning", "rag-source-attribution", "rbac", "reasoning-dos", "religion", "shell-injection", "special-token-injection", "sql-injection", "ssrf", "system-prompt-override", "tool-discovery", "unsafebench", "unverifiable-claims", "vlguard", "vlsu", "wordplay", "xstest"];
|
|
779
785
|
type AdditionalPlugin = (typeof ADDITIONAL_PLUGINS)[number];
|
|
780
786
|
declare const CONFIG_REQUIRED_PLUGINS: readonly ["intent", "policy"];
|
|
781
787
|
type ConfigRequiredPlugin = (typeof CONFIG_REQUIRED_PLUGINS)[number];
|
|
@@ -1499,6 +1505,7 @@ interface EvaluateTableOutput {
|
|
|
1499
1505
|
aspectRatio?: string;
|
|
1500
1506
|
resolution?: string;
|
|
1501
1507
|
};
|
|
1508
|
+
images?: ImageOutput[];
|
|
1502
1509
|
}
|
|
1503
1510
|
interface EvaluateTableRow {
|
|
1504
1511
|
description?: string;
|
|
@@ -17988,6 +17995,8 @@ interface PluginFactory {
|
|
|
17988
17995
|
interface Strategy {
|
|
17989
17996
|
id: string;
|
|
17990
17997
|
action: (testCases: TestCaseWithPlugin[], injectVar: string, config: Record<string, any>, strategyId?: string) => Promise<TestCase[]>;
|
|
17998
|
+
/** Whether this strategy requires pre-extracted intent/goal metadata on test cases. */
|
|
17999
|
+
requiresGoalExtraction?: boolean;
|
|
17991
18000
|
}
|
|
17992
18001
|
//#endregion
|
|
17993
18002
|
//#region src/external/matchers/deepeval.d.ts
|
|
@@ -18352,6 +18361,14 @@ declare class Eval {
|
|
|
18352
18361
|
* This may be higher than getResultsCount() when there are multiple prompts/providers.
|
|
18353
18362
|
*/
|
|
18354
18363
|
getTotalResultRowCount(): Promise<number>;
|
|
18364
|
+
/**
|
|
18365
|
+
* Find a non-transient HTTP error status from evaluation results.
|
|
18366
|
+
* Returns the first non-transient status (401, 403, 404, 500, 501) found, or undefined.
|
|
18367
|
+
*
|
|
18368
|
+
* For persisted evals: Uses efficient O(1) database query with LIMIT 1.
|
|
18369
|
+
* For non-persisted evals: Falls back to scanning in-memory results.
|
|
18370
|
+
*/
|
|
18371
|
+
findTargetErrorStatus(): Promise<number | undefined>;
|
|
18355
18372
|
fetchResultsByTestIdx(testIdx: number): Promise<EvalResult[]>;
|
|
18356
18373
|
/**
|
|
18357
18374
|
* CRITICAL: Builds the WHERE SQL clause for filtering results.
|
|
@@ -18710,5 +18727,5 @@ declare const _default$1: {
|
|
|
18710
18727
|
};
|
|
18711
18728
|
};
|
|
18712
18729
|
//#endregion
|
|
18713
|
-
export { type AfterAllExtensionHookContext, type AfterEachExtensionHookContext, AgentCancelledPayload, AgentErrorPayload, ApiClassificationProvider, ApiEmbeddingProvider, ApiModerationProvider, ApiProvider, ApiSimilarityProvider, Assertion, AssertionOrSet, AssertionOrSetSchema, AssertionParams, AssertionSchema, AssertionSet, AssertionSetSchema, AssertionType, AssertionTypeSchema, AssertionValue, AssertionValueFunction, AssertionValueFunctionContext, AssertionValueFunctionResult, AtomicTestCase, AtomicTestCaseSchema, AudioGradingConfig, BaseAssertionTypes, BaseAssertionTypesSchema, BaseRedteamMetadata, BaseTokenUsage, BaseTokenUsageSchema, type BeforeAllExtensionHookContext, type BeforeEachExtensionHookContext, CallApiContextParams, CallApiFunction, CallApiOptionsParams, ChatMessage, CommandLineOptions, CommandLineOptionsSchema, CompletedPrompt, CompletedPromptSchema, CompletionTokenDetails, CompletionTokenDetailsSchema, ConversationMessage, ConversationMessageSchema, CsvRow, DefaultProviders, DerivedMetric, DerivedMetricSchema, type EnvOverrides, EvalConversations, EvalRegisters, EvalResultsFilterMode, EvalSummary, EvalTableDTO, EvalWithMetadata, EvaluateOptions, EvaluateOptionsSchema, EvaluateResult, EvaluateStats, EvaluateSummaryV2, EvaluateSummaryV3, EvaluateTable, EvaluateTableOutput, EvaluateTableRow, EvaluateTestSuite, EvaluateTestSuiteWithEvaluateOptions, type ExtensionHookContextMap, FailedPluginInfo, FilePath, GradingConfig, GradingConfigSchema, GradingResult, GuardrailResponse, InferSchema, type Inputs, InputsSchema, Intent, Job, LoadApiProviderContext, ModerationFlag, Modifier, NotPrefixedAssertionTypesSchema, NunjucksFilterMap, OutputConfig, OutputConfigSchema, OutputFile, OutputFileExtension, OutputMetadata, PartialGenerationError, PluginActionParams, PluginConfig, PluginConfigSchema, PoliciesById, Policy, PolicyObject, PolicyObjectSchema, Prompt, PromptConfig, PromptContent, PromptFunction, PromptFunctionContext, PromptFunctionResult, PromptMetrics, PromptWithMetadata, ProviderClassificationResponse, ProviderEmbeddingResponse, ProviderFunction, ProviderId, ProviderLabel, ProviderModerationResponse, ProviderOptions, ProviderOptionsMap, ProviderResponse, ProviderSimilarityResponse, ProviderTestResponse, ProviderType, ProviderTypeMap, ProvidersSchema, RateLimitRegistryRef, RedteamAssertionTypes, RedteamCliGenerateOptions, RedteamContext, RedteamFileConfig, RedteamGenerateOptions, RedteamHistoryEntry, RedteamMediaData, RedteamObjectConfig, RedteamPlugin, RedteamPluginObject, RedteamRunOptions, RedteamStrategy, RedteamStrategyObject, ResultFailureReason, ResultLightweight, ResultLightweightWithLabel, ResultSuggestion, ResultsFile, RunEvalOptions, SavedRedteamConfig, Scenario, ScenarioSchema, ScoringFunction, ServerPromptWithMetadata, SharedResults, SpecialAssertionTypes, SpecialAssertionTypesSchema, StrategyConfig, StrategyConfigSchema, SynthesizeOptions, TestCase, TestCaseSchema, TestCaseWithPlugin, TestCaseWithVarsFile, TestCaseWithVarsFileSchema, TestCasesWithMetadata, TestCasesWithMetadataPrompt, TestCasesWithMetadataPromptSchema, TestCasesWithMetadataSchema, TestGeneratorConfig, TestGeneratorConfigSchema, TestSuite, TestSuiteConfig, TestSuiteConfigSchema, TestSuiteSchema, type TokenUsage, TraceData, TraceSpan, TracingConfig, UnifiedConfig, UnifiedConfigSchema, VarMapping, type VarValue, Vars, VarsSchema, ZodLikeSchema, _default as assertions, cache_d_exports as cache, _default$1 as default, evaluate, generateTable, guardrails, isApiProvider, isGradingResult, isProviderOptions, isResultFailureReason, loadApiProvider, redteam };
|
|
18730
|
+
export { type AfterAllExtensionHookContext, type AfterEachExtensionHookContext, AgentCancelledPayload, AgentErrorPayload, ApiClassificationProvider, ApiEmbeddingProvider, ApiModerationProvider, ApiProvider, ApiSimilarityProvider, Assertion, AssertionOrSet, AssertionOrSetSchema, AssertionParams, AssertionSchema, AssertionSet, AssertionSetSchema, AssertionType, AssertionTypeSchema, AssertionValue, AssertionValueFunction, AssertionValueFunctionContext, AssertionValueFunctionResult, AtomicTestCase, AtomicTestCaseSchema, AudioGradingConfig, BaseAssertionTypes, BaseAssertionTypesSchema, BaseRedteamMetadata, BaseTokenUsage, BaseTokenUsageSchema, type BeforeAllExtensionHookContext, type BeforeEachExtensionHookContext, CallApiContextParams, CallApiFunction, CallApiOptionsParams, ChatMessage, CommandLineOptions, CommandLineOptionsSchema, CompletedPrompt, CompletedPromptSchema, CompletionTokenDetails, CompletionTokenDetailsSchema, ConversationMessage, ConversationMessageSchema, CsvRow, DefaultProviders, DerivedMetric, DerivedMetricSchema, type EnvOverrides, EvalConversations, EvalRegisters, EvalResultsFilterMode, EvalSummary, EvalTableDTO, EvalWithMetadata, EvaluateOptions, EvaluateOptionsSchema, EvaluateResult, EvaluateStats, EvaluateSummaryV2, EvaluateSummaryV3, EvaluateTable, EvaluateTableOutput, EvaluateTableRow, EvaluateTestSuite, EvaluateTestSuiteWithEvaluateOptions, type ExtensionHookContextMap, FailedPluginInfo, FilePath, GradingConfig, GradingConfigSchema, GradingResult, GuardrailResponse, ImageOutput, InferSchema, type Inputs, InputsSchema, Intent, Job, LoadApiProviderContext, ModerationFlag, Modifier, NotPrefixedAssertionTypesSchema, NunjucksFilterMap, OutputConfig, OutputConfigSchema, OutputFile, OutputFileExtension, OutputMetadata, PartialGenerationError, PluginActionParams, PluginConfig, PluginConfigSchema, PoliciesById, Policy, PolicyObject, PolicyObjectSchema, Prompt, PromptConfig, PromptContent, PromptFunction, PromptFunctionContext, PromptFunctionResult, PromptMetrics, PromptWithMetadata, ProviderClassificationResponse, ProviderEmbeddingResponse, ProviderFunction, ProviderId, ProviderLabel, ProviderModerationResponse, ProviderOptions, ProviderOptionsMap, ProviderResponse, ProviderSimilarityResponse, ProviderTestResponse, ProviderType, ProviderTypeMap, ProvidersSchema, RateLimitRegistryRef, RedteamAssertionTypes, RedteamCliGenerateOptions, RedteamContext, RedteamFileConfig, RedteamGenerateOptions, RedteamHistoryEntry, RedteamMediaData, RedteamObjectConfig, RedteamPlugin, RedteamPluginObject, RedteamRunOptions, RedteamStrategy, RedteamStrategyObject, ResultFailureReason, ResultLightweight, ResultLightweightWithLabel, ResultSuggestion, ResultsFile, RunEvalOptions, SavedRedteamConfig, Scenario, ScenarioSchema, ScoringFunction, ServerPromptWithMetadata, SharedResults, SpecialAssertionTypes, SpecialAssertionTypesSchema, StrategyConfig, StrategyConfigSchema, SynthesizeOptions, TestCase, TestCaseSchema, TestCaseWithPlugin, TestCaseWithVarsFile, TestCaseWithVarsFileSchema, TestCasesWithMetadata, TestCasesWithMetadataPrompt, TestCasesWithMetadataPromptSchema, TestCasesWithMetadataSchema, TestGeneratorConfig, TestGeneratorConfigSchema, TestSuite, TestSuiteConfig, TestSuiteConfigSchema, TestSuiteSchema, type TokenUsage, TraceData, TraceSpan, TracingConfig, UnifiedConfig, UnifiedConfigSchema, VarMapping, type VarValue, Vars, VarsSchema, ZodLikeSchema, _default as assertions, cache_d_exports as cache, _default$1 as default, evaluate, generateTable, guardrails, isApiProvider, isGradingResult, isProviderOptions, isResultFailureReason, loadApiProvider, redteam };
|
|
18714
18731
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.js
CHANGED
|
@@ -5,36 +5,36 @@ import { r as importModule, t as getDirectory } from "./esm-rDtG_2rg.js";
|
|
|
5
5
|
import { r as runPython } from "./pythonUtils-vMlk9Qp5.js";
|
|
6
6
|
import { i as isJavascriptFile } from "./fileExtensions-ePDqouxn.js";
|
|
7
7
|
import { n as transform, r as getProcessShim, t as TransformInputType } from "./transform-D8dILpfZ.js";
|
|
8
|
-
import { $ as matchesSearchRubric, A as BeavertailsPlugin, B as getAndCheckProvider, C as HarmbenchPlugin, D as DebugAccessPlugin, E as DivergentRepetitionPlugin, F as retryWithDeduplication, G as matchesContextFaithfulness, H as matchesAnswerRelevance, I as sampleArray, J as matchesFactuality, K as matchesContextRecall, L as fetchHuggingFaceDataset, M as RedteamGraderBase, N as RedteamPluginBase, O as CrossSessionLeakPlugin, P as getCustomPolicies, Q as matchesPiScore, R as callProviderWithContext, S as ImitationPlugin, T as ExcessiveAgencyPlugin, U as matchesClassification, V as loadRubricPrompt, W as matchesClosedQa, X as matchesLlmRubric, Y as matchesGEval, Z as matchesModeration, _ as makeInlinePolicyIdSync, a as UnverifiableClaimsPlugin, at as processPrompts, b as OverreliancePlugin, c as ToolDiscoveryPlugin, ct as SUGGEST_PROMPTS_SYSTEM_MESSAGE, d as RbacPlugin, dt as loadFromJavaScriptFile, et as matchesSelectBest, f as PromptExtractionPlugin, ft as processFileReference, g as isValidPolicyObject, h as determinePolicyTypeFromId, i as VLGuardPlugin, it as DefaultSuggestionsProvider, j as AegisPlugin, k as ContractPlugin, l as SqlInjectionPlugin, lt as coerceString, m as PolicyPlugin, n as getGraderById, nt as selectMaxScore, o as UnsafeBenchPlugin, ot as readPrompts, p as PoliticsPlugin, pt as resolveContext, q as matchesContextRelevance, r as VLSUPlugin, rt as getDefaultProviders, s as ToxicChatPlugin, st as readProviderPromptMap, t as GRADERS, tt as matchesSimilarity, u as ShellInjectionPlugin, ut as getFinalTest, v as PlinyPlugin, w as HallucinationPlugin, x as IntentPlugin, y as getPiiLeakTestsForCategory, z as fail } from "./graders-
|
|
9
|
-
import { A as isApiProvider, C as TestGeneratorConfigSchema, Ct as BaseTokenUsageSchema, D as VarsSchema, E as UnifiedConfigSchema, F as ConversationMessageSchema, I as PartialGenerationError, J as getDefaultNFanout, K as STRATEGY_COLLECTIONS, L as PluginConfigSchema, M as RedteamConfigSchema, O as isGradingResult, P as ProvidersSchema, Q as categoryAliases, R as PolicyObjectSchema, S as TestCasesWithMetadataSchema, St as PromptSchema, T as TestSuiteSchema, Tt as InputsSchema, V as isUuid, W as DEFAULT_STRATEGIES, X as isFanoutStrategy, Z as Severity, _ as ScenarioSchema, _t as REDTEAM_PROVIDER_HARM_PLUGINS, a as AtomicTestCaseSchema, at as FINANCIAL_PLUGINS, b as TestCaseWithVarsFileSchema, bt as TELECOM_PLUGINS, c as CompletedPromptSchema, ct as INSURANCE_PLUGINS, d as EvaluateOptionsSchema, dt as MEDICAL_PLUGINS, et as riskCategorySeverityMap, f as GradingConfigSchema, ft as MULTI_INPUT_EXCLUDED_PLUGINS, g as ResultFailureReason, gt as PLUGIN_CATEGORIES, h as OutputFileExtension, ht as PII_PLUGINS, i as AssertionTypeSchema, it as DEFAULT_PLUGINS, j as isProviderOptions, k as isResultFailureReason, l as DerivedMetricSchema, lt as LLAMA_GUARD_ENABLED_CATEGORIES, m as OutputConfigSchema, mt as PHARMACY_PLUGINS, n as AssertionSchema, nt as BIAS_PLUGINS, o as BaseAssertionTypesSchema, ot as FOUNDATION_PLUGINS, p as NotPrefixedAssertionTypesSchema, pt as MULTI_INPUT_VAR, q as STRATEGY_COLLECTION_MAPPINGS, r as AssertionSetSchema, rt as DATASET_EXEMPT_PLUGINS, s as CommandLineOptionsSchema, st as HARM_PLUGINS, t as AssertionOrSetSchema, tt as ALIASED_PLUGIN_MAPPINGS, u as EvalResultsFilterMode, ut as LLAMA_GUARD_REPLICATE_PROVIDER, v as SpecialAssertionTypesSchema, vt as REMOTE_ONLY_PLUGIN_IDS, w as TestSuiteConfigSchema, wt as CompletionTokenDetailsSchema, x as TestCasesWithMetadataPromptSchema, xt as UNALIGNED_PROVIDER_HARM_PLUGINS, y as TestCaseSchema, z as StrategyConfigSchema } from "./types-
|
|
10
|
-
import { A as isAnthropicProvider, C as deduplicateTestCases, D as resultIsForTestCase, E as getTestCaseDeduplicationKey, M as isOpenAiProvider, N as isProviderAllowed, O as doesProviderRefMatch, S as setupEnv, T as filterRuntimeVars, b as loadFunction, c as maybeLoadFromExternalFile, d as maybeLoadToolsFromExternalFile, h as renderEnvOnlyInObject, i as fetchCsvFromGoogleSheet, j as isGoogleProvider, k as getProviderDescription, m as readOutput, n as writeMultipleOutputs, p as readFilters, r as writeOutput, s as maybeLoadConfigFromExternalFile, t as printBorder, v as extractVariablesFromTemplates, w as extractRuntimeVars, x as parseFileUrl, y as getNunjucksEngine } from "./util-
|
|
11
|
-
import { F as getShareViewBaseUrl, L as VERSION, M as TERMINAL_MAX_WIDTH, N as getDefaultShareViewBaseUrl, O as DEFAULT_MAX_CONCURRENCY, P as getShareApiBaseUrl, R as FILE_METADATA_KEY, S as parseChatPrompt, c as cloudConfig, f as getCurrentTimestamp, h as REQUEST_TIMEOUT_MS, k as DEFAULT_QUERY_LIMIT, n as fetchWithRetries, p as sleep, r as fetchWithTimeout, s as CloudConfig, t as fetchWithProxy, y as isPromptfooSampleTarget, z as HUMAN_ASSERTION_TYPE } from "./fetch-
|
|
12
|
-
import { a as fetchWithCache, o as getCache, r as disableCache, t as cache_exports } from "./cache-
|
|
13
|
-
import { A as createRateLimitRegistry, B as isCloudProvider, C as collectFileMetadata, D as loadFromPackage, E as isPackagePath, F as getCloudDatabaseId, I as getEvalConfigFromCloud, J as AIStudioChatProvider, L as getOrgContext, M as PromptfooHarmfulCompletionProvider, O as redteamProviderManager, P as checkCloudPermissions, R as getPluginSeverityOverridesFromCloud, T as runExtensionHook, V as resolveTeamId, _ as extractVariablesFromJson, a as resolveProviderConfigs, b as isBasicRefusal, c as Strategies, d as pluginMatchesStrategyTargets, f as checkExfilTracking, g as extractPromptFromTags, i as resolveProvider, j as createProviderRateLimitOptions, k as TokenUsageTracker, l as loadStrategy, m as extractGoalFromPrompt, n as loadApiProvider, o as MCPProvider, q as VertexChatProvider, r as loadApiProviders, s as GoogleLiveProvider, t as getProviderIds, u as validateStrategies, v as getSessionId, w as renderPrompt, y as getShortPluginId } from "./providers-
|
|
14
|
-
import { i as generateIdFromPrompt, t as hashPrompt } from "./utils-
|
|
15
|
-
import { a as sha256, i as randomSequence, n as isBlobStorageEnabled, t as extractAndStoreBinaryData } from "./extractor-
|
|
8
|
+
import { $ as matchesSearchRubric, A as BeavertailsPlugin, B as getAndCheckProvider, C as HarmbenchPlugin, D as DebugAccessPlugin, E as DivergentRepetitionPlugin, F as retryWithDeduplication, G as matchesContextFaithfulness, H as matchesAnswerRelevance, I as sampleArray, J as matchesFactuality, K as matchesContextRecall, L as fetchHuggingFaceDataset, M as RedteamGraderBase, N as RedteamPluginBase, O as CrossSessionLeakPlugin, P as getCustomPolicies, Q as matchesPiScore, R as callProviderWithContext, S as ImitationPlugin, T as ExcessiveAgencyPlugin, U as matchesClassification, V as loadRubricPrompt, W as matchesClosedQa, X as matchesLlmRubric, Y as matchesGEval, Z as matchesModeration, _ as makeInlinePolicyIdSync, a as UnverifiableClaimsPlugin, at as processPrompts, b as OverreliancePlugin, c as ToolDiscoveryPlugin, ct as SUGGEST_PROMPTS_SYSTEM_MESSAGE, d as RbacPlugin, dt as loadFromJavaScriptFile, et as matchesSelectBest, f as PromptExtractionPlugin, ft as processFileReference, g as isValidPolicyObject, h as determinePolicyTypeFromId, i as VLGuardPlugin, it as DefaultSuggestionsProvider, j as AegisPlugin, k as ContractPlugin, l as SqlInjectionPlugin, lt as coerceString, m as PolicyPlugin, n as getGraderById, nt as selectMaxScore, o as UnsafeBenchPlugin, ot as readPrompts, p as PoliticsPlugin, pt as resolveContext, q as matchesContextRelevance, r as VLSUPlugin, rt as getDefaultProviders, s as ToxicChatPlugin, st as readProviderPromptMap, t as GRADERS, tt as matchesSimilarity, u as ShellInjectionPlugin, ut as getFinalTest, v as PlinyPlugin, w as HallucinationPlugin, x as IntentPlugin, y as getPiiLeakTestsForCategory, z as fail } from "./graders-QsALpIdy.js";
|
|
9
|
+
import { A as isApiProvider, C as TestGeneratorConfigSchema, Ct as BaseTokenUsageSchema, D as VarsSchema, E as UnifiedConfigSchema, F as ConversationMessageSchema, I as PartialGenerationError, J as getDefaultNFanout, K as STRATEGY_COLLECTIONS, L as PluginConfigSchema, M as RedteamConfigSchema, O as isGradingResult, P as ProvidersSchema, Q as categoryAliases, R as PolicyObjectSchema, S as TestCasesWithMetadataSchema, St as PromptSchema, T as TestSuiteSchema, Tt as InputsSchema, V as isUuid, W as DEFAULT_STRATEGIES, X as isFanoutStrategy, Z as Severity, _ as ScenarioSchema, _t as REDTEAM_PROVIDER_HARM_PLUGINS, a as AtomicTestCaseSchema, at as FINANCIAL_PLUGINS, b as TestCaseWithVarsFileSchema, bt as TELECOM_PLUGINS, c as CompletedPromptSchema, ct as INSURANCE_PLUGINS, d as EvaluateOptionsSchema, dt as MEDICAL_PLUGINS, et as riskCategorySeverityMap, f as GradingConfigSchema, ft as MULTI_INPUT_EXCLUDED_PLUGINS, g as ResultFailureReason, gt as PLUGIN_CATEGORIES, h as OutputFileExtension, ht as PII_PLUGINS, i as AssertionTypeSchema, it as DEFAULT_PLUGINS, j as isProviderOptions, k as isResultFailureReason, l as DerivedMetricSchema, lt as LLAMA_GUARD_ENABLED_CATEGORIES, m as OutputConfigSchema, mt as PHARMACY_PLUGINS, n as AssertionSchema, nt as BIAS_PLUGINS, o as BaseAssertionTypesSchema, ot as FOUNDATION_PLUGINS, p as NotPrefixedAssertionTypesSchema, pt as MULTI_INPUT_VAR, q as STRATEGY_COLLECTION_MAPPINGS, r as AssertionSetSchema, rt as DATASET_EXEMPT_PLUGINS, s as CommandLineOptionsSchema, st as HARM_PLUGINS, t as AssertionOrSetSchema, tt as ALIASED_PLUGIN_MAPPINGS, u as EvalResultsFilterMode, ut as LLAMA_GUARD_REPLICATE_PROVIDER, v as SpecialAssertionTypesSchema, vt as REMOTE_ONLY_PLUGIN_IDS, w as TestSuiteConfigSchema, wt as CompletionTokenDetailsSchema, x as TestCasesWithMetadataPromptSchema, xt as UNALIGNED_PROVIDER_HARM_PLUGINS, y as TestCaseSchema, z as StrategyConfigSchema } from "./types-DMVjYLpx.js";
|
|
10
|
+
import { A as isAnthropicProvider, C as deduplicateTestCases, D as resultIsForTestCase, E as getTestCaseDeduplicationKey, M as isOpenAiProvider, N as isProviderAllowed, O as doesProviderRefMatch, S as setupEnv, T as filterRuntimeVars, b as loadFunction, c as maybeLoadFromExternalFile, d as maybeLoadToolsFromExternalFile, h as renderEnvOnlyInObject, i as fetchCsvFromGoogleSheet, j as isGoogleProvider, k as getProviderDescription, m as readOutput, n as writeMultipleOutputs, p as readFilters, r as writeOutput, s as maybeLoadConfigFromExternalFile, t as printBorder, v as extractVariablesFromTemplates, w as extractRuntimeVars, x as parseFileUrl, y as getNunjucksEngine } from "./util-DiCePfDu.js";
|
|
11
|
+
import { F as getShareViewBaseUrl, L as VERSION, M as TERMINAL_MAX_WIDTH, N as getDefaultShareViewBaseUrl, O as DEFAULT_MAX_CONCURRENCY, P as getShareApiBaseUrl, R as FILE_METADATA_KEY, S as parseChatPrompt, c as cloudConfig, f as getCurrentTimestamp, h as REQUEST_TIMEOUT_MS, k as DEFAULT_QUERY_LIMIT, n as fetchWithRetries, p as sleep, r as fetchWithTimeout, s as CloudConfig, t as fetchWithProxy, y as isPromptfooSampleTarget, z as HUMAN_ASSERTION_TYPE } from "./fetch-18MuNu9i.js";
|
|
12
|
+
import { a as fetchWithCache, c as NON_TRANSIENT_HTTP_STATUSES, l as isNonTransientHttpStatus, o as getCache, r as disableCache, t as cache_exports } from "./cache-BLLayYEN.js";
|
|
13
|
+
import { A as createRateLimitRegistry, B as isCloudProvider, C as collectFileMetadata, D as loadFromPackage, E as isPackagePath, F as getCloudDatabaseId, I as getEvalConfigFromCloud, J as AIStudioChatProvider, L as getOrgContext, M as PromptfooHarmfulCompletionProvider, O as redteamProviderManager, P as checkCloudPermissions, R as getPluginSeverityOverridesFromCloud, T as runExtensionHook, V as resolveTeamId, _ as extractVariablesFromJson, a as resolveProviderConfigs, b as isBasicRefusal, c as Strategies, d as pluginMatchesStrategyTargets, f as checkExfilTracking, g as extractPromptFromTags, i as resolveProvider, j as createProviderRateLimitOptions, k as TokenUsageTracker, l as loadStrategy, m as extractGoalFromPrompt, n as loadApiProvider, o as MCPProvider, q as VertexChatProvider, r as loadApiProviders, s as GoogleLiveProvider, t as getProviderIds, u as validateStrategies, v as getSessionId, w as renderPrompt, y as getShortPluginId } from "./providers-BiNq_Iyc.js";
|
|
14
|
+
import { i as generateIdFromPrompt, t as hashPrompt } from "./utils-CVzb4YiI.js";
|
|
15
|
+
import { a as sha256, i as randomSequence, n as isBlobStorageEnabled, t as extractAndStoreBinaryData } from "./extractor-Hs7la_19.js";
|
|
16
16
|
import "./genaiTracer-Ce19n68P.js";
|
|
17
|
-
import { t as OpenAiChatCompletionProvider } from "./chat-
|
|
17
|
+
import { t as OpenAiChatCompletionProvider } from "./chat-C8Ei4f87.js";
|
|
18
18
|
import { a as createEmptyTokenUsage, i as createEmptyAssertions, n as accumulateResponseTokenUsage, o as normalizeTokenUsage, r as accumulateTokenUsage, t as accumulateAssertionTokenUsage } from "./tokenUsageUtils-FZd5O_4A.js";
|
|
19
|
-
import {
|
|
20
|
-
import "./messages-
|
|
21
|
-
import "./util-
|
|
22
|
-
import "./responses-
|
|
19
|
+
import { m as validateFunctionCall } from "./transform-DMaxQwDx.js";
|
|
20
|
+
import "./messages-CDZYGNlS.js";
|
|
21
|
+
import "./util-mJ58qbbw.js";
|
|
22
|
+
import "./responses-DLLjADw5.js";
|
|
23
23
|
import "./openai-Dz3surb_.js";
|
|
24
|
-
import { l as validateFunctionCall$1 } from "./util-
|
|
25
|
-
import "./completion-
|
|
26
|
-
import { c as setUserEmail, i as getUserEmail, l as EMAIL_OK_STATUS, r as getAuthor, s as promptForEmailUnverified, t as checkEmailStatusAndMaybeExit } from "./accounts-
|
|
27
|
-
import { i as getRemoteGenerationUrl, l as shouldGenerateRemote, o as getRemoteHealthUrl, r as promptYesNo, s as neverGenerateRemote } from "./server-
|
|
28
|
-
import { t as getBlobByHash } from "./blobs-
|
|
29
|
-
import { a as evalsTable, c as evalsToTagsTable, d as tagsTable, i as evalResultsTable, l as promptsTable, m as getDbSignalPath, o as evalsToDatasetsTable, p as getDb, r as datasetsTable, s as evalsToPromptsTable } from "./tables-
|
|
30
|
-
import { n as telemetry_default } from "./telemetry-
|
|
24
|
+
import { l as validateFunctionCall$1 } from "./util-Cl0zfT3V.js";
|
|
25
|
+
import "./completion-D9_MDlnd.js";
|
|
26
|
+
import { c as setUserEmail, i as getUserEmail, l as EMAIL_OK_STATUS, r as getAuthor, s as promptForEmailUnverified, t as checkEmailStatusAndMaybeExit } from "./accounts-R3gfCR_g.js";
|
|
27
|
+
import { i as getRemoteGenerationUrl, l as shouldGenerateRemote, o as getRemoteHealthUrl, r as promptYesNo, s as neverGenerateRemote } from "./server-CbMTRQkg.js";
|
|
28
|
+
import { t as getBlobByHash } from "./blobs-C9J2mVgo.js";
|
|
29
|
+
import { a as evalsTable, c as evalsToTagsTable, d as tagsTable, i as evalResultsTable, l as promptsTable, m as getDbSignalPath, o as evalsToDatasetsTable, p as getDb, r as datasetsTable, s as evalsToPromptsTable } from "./tables-D-NSwNIb.js";
|
|
30
|
+
import { n as telemetry_default } from "./telemetry-DZ_7PaVq.js";
|
|
31
31
|
import { t as ellipsize } from "./text-Dm78AVGG.js";
|
|
32
|
-
import { n as getTraceStore } from "./store-
|
|
33
|
-
import "./base-
|
|
34
|
-
import "./image-
|
|
32
|
+
import { n as getTraceStore } from "./store-2ocbYY9D.js";
|
|
33
|
+
import "./base-Dtp8b4_N.js";
|
|
34
|
+
import "./image-BiEVdpdP.js";
|
|
35
35
|
import { t as providerRegistry } from "./providerRegistry-wCWd7sKQ.js";
|
|
36
36
|
import { n as runRuby } from "./rubyUtils-Cs35SDYa.js";
|
|
37
|
-
import { t as EvalResult } from "./evalResult-
|
|
37
|
+
import { t as EvalResult } from "./evalResult-COsVttMA.js";
|
|
38
38
|
import * as fs$1 from "fs";
|
|
39
39
|
import fs, { createWriteStream } from "fs";
|
|
40
40
|
import * as path$2 from "path";
|
|
@@ -292,7 +292,7 @@ async function startOtlpReceiverIfNeeded(testSuite) {
|
|
|
292
292
|
telemetry_default.record("feature_used", { feature: "tracing" });
|
|
293
293
|
try {
|
|
294
294
|
logger_default.debug("[EvaluatorTracing] Tracing configuration detected, starting OTLP receiver");
|
|
295
|
-
const { startOTLPReceiver } = await import("./otlpReceiver-
|
|
295
|
+
const { startOTLPReceiver } = await import("./otlpReceiver-BO0rbDzh.js");
|
|
296
296
|
const port = testSuite.tracing.otlp.http.port || 4318;
|
|
297
297
|
const host = testSuite.tracing.otlp.http.host || "127.0.0.1";
|
|
298
298
|
logger_default.debug(`[EvaluatorTracing] Starting OTLP receiver on ${host}:${port}`);
|
|
@@ -315,7 +315,7 @@ async function startOtlpReceiverIfNeeded(testSuite) {
|
|
|
315
315
|
async function stopOtlpReceiverIfNeeded() {
|
|
316
316
|
if (otlpReceiverStarted) try {
|
|
317
317
|
logger_default.debug("[EvaluatorTracing] Stopping OTLP receiver");
|
|
318
|
-
const { stopOTLPReceiver } = await import("./otlpReceiver-
|
|
318
|
+
const { stopOTLPReceiver } = await import("./otlpReceiver-BO0rbDzh.js");
|
|
319
319
|
await stopOTLPReceiver();
|
|
320
320
|
otlpReceiverStarted = false;
|
|
321
321
|
logger_default.info("[EvaluatorTracing] OTLP receiver stopped successfully");
|
|
@@ -350,7 +350,7 @@ async function generateTraceContextIfNeeded(test, evaluateOptions, testIdx, prom
|
|
|
350
350
|
}
|
|
351
351
|
if (!tracingEnabled) return null;
|
|
352
352
|
logger_default.debug("[EvaluatorTracing] Importing trace store");
|
|
353
|
-
const { getTraceStore } = await import("./store-
|
|
353
|
+
const { getTraceStore } = await import("./store-D_lq_8oQ.js");
|
|
354
354
|
const traceStore = getTraceStore();
|
|
355
355
|
const traceId = generateTraceId();
|
|
356
356
|
const spanId = generateSpanId();
|
|
@@ -2871,9 +2871,9 @@ async function runAssertion({ prompt, provider, assertion, test, vars, latencyMs
|
|
|
2871
2871
|
let filePath = fileRef;
|
|
2872
2872
|
let functionName;
|
|
2873
2873
|
if (fileRef.includes(":")) {
|
|
2874
|
-
const
|
|
2875
|
-
filePath =
|
|
2876
|
-
functionName =
|
|
2874
|
+
const colonIndex = fileRef.indexOf(":");
|
|
2875
|
+
filePath = fileRef.slice(0, colonIndex);
|
|
2876
|
+
functionName = fileRef.slice(colonIndex + 1);
|
|
2877
2877
|
}
|
|
2878
2878
|
filePath = path.resolve(basePath, filePath);
|
|
2879
2879
|
if (isJavascriptFile(filePath)) {
|
|
@@ -3899,7 +3899,7 @@ async function runEval({ provider, prompt, test, testSuite, delay, nunjucksFilte
|
|
|
3899
3899
|
promptIdx,
|
|
3900
3900
|
testIdx
|
|
3901
3901
|
});
|
|
3902
|
-
logger_default.error("Provider call failed during eval", logContext);
|
|
3902
|
+
if (!(err instanceof Error && err.name === "AbortError")) logger_default.error("Provider call failed during eval", logContext);
|
|
3903
3903
|
return [{
|
|
3904
3904
|
...setup,
|
|
3905
3905
|
error: errorWithStack,
|
|
@@ -4080,11 +4080,17 @@ var Evaluator = class {
|
|
|
4080
4080
|
let globalTimeout;
|
|
4081
4081
|
let globalAbortController;
|
|
4082
4082
|
const processedIndices = /* @__PURE__ */ new Set();
|
|
4083
|
+
let targetUnavailable = false;
|
|
4084
|
+
let targetErrorStatus;
|
|
4085
|
+
const targetErrorAbortController = new AbortController();
|
|
4083
4086
|
let ciProgressReporter = null;
|
|
4084
4087
|
let progressBarManager = null;
|
|
4088
|
+
let providerAbortSignal = options.abortSignal;
|
|
4089
|
+
let combinedAbortSignal = options.abortSignal ? AbortSignal.any([options.abortSignal, targetErrorAbortController.signal]) : targetErrorAbortController.signal;
|
|
4085
4090
|
if (maxEvalTimeMs > 0) {
|
|
4086
4091
|
globalAbortController = new AbortController();
|
|
4087
|
-
|
|
4092
|
+
providerAbortSignal = providerAbortSignal ? AbortSignal.any([providerAbortSignal, globalAbortController.signal]) : globalAbortController.signal;
|
|
4093
|
+
combinedAbortSignal = AbortSignal.any([combinedAbortSignal, globalAbortController.signal]);
|
|
4088
4094
|
globalTimeout = setTimeout(() => {
|
|
4089
4095
|
evalTimedOut = true;
|
|
4090
4096
|
globalAbortController?.abort();
|
|
@@ -4092,7 +4098,7 @@ var Evaluator = class {
|
|
|
4092
4098
|
}
|
|
4093
4099
|
const vars = /* @__PURE__ */ new Set();
|
|
4094
4100
|
const checkAbort = () => {
|
|
4095
|
-
if (
|
|
4101
|
+
if (combinedAbortSignal.aborted) throw new Error("Operation cancelled");
|
|
4096
4102
|
};
|
|
4097
4103
|
if (!options.silent) logger_default.info(`Starting evaluation ${this.evalRecord.id}`);
|
|
4098
4104
|
checkAbort();
|
|
@@ -4253,7 +4259,7 @@ var Evaluator = class {
|
|
|
4253
4259
|
const defaultProvider = testSuite.defaultTest.provider;
|
|
4254
4260
|
if (isApiProvider(defaultProvider)) testCase.provider = defaultProvider;
|
|
4255
4261
|
else if (typeof defaultProvider === "object" && defaultProvider.id) {
|
|
4256
|
-
const { loadApiProvider } = await import("./providers-
|
|
4262
|
+
const { loadApiProvider } = await import("./providers-CQQrNaJk.js");
|
|
4257
4263
|
testCase.provider = await loadApiProvider(typeof defaultProvider.id === "function" ? defaultProvider.id() : defaultProvider.id, { options: defaultProvider });
|
|
4258
4264
|
} else testCase.provider = defaultProvider;
|
|
4259
4265
|
}
|
|
@@ -4323,7 +4329,7 @@ var Evaluator = class {
|
|
|
4323
4329
|
registers: this.registers,
|
|
4324
4330
|
isRedteam: testSuite.redteam != null,
|
|
4325
4331
|
concurrency,
|
|
4326
|
-
abortSignal:
|
|
4332
|
+
abortSignal: providerAbortSignal,
|
|
4327
4333
|
evalId: this.evalRecord.id,
|
|
4328
4334
|
rateLimitRegistry: this.rateLimitRegistry
|
|
4329
4335
|
});
|
|
@@ -4337,7 +4343,7 @@ var Evaluator = class {
|
|
|
4337
4343
|
if (evalOption.test.assert?.some((a) => a.type === "max-score")) rowsWithMaxScoreAssertion.add(evalOption.testIdx);
|
|
4338
4344
|
}
|
|
4339
4345
|
if (cliState_default.resume && this.evalRecord.persisted) try {
|
|
4340
|
-
const { default: EvalResult } = await import("./evalResult-
|
|
4346
|
+
const { default: EvalResult } = await import("./evalResult-DyttNQ_G.js");
|
|
4341
4347
|
const completedPairs = await EvalResult.getCompletedIndexPairs(this.evalRecord.id, { excludeErrors: cliState_default.retryMode });
|
|
4342
4348
|
const originalCount = runEvalOptions.length;
|
|
4343
4349
|
for (let i = runEvalOptions.length - 1; i >= 0; i--) {
|
|
@@ -4390,6 +4396,14 @@ var Evaluator = class {
|
|
|
4390
4396
|
logger_default.error(`Error saving result: ${error} ${safeJsonStringify(resultSummary)}`);
|
|
4391
4397
|
}
|
|
4392
4398
|
for (const writer of this.fileWriters) await writer.write(row);
|
|
4399
|
+
const httpStatus = row.response?.metadata?.http?.status;
|
|
4400
|
+
if (typeof httpStatus === "number" && isNonTransientHttpStatus(httpStatus)) {
|
|
4401
|
+
targetUnavailable = true;
|
|
4402
|
+
targetErrorStatus = httpStatus;
|
|
4403
|
+
logger_default.error(`Target returned HTTP ${httpStatus}. Aborting scan - this error will not resolve on retry.`);
|
|
4404
|
+
targetErrorAbortController.abort();
|
|
4405
|
+
break;
|
|
4406
|
+
}
|
|
4393
4407
|
const { promptIdx } = row;
|
|
4394
4408
|
const metrics = prompts[promptIdx].metrics;
|
|
4395
4409
|
invariant(metrics, "Expected prompt.metrics to be set");
|
|
@@ -4553,6 +4567,7 @@ var Evaluator = class {
|
|
|
4553
4567
|
if (this.options.showProgressBar && progressBarManager) await progressBarManager.initialize(runEvalOptions, concurrency, 0);
|
|
4554
4568
|
try {
|
|
4555
4569
|
if (serialRunEvalOptions.length > 0) for (const evalStep of serialRunEvalOptions) {
|
|
4570
|
+
checkAbort();
|
|
4556
4571
|
if (isWebUI) {
|
|
4557
4572
|
const provider = evalStep.provider.label || evalStep.provider.id();
|
|
4558
4573
|
const vars = formatVarsForDisplay(evalStep.test.vars || {}, 50);
|
|
@@ -4570,22 +4585,32 @@ var Evaluator = class {
|
|
|
4570
4585
|
await this.evalRecord.addPrompts(prompts);
|
|
4571
4586
|
});
|
|
4572
4587
|
} catch (err) {
|
|
4573
|
-
if (
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4588
|
+
if (combinedAbortSignal.aborted) {
|
|
4589
|
+
if (evalTimedOut) logger_default.warn(`Evaluation stopped after reaching max duration (${maxEvalTimeMs}ms)`);
|
|
4590
|
+
else if (!targetUnavailable) {
|
|
4591
|
+
logger_default.info("Evaluation interrupted, saving progress...");
|
|
4592
|
+
if (globalTimeout) clearTimeout(globalTimeout);
|
|
4593
|
+
if (progressBarManager) progressBarManager.stop();
|
|
4594
|
+
if (ciProgressReporter) ciProgressReporter.finish();
|
|
4595
|
+
this.evalRecord.setVars(Array.from(vars));
|
|
4596
|
+
await this.evalRecord.addPrompts(prompts);
|
|
4597
|
+
updateSignalFile(this.evalRecord.id);
|
|
4598
|
+
return this.evalRecord;
|
|
4599
|
+
}
|
|
4600
|
+
} else {
|
|
4585
4601
|
if (ciProgressReporter) ciProgressReporter.error(`Evaluation failed: ${String(err)}`);
|
|
4586
4602
|
throw err;
|
|
4587
4603
|
}
|
|
4588
4604
|
}
|
|
4605
|
+
if (targetUnavailable) {
|
|
4606
|
+
if (globalTimeout) clearTimeout(globalTimeout);
|
|
4607
|
+
if (progressBarManager) progressBarManager.stop();
|
|
4608
|
+
if (ciProgressReporter) ciProgressReporter.error(`Target unavailable (HTTP ${targetErrorStatus})`);
|
|
4609
|
+
this.evalRecord.setVars(Array.from(vars));
|
|
4610
|
+
await this.evalRecord.addPrompts(prompts);
|
|
4611
|
+
updateSignalFile(this.evalRecord.id);
|
|
4612
|
+
return this.evalRecord;
|
|
4613
|
+
}
|
|
4589
4614
|
const compareRowsCount = rowsWithSelectBestAssertion.size + rowsWithMaxScoreAssertion.size;
|
|
4590
4615
|
if (progressBarManager) {
|
|
4591
4616
|
if (compareRowsCount > 0) progressBarManager.updateTotalCount(compareRowsCount);
|
|
@@ -5362,7 +5387,12 @@ function convertResultsToTable(eval_) {
|
|
|
5362
5387
|
model: result.response.video.model,
|
|
5363
5388
|
aspectRatio: result.response.video.aspectRatio,
|
|
5364
5389
|
resolution: result.response.video.resolution
|
|
5365
|
-
} : void 0
|
|
5390
|
+
} : void 0,
|
|
5391
|
+
images: result.response?.images?.map((img) => ({
|
|
5392
|
+
data: img.data,
|
|
5393
|
+
blobRef: img.blobRef,
|
|
5394
|
+
mimeType: img.mimeType
|
|
5395
|
+
}))
|
|
5366
5396
|
};
|
|
5367
5397
|
invariant(result.promptId, "Prompt ID is required");
|
|
5368
5398
|
row.testIdx = result.testIdx;
|
|
@@ -5428,7 +5458,12 @@ function convertEvalResultToTableCell(result) {
|
|
|
5428
5458
|
model: result.response.video.model,
|
|
5429
5459
|
aspectRatio: result.response.video.aspectRatio,
|
|
5430
5460
|
resolution: result.response.video.resolution
|
|
5431
|
-
} : void 0
|
|
5461
|
+
} : void 0,
|
|
5462
|
+
images: result.response?.images?.map((img) => ({
|
|
5463
|
+
data: img.data,
|
|
5464
|
+
blobRef: img.blobRef,
|
|
5465
|
+
mimeType: img.mimeType
|
|
5466
|
+
}))
|
|
5432
5467
|
};
|
|
5433
5468
|
}
|
|
5434
5469
|
function convertTestResultsToTableRow(results, varsForHeader) {
|
|
@@ -5986,6 +6021,27 @@ var Eval = class Eval {
|
|
|
5986
6021
|
async getTotalResultRowCount() {
|
|
5987
6022
|
return getTotalResultRowCount(this.id);
|
|
5988
6023
|
}
|
|
6024
|
+
/**
|
|
6025
|
+
* Find a non-transient HTTP error status from evaluation results.
|
|
6026
|
+
* Returns the first non-transient status (401, 403, 404, 500, 501) found, or undefined.
|
|
6027
|
+
*
|
|
6028
|
+
* For persisted evals: Uses efficient O(1) database query with LIMIT 1.
|
|
6029
|
+
* For non-persisted evals: Falls back to scanning in-memory results.
|
|
6030
|
+
*/
|
|
6031
|
+
async findTargetErrorStatus() {
|
|
6032
|
+
const scanInMemory = () => {
|
|
6033
|
+
for (const result of this.results) {
|
|
6034
|
+
const status = result.response?.metadata?.http?.status;
|
|
6035
|
+
if (typeof status === "number" && isNonTransientHttpStatus(status)) return status;
|
|
6036
|
+
}
|
|
6037
|
+
};
|
|
6038
|
+
if (!this.persisted) return scanInMemory();
|
|
6039
|
+
try {
|
|
6040
|
+
return getDb().select({ httpStatus: sql`CAST(json_extract(${evalResultsTable.response}, '$.metadata.http.status') AS INTEGER)` }).from(evalResultsTable).where(and(eq(evalResultsTable.evalId, this.id), sql`json_extract(${evalResultsTable.response}, '$.metadata.http.status') IN (${sql.join(NON_TRANSIENT_HTTP_STATUSES.map((s) => sql`${s}`), sql`, `)})`)).limit(1).get()?.httpStatus ?? void 0;
|
|
6041
|
+
} catch {
|
|
6042
|
+
return scanInMemory();
|
|
6043
|
+
}
|
|
6044
|
+
}
|
|
5989
6045
|
async fetchResultsByTestIdx(testIdx) {
|
|
5990
6046
|
return await EvalResult.findManyByEvalId(this.id, { testIdx });
|
|
5991
6047
|
}
|
|
@@ -9666,6 +9722,7 @@ async function synthesize({ abortSignal, delay, entities: entitiesOverride, inje
|
|
|
9666
9722
|
seen.add(key);
|
|
9667
9723
|
return true;
|
|
9668
9724
|
});
|
|
9725
|
+
const needsGoalExtraction = strategies.some((s) => Strategies.find((def) => def.id === s.id)?.requiresGoalExtraction);
|
|
9669
9726
|
await validateStrategies(strategies);
|
|
9670
9727
|
await validateSharpDependency(strategies, plugins);
|
|
9671
9728
|
const redteamProvider = await redteamProviderManager.getProvider({ provider });
|
|
@@ -9857,13 +9914,15 @@ async function synthesize({ abortSignal, delay, entities: entitiesOverride, inje
|
|
|
9857
9914
|
if (!Array.isArray(allPluginTests) || allPluginTests.length === 0) logger_default.warn(`Failed to generate tests for ${plugin.id}`);
|
|
9858
9915
|
else {
|
|
9859
9916
|
const testCasesWithMetadata = allPluginTests;
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
const
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9917
|
+
if (needsGoalExtraction) {
|
|
9918
|
+
logger_default.debug(`Extracting goal for ${testCasesWithMetadata.length} tests from ${plugin.id}...`);
|
|
9919
|
+
for (const testCase of testCasesWithMetadata) {
|
|
9920
|
+
const promptVar = testCase.vars?.[injectVar];
|
|
9921
|
+
const prompt = Array.isArray(promptVar) ? promptVar[0] : String(promptVar);
|
|
9922
|
+
const policy = getPolicyText(testCase.metadata);
|
|
9923
|
+
const extractedGoal = await extractGoalFromPrompt(prompt, purpose, plugin.id, policy);
|
|
9924
|
+
testCase.metadata.goal = extractedGoal;
|
|
9925
|
+
}
|
|
9867
9926
|
}
|
|
9868
9927
|
testCases.push(...testCasesWithMetadata);
|
|
9869
9928
|
}
|
|
@@ -9898,13 +9957,15 @@ async function synthesize({ abortSignal, delay, entities: entitiesOverride, inje
|
|
|
9898
9957
|
...t.metadata || {}
|
|
9899
9958
|
}
|
|
9900
9959
|
}));
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
const
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9960
|
+
if (needsGoalExtraction) {
|
|
9961
|
+
logger_default.debug(`Extracting goal for ${testCasesWithMetadata.length} custom tests from ${plugin.id}...`);
|
|
9962
|
+
for (const testCase of testCasesWithMetadata) {
|
|
9963
|
+
const promptVar = testCase.vars?.[injectVar];
|
|
9964
|
+
const prompt = Array.isArray(promptVar) ? promptVar[0] : String(promptVar);
|
|
9965
|
+
const policy = getPolicyText(testCase.metadata);
|
|
9966
|
+
const extractedGoal = await extractGoalFromPrompt(prompt, purpose, plugin.id, policy);
|
|
9967
|
+
testCase.metadata.goal = extractedGoal;
|
|
9968
|
+
}
|
|
9908
9969
|
}
|
|
9909
9970
|
testCases.push(...testCasesWithMetadata);
|
|
9910
9971
|
logger_default.debug(`Added ${customTests.length} custom test cases from ${plugin.id}`);
|
|
@@ -11033,11 +11094,31 @@ function formatDuration(seconds) {
|
|
|
11033
11094
|
* ```
|
|
11034
11095
|
*/
|
|
11035
11096
|
function generateEvalSummary(params) {
|
|
11036
|
-
const { evalId, isRedteam, writeToDatabase, shareableUrl, wantsToShare, hasExplicitDisable, cloudEnabled, activelySharing = false, tokenUsage, successes, failures, errors, duration, maxConcurrency, tracker } = params;
|
|
11097
|
+
const { evalId, isRedteam, writeToDatabase, shareableUrl, wantsToShare, hasExplicitDisable, cloudEnabled, activelySharing = false, tokenUsage, successes, failures, errors, duration, maxConcurrency, tracker, targetErrorStatus } = params;
|
|
11037
11098
|
const lines = [];
|
|
11038
11099
|
const completionType = isRedteam ? "Red team" : "Eval";
|
|
11039
|
-
const
|
|
11100
|
+
const wasAborted = targetErrorStatus != null;
|
|
11101
|
+
let completionMessage;
|
|
11102
|
+
if (wasAborted) {
|
|
11103
|
+
completionMessage = `${chalk.red("✗")} ${completionType} aborted`;
|
|
11104
|
+
if (writeToDatabase) completionMessage += ` (ID: ${chalk.cyan(evalId)})`;
|
|
11105
|
+
} else if (writeToDatabase && shareableUrl) completionMessage = `${chalk.green("✓")} ${completionType} complete: ${shareableUrl}`;
|
|
11106
|
+
else if (writeToDatabase && activelySharing) completionMessage = `${chalk.green("✓")} ${completionType} complete`;
|
|
11107
|
+
else if (writeToDatabase) completionMessage = `${chalk.green("✓")} ${completionType} complete (ID: ${chalk.cyan(evalId)})`;
|
|
11108
|
+
else completionMessage = `${chalk.green("✓")} ${completionType} complete`;
|
|
11040
11109
|
lines.push(completionMessage);
|
|
11110
|
+
if (wasAborted && targetErrorStatus != null) {
|
|
11111
|
+
lines.push("");
|
|
11112
|
+
lines.push(chalk.red.bold("Scan stopped: Target is unavailable and will not recover on retry."));
|
|
11113
|
+
lines.push(chalk.red(` Target returned HTTP ${targetErrorStatus}`));
|
|
11114
|
+
lines.push("");
|
|
11115
|
+
lines.push(chalk.yellow("Possible causes:"));
|
|
11116
|
+
lines.push(chalk.yellow(" • Invalid API key or authentication (401/403)"));
|
|
11117
|
+
lines.push(chalk.yellow(" • Target endpoint does not exist (404)"));
|
|
11118
|
+
lines.push(chalk.yellow(" • Server does not support the request (501)"));
|
|
11119
|
+
lines.push("");
|
|
11120
|
+
lines.push(chalk.cyan("To fix: Check your target configuration and credentials."));
|
|
11121
|
+
}
|
|
11041
11122
|
if (writeToDatabase && !shareableUrl && !wantsToShare && !activelySharing) {
|
|
11042
11123
|
lines.push("");
|
|
11043
11124
|
lines.push(`» View results: ${chalk.green.bold("promptfoo view")}`);
|
|
@@ -11598,6 +11679,7 @@ async function doEval(cmdObj, defaultConfig, defaultConfigPath, evaluateOptions)
|
|
|
11598
11679
|
const isRedteam = Boolean(config.redteam);
|
|
11599
11680
|
const duration = Math.round((Date.now() - startTime) / 1e3);
|
|
11600
11681
|
const tracker = TokenUsageTracker.getInstance();
|
|
11682
|
+
const targetErrorStatus = await evalRecord.findTargetErrorStatus();
|
|
11601
11683
|
const summaryLines = generateEvalSummary({
|
|
11602
11684
|
evalId: evalRecord.id,
|
|
11603
11685
|
isRedteam,
|
|
@@ -11613,7 +11695,8 @@ async function doEval(cmdObj, defaultConfig, defaultConfigPath, evaluateOptions)
|
|
|
11613
11695
|
errors,
|
|
11614
11696
|
duration,
|
|
11615
11697
|
maxConcurrency,
|
|
11616
|
-
tracker
|
|
11698
|
+
tracker,
|
|
11699
|
+
targetErrorStatus
|
|
11617
11700
|
});
|
|
11618
11701
|
if (cmdObj.write && wantsToShare && !canShareEval) {
|
|
11619
11702
|
logger_default.info(summaryLines[0]);
|
|
@@ -11668,7 +11751,7 @@ async function doEval(cmdObj, defaultConfig, defaultConfigPath, evaluateOptions)
|
|
|
11668
11751
|
if (initialization) {
|
|
11669
11752
|
const configPaths = (cmdObj.config || [defaultConfigPath]).filter(Boolean);
|
|
11670
11753
|
if (!configPaths.length) {
|
|
11671
|
-
logger_default.error(
|
|
11754
|
+
logger_default.error(`Could not locate config file(s) to watch. Pass --config path/to/promptfooconfig.yaml or run from a directory containing promptfooconfig.{${DEFAULT_CONFIG_EXTENSIONS.join(",")}}.`);
|
|
11672
11755
|
process.exitCode = 1;
|
|
11673
11756
|
return ret;
|
|
11674
11757
|
}
|
|
@@ -11880,7 +11963,7 @@ async function doRedteamRun(options) {
|
|
|
11880
11963
|
const evalMs = evalResult.evaluationDurationMs ?? 0;
|
|
11881
11964
|
logger_default.info(chalk.gray(`Total scan time: ${formatDuration(totalMs / 1e3)} (generation: ${formatDuration(generationDurationMs / 1e3)}, evaluation: ${formatDuration(evalMs / 1e3)})`));
|
|
11882
11965
|
}
|
|
11883
|
-
logger_default.info(chalk.green("\nRed team scan complete!"));
|
|
11966
|
+
if (evalResult ? await evalResult.findTargetErrorStatus() != null : false) {} else logger_default.info(chalk.green("\nRed team scan complete!"));
|
|
11884
11967
|
if (!evalResult?.shared) if (options.liveRedteamConfig) logger_default.info(chalk.blue(`To view the results, click the ${chalk.bold("View Report")} button or run ${chalk.bold(promptfooCommand("redteam report"))} on the command line.`));
|
|
11885
11968
|
else logger_default.info(chalk.blue(`To view the results, run ${chalk.bold(promptfooCommand("redteam report"))}`));
|
|
11886
11969
|
setLogCallback(null);
|