promptfoo 0.120.24 → 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-55OAHww3.js → ListApp-D3DG0F8h.js} +1 -1
- package/dist/src/{accounts-BwVGYllP.cjs → accounts-BzEY8H3v.cjs} +5 -5
- package/dist/src/{accounts-BOlMHrvn.js → accounts-DHHiXsy6.js} +6 -6
- package/dist/src/{accounts-DxR9x_En.js → accounts-R3gfCR_g.js} +5 -5
- package/dist/src/{agentic-utils-t9-1raty.js → agentic-utils-D6_gzOUF.js} +3 -3
- package/dist/src/{agents-DMpQ860j.cjs → agents-C7BiinFI.cjs} +7 -7
- package/dist/src/{agents-9Z7pO8yx.js → agents-Cao4i7AX.js} +8 -8
- package/dist/src/{agents-DjExVR3v.js → agents-Cnph5GLD.js} +2 -2
- package/dist/src/{agents-CI0Ad69d.cjs → agents-CwM7re15.cjs} +5 -5
- package/dist/src/{agents-BwI-Tm5m.js → agents-DETIQHqF.js} +7 -7
- package/dist/src/{agents-CRAmwjo-.js → agents-DYIT-hQy.js} +6 -6
- package/dist/src/{agents-BbIpDhgp.js → agents-GiUianme.js} +5 -5
- package/dist/src/{agents-yL5DzIKY.js → agents-v4cW_ZgC.js} +2 -2
- package/dist/src/{aimlapi-xHHqwNg8.js → aimlapi-CMJpKK-B.js} +13 -13
- package/dist/src/{aimlapi-BM9P45Bp.js → aimlapi-DMF6v_vb.js} +15 -15
- package/dist/src/{aimlapi-DKo7IxJg.cjs → aimlapi-DoGLcQW_.cjs} +14 -14
- package/dist/src/{aimlapi-ivzDkqbs.js → aimlapi-DtSf1ykJ.js} +2 -2
- 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-B3QGL6Nl.cjs → audio-BWjyvHn9.cjs} +4 -4
- package/dist/src/{audio-C-1oBiVZ.js → audio-BrJBFN2b.js} +4 -4
- package/dist/src/{audio-DnfDVjhL.js → audio-DUH4q0Xq.js} +5 -5
- package/dist/src/{audio-DQWHfAr8.js → audio-U580w8jM.js} +2 -2
- package/dist/src/{base-DHam07ip.js → base-BaXmtXYp.js} +3 -3
- package/dist/src/{base-BjsgxJp9.js → base-Dtp8b4_N.js} +3 -3
- package/dist/src/{base-Bso8ccGu.cjs → base-f71xxWai.cjs} +3 -3
- package/dist/src/{blobs-DOdc-E8L.cjs → blobs-673H0jCl.cjs} +3 -3
- package/dist/src/{blobs-Dcm272OH.js → blobs-C9J2mVgo.js} +3 -3
- package/dist/src/{blobs-MlVQyoSc.js → blobs-kt8v3UyH.js} +3 -3
- package/dist/src/{cache-KNsTJLKP.cjs → cache-7xULbvt3.cjs} +35 -8
- package/dist/src/{cache-BMl3AIo5.js → cache-BLLayYEN.js} +24 -9
- package/dist/src/{cache-B0ptF7sO.js → cache-BUPcq0Ad.js} +3 -3
- package/dist/src/cache-CVfRb-HD.cjs +6 -0
- package/dist/src/{cache-DPztwHxt.js → cache-O4EuX2JV.js} +4 -4
- package/dist/src/{cache-DHm8Pc8l.js → cache-mIszOnuz.js} +5 -22
- package/dist/src/{chat-DOQIJx7O.cjs → chat-C4zqjObh.cjs} +10 -10
- package/dist/src/{chat-DDGU7Tik.js → chat-C8Ei4f87.js} +9 -9
- package/dist/src/{chat-BnzIuoTQ.js → chat-CgyGj2hC.js} +12 -12
- package/dist/src/{chat-BRMJOuCv.js → chat-Cpz3O-Xl.js} +14 -14
- package/dist/src/{chat-CVOyOBYk.js → chat-DIywASPG.js} +11 -11
- package/dist/src/{chat-CrnXMbvh.cjs → chat-Fl6TZJRS.cjs} +13 -13
- package/dist/src/{chat-D8GcWK9l.js → chat-XPN9YHhr.js} +2 -2
- package/dist/src/{chatkit-IWIuhxFE.js → chatkit-DEls11hE.js} +4 -4
- package/dist/src/{chatkit-DlOZ-eNb.js → chatkit-DIrJX8xk.js} +4 -4
- package/dist/src/{chatkit-CcktkleS.js → chatkit-Dpxrq4eD.js} +2 -2
- package/dist/src/{chatkit-yeVtURUi.cjs → chatkit-e25Ziu17.cjs} +4 -4
- package/dist/src/{claude-agent-sdk-BiMgSH9g.js → claude-agent-sdk-6-xTaLwM.js} +48 -19
- package/dist/src/{claude-agent-sdk-Yj9Hq0cH.cjs → claude-agent-sdk-BzxF6NIJ.cjs} +48 -19
- package/dist/src/{claude-agent-sdk-rVqlUIJl.js → claude-agent-sdk-CmkTnKGH.js} +49 -20
- package/dist/src/{claude-agent-sdk-yid1kGsL.js → claude-agent-sdk-rXCBLK_o.js} +40 -11
- package/dist/src/{cloud-ByJVRSQI.js → cloud-BMbRVJFw.js} +3 -3
- package/dist/src/cloud-CZ4hytdm.js +5 -0
- package/dist/src/{cloudflare-ai-DmJZcvVx.cjs → cloudflare-ai-BAQ0u_dg.cjs} +14 -14
- package/dist/src/{cloudflare-ai-CWKYPCCF.js → cloudflare-ai-CUg4BTcj.js} +13 -13
- package/dist/src/{cloudflare-ai-goDJ5bwr.js → cloudflare-ai-CobxMTR4.js} +15 -15
- package/dist/src/{cloudflare-ai-CdKv38f6.js → cloudflare-ai-Z9X219gp.js} +2 -2
- package/dist/src/{cloudflare-gateway-BW8hcdB0.cjs → cloudflare-gateway-C0sgfr_z.cjs} +15 -15
- package/dist/src/{cloudflare-gateway-CDCOS1Os.js → cloudflare-gateway-D2_yi-Fh.js} +16 -16
- package/dist/src/{cloudflare-gateway-Dz_HCMGY.js → cloudflare-gateway-Djf3F3_H.js} +2 -2
- package/dist/src/{cloudflare-gateway-gzmTsXcd.js → cloudflare-gateway-_itGuXry.js} +14 -14
- package/dist/src/{codex-sdk-BlvhxMr0.js → codex-sdk-BASDNkIl.js} +90 -34
- package/dist/src/{codex-sdk-BC5qbCjh.js → codex-sdk-dSnGdgIp.js} +92 -36
- package/dist/src/{codex-sdk-CBpm53B8.js → codex-sdk-ibXwdglL.js} +91 -35
- package/dist/src/{codex-sdk-Cf5_CQch.cjs → codex-sdk-wTEpMM_X.cjs} +92 -36
- package/dist/src/{cometapi-DoaO5SLq.js → cometapi-B01btbfb.js} +16 -16
- package/dist/src/{cometapi-BUKGSUCw.js → cometapi-ChAaRjg5.js} +14 -14
- package/dist/src/{cometapi-C6BSw9k3.js → cometapi-DHUAH6nK.js} +2 -2
- package/dist/src/{cometapi-B3TzpkNI.cjs → cometapi-JbvOJSCO.cjs} +15 -15
- package/dist/src/{completion-BLe7SUA4.js → completion-BBJ6zmG3.js} +6 -6
- package/dist/src/{completion-1RAiLcwi.js → completion-D9_MDlnd.js} +6 -6
- package/dist/src/{completion-D6BTVt6e.cjs → completion-DDyL3Cb2.cjs} +6 -6
- package/dist/src/{docker-CkOzlD1W.js → docker-BuButc4D.js} +15 -15
- package/dist/src/{docker-BWsSX8Pn.cjs → docker-Ckw-j7Rr.cjs} +14 -14
- package/dist/src/{docker-CMf5SGLq.js → docker-JAAubMw3.js} +13 -13
- package/dist/src/{docker-C0AzMsuf.js → docker-vnOg96gi.js} +2 -2
- package/dist/src/errors-DnGCbnx8.js +36 -0
- package/dist/src/{esm-gWVPXn3r.cjs → esm-BQkx5roy.cjs} +2 -2
- package/dist/src/{esm-Lh6czAFT.js → esm-CYhseqj4.js} +2 -2
- package/dist/src/{esm-D40XsWlR.js → esm-rDtG_2rg.js} +2 -2
- package/dist/src/eval-CKHWqG9f.js +16 -0
- package/dist/src/{eval-WaSg64w3.js → eval-CYrbG57o.js} +106 -29
- package/dist/src/{evalResult-CGrGU_cG.js → evalResult-6JaUIStC.js} +7 -7
- package/dist/src/{evalResult-C_UM63nn.js → evalResult-COsVttMA.js} +7 -7
- package/dist/src/evalResult-CxTP-LMm.cjs +11 -0
- package/dist/src/evalResult-CzLURDcP.js +13 -0
- package/dist/src/{evalResult-BU4huold.cjs → evalResult-DlRfu_Rq.cjs} +7 -7
- package/dist/src/evalResult-DyttNQ_G.js +11 -0
- package/dist/src/evaluator-0PvfeBYh.js +38 -0
- package/dist/src/{evaluator-gmF3Vddp.js → evaluator-3EJCMTs0.js} +75 -49
- package/dist/src/{extractor-D-RM2m6A.cjs → extractor-DbhlYEeo.cjs} +23 -6
- package/dist/src/{extractor-Da8IxCeS.js → extractor-Hs7la_19.js} +23 -6
- package/dist/src/{extractor-BA90EtLq.js → extractor-LSYjrhK0.js} +23 -6
- package/dist/src/{fetch-BIfcW-Fd.js → fetch-18MuNu9i.js} +21 -7
- package/dist/src/{fetch-CW9GabAi.js → fetch-Bi0o-fdp.js} +2 -2
- package/dist/src/fetch-CMptBDVg.cjs +4 -0
- package/dist/src/fetch-DAZkv3gV.js +6 -0
- package/dist/src/{fetch-Mb7SbeM-.js → fetch-SRsE6Ctl.js} +21 -7
- package/dist/src/{fetch-MvWxCS5U.cjs → fetch-ZMn_oemb.cjs} +21 -7
- package/dist/src/{fileExtensions-CzcPkiKZ.js → fileExtensions-BpuMmaFL.js} +1 -1
- package/dist/src/{formatDuration-CCiZ-wBY.js → formatDuration-Doo0xq-z.js} +1 -1
- package/dist/src/{genaiTracer-BQ8AmajD.cjs → genaiTracer-CQlpZkrp.cjs} +2 -2
- package/dist/src/{genaiTracer-foKtbVa2.js → genaiTracer-CqNnnXrE.js} +1 -1
- package/dist/src/graders-BCytzXrb.js +34 -0
- package/dist/src/{graders-CwtelA9k.js → graders-BaMCwIKp.js} +212 -91
- package/dist/src/graders-CGZQShfJ.cjs +33 -0
- package/dist/src/{graders-2dabIkXs.cjs → graders-DzUUnUjC.cjs} +212 -91
- package/dist/src/{graders-BscQ6O1Q.js → graders-QsALpIdy.js} +211 -90
- package/dist/src/graders-spkuVC-E.js +36 -0
- package/dist/src/{image-Dv0o-Ab7.js → image-BXt_7u0v.js} +4 -4
- package/dist/src/{image-B6TV9l0v.js → image-BiEVdpdP.js} +7 -7
- package/dist/src/{image-DS9hlgSc.cjs → image-C3BjJUAU.cjs} +7 -7
- package/dist/src/{image-_jKUeeh9.js → image-COCWy5dX.js} +2 -2
- package/dist/src/{image-DqElR73O.cjs → image-D10zEe1f.cjs} +4 -4
- package/dist/src/{image-BVEVjrwl.js → image-DB4sHxdJ.js} +5 -5
- package/dist/src/{image-C1i3NoZo.js → image-mhAGP07h.js} +7 -7
- package/dist/src/index.cjs +305 -112
- package/dist/src/index.d.cts +137 -3
- package/dist/src/index.d.ts +137 -3
- package/dist/src/index.js +304 -111
- package/dist/src/{interactiveCheck-CjK2R4rB.js → interactiveCheck-DU-MAhp5.js} +2 -2
- package/dist/src/{knowledgeBase-K5fJN2kC.cjs → knowledgeBase-Bnb00xKs.cjs} +8 -8
- package/dist/src/{knowledgeBase-D-xthvn0.js → knowledgeBase-CMvMlLZR.js} +9 -9
- package/dist/src/{knowledgeBase-DJZHeJqg.js → knowledgeBase-DotRBzUE.js} +2 -2
- package/dist/src/{knowledgeBase-BSs2ldSR.js → knowledgeBase-XJQ0Qyez.js} +8 -8
- package/dist/src/{litellm-kPhaZkzz.js → litellm-BECdjOTx.js} +3 -3
- package/dist/src/{litellm-uRLukY7s.cjs → litellm-BrnZhMcL.cjs} +15 -15
- package/dist/src/{litellm-DH_rVIOd.js → litellm-CHrRmPAe.js} +16 -16
- package/dist/src/{litellm-DoXGHlpD.js → litellm-CrLJrPIm.js} +14 -14
- package/dist/src/{logger-CMp-NS-e.cjs → logger-BdZ-IqBc.cjs} +5 -2
- package/dist/src/{logger-Bzi5o47S.js → logger-BotXmWKW.js} +5 -2
- package/dist/src/{logger-q5I8CByj.js → logger-w8Ozp0Td.js} +5 -2
- package/dist/src/{luma-ray-B3GiVpuq.js → luma-ray-BOeX-h0M.js} +10 -10
- package/dist/src/{luma-ray-CPISsLu-.js → luma-ray-C-w6EsJm.js} +2 -2
- package/dist/src/{luma-ray-BrWrKIIB.cjs → luma-ray-C0RkI3lt.cjs} +10 -10
- package/dist/src/{luma-ray-gyI_GEy2.js → luma-ray-DgKLS0BF.js} +11 -11
- package/dist/src/main.js +3260 -2537
- package/dist/src/{messages-CJgEjRQF.js → messages-CDZYGNlS.js} +13 -10
- package/dist/src/{messages-BMkwrfmt.js → messages-D61tPFQo.js} +14 -11
- package/dist/src/{messages-B5HsO_dM.cjs → messages-DXV3Qh8_.cjs} +14 -11
- package/dist/src/{meteor-CBciquOS.js → meteor-Dj8cTkU_.js} +1 -1
- package/dist/src/{meteor-0cLf9TIn.js → meteor-P2rUE-Uz.js} +1 -1
- package/dist/src/{meteor-BQ6Ws9k2.js → meteor-SLNTgmXm.js} +2 -2
- package/dist/src/{meteor-DRuEfzuQ.cjs → meteor-odmwVbyG.cjs} +1 -1
- package/dist/src/{nova-reel-B5SOonY2.js → nova-reel-Bk5npr2q.js} +11 -11
- package/dist/src/{nova-reel-CT9ZuhJ3.js → nova-reel-C2LFfVTf.js} +2 -2
- package/dist/src/{nova-reel-ByTx85ed.cjs → nova-reel-D9FXq3Mt.cjs} +10 -10
- package/dist/src/{nova-reel-ChM7WaHR.js → nova-reel-DtCjbD5O.js} +10 -10
- package/dist/src/{nova-sonic-D4M3kKYu.js → nova-sonic-BXRfQyF-.js} +8 -8
- package/dist/src/{nova-sonic-C-H3eDvL.cjs → nova-sonic-BoRSY_U6.cjs} +7 -7
- package/dist/src/{nova-sonic-DgifpOKF.js → nova-sonic-CgaWLDM1.js} +7 -7
- package/dist/src/{nova-sonic-BqP59oOu.js → nova-sonic-D_qERM-K.js} +2 -2
- package/dist/src/{openai-BjpdxIOG.cjs → openai-Bigwjgo1.cjs} +2 -2
- package/dist/src/{openai-Cv9pEKxp.js → openai-CT5fwbve.js} +2 -2
- package/dist/src/{openai-CitF-gEN.js → openai-Dz3surb_.js} +2 -2
- package/dist/src/openclaw-B6XY2kUf.js +526 -0
- package/dist/src/openclaw-CpPrXwf6.js +524 -0
- package/dist/src/openclaw-DDSfq5fp.cjs +528 -0
- package/dist/src/openclaw-dHLcXUWZ.js +511 -0
- package/dist/src/{opencode-sdk-Dakn4QMp.js → opencode-sdk-CImWVqy9.js} +7 -7
- package/dist/src/{opencode-sdk-BcLvVMV-.js → opencode-sdk-CuCztr4P.js} +6 -6
- package/dist/src/{opencode-sdk-z7KKOCdB.js → opencode-sdk-DhcfRbBH.js} +3 -3
- package/dist/src/{opencode-sdk-Cqszt4br.cjs → opencode-sdk-mqF-Oj3f.cjs} +6 -6
- package/dist/src/{otlpReceiver-BvmMgacx.cjs → otlpReceiver-B6Xo4KZM.cjs} +6 -6
- package/dist/src/{otlpReceiver-DRNetlJH.js → otlpReceiver-BO0rbDzh.js} +6 -6
- package/dist/src/{otlpReceiver-Bhj_vnzl.js → otlpReceiver-Dg817agV.js} +6 -6
- package/dist/src/{otlpReceiver-Cpnk-Hjf.js → otlpReceiver-DmRb0NBj.js} +2 -2
- package/dist/src/{providerRegistry-D32Lt9vp.js → providerRegistry-Xf0qdqGQ.js} +2 -2
- package/dist/src/{providerRegistry-HGQd2MF6.cjs → providerRegistry-lc7a7utN.cjs} +2 -2
- package/dist/src/{providerRegistry-BdKWcUa8.js → providerRegistry-wCWd7sKQ.js} +2 -2
- package/dist/src/providers-BMZZmPBJ.cjs +32 -0
- package/dist/src/{providers-BWoVY_Wz.cjs → providers-BNKVY53V.cjs} +294 -782
- package/dist/src/{providers-Co_FGgH8.js → providers-BiNq_Iyc.js} +281 -769
- package/dist/src/{providers-CUCHJCHD.js → providers-BlEhY5mi.js} +286 -779
- package/dist/src/providers-CQQrNaJk.js +32 -0
- package/dist/src/providers-Ck8HyrC-.js +34 -0
- package/dist/src/{pythonUtils-rOCm9w_5.cjs → pythonUtils-DZ6EbdY4.cjs} +3 -3
- package/dist/src/{pythonUtils-B9JA-gsC.js → pythonUtils-r1uBuA0n.js} +3 -3
- package/dist/src/{pythonUtils-eNq6Wsfr.js → pythonUtils-vMlk9Qp5.js} +3 -3
- package/dist/src/{quiverai-BpWtOEQZ.cjs → quiverai-BNfIwKCO.cjs} +13 -13
- package/dist/src/{quiverai-Cj-PUa3p.js → quiverai-BQigKdIH.js} +14 -14
- package/dist/src/{quiverai-BN8OVvDE.js → quiverai-Bfy2WnE2.js} +12 -12
- package/dist/src/{quiverai-D5MSsd2c.js → quiverai-CedIP0PJ.js} +2 -2
- package/dist/src/{render-D2710HbA.js → render-CAZvKKkB.js} +4 -4
- package/dist/src/responses-DLLjADw5.js +653 -0
- package/dist/src/responses-TsdODUpm.js +654 -0
- package/dist/src/responses-zOtKtnY_.cjs +671 -0
- package/dist/src/{rubyUtils-Dn6MGcsk.js → rubyUtils-BtjlqyXt.js} +3 -3
- package/dist/src/{rubyUtils-LBsk3zIm.js → rubyUtils-Cs35SDYa.js} +3 -3
- package/dist/src/rubyUtils-D7--T12C.js +6 -0
- package/dist/src/{rubyUtils-rnCVDgH-.cjs → rubyUtils-DCVaJ3mc.cjs} +3 -3
- package/dist/src/rubyUtils-DRRiMFV2.js +5 -0
- package/dist/src/rubyUtils-vb8OYFC-.cjs +5 -0
- package/dist/src/{sagemaker-C8MeZIkH.js → sagemaker-BcgLu0U4.js} +18 -18
- package/dist/src/{sagemaker-4ukMNSN0.js → sagemaker-CLdUAv5z.js} +17 -17
- package/dist/src/{sagemaker-DyVHy2BW.js → sagemaker-Du4LIR97.js} +2 -2
- package/dist/src/{sagemaker-DB3Eojau.cjs → sagemaker-DwNnEVYt.cjs} +17 -17
- package/dist/src/{scanner-C28XVEq2.js → scanner-Dyw21Wg_.js} +12 -12
- package/dist/src/server/index.js +1818 -605
- package/dist/src/server-BUbS0Qfh.js +6 -0
- package/dist/src/{server-BF3HkMhe.js → server-CbMTRQkg.js} +8 -6
- package/dist/src/{server-CSbLW-UI.cjs → server-CgUQ25qW.cjs} +8 -6
- package/dist/src/{server-mycZbUH8.js → server-DWmZLfCy.js} +10 -7
- package/dist/src/server-XpGXFHkS.cjs +6 -0
- package/dist/src/server-gfOx5Zrk.js +8 -0
- package/dist/src/{signal-DM_SPNmi.js → signal-Bl32q42d.js} +3 -3
- package/dist/src/{slack-Ed1yyt_j.js → slack-BfdBx2tO.js} +2 -2
- package/dist/src/{slack-D1F9Y7CH.cjs → slack-BtMkB6xP.cjs} +2 -2
- package/dist/src/{slack-DkAF58Tr.js → slack-DPqj42Ts.js} +2 -2
- package/dist/src/{slack-BK312SXM.js → slack-OZYxoVON.js} +2 -2
- package/dist/src/{store-CT_e5OZX.js → store-2ocbYY9D.js} +3 -3
- package/dist/src/store-5u2yriTV.js +7 -0
- package/dist/src/{store-BpumNYCl.cjs → store-BqwfFEyF.cjs} +3 -3
- package/dist/src/{store-BFLqwuc_.js → store-D4gdn9ih.js} +3 -3
- package/dist/src/store-D_lq_8oQ.js +6 -0
- package/dist/src/store-m5KT6Ly7.cjs +6 -0
- package/dist/src/{tables-Dansasnu.cjs → tables-B9E1kRp-.cjs} +3 -3
- package/dist/src/{tables-BjaApSAB.js → tables-C7TT2XVn.js} +3 -3
- package/dist/src/{tables-Dwexr5Z6.js → tables-D-NSwNIb.js} +3 -3
- package/dist/src/telemetry-5RHFoCJh.js +6 -0
- package/dist/src/{telemetry-MVkZQxt9.js → telemetry-BXyVqyAg.js} +5 -4
- package/dist/src/{telemetry-DFDFKdnr.cjs → telemetry-D0_yFdtU.cjs} +5 -4
- package/dist/src/{telemetry-Ds5Nn81l.js → telemetry-DZ_7PaVq.js} +5 -4
- package/dist/src/telemetry-Do8wMnA-.js +8 -0
- package/dist/src/telemetry-LojxPoFq.cjs +6 -0
- package/dist/src/{text-PYISqVm1.cjs → text-DF2hMKdg.cjs} +1 -1
- package/dist/src/{text-DuYSUYPB.js → text-DgMr_tiM.js} +1 -1
- package/dist/src/{text-Dx0GJOCN.js → text-Dm78AVGG.js} +1 -1
- package/dist/src/{tokenUsageUtils-BtZd3sP7.cjs → tokenUsageUtils-CXhxVj72.cjs} +9 -4
- package/dist/src/{tokenUsageUtils-DoinwgKF.js → tokenUsageUtils-DmZSD2eU.js} +9 -4
- package/dist/src/{tokenUsageUtils-cFdLMERB.js → tokenUsageUtils-FZd5O_4A.js} +9 -4
- package/dist/src/{transcription-Cp19m_Mt.js → transcription-C-M81iDA.js} +2 -2
- package/dist/src/{transcription-CLRpAg07.js → transcription-CYuY5sFO.js} +10 -10
- package/dist/src/{transcription-D8ifIKOv.js → transcription-Ch7S-LWw.js} +11 -11
- package/dist/src/{transcription-CXXFEVM_.cjs → transcription-FNIz3YOe.cjs} +10 -10
- package/dist/src/transform-8eGmaH-7.js +7 -0
- package/dist/src/transform-BRVvWaG4.cjs +6 -0
- package/dist/src/{transform-Bn-lgBE2.js → transform-CoP2bJ7P.js} +44 -5
- package/dist/src/{transform-BFPYuBaW.js → transform-CqTFr7KR.js} +5 -5
- package/dist/src/{transform-DvQWeBSR.js → transform-D8dILpfZ.js} +4 -4
- package/dist/src/{transform-BUrxadlA.js → transform-DMaxQwDx.js} +44 -5
- package/dist/src/transform-GybT0X0u.js +8 -0
- package/dist/src/{transform-DshYLyBq.cjs → transform-Kd6u-oNm.cjs} +4 -4
- package/dist/src/{transform-Bw1IstDE.cjs → transform-ivxEY4f7.cjs} +55 -4
- package/dist/src/{transformersAvailability-BaoWHpu1.cjs → transformersAvailability-Bkep3ka7.cjs} +1 -1
- package/dist/src/{transformersAvailability-Dhh45n5P.js → transformersAvailability-DEU2naS1.js} +1 -1
- package/dist/src/{transformersAvailability-DtpwoeFC.js → transformersAvailability-DkAWaK5B.js} +1 -1
- package/dist/src/{transformersAvailability-O2YaCv9Z.js → transformersAvailability-DwmezkVe.js} +1 -1
- package/dist/src/{types-B-XUqfNs.cjs → types-BIfttHrT.cjs} +22 -2
- package/dist/src/{types-BsU_PxR3.js → types-DMVjYLpx.js} +16 -2
- package/dist/src/{types-CgrxBFgm.js → types-t52w-XsS.js} +19 -3
- package/dist/src/{util-M2MoNCUR.js → util-BSh4a_Q8.js} +7 -7
- package/dist/src/{util-DTJWKLkl.cjs → util-C08Kns6-.cjs} +18 -4
- package/dist/src/{util-DHBpsbZE.js → util-CUEt0Vum.js} +18 -4
- package/dist/src/{util-Bnw6EyZN.js → util-Cl0zfT3V.js} +18 -4
- package/dist/src/{util-C7A-PlKK.cjs → util-DUYOvxAy.cjs} +6 -6
- package/dist/src/{util-WYC3rB_p.js → util-DiCePfDu.js} +6 -6
- package/dist/src/{util-CV99ps44.cjs → util-DkFTvieG.cjs} +17 -5
- package/dist/src/{util-CfepsNVK.js → util-mJ58qbbw.js} +17 -5
- package/dist/src/{util-BZaMVBMq.js → util-vjscpUzy.js} +17 -5
- package/dist/src/{utils-BryuD3vq.js → utils-CVzb4YiI.js} +3 -3
- package/dist/src/{utils-Dezi3MBH.cjs → utils-DFaZa6Rf.cjs} +3 -3
- package/dist/src/{utils-GiyI2K4P.js → utils-JaY9veb5.js} +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +75 -77
- package/dist/src/app/assets/index-07dbAcWK.js +0 -427
- package/dist/src/app/assets/index-DnEcCQgk.css +0 -1
- package/dist/src/app/assets/vendor-react-DHoaNLma.js +0 -4
- package/dist/src/cache-BujOdYlc.cjs +0 -6
- package/dist/src/cloud-BHYz0XkH.js +0 -5
- package/dist/src/eval-0IFf8hON.js +0 -16
- package/dist/src/evalResult-BCCv6FXj.js +0 -13
- package/dist/src/evalResult-C8iVgVvr.js +0 -11
- package/dist/src/evalResult-CqFeWKYx.cjs +0 -11
- package/dist/src/evaluator-DwS5NAEj.js +0 -37
- package/dist/src/fetch-BH9KSaUC.cjs +0 -4
- package/dist/src/fetch-BL6kqunF.js +0 -6
- package/dist/src/graders-BK3LuhJ8.cjs +0 -32
- package/dist/src/graders-Bpjtip-E.js +0 -35
- package/dist/src/graders-KIf6Uej3.js +0 -33
- package/dist/src/providers-41mSodR_.js +0 -31
- package/dist/src/providers-CiZCpIxz.cjs +0 -31
- package/dist/src/providers-G531909f.js +0 -33
- package/dist/src/rubyUtils-BLd6EE1u.cjs +0 -5
- package/dist/src/rubyUtils-CVELPvUH.js +0 -6
- package/dist/src/rubyUtils-_t9Gmf7U.js +0 -5
- package/dist/src/server-Bc4T4XDt.cjs +0 -6
- package/dist/src/server-CMyxJ7ct.js +0 -6
- package/dist/src/server-D9FuxNYE.js +0 -8
- package/dist/src/store-CrMinjmN.cjs +0 -6
- package/dist/src/store-EaWZOoxz.js +0 -7
- package/dist/src/store-KXWnHB15.js +0 -6
- package/dist/src/telemetry-BXD2mCyr.cjs +0 -6
- package/dist/src/telemetry-CYiBm56v.js +0 -8
- package/dist/src/telemetry-lICYKIMB.js +0 -6
- package/dist/src/transform-DZI2t8-9.js +0 -8
- package/dist/src/transform-DZUV3qpO.js +0 -7
- package/dist/src/transform-XcotjzZX.cjs +0 -6
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as getEnvString, E as isCI, O as cliState_default, S as getEnvInt, T as getMaxEvalTimeMs, _ as summarizeEvaluateResultForLogging, b as getEnvBool, f as extractJsonObjects, g as safeJsonStringify, o as logger_default, p as getAjv, w as getEvalTimeoutMs } from "./logger-
|
|
3
|
-
import { F as FILE_METADATA_KEY, P as VERSION, h as isPromptfooSampleTarget, l as sleep, r as fetchWithRetries, v as parseChatPrompt, w as DEFAULT_MAX_CONCURRENCY } from "./fetch-
|
|
2
|
+
import { C as getEnvString, E as isCI, O as cliState_default, S as getEnvInt, T as getMaxEvalTimeMs, _ as summarizeEvaluateResultForLogging, b as getEnvBool, f as extractJsonObjects, g as safeJsonStringify, o as logger_default, p as getAjv, w as getEvalTimeoutMs } from "./logger-BotXmWKW.js";
|
|
3
|
+
import { F as FILE_METADATA_KEY, P as VERSION, h as isPromptfooSampleTarget, l as sleep, r as fetchWithRetries, v as parseChatPrompt, w as DEFAULT_MAX_CONCURRENCY } from "./fetch-SRsE6Ctl.js";
|
|
4
4
|
import { t as invariant } from "./invariant-DT20jrBd.js";
|
|
5
|
-
import { r as telemetry_default } from "./telemetry-
|
|
6
|
-
import { d as isGradingResult, p as isApiProvider, s as ResultFailureReason } from "./types-
|
|
7
|
-
import { c as promptYesNo } from "./server-
|
|
8
|
-
import { A as renderPrompt, E as isBasicRefusal, F as TokenUsageTracker, I as createRateLimitRegistry, K as
|
|
9
|
-
import { o as getCache } from "./cache-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { t as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
5
|
+
import { r as telemetry_default } from "./telemetry-BXyVqyAg.js";
|
|
6
|
+
import { d as isGradingResult, p as isApiProvider, s as ResultFailureReason } from "./types-t52w-XsS.js";
|
|
7
|
+
import { c as promptYesNo } from "./server-DWmZLfCy.js";
|
|
8
|
+
import { A as renderPrompt, E as isBasicRefusal, F as TokenUsageTracker, G as VertexChatProvider, I as createRateLimitRegistry, K as AIStudioChatProvider, L as createProviderRateLimitOptions, M as isPackagePath, N as loadFromPackage, P as redteamProviderManager, j as runExtensionHook, k as collectFileMetadata, u as GoogleLiveProvider, v as checkExfilTracking, w as getSessionId } from "./providers-BlEhY5mi.js";
|
|
9
|
+
import { o as getCache } from "./cache-mIszOnuz.js";
|
|
10
|
+
import { n as isNonTransientHttpStatus } from "./errors-DnGCbnx8.js";
|
|
11
|
+
import { i as isJavascriptFile } from "./fileExtensions-BpuMmaFL.js";
|
|
12
|
+
import { E as parseFileUrl, F as isAnthropicProvider, I as isGoogleProvider, L as isOpenAiProvider, R as isProviderAllowed, T as loadFunction, g as maybeLoadToolsFromExternalFile, w as getNunjucksEngine } from "./util-BSh4a_Q8.js";
|
|
13
|
+
import { r as runPython } from "./pythonUtils-r1uBuA0n.js";
|
|
14
|
+
import { n as transform, r as getProcessShim, t as TransformInputType } from "./transform-CqTFr7KR.js";
|
|
15
|
+
import { $ as matchesSearchRubric, B as getAndCheckProvider, G as matchesContextFaithfulness, H as matchesAnswerRelevance, J as matchesFactuality, K as matchesContextRecall, Q as matchesPiScore, R as callProviderWithContext, U as matchesClassification, V as loadRubricPrompt, W as matchesClosedQa, X as matchesLlmRubric, Y as matchesGEval, Z as matchesModeration, at as DefaultSuggestionsProvider, dt as getFinalTest, et as matchesSelectBest, ft as loadFromJavaScriptFile, it as getDefaultProviders, lt as SUGGEST_PROMPTS_SYSTEM_MESSAGE, mt as resolveContext, n as getGraderById, nt as selectMaxScore, pt as processFileReference, q as matchesContextRelevance, tt as matchesSimilarity, ut as coerceString, z as fail } from "./graders-BaMCwIKp.js";
|
|
16
|
+
import { i as generateIdFromPrompt } from "./utils-JaY9veb5.js";
|
|
17
|
+
import { t as extractAndStoreBinaryData } from "./extractor-LSYjrhK0.js";
|
|
18
|
+
import { t as OpenAiChatCompletionProvider } from "./chat-DIywASPG.js";
|
|
19
|
+
import { a as createEmptyTokenUsage, i as createEmptyAssertions, n as accumulateResponseTokenUsage, o as normalizeTokenUsage, r as accumulateTokenUsage, t as accumulateAssertionTokenUsage } from "./tokenUsageUtils-DmZSD2eU.js";
|
|
20
|
+
import { m as validateFunctionCall } from "./transform-CoP2bJ7P.js";
|
|
21
|
+
import { l as validateFunctionCall$1 } from "./util-CUEt0Vum.js";
|
|
22
|
+
import { n as getTraceStore } from "./store-D4gdn9ih.js";
|
|
23
|
+
import { t as providerRegistry } from "./providerRegistry-Xf0qdqGQ.js";
|
|
24
|
+
import { n as runRuby } from "./rubyUtils-BtjlqyXt.js";
|
|
25
|
+
import { a as getActualPromptWithFallback, r as updateSignalFile } from "./signal-Bl32q42d.js";
|
|
25
26
|
import chalk from "chalk";
|
|
26
27
|
import fs, { createWriteStream } from "fs";
|
|
27
28
|
import path from "path";
|
|
@@ -259,7 +260,7 @@ async function startOtlpReceiverIfNeeded(testSuite) {
|
|
|
259
260
|
telemetry_default.record("feature_used", { feature: "tracing" });
|
|
260
261
|
try {
|
|
261
262
|
logger_default.debug("[EvaluatorTracing] Tracing configuration detected, starting OTLP receiver");
|
|
262
|
-
const { startOTLPReceiver } = await import("./otlpReceiver-
|
|
263
|
+
const { startOTLPReceiver } = await import("./otlpReceiver-Dg817agV.js");
|
|
263
264
|
const port = testSuite.tracing.otlp.http.port || 4318;
|
|
264
265
|
const host = testSuite.tracing.otlp.http.host || "127.0.0.1";
|
|
265
266
|
logger_default.debug(`[EvaluatorTracing] Starting OTLP receiver on ${host}:${port}`);
|
|
@@ -282,7 +283,7 @@ async function startOtlpReceiverIfNeeded(testSuite) {
|
|
|
282
283
|
async function stopOtlpReceiverIfNeeded() {
|
|
283
284
|
if (otlpReceiverStarted) try {
|
|
284
285
|
logger_default.debug("[EvaluatorTracing] Stopping OTLP receiver");
|
|
285
|
-
const { stopOTLPReceiver } = await import("./otlpReceiver-
|
|
286
|
+
const { stopOTLPReceiver } = await import("./otlpReceiver-Dg817agV.js");
|
|
286
287
|
await stopOTLPReceiver();
|
|
287
288
|
otlpReceiverStarted = false;
|
|
288
289
|
logger_default.info("[EvaluatorTracing] OTLP receiver stopped successfully");
|
|
@@ -317,7 +318,7 @@ async function generateTraceContextIfNeeded(test, evaluateOptions, testIdx, prom
|
|
|
317
318
|
}
|
|
318
319
|
if (!tracingEnabled) return null;
|
|
319
320
|
logger_default.debug("[EvaluatorTracing] Importing trace store");
|
|
320
|
-
const { getTraceStore } = await import("./store-
|
|
321
|
+
const { getTraceStore } = await import("./store-5u2yriTV.js");
|
|
321
322
|
const traceStore = getTraceStore();
|
|
322
323
|
const traceId = generateTraceId();
|
|
323
324
|
const spanId = generateSpanId();
|
|
@@ -2685,7 +2686,7 @@ const ASSERTION_HANDLERS = {
|
|
|
2685
2686
|
"llm-rubric": handleLlmRubric,
|
|
2686
2687
|
meteor: async (params) => {
|
|
2687
2688
|
try {
|
|
2688
|
-
const { handleMeteorAssertion } = await import("./meteor-
|
|
2689
|
+
const { handleMeteorAssertion } = await import("./meteor-P2rUE-Uz.js");
|
|
2689
2690
|
return handleMeteorAssertion(params);
|
|
2690
2691
|
} catch (error) {
|
|
2691
2692
|
if (error instanceof Error && (error.message.includes("Cannot find module") || error.message.includes("natural\" package is required"))) return {
|
|
@@ -2795,9 +2796,9 @@ async function runAssertion({ prompt, provider, assertion, test, vars, latencyMs
|
|
|
2795
2796
|
let filePath = fileRef;
|
|
2796
2797
|
let functionName;
|
|
2797
2798
|
if (fileRef.includes(":")) {
|
|
2798
|
-
const
|
|
2799
|
-
filePath =
|
|
2800
|
-
functionName =
|
|
2799
|
+
const colonIndex = fileRef.indexOf(":");
|
|
2800
|
+
filePath = fileRef.slice(0, colonIndex);
|
|
2801
|
+
functionName = fileRef.slice(colonIndex + 1);
|
|
2801
2802
|
}
|
|
2802
2803
|
filePath = path.resolve(basePath, filePath);
|
|
2803
2804
|
if (isJavascriptFile(filePath)) {
|
|
@@ -2815,7 +2816,7 @@ async function runAssertion({ prompt, provider, assertion, test, vars, latencyMs
|
|
|
2815
2816
|
};
|
|
2816
2817
|
}
|
|
2817
2818
|
else if (filePath.endsWith(".rb")) try {
|
|
2818
|
-
const { runRuby } = await import("./rubyUtils-
|
|
2819
|
+
const { runRuby } = await import("./rubyUtils-D7--T12C.js");
|
|
2819
2820
|
valueFromScript = await runRuby(filePath, functionName || "get_assert", [output, context]);
|
|
2820
2821
|
logger_default.debug(`Ruby script ${filePath} output: ${valueFromScript}`);
|
|
2821
2822
|
} catch (error) {
|
|
@@ -3805,7 +3806,7 @@ async function runEval({ provider, prompt, test, testSuite, delay, nunjucksFilte
|
|
|
3805
3806
|
promptIdx,
|
|
3806
3807
|
testIdx
|
|
3807
3808
|
});
|
|
3808
|
-
logger_default.error("Provider call failed during eval", logContext);
|
|
3809
|
+
if (!(err instanceof Error && err.name === "AbortError")) logger_default.error("Provider call failed during eval", logContext);
|
|
3809
3810
|
return [{
|
|
3810
3811
|
...setup,
|
|
3811
3812
|
error: errorWithStack,
|
|
@@ -3986,11 +3987,17 @@ var Evaluator = class {
|
|
|
3986
3987
|
let globalTimeout;
|
|
3987
3988
|
let globalAbortController;
|
|
3988
3989
|
const processedIndices = /* @__PURE__ */ new Set();
|
|
3990
|
+
let targetUnavailable = false;
|
|
3991
|
+
let targetErrorStatus;
|
|
3992
|
+
const targetErrorAbortController = new AbortController();
|
|
3989
3993
|
let ciProgressReporter = null;
|
|
3990
3994
|
let progressBarManager = null;
|
|
3995
|
+
let providerAbortSignal = options.abortSignal;
|
|
3996
|
+
let combinedAbortSignal = options.abortSignal ? AbortSignal.any([options.abortSignal, targetErrorAbortController.signal]) : targetErrorAbortController.signal;
|
|
3991
3997
|
if (maxEvalTimeMs > 0) {
|
|
3992
3998
|
globalAbortController = new AbortController();
|
|
3993
|
-
|
|
3999
|
+
providerAbortSignal = providerAbortSignal ? AbortSignal.any([providerAbortSignal, globalAbortController.signal]) : globalAbortController.signal;
|
|
4000
|
+
combinedAbortSignal = AbortSignal.any([combinedAbortSignal, globalAbortController.signal]);
|
|
3994
4001
|
globalTimeout = setTimeout(() => {
|
|
3995
4002
|
evalTimedOut = true;
|
|
3996
4003
|
globalAbortController?.abort();
|
|
@@ -3998,7 +4005,7 @@ var Evaluator = class {
|
|
|
3998
4005
|
}
|
|
3999
4006
|
const vars = /* @__PURE__ */ new Set();
|
|
4000
4007
|
const checkAbort = () => {
|
|
4001
|
-
if (
|
|
4008
|
+
if (combinedAbortSignal.aborted) throw new Error("Operation cancelled");
|
|
4002
4009
|
};
|
|
4003
4010
|
if (!options.silent) logger_default.info(`Starting evaluation ${this.evalRecord.id}`);
|
|
4004
4011
|
checkAbort();
|
|
@@ -4159,7 +4166,7 @@ var Evaluator = class {
|
|
|
4159
4166
|
const defaultProvider = testSuite.defaultTest.provider;
|
|
4160
4167
|
if (isApiProvider(defaultProvider)) testCase.provider = defaultProvider;
|
|
4161
4168
|
else if (typeof defaultProvider === "object" && defaultProvider.id) {
|
|
4162
|
-
const { loadApiProvider } = await import("./providers-
|
|
4169
|
+
const { loadApiProvider } = await import("./providers-Ck8HyrC-.js");
|
|
4163
4170
|
testCase.provider = await loadApiProvider(typeof defaultProvider.id === "function" ? defaultProvider.id() : defaultProvider.id, { options: defaultProvider });
|
|
4164
4171
|
} else testCase.provider = defaultProvider;
|
|
4165
4172
|
}
|
|
@@ -4229,7 +4236,7 @@ var Evaluator = class {
|
|
|
4229
4236
|
registers: this.registers,
|
|
4230
4237
|
isRedteam: testSuite.redteam != null,
|
|
4231
4238
|
concurrency,
|
|
4232
|
-
abortSignal:
|
|
4239
|
+
abortSignal: providerAbortSignal,
|
|
4233
4240
|
evalId: this.evalRecord.id,
|
|
4234
4241
|
rateLimitRegistry: this.rateLimitRegistry
|
|
4235
4242
|
});
|
|
@@ -4243,7 +4250,7 @@ var Evaluator = class {
|
|
|
4243
4250
|
if (evalOption.test.assert?.some((a) => a.type === "max-score")) rowsWithMaxScoreAssertion.add(evalOption.testIdx);
|
|
4244
4251
|
}
|
|
4245
4252
|
if (cliState_default.resume && this.evalRecord.persisted) try {
|
|
4246
|
-
const { default: EvalResult } = await import("./evalResult-
|
|
4253
|
+
const { default: EvalResult } = await import("./evalResult-CzLURDcP.js");
|
|
4247
4254
|
const completedPairs = await EvalResult.getCompletedIndexPairs(this.evalRecord.id, { excludeErrors: cliState_default.retryMode });
|
|
4248
4255
|
const originalCount = runEvalOptions.length;
|
|
4249
4256
|
for (let i = runEvalOptions.length - 1; i >= 0; i--) {
|
|
@@ -4296,6 +4303,14 @@ var Evaluator = class {
|
|
|
4296
4303
|
logger_default.error(`Error saving result: ${error} ${safeJsonStringify(resultSummary)}`);
|
|
4297
4304
|
}
|
|
4298
4305
|
for (const writer of this.fileWriters) await writer.write(row);
|
|
4306
|
+
const httpStatus = row.response?.metadata?.http?.status;
|
|
4307
|
+
if (typeof httpStatus === "number" && isNonTransientHttpStatus(httpStatus)) {
|
|
4308
|
+
targetUnavailable = true;
|
|
4309
|
+
targetErrorStatus = httpStatus;
|
|
4310
|
+
logger_default.error(`Target returned HTTP ${httpStatus}. Aborting scan - this error will not resolve on retry.`);
|
|
4311
|
+
targetErrorAbortController.abort();
|
|
4312
|
+
break;
|
|
4313
|
+
}
|
|
4299
4314
|
const { promptIdx } = row;
|
|
4300
4315
|
const metrics = prompts[promptIdx].metrics;
|
|
4301
4316
|
invariant(metrics, "Expected prompt.metrics to be set");
|
|
@@ -4459,6 +4474,7 @@ var Evaluator = class {
|
|
|
4459
4474
|
if (this.options.showProgressBar && progressBarManager) await progressBarManager.initialize(runEvalOptions, concurrency, 0);
|
|
4460
4475
|
try {
|
|
4461
4476
|
if (serialRunEvalOptions.length > 0) for (const evalStep of serialRunEvalOptions) {
|
|
4477
|
+
checkAbort();
|
|
4462
4478
|
if (isWebUI) {
|
|
4463
4479
|
const provider = evalStep.provider.label || evalStep.provider.id();
|
|
4464
4480
|
const vars = formatVarsForDisplay(evalStep.test.vars || {}, 50);
|
|
@@ -4476,22 +4492,32 @@ var Evaluator = class {
|
|
|
4476
4492
|
await this.evalRecord.addPrompts(prompts);
|
|
4477
4493
|
});
|
|
4478
4494
|
} catch (err) {
|
|
4479
|
-
if (
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4495
|
+
if (combinedAbortSignal.aborted) {
|
|
4496
|
+
if (evalTimedOut) logger_default.warn(`Evaluation stopped after reaching max duration (${maxEvalTimeMs}ms)`);
|
|
4497
|
+
else if (!targetUnavailable) {
|
|
4498
|
+
logger_default.info("Evaluation interrupted, saving progress...");
|
|
4499
|
+
if (globalTimeout) clearTimeout(globalTimeout);
|
|
4500
|
+
if (progressBarManager) progressBarManager.stop();
|
|
4501
|
+
if (ciProgressReporter) ciProgressReporter.finish();
|
|
4502
|
+
this.evalRecord.setVars(Array.from(vars));
|
|
4503
|
+
await this.evalRecord.addPrompts(prompts);
|
|
4504
|
+
updateSignalFile(this.evalRecord.id);
|
|
4505
|
+
return this.evalRecord;
|
|
4506
|
+
}
|
|
4507
|
+
} else {
|
|
4491
4508
|
if (ciProgressReporter) ciProgressReporter.error(`Evaluation failed: ${String(err)}`);
|
|
4492
4509
|
throw err;
|
|
4493
4510
|
}
|
|
4494
4511
|
}
|
|
4512
|
+
if (targetUnavailable) {
|
|
4513
|
+
if (globalTimeout) clearTimeout(globalTimeout);
|
|
4514
|
+
if (progressBarManager) progressBarManager.stop();
|
|
4515
|
+
if (ciProgressReporter) ciProgressReporter.error(`Target unavailable (HTTP ${targetErrorStatus})`);
|
|
4516
|
+
this.evalRecord.setVars(Array.from(vars));
|
|
4517
|
+
await this.evalRecord.addPrompts(prompts);
|
|
4518
|
+
updateSignalFile(this.evalRecord.id);
|
|
4519
|
+
return this.evalRecord;
|
|
4520
|
+
}
|
|
4495
4521
|
const compareRowsCount = rowsWithSelectBestAssertion.size + rowsWithMaxScoreAssertion.size;
|
|
4496
4522
|
if (progressBarManager) {
|
|
4497
4523
|
if (compareRowsCount > 0) progressBarManager.updateTotalCount(compareRowsCount);
|
|
@@ -4788,4 +4814,4 @@ function evaluate(testSuite, evalRecord, options) {
|
|
|
4788
4814
|
|
|
4789
4815
|
//#endregion
|
|
4790
4816
|
export { runEval as a, readAssertions as c, isAllowedPrompt as i, renderMetricName as l, formatVarsForDisplay as n, doesPromptRefMatch as o, generateVarCombinations as r, assertions_default as s, evaluate as t, runAssertions as u };
|
|
4791
|
-
//# sourceMappingURL=evaluator-
|
|
4817
|
+
//# sourceMappingURL=evaluator-3EJCMTs0.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_logger = require('./logger-
|
|
2
|
-
const require_fetch = require('./fetch-
|
|
3
|
-
const require_accounts = require('./accounts-
|
|
4
|
-
const require_blobs = require('./blobs-
|
|
1
|
+
const require_logger = require('./logger-BdZ-IqBc.cjs');
|
|
2
|
+
const require_fetch = require('./fetch-ZMn_oemb.cjs');
|
|
3
|
+
const require_accounts = require('./accounts-BzEY8H3v.cjs');
|
|
4
|
+
const require_blobs = require('./blobs-673H0jCl.cjs');
|
|
5
5
|
let crypto = require("crypto");
|
|
6
6
|
|
|
7
7
|
//#region src/util/createHash.ts
|
|
@@ -39,7 +39,7 @@ async function uploadBlobRemote(buffer, mimeType, context) {
|
|
|
39
39
|
const apiKey = require_fetch.cloudConfig.getApiKey();
|
|
40
40
|
if (!url || !apiKey) return null;
|
|
41
41
|
try {
|
|
42
|
-
const { fetchWithProxy } = await Promise.resolve().then(() => require("./fetch-
|
|
42
|
+
const { fetchWithProxy } = await Promise.resolve().then(() => require("./fetch-CMptBDVg.cjs"));
|
|
43
43
|
const response = await fetchWithProxy(url, {
|
|
44
44
|
method: "POST",
|
|
45
45
|
headers: {
|
|
@@ -254,6 +254,23 @@ async function extractAndStoreBinaryData(response, context) {
|
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
+
if (response.images?.length) next.images = await Promise.all(response.images.map(async (img, idx) => {
|
|
258
|
+
if (!img.data || typeof img.data !== "string" || !isDataUrl(img.data)) return img;
|
|
259
|
+
const stored = await maybeStore(img.data, img.mimeType || "image/png", blobContext, `response.images[${idx}].data`, "image");
|
|
260
|
+
if (stored) {
|
|
261
|
+
mutated = true;
|
|
262
|
+
require_logger.logger_default.debug("[BlobExtractor] Stored image blob", {
|
|
263
|
+
...context,
|
|
264
|
+
hash: stored.hash
|
|
265
|
+
});
|
|
266
|
+
return {
|
|
267
|
+
...img,
|
|
268
|
+
data: void 0,
|
|
269
|
+
blobRef: stored
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
return img;
|
|
273
|
+
}));
|
|
257
274
|
const turns = response.turns;
|
|
258
275
|
if (Array.isArray(turns)) next.turns = await Promise.all(turns.map(async (turn, idx) => {
|
|
259
276
|
if (turn?.audio?.data && typeof turn.audio.data === "string") {
|
|
@@ -398,4 +415,4 @@ Object.defineProperty(exports, 'shouldAttemptRemoteBlobUpload', {
|
|
|
398
415
|
return shouldAttemptRemoteBlobUpload;
|
|
399
416
|
}
|
|
400
417
|
});
|
|
401
|
-
//# sourceMappingURL=extractor-
|
|
418
|
+
//# sourceMappingURL=extractor-DbhlYEeo.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as getEnvBool, i as logger_default } from "./logger-
|
|
2
|
-
import { c as cloudConfig } from "./fetch-
|
|
3
|
-
import { o as isLoggedIntoCloud } from "./accounts-
|
|
4
|
-
import { a as BLOB_MIN_SIZE, i as BLOB_MAX_SIZE, n as recordBlobReference, r as storeBlob } from "./blobs-
|
|
1
|
+
import { _ as getEnvBool, i as logger_default } from "./logger-w8Ozp0Td.js";
|
|
2
|
+
import { c as cloudConfig } from "./fetch-18MuNu9i.js";
|
|
3
|
+
import { o as isLoggedIntoCloud } from "./accounts-R3gfCR_g.js";
|
|
4
|
+
import { a as BLOB_MIN_SIZE, i as BLOB_MAX_SIZE, n as recordBlobReference, r as storeBlob } from "./blobs-C9J2mVgo.js";
|
|
5
5
|
import { createHash } from "crypto";
|
|
6
6
|
|
|
7
7
|
//#region src/util/createHash.ts
|
|
@@ -39,7 +39,7 @@ async function uploadBlobRemote(buffer, mimeType, context) {
|
|
|
39
39
|
const apiKey = cloudConfig.getApiKey();
|
|
40
40
|
if (!url || !apiKey) return null;
|
|
41
41
|
try {
|
|
42
|
-
const { fetchWithProxy } = await import("./fetch-
|
|
42
|
+
const { fetchWithProxy } = await import("./fetch-Bi0o-fdp.js");
|
|
43
43
|
const response = await fetchWithProxy(url, {
|
|
44
44
|
method: "POST",
|
|
45
45
|
headers: {
|
|
@@ -254,6 +254,23 @@ async function extractAndStoreBinaryData(response, context) {
|
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
+
if (response.images?.length) next.images = await Promise.all(response.images.map(async (img, idx) => {
|
|
258
|
+
if (!img.data || typeof img.data !== "string" || !isDataUrl(img.data)) return img;
|
|
259
|
+
const stored = await maybeStore(img.data, img.mimeType || "image/png", blobContext, `response.images[${idx}].data`, "image");
|
|
260
|
+
if (stored) {
|
|
261
|
+
mutated = true;
|
|
262
|
+
logger_default.debug("[BlobExtractor] Stored image blob", {
|
|
263
|
+
...context,
|
|
264
|
+
hash: stored.hash
|
|
265
|
+
});
|
|
266
|
+
return {
|
|
267
|
+
...img,
|
|
268
|
+
data: void 0,
|
|
269
|
+
blobRef: stored
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
return img;
|
|
273
|
+
}));
|
|
257
274
|
const turns = response.turns;
|
|
258
275
|
if (Array.isArray(turns)) next.turns = await Promise.all(turns.map(async (turn, idx) => {
|
|
259
276
|
if (turn?.audio?.data && typeof turn.audio.data === "string") {
|
|
@@ -369,4 +386,4 @@ async function recordExistingBlobReferences(value, context, location) {
|
|
|
369
386
|
|
|
370
387
|
//#endregion
|
|
371
388
|
export { sha256 as a, randomSequence as i, isBlobStorageEnabled as n, shouldAttemptRemoteBlobUpload as r, extractAndStoreBinaryData as t };
|
|
372
|
-
//# sourceMappingURL=extractor-
|
|
389
|
+
//# sourceMappingURL=extractor-Hs7la_19.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { b as getEnvBool, o as logger_default } from "./logger-
|
|
3
|
-
import { c as isLoggedIntoCloud } from "./accounts-
|
|
4
|
-
import { i as cloudConfig } from "./cloud-
|
|
5
|
-
import { a as BLOB_MAX_SIZE, i as storeBlob, o as BLOB_MIN_SIZE, r as recordBlobReference } from "./blobs-
|
|
2
|
+
import { b as getEnvBool, o as logger_default } from "./logger-BotXmWKW.js";
|
|
3
|
+
import { c as isLoggedIntoCloud } from "./accounts-DHHiXsy6.js";
|
|
4
|
+
import { i as cloudConfig } from "./cloud-BMbRVJFw.js";
|
|
5
|
+
import { a as BLOB_MAX_SIZE, i as storeBlob, o as BLOB_MIN_SIZE, r as recordBlobReference } from "./blobs-kt8v3UyH.js";
|
|
6
6
|
import { createHash } from "crypto";
|
|
7
7
|
|
|
8
8
|
//#region src/util/createHash.ts
|
|
@@ -40,7 +40,7 @@ async function uploadBlobRemote(buffer, mimeType, context) {
|
|
|
40
40
|
const apiKey = cloudConfig.getApiKey();
|
|
41
41
|
if (!url || !apiKey) return null;
|
|
42
42
|
try {
|
|
43
|
-
const { fetchWithProxy } = await import("./fetch-
|
|
43
|
+
const { fetchWithProxy } = await import("./fetch-DAZkv3gV.js");
|
|
44
44
|
const response = await fetchWithProxy(url, {
|
|
45
45
|
method: "POST",
|
|
46
46
|
headers: {
|
|
@@ -255,6 +255,23 @@ async function extractAndStoreBinaryData(response, context) {
|
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
+
if (response.images?.length) next.images = await Promise.all(response.images.map(async (img, idx) => {
|
|
259
|
+
if (!img.data || typeof img.data !== "string" || !isDataUrl(img.data)) return img;
|
|
260
|
+
const stored = await maybeStore(img.data, img.mimeType || "image/png", blobContext, `response.images[${idx}].data`, "image");
|
|
261
|
+
if (stored) {
|
|
262
|
+
mutated = true;
|
|
263
|
+
logger_default.debug("[BlobExtractor] Stored image blob", {
|
|
264
|
+
...context,
|
|
265
|
+
hash: stored.hash
|
|
266
|
+
});
|
|
267
|
+
return {
|
|
268
|
+
...img,
|
|
269
|
+
data: void 0,
|
|
270
|
+
blobRef: stored
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
return img;
|
|
274
|
+
}));
|
|
258
275
|
const turns = response.turns;
|
|
259
276
|
if (Array.isArray(turns)) next.turns = await Promise.all(turns.map(async (turn, idx) => {
|
|
260
277
|
if (turn?.audio?.data && typeof turn.audio.data === "string") {
|
|
@@ -370,4 +387,4 @@ async function recordExistingBlobReferences(value, context, location) {
|
|
|
370
387
|
|
|
371
388
|
//#endregion
|
|
372
389
|
export { sha256 as a, randomSequence as i, isBlobStorageEnabled as n, shouldAttemptRemoteBlobUpload as r, extractAndStoreBinaryData as t };
|
|
373
|
-
//# sourceMappingURL=extractor-
|
|
390
|
+
//# sourceMappingURL=extractor-LSYjrhK0.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as getEnvBool, b as getEnvString, c as sanitizeUrl, g as getConfigDirectoryPath, i as logger_default, r as logRequestResponse, w as cliState_default, y as getEnvInt } from "./logger-
|
|
1
|
+
import { _ as getEnvBool, b as getEnvString, c as sanitizeUrl, g as getConfigDirectoryPath, i as logger_default, r as logRequestResponse, w as cliState_default, y as getEnvInt } from "./logger-w8Ozp0Td.js";
|
|
2
2
|
import { t as invariant } from "./invariant-1pAf2CD1.js";
|
|
3
3
|
import * as fs$1 from "fs";
|
|
4
4
|
import * as path$1 from "path";
|
|
@@ -24,7 +24,7 @@ const HUMAN_ASSERTION_TYPE = "human";
|
|
|
24
24
|
* Application version from package.json.
|
|
25
25
|
* Injected at build time, or read from npm environment in development.
|
|
26
26
|
*/
|
|
27
|
-
const VERSION = "0.120.
|
|
27
|
+
const VERSION = "0.120.26";
|
|
28
28
|
/**
|
|
29
29
|
* PostHog analytics key.
|
|
30
30
|
* Only populated during production builds via PROMPTFOO_POSTHOG_KEY env var.
|
|
@@ -415,7 +415,7 @@ var CloudConfig = class {
|
|
|
415
415
|
}
|
|
416
416
|
async validateAndSetApiToken(token, apiHost) {
|
|
417
417
|
try {
|
|
418
|
-
const { fetchWithProxy } = await import("./fetch-
|
|
418
|
+
const { fetchWithProxy } = await import("./fetch-Bi0o-fdp.js");
|
|
419
419
|
const response = await fetchWithProxy(`${apiHost}/api/v1/users/me`, { headers: { Authorization: `Bearer ${token}` } });
|
|
420
420
|
if (!response.ok) {
|
|
421
421
|
const errorMessage = await response.text();
|
|
@@ -550,8 +550,22 @@ async function monkeyPatchFetch(url, options) {
|
|
|
550
550
|
let cachedAgent = null;
|
|
551
551
|
let cachedAgentConcurrency;
|
|
552
552
|
let cachedProxyAgents = /* @__PURE__ */ new Map();
|
|
553
|
+
/**
|
|
554
|
+
* Get the connection pool size for HTTP agents.
|
|
555
|
+
* Priority: PROMPTFOO_FETCH_CONNECTIONS env var > CLI -j flag > DEFAULT_MAX_CONCURRENCY (4).
|
|
556
|
+
* Set PROMPTFOO_FETCH_CONNECTIONS to override independently of eval concurrency
|
|
557
|
+
* (e.g., server deployments that need more connections than the default 4).
|
|
558
|
+
*/
|
|
559
|
+
function getConnectionPoolSize() {
|
|
560
|
+
const envConnections = getEnvString("PROMPTFOO_FETCH_CONNECTIONS");
|
|
561
|
+
if (envConnections != null) {
|
|
562
|
+
const parsed = parseInt(envConnections, 10);
|
|
563
|
+
if (!isNaN(parsed)) return parsed;
|
|
564
|
+
}
|
|
565
|
+
return cliState_default.maxConcurrency || DEFAULT_MAX_CONCURRENCY;
|
|
566
|
+
}
|
|
553
567
|
function getOrCreateAgent(tlsOptions) {
|
|
554
|
-
const concurrency =
|
|
568
|
+
const concurrency = getConnectionPoolSize();
|
|
555
569
|
if (cachedAgent && cachedAgentConcurrency !== concurrency) {
|
|
556
570
|
if (typeof cachedAgent.close === "function") cachedAgent.close();
|
|
557
571
|
cachedAgent = null;
|
|
@@ -577,7 +591,7 @@ function getOrCreateProxyAgent(proxyUrl, tlsOptions) {
|
|
|
577
591
|
headersTimeout: REQUEST_TIMEOUT_MS,
|
|
578
592
|
keepAliveTimeout: 3e4,
|
|
579
593
|
keepAliveMaxTimeout: 6e4,
|
|
580
|
-
connections:
|
|
594
|
+
connections: getConnectionPoolSize()
|
|
581
595
|
});
|
|
582
596
|
cachedProxyAgents.set(proxyUrl, agent);
|
|
583
597
|
}
|
|
@@ -630,7 +644,7 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
|
|
|
630
644
|
logger_default.warn(`Failed to read CA certificate from ${caCertPath}: ${e}`);
|
|
631
645
|
}
|
|
632
646
|
const proxyUrl = finalUrlString ? getProxyForUrl(finalUrlString) : "";
|
|
633
|
-
if (proxyUrl) {
|
|
647
|
+
if (!finalOptions.dispatcher) if (proxyUrl) {
|
|
634
648
|
logger_default.debug(`Using proxy: ${sanitizeUrl(proxyUrl)}`);
|
|
635
649
|
finalOptions.dispatcher = getOrCreateProxyAgent(proxyUrl, tlsOptions);
|
|
636
650
|
} else finalOptions.dispatcher = getOrCreateAgent(tlsOptions);
|
|
@@ -746,4 +760,4 @@ async function fetchWithRetries(url, options = {}, timeout, maxRetries) {
|
|
|
746
760
|
|
|
747
761
|
//#endregion
|
|
748
762
|
export { EVENTS_ENDPOINT as A, toTitleCase as C, CONSENT_ENDPOINT as D, CLOUD_PROVIDER_PREFIX as E, getShareViewBaseUrl as F, POSTHOG_KEY as I, VERSION as L, TERMINAL_MAX_WIDTH as M, getDefaultShareViewBaseUrl as N, DEFAULT_MAX_CONCURRENCY as O, getShareApiBaseUrl as P, FILE_METADATA_KEY as R, parseChatPrompt as S, transformTools as T, isOpenAIToolArray as _, isRateLimited as a, openaiToolChoiceToBedrock as b, cloudConfig as c, writeGlobalConfigPartial as d, getCurrentTimestamp as f, calculateCost as g, REQUEST_TIMEOUT_MS as h, handleRateLimit as i, R_ENDPOINT as j, DEFAULT_QUERY_LIMIT as k, readGlobalConfig as l, LONG_RUNNING_MODEL_TIMEOUT_MS as m, fetchWithRetries as n, isTransientError as o, sleep as p, fetchWithTimeout as r, CloudConfig as s, fetchWithProxy as t, writeGlobalConfig as u, isOpenAIToolChoice as v, transformToolChoice as w, openaiToolsToBedrock as x, isPromptfooSampleTarget as y, HUMAN_ASSERTION_TYPE as z };
|
|
749
|
-
//# sourceMappingURL=fetch-
|
|
763
|
+
//# sourceMappingURL=fetch-18MuNu9i.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./logger-
|
|
2
|
-
import { a as isRateLimited, i as handleRateLimit, n as fetchWithRetries, o as isTransientError, r as fetchWithTimeout, t as fetchWithProxy } from "./fetch-
|
|
1
|
+
import "./logger-w8Ozp0Td.js";
|
|
2
|
+
import { a as isRateLimited, i as handleRateLimit, n as fetchWithRetries, o as isTransientError, r as fetchWithTimeout, t as fetchWithProxy } from "./fetch-18MuNu9i.js";
|
|
3
3
|
|
|
4
4
|
export { fetchWithProxy };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "./logger-BotXmWKW.js";
|
|
3
|
+
import { a as handleRateLimit, i as fetchWithTimeout, n as fetchWithProxy, o as isRateLimited, r as fetchWithRetries, s as isTransientError, t as clearAgentCache } from "./fetch-SRsE6Ctl.js";
|
|
4
|
+
import "./cloud-BMbRVJFw.js";
|
|
5
|
+
|
|
6
|
+
export { fetchWithProxy };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as getEnvString, O as cliState_default, S as getEnvInt, a as logRequestResponse, b as getEnvBool, o as logger_default, u as sanitizeUrl } from "./logger-
|
|
2
|
+
import { C as getEnvString, O as cliState_default, S as getEnvInt, a as logRequestResponse, b as getEnvBool, o as logger_default, u as sanitizeUrl } from "./logger-BotXmWKW.js";
|
|
3
3
|
import { t as invariant } from "./invariant-DT20jrBd.js";
|
|
4
|
-
import { i as cloudConfig, n as CLOUD_API_HOST } from "./cloud-
|
|
4
|
+
import { i as cloudConfig, n as CLOUD_API_HOST } from "./cloud-BMbRVJFw.js";
|
|
5
5
|
import { Agent, ProxyAgent } from "undici";
|
|
6
6
|
import path from "path";
|
|
7
7
|
import yaml from "js-yaml";
|
|
@@ -24,7 +24,7 @@ const HUMAN_ASSERTION_TYPE = "human";
|
|
|
24
24
|
* Application version from package.json.
|
|
25
25
|
* Injected at build time, or read from npm environment in development.
|
|
26
26
|
*/
|
|
27
|
-
const VERSION = "0.120.
|
|
27
|
+
const VERSION = "0.120.26";
|
|
28
28
|
/**
|
|
29
29
|
* PostHog analytics key.
|
|
30
30
|
* Only populated during production builds via PROMPTFOO_POSTHOG_KEY env var.
|
|
@@ -369,6 +369,20 @@ let cachedAgent = null;
|
|
|
369
369
|
let cachedAgentConcurrency;
|
|
370
370
|
let cachedProxyAgents = /* @__PURE__ */ new Map();
|
|
371
371
|
/**
|
|
372
|
+
* Get the connection pool size for HTTP agents.
|
|
373
|
+
* Priority: PROMPTFOO_FETCH_CONNECTIONS env var > CLI -j flag > DEFAULT_MAX_CONCURRENCY (4).
|
|
374
|
+
* Set PROMPTFOO_FETCH_CONNECTIONS to override independently of eval concurrency
|
|
375
|
+
* (e.g., server deployments that need more connections than the default 4).
|
|
376
|
+
*/
|
|
377
|
+
function getConnectionPoolSize() {
|
|
378
|
+
const envConnections = getEnvString("PROMPTFOO_FETCH_CONNECTIONS");
|
|
379
|
+
if (envConnections != null) {
|
|
380
|
+
const parsed = parseInt(envConnections, 10);
|
|
381
|
+
if (!isNaN(parsed)) return parsed;
|
|
382
|
+
}
|
|
383
|
+
return cliState_default.maxConcurrency || DEFAULT_MAX_CONCURRENCY;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
372
386
|
* Clear cached agents so the next request creates fresh ones.
|
|
373
387
|
* Exported for testing only.
|
|
374
388
|
*/
|
|
@@ -380,7 +394,7 @@ function clearAgentCache() {
|
|
|
380
394
|
cachedProxyAgents = /* @__PURE__ */ new Map();
|
|
381
395
|
}
|
|
382
396
|
function getOrCreateAgent(tlsOptions) {
|
|
383
|
-
const concurrency =
|
|
397
|
+
const concurrency = getConnectionPoolSize();
|
|
384
398
|
if (cachedAgent && cachedAgentConcurrency !== concurrency) {
|
|
385
399
|
if (typeof cachedAgent.close === "function") cachedAgent.close();
|
|
386
400
|
cachedAgent = null;
|
|
@@ -406,7 +420,7 @@ function getOrCreateProxyAgent(proxyUrl, tlsOptions) {
|
|
|
406
420
|
headersTimeout: REQUEST_TIMEOUT_MS,
|
|
407
421
|
keepAliveTimeout: 3e4,
|
|
408
422
|
keepAliveMaxTimeout: 6e4,
|
|
409
|
-
connections:
|
|
423
|
+
connections: getConnectionPoolSize()
|
|
410
424
|
});
|
|
411
425
|
cachedProxyAgents.set(proxyUrl, agent);
|
|
412
426
|
}
|
|
@@ -459,7 +473,7 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
|
|
|
459
473
|
logger_default.warn(`Failed to read CA certificate from ${caCertPath}: ${e}`);
|
|
460
474
|
}
|
|
461
475
|
const proxyUrl = finalUrlString ? getProxyForUrl(finalUrlString) : "";
|
|
462
|
-
if (proxyUrl) {
|
|
476
|
+
if (!finalOptions.dispatcher) if (proxyUrl) {
|
|
463
477
|
logger_default.debug(`Using proxy: ${sanitizeUrl(proxyUrl)}`);
|
|
464
478
|
finalOptions.dispatcher = getOrCreateProxyAgent(proxyUrl, tlsOptions);
|
|
465
479
|
} else finalOptions.dispatcher = getOrCreateAgent(tlsOptions);
|
|
@@ -575,4 +589,4 @@ async function fetchWithRetries(url, options = {}, timeout, maxRetries) {
|
|
|
575
589
|
|
|
576
590
|
//#endregion
|
|
577
591
|
export { getDefaultShareViewBaseUrl as A, CONSENT_ENDPOINT as C, R_ENDPOINT as D, EVENTS_ENDPOINT as E, FILE_METADATA_KEY as F, HUMAN_ASSERTION_TYPE as I, getShareViewBaseUrl as M, POSTHOG_KEY as N, TERMINAL_MAX_WIDTH as O, VERSION as P, CLOUD_PROVIDER_PREFIX as S, DEFAULT_QUERY_LIMIT as T, openaiToolsToBedrock as _, handleRateLimit as a, transformToolChoice as b, getCurrentTimestamp as c, REQUEST_TIMEOUT_MS as d, calculateCost as f, openaiToolChoiceToBedrock as g, isPromptfooSampleTarget as h, fetchWithTimeout as i, getShareApiBaseUrl as j, getDefaultPort as k, sleep as l, isOpenAIToolChoice as m, fetchWithProxy as n, isRateLimited as o, isOpenAIToolArray as p, fetchWithRetries as r, isTransientError as s, clearAgentCache as t, LONG_RUNNING_MODEL_TIMEOUT_MS as u, parseChatPrompt as v, DEFAULT_MAX_CONCURRENCY as w, transformTools as x, toTitleCase as y };
|
|
578
|
-
//# sourceMappingURL=fetch-
|
|
592
|
+
//# sourceMappingURL=fetch-SRsE6Ctl.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_logger = require('./logger-
|
|
1
|
+
const require_logger = require('./logger-BdZ-IqBc.cjs');
|
|
2
2
|
const require_invariant = require('./invariant-CKcJAQ6M.cjs');
|
|
3
3
|
let fs = require("fs");
|
|
4
4
|
fs = require_logger.__toESM(fs);
|
|
@@ -27,7 +27,7 @@ const HUMAN_ASSERTION_TYPE = "human";
|
|
|
27
27
|
* Application version from package.json.
|
|
28
28
|
* Injected at build time, or read from npm environment in development.
|
|
29
29
|
*/
|
|
30
|
-
const VERSION = "0.120.
|
|
30
|
+
const VERSION = "0.120.26";
|
|
31
31
|
/**
|
|
32
32
|
* PostHog analytics key.
|
|
33
33
|
* Only populated during production builds via PROMPTFOO_POSTHOG_KEY env var.
|
|
@@ -418,7 +418,7 @@ var CloudConfig = class {
|
|
|
418
418
|
}
|
|
419
419
|
async validateAndSetApiToken(token, apiHost) {
|
|
420
420
|
try {
|
|
421
|
-
const { fetchWithProxy } = await Promise.resolve().then(() => require("./fetch-
|
|
421
|
+
const { fetchWithProxy } = await Promise.resolve().then(() => require("./fetch-CMptBDVg.cjs"));
|
|
422
422
|
const response = await fetchWithProxy(`${apiHost}/api/v1/users/me`, { headers: { Authorization: `Bearer ${token}` } });
|
|
423
423
|
if (!response.ok) {
|
|
424
424
|
const errorMessage = await response.text();
|
|
@@ -553,8 +553,22 @@ async function monkeyPatchFetch(url, options) {
|
|
|
553
553
|
let cachedAgent = null;
|
|
554
554
|
let cachedAgentConcurrency;
|
|
555
555
|
let cachedProxyAgents = /* @__PURE__ */ new Map();
|
|
556
|
+
/**
|
|
557
|
+
* Get the connection pool size for HTTP agents.
|
|
558
|
+
* Priority: PROMPTFOO_FETCH_CONNECTIONS env var > CLI -j flag > DEFAULT_MAX_CONCURRENCY (4).
|
|
559
|
+
* Set PROMPTFOO_FETCH_CONNECTIONS to override independently of eval concurrency
|
|
560
|
+
* (e.g., server deployments that need more connections than the default 4).
|
|
561
|
+
*/
|
|
562
|
+
function getConnectionPoolSize() {
|
|
563
|
+
const envConnections = require_logger.getEnvString("PROMPTFOO_FETCH_CONNECTIONS");
|
|
564
|
+
if (envConnections != null) {
|
|
565
|
+
const parsed = parseInt(envConnections, 10);
|
|
566
|
+
if (!isNaN(parsed)) return parsed;
|
|
567
|
+
}
|
|
568
|
+
return require_logger.cliState_default.maxConcurrency || DEFAULT_MAX_CONCURRENCY;
|
|
569
|
+
}
|
|
556
570
|
function getOrCreateAgent(tlsOptions) {
|
|
557
|
-
const concurrency =
|
|
571
|
+
const concurrency = getConnectionPoolSize();
|
|
558
572
|
if (cachedAgent && cachedAgentConcurrency !== concurrency) {
|
|
559
573
|
if (typeof cachedAgent.close === "function") cachedAgent.close();
|
|
560
574
|
cachedAgent = null;
|
|
@@ -580,7 +594,7 @@ function getOrCreateProxyAgent(proxyUrl, tlsOptions) {
|
|
|
580
594
|
headersTimeout: REQUEST_TIMEOUT_MS,
|
|
581
595
|
keepAliveTimeout: 3e4,
|
|
582
596
|
keepAliveMaxTimeout: 6e4,
|
|
583
|
-
connections:
|
|
597
|
+
connections: getConnectionPoolSize()
|
|
584
598
|
});
|
|
585
599
|
cachedProxyAgents.set(proxyUrl, agent);
|
|
586
600
|
}
|
|
@@ -633,7 +647,7 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
|
|
|
633
647
|
require_logger.logger_default.warn(`Failed to read CA certificate from ${caCertPath}: ${e}`);
|
|
634
648
|
}
|
|
635
649
|
const proxyUrl = finalUrlString ? (0, proxy_from_env.getProxyForUrl)(finalUrlString) : "";
|
|
636
|
-
if (proxyUrl) {
|
|
650
|
+
if (!finalOptions.dispatcher) if (proxyUrl) {
|
|
637
651
|
require_logger.logger_default.debug(`Using proxy: ${require_logger.sanitizeUrl(proxyUrl)}`);
|
|
638
652
|
finalOptions.dispatcher = getOrCreateProxyAgent(proxyUrl, tlsOptions);
|
|
639
653
|
} else finalOptions.dispatcher = getOrCreateAgent(tlsOptions);
|
|
@@ -982,4 +996,4 @@ Object.defineProperty(exports, 'writeGlobalConfigPartial', {
|
|
|
982
996
|
return writeGlobalConfigPartial;
|
|
983
997
|
}
|
|
984
998
|
});
|
|
985
|
-
//# sourceMappingURL=fetch-
|
|
999
|
+
//# sourceMappingURL=fetch-ZMn_oemb.cjs.map
|
|
@@ -83,4 +83,4 @@ function isAudioFile(filePath) {
|
|
|
83
83
|
|
|
84
84
|
//#endregion
|
|
85
85
|
export { isVideoFile as a, isJavascriptFile as i, isAudioFile as n, isImageFile as r, JAVASCRIPT_EXTENSIONS as t };
|
|
86
|
-
//# sourceMappingURL=fileExtensions-
|
|
86
|
+
//# sourceMappingURL=fileExtensions-BpuMmaFL.js.map
|