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,34 +1,35 @@
|
|
|
1
|
-
import { _ as getEnvBool, b as getEnvString, c as sanitizeUrl, f as isValidJson, g as getConfigDirectoryPath, i as logger_default, l as extractFirstJsonObject, m as safeJsonStringify, s as sanitizeObject, v as getEnvFloat, w as cliState_default, y as getEnvInt } from "./logger-
|
|
1
|
+
import { _ as getEnvBool, b as getEnvString, c as sanitizeUrl, f as isValidJson, g as getConfigDirectoryPath, i as logger_default, l as extractFirstJsonObject, m as safeJsonStringify, s as sanitizeObject, v as getEnvFloat, w as cliState_default, y as getEnvInt } from "./logger-w8Ozp0Td.js";
|
|
2
2
|
import { t as invariant } from "./invariant-1pAf2CD1.js";
|
|
3
|
-
import { a as safeJoin, i as resolvePackageEntryPoint, n as getWrapperDir, o as safeResolve, r as importModule } from "./esm-
|
|
4
|
-
import { i as validatePythonPath, n as getEnvInt$1, r as runPython, t as getConfiguredPythonPath } from "./pythonUtils-
|
|
3
|
+
import { a as safeJoin, i as resolvePackageEntryPoint, n as getWrapperDir, o as safeResolve, r as importModule } from "./esm-rDtG_2rg.js";
|
|
4
|
+
import { i as validatePythonPath, n as getEnvInt$1, r as runPython, t as getConfiguredPythonPath } from "./pythonUtils-vMlk9Qp5.js";
|
|
5
5
|
import { a as isVideoFile, i as isJavascriptFile, n as isAudioFile, r as isImageFile } from "./fileExtensions-ePDqouxn.js";
|
|
6
|
-
import { n as transform, r as getProcessShim, t as TransformInputType } from "./transform-
|
|
7
|
-
import { A as isApiProvider,
|
|
8
|
-
import { c as maybeLoadFromExternalFile, d as maybeLoadToolsFromExternalFile, f as parsePathOrGlob, g as renderVarsInObject, h as renderEnvOnlyInObject, l as maybeLoadFromExternalFileWithVars, o as getResolvedRelativePath, s as maybeLoadConfigFromExternalFile, u as maybeLoadResponseFormatFromExternalFile, v as extractVariablesFromTemplates, x as parseFileUrl, y as getNunjucksEngine } from "./util-
|
|
9
|
-
import { C as toTitleCase, E as CLOUD_PROVIDER_PREFIX, L as VERSION, S as parseChatPrompt, T as transformTools, _ as isOpenAIToolArray, b as openaiToolChoiceToBedrock, c as cloudConfig, g as calculateCost, h as REQUEST_TIMEOUT_MS, m as LONG_RUNNING_MODEL_TIMEOUT_MS, n as fetchWithRetries, p as sleep, r as fetchWithTimeout, t as fetchWithProxy, v as isOpenAIToolChoice, w as transformToolChoice, x as openaiToolsToBedrock } from "./fetch-
|
|
10
|
-
import { a as fetchWithCache,
|
|
11
|
-
import { a as sha256, n as isBlobStorageEnabled, r as shouldAttemptRemoteBlobUpload, t as extractAndStoreBinaryData } from "./extractor-
|
|
6
|
+
import { n as transform, r as getProcessShim, t as TransformInputType } from "./transform-D8dILpfZ.js";
|
|
7
|
+
import { $ as pluginDescriptions, A as isApiProvider, G as MULTI_TURN_STRATEGIES, H as AGENTIC_STRATEGIES, N as ProviderOptionsSchema, U as DATASET_PLUGINS, V as isUuid, Y as isCustomStrategy, j as isProviderOptions, yt as STRATEGY_EXEMPT_PLUGINS } from "./types-DMVjYLpx.js";
|
|
8
|
+
import { c as maybeLoadFromExternalFile, d as maybeLoadToolsFromExternalFile, f as parsePathOrGlob, g as renderVarsInObject, h as renderEnvOnlyInObject, l as maybeLoadFromExternalFileWithVars, o as getResolvedRelativePath, s as maybeLoadConfigFromExternalFile, u as maybeLoadResponseFormatFromExternalFile, v as extractVariablesFromTemplates, x as parseFileUrl, y as getNunjucksEngine } from "./util-DiCePfDu.js";
|
|
9
|
+
import { C as toTitleCase, E as CLOUD_PROVIDER_PREFIX, L as VERSION, S as parseChatPrompt, T as transformTools, _ as isOpenAIToolArray, b as openaiToolChoiceToBedrock, c as cloudConfig, g as calculateCost, h as REQUEST_TIMEOUT_MS, m as LONG_RUNNING_MODEL_TIMEOUT_MS, n as fetchWithRetries, p as sleep, r as fetchWithTimeout, t as fetchWithProxy, v as isOpenAIToolChoice, w as transformToolChoice, x as openaiToolsToBedrock } from "./fetch-18MuNu9i.js";
|
|
10
|
+
import { a as fetchWithCache, o as getCache, s as isCacheEnabled, u as isTransientConnectionError } from "./cache-BLLayYEN.js";
|
|
11
|
+
import { a as sha256, n as isBlobStorageEnabled, r as shouldAttemptRemoteBlobUpload, t as extractAndStoreBinaryData } from "./extractor-Hs7la_19.js";
|
|
12
12
|
import { n as withGenAISpan } from "./genaiTracer-Ce19n68P.js";
|
|
13
|
-
import { i as normalizeFinishReason, n as MCPClient, r as FINISH_REASON_MAP, t as OpenAiChatCompletionProvider } from "./chat-
|
|
14
|
-
import { a as createEmptyTokenUsage, n as accumulateResponseTokenUsage, r as accumulateTokenUsage } from "./tokenUsageUtils-
|
|
15
|
-
import {
|
|
16
|
-
import { n as AnthropicGenericProvider, t as AnthropicMessagesProvider } from "./messages-
|
|
17
|
-
import { a as parseMessages, i as outputFromMessage, t as ANTHROPIC_MODELS } from "./util-
|
|
18
|
-
import { t as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { n as
|
|
27
|
-
import { n as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import { t as
|
|
31
|
-
import {
|
|
13
|
+
import { i as normalizeFinishReason, n as MCPClient, r as FINISH_REASON_MAP, t as OpenAiChatCompletionProvider } from "./chat-C8Ei4f87.js";
|
|
14
|
+
import { a as createEmptyTokenUsage, n as accumulateResponseTokenUsage, r as accumulateTokenUsage } from "./tokenUsageUtils-FZd5O_4A.js";
|
|
15
|
+
import { O as TOKEN_REFRESH_BUFFER_MS, S as toDataUri, _ as getGoogleClient, a as calculateGoogleCost, b as resolveProjectId, c as geminiFormatAndSystemInstructions, d as mergeParts, f as normalizeSafetySettings, g as GoogleAuthManager, h as CHAT_MODELS, i as transformMCPToolsToOpenAi, l as getCandidate, o as createAuthCacheDiscriminator, p as normalizeTools, r as transformMCPToolsToGoogle, s as formatCandidateContents, u as getGoogleAccessToken, y as loadCredentials } from "./transform-DMaxQwDx.js";
|
|
16
|
+
import { n as AnthropicGenericProvider, t as AnthropicMessagesProvider } from "./messages-CDZYGNlS.js";
|
|
17
|
+
import { a as parseMessages, i as outputFromMessage, t as ANTHROPIC_MODELS } from "./util-mJ58qbbw.js";
|
|
18
|
+
import { n as ResponsesProcessor, r as FunctionCallbackHandler, t as OpenAiResponsesProvider } from "./responses-DLLjADw5.js";
|
|
19
|
+
import { t as OpenAiGenericProvider } from "./openai-Dz3surb_.js";
|
|
20
|
+
import { a as calculateOpenAICost, c as getTokenUsage$2, o as failApiCall, r as OPENAI_REALTIME_MODELS, s as formatOpenAiError } from "./util-Cl0zfT3V.js";
|
|
21
|
+
import { n as OpenAiEmbeddingProvider, t as OpenAiCompletionProvider } from "./completion-D9_MDlnd.js";
|
|
22
|
+
import { i as getUserEmail } from "./accounts-R3gfCR_g.js";
|
|
23
|
+
import { a as getRemoteGenerationUrlForUnaligned, c as neverGenerateRemoteForRegularEvals, i as getRemoteGenerationUrl, l as shouldGenerateRemote, n as checkServerFeatureSupport, s as neverGenerateRemote } from "./server-CbMTRQkg.js";
|
|
24
|
+
import { r as storeBlob } from "./blobs-C9J2mVgo.js";
|
|
25
|
+
import { i as evalResultsTable, p as getDb } from "./tables-D-NSwNIb.js";
|
|
26
|
+
import { n as telemetry_default } from "./telemetry-DZ_7PaVq.js";
|
|
27
|
+
import { n as escapeRegExp, t as ellipsize } from "./text-Dm78AVGG.js";
|
|
28
|
+
import { n as getTraceStore } from "./store-2ocbYY9D.js";
|
|
29
|
+
import { t as AwsBedrockGenericProvider } from "./base-Dtp8b4_N.js";
|
|
30
|
+
import { n as callOpenAiImageApi, r as formatOutput, t as OpenAiImageProvider } from "./image-BiEVdpdP.js";
|
|
31
|
+
import { t as providerRegistry } from "./providerRegistry-wCWd7sKQ.js";
|
|
32
|
+
import { n as runRuby } from "./rubyUtils-Cs35SDYa.js";
|
|
32
33
|
import * as fs$1 from "fs";
|
|
33
34
|
import fs, { promises } from "fs";
|
|
34
35
|
import * as path$1 from "path";
|
|
@@ -53,6 +54,7 @@ import { createHash as createHash$1, randomUUID as randomUUID$1 } from "node:cry
|
|
|
53
54
|
import { and, desc, eq, sql } from "drizzle-orm";
|
|
54
55
|
import { EventEmitter } from "events";
|
|
55
56
|
import { Presets, SingleBar } from "cli-progress";
|
|
57
|
+
import { execa } from "execa";
|
|
56
58
|
import WebSocket from "ws";
|
|
57
59
|
import http from "http";
|
|
58
60
|
import httpZ from "http-z";
|
|
@@ -144,179 +146,6 @@ var ScriptCompletionProvider = class {
|
|
|
144
146
|
}
|
|
145
147
|
};
|
|
146
148
|
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region src/providers/functionCallbackUtils.ts
|
|
149
|
-
/**
|
|
150
|
-
* Handles function callback execution for AI providers.
|
|
151
|
-
* Provides a unified way to execute function callbacks across different provider formats.
|
|
152
|
-
*/
|
|
153
|
-
var FunctionCallbackHandler = class {
|
|
154
|
-
loadedCallbacks = {};
|
|
155
|
-
mcpToolNames = null;
|
|
156
|
-
constructor(mcpClient) {
|
|
157
|
-
this.mcpClient = mcpClient;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Processes a function call by executing its callback or returning the original call
|
|
161
|
-
* @param call The function call to process (can be various formats)
|
|
162
|
-
* @param callbacks Configuration mapping function names to callbacks
|
|
163
|
-
* @param context Optional context to pass to the callback
|
|
164
|
-
* @returns The result of processing
|
|
165
|
-
*/
|
|
166
|
-
async processCall(call, callbacks, context) {
|
|
167
|
-
const functionInfo = this.extractFunctionInfo(call);
|
|
168
|
-
if (this.mcpClient && functionInfo) {
|
|
169
|
-
if (this.mcpToolNames === null) {
|
|
170
|
-
const mcpTools = this.mcpClient.getAllTools();
|
|
171
|
-
this.mcpToolNames = new Set(mcpTools.map((tool) => tool.name));
|
|
172
|
-
}
|
|
173
|
-
if (this.mcpToolNames.has(functionInfo.name)) return await this.executeMcpTool(functionInfo.name, functionInfo.arguments);
|
|
174
|
-
}
|
|
175
|
-
if (!functionInfo || !callbacks || !callbacks[functionInfo.name]) return {
|
|
176
|
-
output: typeof call === "string" ? call : JSON.stringify(call),
|
|
177
|
-
isError: false
|
|
178
|
-
};
|
|
179
|
-
try {
|
|
180
|
-
return {
|
|
181
|
-
output: await this.executeCallback(functionInfo.name, functionInfo.arguments || "{}", callbacks, context),
|
|
182
|
-
isError: false
|
|
183
|
-
};
|
|
184
|
-
} catch (error) {
|
|
185
|
-
logger_default.debug(`Function callback failed for ${functionInfo.name}: ${error}`);
|
|
186
|
-
return {
|
|
187
|
-
output: typeof call === "string" ? call : JSON.stringify(call),
|
|
188
|
-
isError: true
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Processes multiple function calls
|
|
194
|
-
* @param calls Array of calls or a single call
|
|
195
|
-
* @param callbacks Configuration mapping function names to callbacks
|
|
196
|
-
* @param context Optional context to pass to callbacks
|
|
197
|
-
* @param options Processing options
|
|
198
|
-
* @returns Processed output in appropriate format
|
|
199
|
-
*/
|
|
200
|
-
async processCalls(calls, callbacks, context, _options) {
|
|
201
|
-
if (!calls) return calls;
|
|
202
|
-
const isArray = Array.isArray(calls);
|
|
203
|
-
const callsArray = isArray ? calls : [calls];
|
|
204
|
-
const results = await Promise.all(callsArray.map((call) => this.processCall(call, callbacks, context)));
|
|
205
|
-
if (results.some((r, index) => !r.isError && r.output !== JSON.stringify(callsArray[index]))) {
|
|
206
|
-
const outputs = results.map((r) => r.output);
|
|
207
|
-
if (!isArray && outputs.length === 1) return outputs[0];
|
|
208
|
-
return outputs.every((o) => typeof o === "string") ? outputs.join("\n") : outputs;
|
|
209
|
-
}
|
|
210
|
-
if (!isArray && results.length === 1) return results[0].output;
|
|
211
|
-
return calls;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Extracts function name and arguments from various call formats
|
|
215
|
-
*/
|
|
216
|
-
extractFunctionInfo(call) {
|
|
217
|
-
if (!call || typeof call !== "object") return null;
|
|
218
|
-
if (call.name && typeof call.name === "string") return {
|
|
219
|
-
name: call.name,
|
|
220
|
-
arguments: call.arguments
|
|
221
|
-
};
|
|
222
|
-
if (call.type === "function" && call.function?.name) return {
|
|
223
|
-
name: call.function.name,
|
|
224
|
-
arguments: call.function.arguments
|
|
225
|
-
};
|
|
226
|
-
return null;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Executes a function callback
|
|
230
|
-
*/
|
|
231
|
-
async executeCallback(functionName, args, callbacks, context) {
|
|
232
|
-
let callback = this.loadedCallbacks[functionName];
|
|
233
|
-
if (!callback) {
|
|
234
|
-
const callbackConfig = callbacks[functionName];
|
|
235
|
-
if (typeof callbackConfig === "string") if (callbackConfig.startsWith("file://")) callback = await this.loadExternalFunction(callbackConfig);
|
|
236
|
-
else callback = new Function("return " + callbackConfig)();
|
|
237
|
-
else if (typeof callbackConfig === "function") callback = callbackConfig;
|
|
238
|
-
else throw new Error(`Invalid callback configuration for ${functionName}`);
|
|
239
|
-
this.loadedCallbacks[functionName] = callback;
|
|
240
|
-
}
|
|
241
|
-
const result = await callback(args, context);
|
|
242
|
-
return typeof result === "string" ? result : JSON.stringify(result);
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Loads a function from an external file
|
|
246
|
-
*/
|
|
247
|
-
async loadExternalFunction(fileRef) {
|
|
248
|
-
let filePath = fileRef.slice(7);
|
|
249
|
-
let functionName;
|
|
250
|
-
if (filePath.includes(":")) {
|
|
251
|
-
const splits = filePath.split(":");
|
|
252
|
-
if (splits[0] && isJavascriptFile(splits[0])) [filePath, functionName] = splits;
|
|
253
|
-
}
|
|
254
|
-
try {
|
|
255
|
-
const resolvedPath = path.resolve(cliState_default.basePath || "", filePath);
|
|
256
|
-
logger_default.debug(`Loading function from ${resolvedPath}${functionName ? `:${functionName}` : ""}`);
|
|
257
|
-
const mod = await importModule(resolvedPath);
|
|
258
|
-
const func = functionName && mod[functionName] ? mod[functionName] : mod.default || mod;
|
|
259
|
-
if (typeof func !== "function") throw new Error(`Expected ${resolvedPath}${functionName ? `:${functionName}` : ""} to export a function, got ${typeof func}`);
|
|
260
|
-
return func;
|
|
261
|
-
} catch (error) {
|
|
262
|
-
throw new Error(`Failed to load function from ${fileRef}: ${error}`);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Executes an MCP tool
|
|
267
|
-
*/
|
|
268
|
-
async executeMcpTool(toolName, args) {
|
|
269
|
-
try {
|
|
270
|
-
if (!this.mcpClient) throw new Error("MCP client not available");
|
|
271
|
-
const parsedArgs = args == null || args === "" ? {} : typeof args === "string" ? JSON.parse(args) : args;
|
|
272
|
-
const result = await this.mcpClient.callTool(toolName, parsedArgs);
|
|
273
|
-
if (result?.error) return {
|
|
274
|
-
output: `MCP Tool Error (${toolName}): ${result.error}`,
|
|
275
|
-
isError: true
|
|
276
|
-
};
|
|
277
|
-
const normalizeContent = (content) => {
|
|
278
|
-
if (content == null) return "";
|
|
279
|
-
if (typeof content === "string") return content;
|
|
280
|
-
if (Array.isArray(content)) return content.map((part) => {
|
|
281
|
-
if (typeof part === "string") return part;
|
|
282
|
-
if (part && typeof part === "object") {
|
|
283
|
-
if ("text" in part && part.text != null) return String(part.text);
|
|
284
|
-
if ("json" in part) return JSON.stringify(part.json);
|
|
285
|
-
if ("data" in part) return JSON.stringify(part.data);
|
|
286
|
-
return JSON.stringify(part);
|
|
287
|
-
}
|
|
288
|
-
return String(part);
|
|
289
|
-
}).join("\n");
|
|
290
|
-
return JSON.stringify(content);
|
|
291
|
-
};
|
|
292
|
-
return {
|
|
293
|
-
output: `MCP Tool Result (${toolName}): ${normalizeContent(result?.content)}`,
|
|
294
|
-
isError: false
|
|
295
|
-
};
|
|
296
|
-
} catch (error) {
|
|
297
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
298
|
-
logger_default.debug(`MCP tool execution failed for ${toolName}: ${errorMessage}`);
|
|
299
|
-
return {
|
|
300
|
-
output: `MCP Tool Error (${toolName}): ${errorMessage}`,
|
|
301
|
-
isError: true
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Sets the MCP client, preserving any loaded callbacks
|
|
307
|
-
*/
|
|
308
|
-
setMcpClient(client) {
|
|
309
|
-
this.mcpClient = client;
|
|
310
|
-
this.mcpToolNames = null;
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Clears the cached callbacks
|
|
314
|
-
*/
|
|
315
|
-
clearCache() {
|
|
316
|
-
this.loadedCallbacks = {};
|
|
317
|
-
}
|
|
318
|
-
};
|
|
319
|
-
|
|
320
149
|
//#endregion
|
|
321
150
|
//#region src/providers/azure/defaults.ts
|
|
322
151
|
const DEFAULT_AZURE_API_VERSION = "2024-12-01-preview";
|
|
@@ -1095,6 +924,13 @@ const AZURE_MODELS = [
|
|
|
1095
924
|
output: 6 / 1e6
|
|
1096
925
|
}
|
|
1097
926
|
},
|
|
927
|
+
{
|
|
928
|
+
id: "claude-sonnet-4-6",
|
|
929
|
+
cost: {
|
|
930
|
+
input: 3 / 1e6,
|
|
931
|
+
output: 15 / 1e6
|
|
932
|
+
}
|
|
933
|
+
},
|
|
1098
934
|
{
|
|
1099
935
|
id: "claude-opus-4-6",
|
|
1100
936
|
cost: {
|
|
@@ -1389,6 +1225,13 @@ const AZURE_MODELS = [
|
|
|
1389
1225
|
output: .026 / 1e6
|
|
1390
1226
|
}
|
|
1391
1227
|
},
|
|
1228
|
+
{
|
|
1229
|
+
id: "Mistral-Large-3",
|
|
1230
|
+
cost: {
|
|
1231
|
+
input: .5 / 1e6,
|
|
1232
|
+
output: 1.5 / 1e6
|
|
1233
|
+
}
|
|
1234
|
+
},
|
|
1392
1235
|
{
|
|
1393
1236
|
id: "Mistral-Large-2411",
|
|
1394
1237
|
cost: {
|
|
@@ -2447,7 +2290,7 @@ var AIStudioChatProvider = class extends GoogleGenericProvider {
|
|
|
2447
2290
|
temperature: config.temperature,
|
|
2448
2291
|
topP: config.topP,
|
|
2449
2292
|
topK: config.topK,
|
|
2450
|
-
safetySettings: config.safetySettings,
|
|
2293
|
+
safetySettings: normalizeSafetySettings(config.safetySettings),
|
|
2451
2294
|
stopSequences: config.stopSequences,
|
|
2452
2295
|
maxOutputTokens: config.maxOutputTokens
|
|
2453
2296
|
};
|
|
@@ -2521,7 +2364,7 @@ var AIStudioChatProvider = class extends GoogleGenericProvider {
|
|
|
2521
2364
|
...config.maxOutputTokens !== void 0 && { maxOutputTokens: config.maxOutputTokens },
|
|
2522
2365
|
...config.generationConfig
|
|
2523
2366
|
},
|
|
2524
|
-
safetySettings: config.safetySettings,
|
|
2367
|
+
safetySettings: normalizeSafetySettings(config.safetySettings),
|
|
2525
2368
|
...config.toolConfig ? { toolConfig: config.toolConfig } : {},
|
|
2526
2369
|
...allTools.length > 0 ? { tools: allTools } : {},
|
|
2527
2370
|
...systemInstruction ? { system_instruction: systemInstruction } : {}
|
|
@@ -2840,7 +2683,7 @@ var VertexChatProvider = class extends GoogleGenericProvider {
|
|
|
2840
2683
|
topK: config.topK,
|
|
2841
2684
|
...config.generationConfig
|
|
2842
2685
|
},
|
|
2843
|
-
...config.safetySettings ? { safetySettings: config.safetySettings } : {},
|
|
2686
|
+
...config.safetySettings ? { safetySettings: normalizeSafetySettings(config.safetySettings) } : {},
|
|
2844
2687
|
...config.toolConfig ? { toolConfig: config.toolConfig } : {},
|
|
2845
2688
|
...allTools.length > 0 ? { tools: allTools } : {},
|
|
2846
2689
|
...systemInstruction ? { systemInstruction } : {},
|
|
@@ -3054,7 +2897,7 @@ var VertexChatProvider = class extends GoogleGenericProvider {
|
|
|
3054
2897
|
parameters: {
|
|
3055
2898
|
context: this.config.context,
|
|
3056
2899
|
examples: this.config.examples,
|
|
3057
|
-
safetySettings: this.config.safetySettings,
|
|
2900
|
+
safetySettings: normalizeSafetySettings(this.config.safetySettings),
|
|
3058
2901
|
stopSequences: this.config.stopSequences,
|
|
3059
2902
|
temperature: this.config.temperature,
|
|
3060
2903
|
maxOutputTokens: this.config.maxOutputTokens,
|
|
@@ -3405,7 +3248,7 @@ const MISTRAL_EMBEDDING_MODELS = [{
|
|
|
3405
3248
|
output: .1 / 1e6
|
|
3406
3249
|
}
|
|
3407
3250
|
}];
|
|
3408
|
-
function getTokenUsage$
|
|
3251
|
+
function getTokenUsage$1(data, cached) {
|
|
3409
3252
|
if (data.usage) if (cached) return {
|
|
3410
3253
|
cached: data.usage.total_tokens,
|
|
3411
3254
|
total: data.usage.total_tokens,
|
|
@@ -3539,7 +3382,7 @@ var MistralChatCompletionProvider = class MistralChatCompletionProvider {
|
|
|
3539
3382
|
if (!data.choices || !data.choices[0] || !data.choices[0].message.content) return { error: `Malformed response data: ${JSON.stringify(data)}` };
|
|
3540
3383
|
const result = {
|
|
3541
3384
|
output: data.choices[0].message.content,
|
|
3542
|
-
tokenUsage: getTokenUsage$
|
|
3385
|
+
tokenUsage: getTokenUsage$1(data, cached),
|
|
3543
3386
|
cached,
|
|
3544
3387
|
cost: calculateMistralCost(this.modelName, config, data.usage?.prompt_tokens, data.usage?.completion_tokens)
|
|
3545
3388
|
};
|
|
@@ -3616,7 +3459,7 @@ var MistralEmbeddingProvider = class {
|
|
|
3616
3459
|
try {
|
|
3617
3460
|
const embedding = data?.data?.[0]?.embedding;
|
|
3618
3461
|
if (!embedding) throw new Error("No embedding found in Mistral Embedding API response");
|
|
3619
|
-
const tokenUsage = getTokenUsage$
|
|
3462
|
+
const tokenUsage = getTokenUsage$1(data, cached);
|
|
3620
3463
|
const promptTokens = tokenUsage.prompt || 0;
|
|
3621
3464
|
const completionTokens = 0;
|
|
3622
3465
|
return {
|
|
@@ -3757,472 +3600,6 @@ var OpenAiModerationProvider = class OpenAiModerationProvider extends OpenAiGene
|
|
|
3757
3600
|
}
|
|
3758
3601
|
};
|
|
3759
3602
|
|
|
3760
|
-
//#endregion
|
|
3761
|
-
//#region src/providers/responses/processor.ts
|
|
3762
|
-
/**
|
|
3763
|
-
* Extract user-facing metadata from response data.
|
|
3764
|
-
* Only includes fields that are useful for users viewing eval results.
|
|
3765
|
-
*/
|
|
3766
|
-
function extractMetadata(data, processedOutput) {
|
|
3767
|
-
const metadata = {};
|
|
3768
|
-
if (typeof data.id === "string" && data.id) metadata.responseId = data.id;
|
|
3769
|
-
if (typeof data.model === "string" && data.model) metadata.model = data.model;
|
|
3770
|
-
if (Array.isArray(processedOutput.annotations) && processedOutput.annotations.length > 0) metadata.annotations = processedOutput.annotations;
|
|
3771
|
-
return metadata;
|
|
3772
|
-
}
|
|
3773
|
-
/**
|
|
3774
|
-
* Extract token usage from response data, handling both OpenAI Chat Completions format
|
|
3775
|
-
* (prompt_tokens, completion_tokens) and Azure Responses format (input_tokens, output_tokens)
|
|
3776
|
-
*/
|
|
3777
|
-
function getTokenUsage$1(data, cached) {
|
|
3778
|
-
if (data.usage) if (cached) {
|
|
3779
|
-
const totalTokens = data.usage.total_tokens || (data.usage.input_tokens || 0) + (data.usage.output_tokens || 0);
|
|
3780
|
-
return {
|
|
3781
|
-
cached: totalTokens,
|
|
3782
|
-
total: totalTokens,
|
|
3783
|
-
numRequests: 1
|
|
3784
|
-
};
|
|
3785
|
-
} else {
|
|
3786
|
-
const promptTokens = data.usage.prompt_tokens || data.usage.input_tokens || 0;
|
|
3787
|
-
const completionTokens = data.usage.completion_tokens || data.usage.output_tokens || 0;
|
|
3788
|
-
return {
|
|
3789
|
-
total: data.usage.total_tokens || promptTokens + completionTokens,
|
|
3790
|
-
prompt: promptTokens,
|
|
3791
|
-
completion: completionTokens,
|
|
3792
|
-
numRequests: 1,
|
|
3793
|
-
...data.usage.completion_tokens_details ? { completionDetails: {
|
|
3794
|
-
reasoning: data.usage.completion_tokens_details.reasoning_tokens,
|
|
3795
|
-
acceptedPrediction: data.usage.completion_tokens_details.accepted_prediction_tokens,
|
|
3796
|
-
rejectedPrediction: data.usage.completion_tokens_details.rejected_prediction_tokens
|
|
3797
|
-
} } : {}
|
|
3798
|
-
};
|
|
3799
|
-
}
|
|
3800
|
-
return {};
|
|
3801
|
-
}
|
|
3802
|
-
/**
|
|
3803
|
-
* Shared response processor for OpenAI and Azure Responses APIs.
|
|
3804
|
-
* Handles all response types with identical logic to ensure feature parity.
|
|
3805
|
-
*/
|
|
3806
|
-
var ResponsesProcessor = class {
|
|
3807
|
-
constructor(config) {
|
|
3808
|
-
this.config = config;
|
|
3809
|
-
}
|
|
3810
|
-
async processResponseOutput(data, requestConfig, cached) {
|
|
3811
|
-
logger_default.debug(`Processing ${this.config.providerType} responses output`, {
|
|
3812
|
-
responseId: data.id,
|
|
3813
|
-
model: data.model
|
|
3814
|
-
});
|
|
3815
|
-
if (data.error) return { error: formatOpenAiError(data) };
|
|
3816
|
-
try {
|
|
3817
|
-
const context = {
|
|
3818
|
-
config: requestConfig,
|
|
3819
|
-
cached,
|
|
3820
|
-
data
|
|
3821
|
-
};
|
|
3822
|
-
const processedOutput = await this.processOutput(data.output, context);
|
|
3823
|
-
if (processedOutput.isRefusal) return {
|
|
3824
|
-
output: processedOutput.refusal,
|
|
3825
|
-
tokenUsage: getTokenUsage$1(data, cached),
|
|
3826
|
-
isRefusal: true,
|
|
3827
|
-
cached,
|
|
3828
|
-
cost: this.config.costCalculator(this.config.modelName, data.usage, requestConfig),
|
|
3829
|
-
raw: data,
|
|
3830
|
-
metadata: extractMetadata(data, processedOutput)
|
|
3831
|
-
};
|
|
3832
|
-
let finalOutput = processedOutput.result;
|
|
3833
|
-
if (requestConfig.response_format?.type === "json_schema" && typeof finalOutput === "string") try {
|
|
3834
|
-
finalOutput = JSON.parse(finalOutput);
|
|
3835
|
-
} catch (error) {
|
|
3836
|
-
logger_default.error(`Failed to parse JSON output: ${error}`);
|
|
3837
|
-
}
|
|
3838
|
-
const result = {
|
|
3839
|
-
output: finalOutput,
|
|
3840
|
-
tokenUsage: getTokenUsage$1(data, cached),
|
|
3841
|
-
cached,
|
|
3842
|
-
cost: this.config.costCalculator(this.config.modelName, data.usage, requestConfig),
|
|
3843
|
-
raw: data,
|
|
3844
|
-
metadata: extractMetadata(data, processedOutput)
|
|
3845
|
-
};
|
|
3846
|
-
if (processedOutput.annotations && processedOutput.annotations.length > 0) result.raw = {
|
|
3847
|
-
...data,
|
|
3848
|
-
annotations: processedOutput.annotations
|
|
3849
|
-
};
|
|
3850
|
-
return result;
|
|
3851
|
-
} catch (err) {
|
|
3852
|
-
return { error: `Error parsing response: ${String(err)}\nResponse: ${JSON.stringify(data)}` };
|
|
3853
|
-
}
|
|
3854
|
-
}
|
|
3855
|
-
async processOutput(output, context) {
|
|
3856
|
-
if (this.config.modelName.includes("deep-research")) logger_default.debug(`Deep research response structure: ${JSON.stringify(context.data, null, 2)}`);
|
|
3857
|
-
if (!output || !Array.isArray(output) || output.length === 0) throw new Error("Invalid response format: Missing output array");
|
|
3858
|
-
let result = "";
|
|
3859
|
-
let refusal = "";
|
|
3860
|
-
let isRefusal = false;
|
|
3861
|
-
const annotations = [];
|
|
3862
|
-
for (const item of output) {
|
|
3863
|
-
if (!item || typeof item !== "object") {
|
|
3864
|
-
logger_default.warn(`Skipping invalid output item: ${JSON.stringify(item)}`);
|
|
3865
|
-
continue;
|
|
3866
|
-
}
|
|
3867
|
-
const processed = await this.processOutputItem(item, context);
|
|
3868
|
-
if (processed.isRefusal) {
|
|
3869
|
-
refusal = processed.content || "";
|
|
3870
|
-
isRefusal = true;
|
|
3871
|
-
} else if (processed.content) if (result) result += "\n" + processed.content;
|
|
3872
|
-
else result = processed.content;
|
|
3873
|
-
if (processed.annotations) annotations.push(...processed.annotations);
|
|
3874
|
-
}
|
|
3875
|
-
return {
|
|
3876
|
-
result,
|
|
3877
|
-
refusal,
|
|
3878
|
-
isRefusal,
|
|
3879
|
-
annotations: annotations.length > 0 ? annotations : void 0
|
|
3880
|
-
};
|
|
3881
|
-
}
|
|
3882
|
-
async processOutputItem(item, context) {
|
|
3883
|
-
switch (item.type) {
|
|
3884
|
-
case "function_call": return await this.processFunctionCall(item, context);
|
|
3885
|
-
case "message": return await this.processMessage(item, context);
|
|
3886
|
-
case "tool_result": return this.processToolResult(item);
|
|
3887
|
-
case "reasoning": return this.processReasoning(item);
|
|
3888
|
-
case "web_search_call": return this.processWebSearch(item);
|
|
3889
|
-
case "code_interpreter_call": return this.processCodeInterpreter(item);
|
|
3890
|
-
case "mcp_list_tools": return this.processMcpListTools(item);
|
|
3891
|
-
case "mcp_call": return this.processMcpCall(item);
|
|
3892
|
-
case "mcp_approval_request": return this.processMcpApprovalRequest(item);
|
|
3893
|
-
default:
|
|
3894
|
-
logger_default.debug(`Unknown output item type: ${item.type}`);
|
|
3895
|
-
return {};
|
|
3896
|
-
}
|
|
3897
|
-
}
|
|
3898
|
-
async processFunctionCall(item, context) {
|
|
3899
|
-
let functionResult;
|
|
3900
|
-
if (item.arguments === "{}" && item.status === "completed") functionResult = JSON.stringify({
|
|
3901
|
-
type: "function_call",
|
|
3902
|
-
name: item.name,
|
|
3903
|
-
status: "no_arguments_provided",
|
|
3904
|
-
note: "Function called but no arguments were extracted. Consider using the correct Responses API tool format."
|
|
3905
|
-
});
|
|
3906
|
-
else functionResult = await this.config.functionCallbackHandler.processCalls(item, context.config.functionToolCallbacks);
|
|
3907
|
-
return { content: functionResult };
|
|
3908
|
-
}
|
|
3909
|
-
async processMessage(item, context) {
|
|
3910
|
-
if (item.role !== "assistant") return {};
|
|
3911
|
-
let content = "";
|
|
3912
|
-
let isRefusal = false;
|
|
3913
|
-
let refusal = "";
|
|
3914
|
-
const annotations = [];
|
|
3915
|
-
if (item.content) for (const contentItem of item.content) {
|
|
3916
|
-
if (!contentItem || typeof contentItem !== "object") {
|
|
3917
|
-
logger_default.warn(`Skipping invalid content item: ${JSON.stringify(contentItem)}`);
|
|
3918
|
-
continue;
|
|
3919
|
-
}
|
|
3920
|
-
if (contentItem.type === "output_text") {
|
|
3921
|
-
content += contentItem.text;
|
|
3922
|
-
if (Array.isArray(contentItem.annotations) && contentItem.annotations.length > 0) annotations.push(...contentItem.annotations);
|
|
3923
|
-
} else if (contentItem.type === "tool_use" || contentItem.type === "function_call") content = await this.config.functionCallbackHandler.processCalls(contentItem, context.config.functionToolCallbacks);
|
|
3924
|
-
else if (contentItem.type === "refusal") {
|
|
3925
|
-
refusal = contentItem.refusal;
|
|
3926
|
-
isRefusal = true;
|
|
3927
|
-
}
|
|
3928
|
-
}
|
|
3929
|
-
else if (item.refusal) {
|
|
3930
|
-
refusal = item.refusal;
|
|
3931
|
-
isRefusal = true;
|
|
3932
|
-
}
|
|
3933
|
-
return {
|
|
3934
|
-
content: isRefusal ? refusal : content,
|
|
3935
|
-
isRefusal,
|
|
3936
|
-
annotations: annotations.length > 0 ? annotations : void 0
|
|
3937
|
-
};
|
|
3938
|
-
}
|
|
3939
|
-
processToolResult(item) {
|
|
3940
|
-
return Promise.resolve({ content: JSON.stringify(item) });
|
|
3941
|
-
}
|
|
3942
|
-
processReasoning(item) {
|
|
3943
|
-
if (!item.summary || !item.summary.length) return Promise.resolve({});
|
|
3944
|
-
const reasoningText = `Reasoning: ${item.summary.map((s) => s.text).join("\n")}`;
|
|
3945
|
-
return Promise.resolve({ content: reasoningText });
|
|
3946
|
-
}
|
|
3947
|
-
processWebSearch(item) {
|
|
3948
|
-
let content = "";
|
|
3949
|
-
const action = item.action;
|
|
3950
|
-
if (action) if (action.type === "search") content = `Web Search: "${action.query}"`;
|
|
3951
|
-
else if (action.type === "open_page") content = `Opening page: ${action.url}`;
|
|
3952
|
-
else if (action.type === "find_in_page") content = `Finding in page: "${action.query}"`;
|
|
3953
|
-
else content = `Web action: ${action.type}`;
|
|
3954
|
-
else content = `Web Search Call (status: ${item.status || "unknown"})`;
|
|
3955
|
-
if (item.status === "failed" && item.error) content += ` (Error: ${item.error})`;
|
|
3956
|
-
return Promise.resolve({ content });
|
|
3957
|
-
}
|
|
3958
|
-
processCodeInterpreter(item) {
|
|
3959
|
-
let content = `Code Interpreter: ${item.code || "Running code..."}`;
|
|
3960
|
-
if (item.status === "failed" && item.error) content += ` (Error: ${item.error})`;
|
|
3961
|
-
return Promise.resolve({ content });
|
|
3962
|
-
}
|
|
3963
|
-
processMcpListTools(item) {
|
|
3964
|
-
const content = `MCP Tools from ${item.server_label}: ${JSON.stringify(item.tools, null, 2)}`;
|
|
3965
|
-
return Promise.resolve({ content });
|
|
3966
|
-
}
|
|
3967
|
-
processMcpCall(item) {
|
|
3968
|
-
let content;
|
|
3969
|
-
if (item.error) content = `MCP Tool Error (${item.name}): ${item.error}`;
|
|
3970
|
-
else content = `MCP Tool Result (${item.name}): ${item.output}`;
|
|
3971
|
-
return Promise.resolve({ content });
|
|
3972
|
-
}
|
|
3973
|
-
processMcpApprovalRequest(item) {
|
|
3974
|
-
const content = `MCP Approval Required for ${item.server_label}.${item.name}: ${item.arguments}`;
|
|
3975
|
-
return Promise.resolve({ content });
|
|
3976
|
-
}
|
|
3977
|
-
};
|
|
3978
|
-
|
|
3979
|
-
//#endregion
|
|
3980
|
-
//#region src/providers/openai/responses.ts
|
|
3981
|
-
var OpenAiResponsesProvider = class extends OpenAiGenericProvider {
|
|
3982
|
-
functionCallbackHandler = new FunctionCallbackHandler();
|
|
3983
|
-
processor;
|
|
3984
|
-
static OPENAI_RESPONSES_MODEL_NAMES = [
|
|
3985
|
-
"gpt-4o",
|
|
3986
|
-
"gpt-4o-2024-08-06",
|
|
3987
|
-
"gpt-4o-2024-11-20",
|
|
3988
|
-
"gpt-4o-2024-05-13",
|
|
3989
|
-
"gpt-4o-2024-07-18",
|
|
3990
|
-
"gpt-4o-mini",
|
|
3991
|
-
"gpt-4o-mini-2024-07-18",
|
|
3992
|
-
"gpt-4.1",
|
|
3993
|
-
"gpt-4.1-2025-04-14",
|
|
3994
|
-
"gpt-4.1-mini",
|
|
3995
|
-
"gpt-4.1-mini-2025-04-14",
|
|
3996
|
-
"gpt-4.1-nano",
|
|
3997
|
-
"gpt-4.1-nano-2025-04-14",
|
|
3998
|
-
"gpt-5",
|
|
3999
|
-
"gpt-5-2025-08-07",
|
|
4000
|
-
"gpt-5-chat",
|
|
4001
|
-
"gpt-5-chat-latest",
|
|
4002
|
-
"gpt-5-nano",
|
|
4003
|
-
"gpt-5-nano-2025-08-07",
|
|
4004
|
-
"gpt-5-mini",
|
|
4005
|
-
"gpt-5-mini-2025-08-07",
|
|
4006
|
-
"gpt-5-pro",
|
|
4007
|
-
"gpt-5-pro-2025-10-06",
|
|
4008
|
-
"gpt-5.1",
|
|
4009
|
-
"gpt-5.1-2025-11-13",
|
|
4010
|
-
"gpt-5.1-mini",
|
|
4011
|
-
"gpt-5.1-nano",
|
|
4012
|
-
"gpt-5.1-codex",
|
|
4013
|
-
"gpt-5.1-codex-max",
|
|
4014
|
-
"gpt-5.1-chat-latest",
|
|
4015
|
-
"gpt-5.2",
|
|
4016
|
-
"gpt-5.2-2025-12-11",
|
|
4017
|
-
"gpt-audio",
|
|
4018
|
-
"gpt-audio-2025-08-28",
|
|
4019
|
-
"gpt-audio-mini",
|
|
4020
|
-
"gpt-audio-mini-2025-10-06",
|
|
4021
|
-
"computer-use-preview",
|
|
4022
|
-
"computer-use-preview-2025-03-11",
|
|
4023
|
-
"o1",
|
|
4024
|
-
"o1-2024-12-17",
|
|
4025
|
-
"o1-preview",
|
|
4026
|
-
"o1-preview-2024-09-12",
|
|
4027
|
-
"o1-mini",
|
|
4028
|
-
"o1-mini-2024-09-12",
|
|
4029
|
-
"o1-pro",
|
|
4030
|
-
"o1-pro-2025-03-19",
|
|
4031
|
-
"o3-pro",
|
|
4032
|
-
"o3-pro-2025-06-10",
|
|
4033
|
-
"o3",
|
|
4034
|
-
"o3-2025-04-16",
|
|
4035
|
-
"o4-mini",
|
|
4036
|
-
"o4-mini-2025-04-16",
|
|
4037
|
-
"o3-mini",
|
|
4038
|
-
"o3-mini-2025-01-31",
|
|
4039
|
-
"codex-mini-latest",
|
|
4040
|
-
"gpt-5-codex",
|
|
4041
|
-
"o3-deep-research",
|
|
4042
|
-
"o3-deep-research-2025-06-26",
|
|
4043
|
-
"o4-mini-deep-research",
|
|
4044
|
-
"o4-mini-deep-research-2025-06-26"
|
|
4045
|
-
];
|
|
4046
|
-
config;
|
|
4047
|
-
constructor(modelName, options = {}) {
|
|
4048
|
-
super(modelName, options);
|
|
4049
|
-
this.config = options.config || {};
|
|
4050
|
-
this.processor = new ResponsesProcessor({
|
|
4051
|
-
modelName: this.modelName,
|
|
4052
|
-
providerType: "openai",
|
|
4053
|
-
functionCallbackHandler: this.functionCallbackHandler,
|
|
4054
|
-
costCalculator: (modelName, usage, config) => calculateOpenAICost(modelName, config, usage?.input_tokens, usage?.output_tokens, 0, 0) ?? 0
|
|
4055
|
-
});
|
|
4056
|
-
}
|
|
4057
|
-
isGPT5Model() {
|
|
4058
|
-
return this.modelName.startsWith("gpt-5") || this.modelName.includes("/gpt-5");
|
|
4059
|
-
}
|
|
4060
|
-
isReasoningModel() {
|
|
4061
|
-
return this.modelName.startsWith("o1") || this.modelName.startsWith("o3") || this.modelName.startsWith("o4") || this.modelName.includes("/o1") || this.modelName.includes("/o3") || this.modelName.includes("/o4") || this.modelName === "codex-mini-latest" || this.isGPT5Model();
|
|
4062
|
-
}
|
|
4063
|
-
supportsTemperature() {
|
|
4064
|
-
return !this.isReasoningModel();
|
|
4065
|
-
}
|
|
4066
|
-
async getOpenAiBody(prompt, context, _callApiOptions) {
|
|
4067
|
-
const config = {
|
|
4068
|
-
...this.config,
|
|
4069
|
-
...context?.prompt?.config
|
|
4070
|
-
};
|
|
4071
|
-
let input;
|
|
4072
|
-
try {
|
|
4073
|
-
const parsedJson = JSON.parse(prompt);
|
|
4074
|
-
if (Array.isArray(parsedJson)) input = parsedJson;
|
|
4075
|
-
else input = prompt;
|
|
4076
|
-
} catch {
|
|
4077
|
-
input = prompt;
|
|
4078
|
-
}
|
|
4079
|
-
const isReasoningModel = this.isReasoningModel();
|
|
4080
|
-
const maxOutputTokens = config.max_output_tokens ?? (isReasoningModel ? getEnvInt("OPENAI_MAX_COMPLETION_TOKENS") : getEnvInt("OPENAI_MAX_TOKENS", 1024));
|
|
4081
|
-
const temperature = this.supportsTemperature() ? config.temperature ?? getEnvFloat("OPENAI_TEMPERATURE", 0) : void 0;
|
|
4082
|
-
const reasoningEffort = isReasoningModel ? renderVarsInObject(config.reasoning_effort, context?.vars) : void 0;
|
|
4083
|
-
const instructions = config.instructions;
|
|
4084
|
-
const responseFormat = maybeLoadResponseFormatFromExternalFile(config.response_format, context?.vars);
|
|
4085
|
-
let textFormat;
|
|
4086
|
-
if (responseFormat) if (responseFormat.type === "json_object") textFormat = { format: { type: "json_object" } };
|
|
4087
|
-
else if (responseFormat.type === "json_schema") {
|
|
4088
|
-
const schema = responseFormat.schema || responseFormat.json_schema?.schema;
|
|
4089
|
-
textFormat = { format: {
|
|
4090
|
-
type: "json_schema",
|
|
4091
|
-
name: responseFormat.json_schema?.name || responseFormat.name || "response_schema",
|
|
4092
|
-
schema,
|
|
4093
|
-
strict: true
|
|
4094
|
-
} };
|
|
4095
|
-
} else textFormat = { format: { type: "text" } };
|
|
4096
|
-
else textFormat = { format: { type: "text" } };
|
|
4097
|
-
if (this.isGPT5Model() && config.verbosity) textFormat = {
|
|
4098
|
-
...textFormat,
|
|
4099
|
-
verbosity: config.verbosity
|
|
4100
|
-
};
|
|
4101
|
-
const loadedTools = config.tools ? await maybeLoadToolsFromExternalFile(config.tools, context?.vars) : void 0;
|
|
4102
|
-
const body = {
|
|
4103
|
-
model: this.modelName,
|
|
4104
|
-
input,
|
|
4105
|
-
...maxOutputTokens !== void 0 ? { max_output_tokens: maxOutputTokens } : {},
|
|
4106
|
-
...reasoningEffort ? { reasoning: { effort: reasoningEffort } } : {},
|
|
4107
|
-
...temperature !== void 0 ? { temperature } : {},
|
|
4108
|
-
...instructions ? { instructions } : {},
|
|
4109
|
-
...config.top_p !== void 0 || getEnvString("OPENAI_TOP_P") ? { top_p: config.top_p ?? getEnvFloat("OPENAI_TOP_P", 1) } : {},
|
|
4110
|
-
...loadedTools ? { tools: loadedTools } : {},
|
|
4111
|
-
...config.tool_choice ? { tool_choice: config.tool_choice } : {},
|
|
4112
|
-
...config.max_tool_calls ? { max_tool_calls: config.max_tool_calls } : {},
|
|
4113
|
-
...config.previous_response_id ? { previous_response_id: config.previous_response_id } : {},
|
|
4114
|
-
text: textFormat,
|
|
4115
|
-
...config.truncation ? { truncation: config.truncation } : {},
|
|
4116
|
-
...config.metadata ? { metadata: config.metadata } : {},
|
|
4117
|
-
..."parallel_tool_calls" in config ? { parallel_tool_calls: Boolean(config.parallel_tool_calls) } : {},
|
|
4118
|
-
...config.stream ? { stream: config.stream } : {},
|
|
4119
|
-
..."store" in config ? { store: Boolean(config.store) } : {},
|
|
4120
|
-
...config.background ? { background: config.background } : {},
|
|
4121
|
-
...config.webhook_url ? { webhook_url: config.webhook_url } : {},
|
|
4122
|
-
...config.user ? { user: config.user } : {},
|
|
4123
|
-
...config.passthrough || {}
|
|
4124
|
-
};
|
|
4125
|
-
if (config.reasoning && this.isReasoningModel()) body.reasoning = config.reasoning;
|
|
4126
|
-
return {
|
|
4127
|
-
body,
|
|
4128
|
-
config: {
|
|
4129
|
-
...config,
|
|
4130
|
-
tools: loadedTools,
|
|
4131
|
-
response_format: responseFormat
|
|
4132
|
-
}
|
|
4133
|
-
};
|
|
4134
|
-
}
|
|
4135
|
-
async callApi(prompt, context, callApiOptions) {
|
|
4136
|
-
if (!this.getApiKey()) throw new Error("OpenAI API key is not set. Set the OPENAI_API_KEY environment variable or add `apiKey` to the provider config.");
|
|
4137
|
-
const { body, config } = await this.getOpenAiBody(prompt, context, callApiOptions);
|
|
4138
|
-
const isDeepResearchModel = this.modelName.includes("deep-research");
|
|
4139
|
-
if (isDeepResearchModel) {
|
|
4140
|
-
if (!config.tools?.some((tool) => tool.type === "web_search_preview")) return { error: `Deep research model ${this.modelName} requires the web_search_preview tool to be configured. Add it to your provider config:\ntools:\n - type: web_search_preview` };
|
|
4141
|
-
const mcpTools = config.tools?.filter((tool) => tool.type === "mcp") || [];
|
|
4142
|
-
for (const mcpTool of mcpTools) if (mcpTool.require_approval !== "never") return { error: `Deep research model ${this.modelName} requires MCP tools to have require_approval: 'never'. Update your MCP tool configuration:\ntools:\n - type: mcp\n require_approval: never` };
|
|
4143
|
-
}
|
|
4144
|
-
let timeout = REQUEST_TIMEOUT_MS;
|
|
4145
|
-
if (isDeepResearchModel || this.modelName.includes("gpt-5-pro")) {
|
|
4146
|
-
const evalTimeout = getEnvInt("PROMPTFOO_EVAL_TIMEOUT_MS", 0);
|
|
4147
|
-
timeout = evalTimeout > 0 ? evalTimeout : LONG_RUNNING_MODEL_TIMEOUT_MS;
|
|
4148
|
-
logger_default.debug(`Using timeout of ${timeout}ms for long-running model ${this.modelName}`);
|
|
4149
|
-
}
|
|
4150
|
-
let data;
|
|
4151
|
-
let status;
|
|
4152
|
-
let statusText;
|
|
4153
|
-
let cached = false;
|
|
4154
|
-
let deleteFromCache;
|
|
4155
|
-
let responseHeaders;
|
|
4156
|
-
try {
|
|
4157
|
-
({data, cached, status, statusText, deleteFromCache, headers: responseHeaders} = await fetchWithCache(`${this.getApiUrl()}/responses`, {
|
|
4158
|
-
method: "POST",
|
|
4159
|
-
headers: {
|
|
4160
|
-
"Content-Type": "application/json",
|
|
4161
|
-
Authorization: `Bearer ${this.getApiKey()}`,
|
|
4162
|
-
...this.getOrganization() ? { "OpenAI-Organization": this.getOrganization() } : {},
|
|
4163
|
-
...config.headers
|
|
4164
|
-
},
|
|
4165
|
-
body: JSON.stringify(body)
|
|
4166
|
-
}, timeout, "json", context?.bustCache ?? context?.debug, this.config.maxRetries));
|
|
4167
|
-
if (status < 200 || status >= 300) {
|
|
4168
|
-
const errorMessage = `API error: ${status} ${statusText}\n${typeof data === "string" ? data : JSON.stringify(data)}`;
|
|
4169
|
-
if (typeof data === "object" && data?.error?.code === "invalid_prompt") return {
|
|
4170
|
-
output: errorMessage,
|
|
4171
|
-
tokenUsage: data?.usage ? getTokenUsage$3(data, cached) : void 0,
|
|
4172
|
-
isRefusal: true,
|
|
4173
|
-
metadata: { http: {
|
|
4174
|
-
status,
|
|
4175
|
-
statusText,
|
|
4176
|
-
headers: responseHeaders ?? {}
|
|
4177
|
-
} }
|
|
4178
|
-
};
|
|
4179
|
-
return {
|
|
4180
|
-
error: errorMessage,
|
|
4181
|
-
metadata: { http: {
|
|
4182
|
-
status,
|
|
4183
|
-
statusText,
|
|
4184
|
-
headers: responseHeaders ?? {}
|
|
4185
|
-
} }
|
|
4186
|
-
};
|
|
4187
|
-
}
|
|
4188
|
-
} catch (err) {
|
|
4189
|
-
logger_default.error(`API call error: ${String(err)}`);
|
|
4190
|
-
await deleteFromCache?.();
|
|
4191
|
-
return {
|
|
4192
|
-
error: `API call error: ${String(err)}`,
|
|
4193
|
-
metadata: { http: {
|
|
4194
|
-
status: 0,
|
|
4195
|
-
statusText: "Error",
|
|
4196
|
-
headers: responseHeaders ?? {}
|
|
4197
|
-
} }
|
|
4198
|
-
};
|
|
4199
|
-
}
|
|
4200
|
-
if (data.error?.message) {
|
|
4201
|
-
await deleteFromCache?.();
|
|
4202
|
-
return {
|
|
4203
|
-
error: formatOpenAiError(data),
|
|
4204
|
-
metadata: { http: {
|
|
4205
|
-
status,
|
|
4206
|
-
statusText,
|
|
4207
|
-
headers: responseHeaders ?? {}
|
|
4208
|
-
} }
|
|
4209
|
-
};
|
|
4210
|
-
}
|
|
4211
|
-
const result = await this.processor.processResponseOutput(data, config, cached);
|
|
4212
|
-
return {
|
|
4213
|
-
...result,
|
|
4214
|
-
metadata: {
|
|
4215
|
-
...result.metadata,
|
|
4216
|
-
http: {
|
|
4217
|
-
status,
|
|
4218
|
-
statusText,
|
|
4219
|
-
headers: responseHeaders ?? {}
|
|
4220
|
-
}
|
|
4221
|
-
}
|
|
4222
|
-
};
|
|
4223
|
-
}
|
|
4224
|
-
};
|
|
4225
|
-
|
|
4226
3603
|
//#endregion
|
|
4227
3604
|
//#region src/util/cloud.ts
|
|
4228
3605
|
const PERMISSION_CHECK_SERVER_FEATURE_NAME = "config-permission-check-endpoint";
|
|
@@ -4283,6 +3660,98 @@ async function getProviderFromCloud(id) {
|
|
|
4283
3660
|
throw new Error(`Failed to fetch provider from cloud: ${id}.`);
|
|
4284
3661
|
}
|
|
4285
3662
|
}
|
|
3663
|
+
function isRecord(value) {
|
|
3664
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
3665
|
+
}
|
|
3666
|
+
async function fetchCloudConfig(path) {
|
|
3667
|
+
const response = await makeRequest(path, "GET");
|
|
3668
|
+
if (!response.ok) {
|
|
3669
|
+
const errorMessage = typeof response.text === "function" ? await response.text() : "";
|
|
3670
|
+
logger_default.error(`[Cloud] Failed to fetch config from cloud: ${errorMessage}. HTTP Status: ${response.status} -- ${response.statusText}.`);
|
|
3671
|
+
throw new Error(`Failed to fetch config from cloud: ${response.statusText}`);
|
|
3672
|
+
}
|
|
3673
|
+
return response.json();
|
|
3674
|
+
}
|
|
3675
|
+
function looksLikeEvalConfig(config) {
|
|
3676
|
+
return "providers" in config || "providerIds" in config || "prompts" in config || "tests" in config || "testCases" in config;
|
|
3677
|
+
}
|
|
3678
|
+
function extractEvalConfigPayload(body) {
|
|
3679
|
+
if (!isRecord(body)) throw new Error("Invalid cloud eval config response: expected a JSON object.");
|
|
3680
|
+
const bodyConfig = isRecord(body.config) ? body.config : void 0;
|
|
3681
|
+
if (!bodyConfig) {
|
|
3682
|
+
if (looksLikeEvalConfig(body)) return body;
|
|
3683
|
+
throw new Error("Invalid cloud eval config response: missing \"config\" object.");
|
|
3684
|
+
}
|
|
3685
|
+
const nestedConfig = isRecord(bodyConfig.config) ? bodyConfig.config : void 0;
|
|
3686
|
+
if (!nestedConfig) return {
|
|
3687
|
+
...bodyConfig,
|
|
3688
|
+
...typeof bodyConfig.name !== "string" && typeof body.name === "string" ? { name: body.name } : {}
|
|
3689
|
+
};
|
|
3690
|
+
return {
|
|
3691
|
+
...nestedConfig,
|
|
3692
|
+
...typeof nestedConfig.name !== "string" && typeof bodyConfig.name === "string" ? { name: bodyConfig.name } : {}
|
|
3693
|
+
};
|
|
3694
|
+
}
|
|
3695
|
+
function normalizeCloudEvalProvider(provider) {
|
|
3696
|
+
if (typeof provider !== "string") return provider;
|
|
3697
|
+
if (provider.startsWith(CLOUD_PROVIDER_PREFIX) || !isUuid(provider)) return provider;
|
|
3698
|
+
return `${CLOUD_PROVIDER_PREFIX}${provider}`;
|
|
3699
|
+
}
|
|
3700
|
+
function normalizeCloudEvalPrompt(prompt) {
|
|
3701
|
+
if (typeof prompt === "string") return prompt;
|
|
3702
|
+
if (isRecord(prompt)) {
|
|
3703
|
+
if (typeof prompt.content === "string") return prompt.content;
|
|
3704
|
+
if (typeof prompt.raw === "string") return prompt.raw;
|
|
3705
|
+
}
|
|
3706
|
+
return String(prompt ?? "");
|
|
3707
|
+
}
|
|
3708
|
+
function normalizeEvalConfig(config) {
|
|
3709
|
+
const providers = Array.isArray(config.providers) ? config.providers : Array.isArray(config.providerIds) ? config.providerIds : [];
|
|
3710
|
+
const prompts = Array.isArray(config.prompts) ? config.prompts : [];
|
|
3711
|
+
const tests = Array.isArray(config.tests) ? config.tests : Array.isArray(config.testCases) ? config.testCases : [];
|
|
3712
|
+
const commandLineOptions = {
|
|
3713
|
+
...isRecord(config.commandLineOptions) ? config.commandLineOptions : {},
|
|
3714
|
+
...config.maxConcurrency != null ? { maxConcurrency: config.maxConcurrency } : {},
|
|
3715
|
+
...config.delay != null ? { delay: config.delay } : {},
|
|
3716
|
+
...config.verbose != null ? { verbose: config.verbose } : {}
|
|
3717
|
+
};
|
|
3718
|
+
const normalizedConfig = {
|
|
3719
|
+
...config,
|
|
3720
|
+
providers: providers.map(normalizeCloudEvalProvider),
|
|
3721
|
+
prompts: prompts.map(normalizeCloudEvalPrompt),
|
|
3722
|
+
tests
|
|
3723
|
+
};
|
|
3724
|
+
if (Object.keys(commandLineOptions).length > 0) normalizedConfig.commandLineOptions = commandLineOptions;
|
|
3725
|
+
else delete normalizedConfig.commandLineOptions;
|
|
3726
|
+
if (typeof config.description === "string" && config.description.trim().length > 0) normalizedConfig.description = config.description;
|
|
3727
|
+
else if (typeof config.name === "string" && config.name.trim().length > 0) normalizedConfig.description = config.name;
|
|
3728
|
+
delete normalizedConfig.providerIds;
|
|
3729
|
+
delete normalizedConfig.testCases;
|
|
3730
|
+
delete normalizedConfig.maxConcurrency;
|
|
3731
|
+
delete normalizedConfig.delay;
|
|
3732
|
+
delete normalizedConfig.verbose;
|
|
3733
|
+
return normalizedConfig;
|
|
3734
|
+
}
|
|
3735
|
+
/**
|
|
3736
|
+
* Fetches an eval configuration from PromptFoo Cloud by ID.
|
|
3737
|
+
* The response may contain legacy eval fields, which are normalized into UnifiedConfig.
|
|
3738
|
+
* @param id - The unique identifier of the cloud eval configuration
|
|
3739
|
+
* @returns Promise resolving to a normalized unified configuration object
|
|
3740
|
+
* @throws Error if cloud is not enabled, config not found, or response shape is invalid
|
|
3741
|
+
*/
|
|
3742
|
+
async function getEvalConfigFromCloud(id) {
|
|
3743
|
+
if (!cloudConfig.isEnabled()) throw new Error(`Could not fetch Config ${id} from cloud. Cloud config is not enabled. Please run \`promptfoo auth login\` to login.`);
|
|
3744
|
+
try {
|
|
3745
|
+
const config = normalizeEvalConfig(extractEvalConfigPayload(await fetchCloudConfig(`configs/${id}`)));
|
|
3746
|
+
logger_default.info(`Eval config fetched from cloud: ${id}`);
|
|
3747
|
+
return config;
|
|
3748
|
+
} catch (e) {
|
|
3749
|
+
logger_default.error(`Failed to fetch eval config from cloud: ${id}.`);
|
|
3750
|
+
logger_default.error(String(e));
|
|
3751
|
+
if (e instanceof Error) throw e;
|
|
3752
|
+
throw new Error(String(e));
|
|
3753
|
+
}
|
|
3754
|
+
}
|
|
4286
3755
|
/**
|
|
4287
3756
|
* Checks if a provider path represents a cloud-based provider.
|
|
4288
3757
|
* @param providerPath - The provider path to check
|
|
@@ -5886,7 +5355,7 @@ async function loadRedteamProvider({ provider, jsonOnly = false, preferSmallMode
|
|
|
5886
5355
|
ret = redteamProvider;
|
|
5887
5356
|
} else if (typeof redteamProvider === "string" || isProviderOptions(redteamProvider)) {
|
|
5888
5357
|
logger_default.debug(`Loading ${purpose} provider`, { provider: redteamProvider });
|
|
5889
|
-
ret = (await (await import("./providers-
|
|
5358
|
+
ret = (await (await import("./providers-CQQrNaJk.js")).loadApiProviders([redteamProvider]))[0];
|
|
5890
5359
|
} else {
|
|
5891
5360
|
const defaultModel = preferSmallModel ? ATTACKER_MODEL_SMALL : ATTACKER_MODEL;
|
|
5892
5361
|
logger_default.debug(`Using default ${purpose} provider: ${defaultModel}`);
|
|
@@ -6165,7 +5634,7 @@ async function externalizeResponseForRedteamHistory(response, context) {
|
|
|
6165
5634
|
*/
|
|
6166
5635
|
async function tryUnblocking({ messages, lastResponse, goal, purpose }) {
|
|
6167
5636
|
try {
|
|
6168
|
-
const { checkServerFeatureSupport } = await import("./server-
|
|
5637
|
+
const { checkServerFeatureSupport } = await import("./server-BUbS0Qfh.js");
|
|
6169
5638
|
const supportsUnblocking = await checkServerFeatureSupport("blocking-question-analysis", "2025-06-16T14:49:11-07:00");
|
|
6170
5639
|
if (!getEnvBool("PROMPTFOO_ENABLE_UNBLOCKING")) {
|
|
6171
5640
|
logger_default.debug("[Unblocking] Disabled by default (set PROMPTFOO_ENABLE_UNBLOCKING=true to enable)");
|
|
@@ -9934,7 +9403,6 @@ async function addImageToBase64(testCases, injectVar, config = {}) {
|
|
|
9934
9403
|
|
|
9935
9404
|
//#endregion
|
|
9936
9405
|
//#region src/redteam/strategies/simpleVideo.ts
|
|
9937
|
-
let ffmpegCache = null;
|
|
9938
9406
|
function shouldShowProgressBar() {
|
|
9939
9407
|
return !cliState_default.webUI && logger_default.level !== "debug";
|
|
9940
9408
|
}
|
|
@@ -9951,25 +9419,29 @@ function getSystemFont() {
|
|
|
9951
9419
|
return "DejaVu-Sans";
|
|
9952
9420
|
}
|
|
9953
9421
|
}
|
|
9954
|
-
|
|
9955
|
-
|
|
9422
|
+
let ffmpegAvailable = false;
|
|
9423
|
+
async function checkFfmpegAvailable() {
|
|
9424
|
+
if (ffmpegAvailable) return;
|
|
9956
9425
|
try {
|
|
9957
|
-
|
|
9958
|
-
|
|
9426
|
+
await execa("ffmpeg", ["-version"]);
|
|
9427
|
+
ffmpegAvailable = true;
|
|
9959
9428
|
} catch (error) {
|
|
9960
|
-
|
|
9961
|
-
|
|
9429
|
+
throw new Error(`To use the video strategy, FFmpeg must be installed on your system:
|
|
9430
|
+
- macOS: brew install ffmpeg
|
|
9431
|
+
- Ubuntu/Debian: apt-get install ffmpeg
|
|
9432
|
+
- Windows: Download from ffmpeg.org
|
|
9433
|
+
Error: ${error}`);
|
|
9962
9434
|
}
|
|
9963
9435
|
}
|
|
9964
|
-
|
|
9436
|
+
function escapeDrawtextString(text) {
|
|
9437
|
+
return text.replace(/\\/g, "\\\\").replace(/'/g, "'\\''").replace(/:/g, "\\:").replace(/\n/g, "\\n").replace(/%/g, "%%");
|
|
9438
|
+
}
|
|
9439
|
+
async function createTempVideoEnvironment() {
|
|
9965
9440
|
const tempDir = path.join(os.tmpdir(), "promptfoo-video");
|
|
9966
9441
|
if (!fs.existsSync(tempDir)) fs.mkdirSync(tempDir, { recursive: true });
|
|
9967
|
-
const
|
|
9968
|
-
const outputPath = path.join(tempDir, "output-video.mp4");
|
|
9969
|
-
fs.writeFileSync(textFilePath, text);
|
|
9442
|
+
const outputPath = path.join(tempDir, `output-video-${randomUUID()}.mp4`);
|
|
9970
9443
|
const cleanup = () => {
|
|
9971
9444
|
try {
|
|
9972
|
-
if (fs.existsSync(textFilePath)) fs.unlinkSync(textFilePath);
|
|
9973
9445
|
if (fs.existsSync(outputPath)) fs.unlinkSync(outputPath);
|
|
9974
9446
|
} catch (error) {
|
|
9975
9447
|
logger_default.warn(`Failed to clean up temporary files: ${error}`);
|
|
@@ -9977,7 +9449,6 @@ async function createTempVideoEnvironment(text) {
|
|
|
9977
9449
|
};
|
|
9978
9450
|
return {
|
|
9979
9451
|
tempDir,
|
|
9980
|
-
textFilePath,
|
|
9981
9452
|
outputPath,
|
|
9982
9453
|
cleanup
|
|
9983
9454
|
};
|
|
@@ -9988,26 +9459,29 @@ function getFallbackBase64(text) {
|
|
|
9988
9459
|
async function textToVideo(text) {
|
|
9989
9460
|
try {
|
|
9990
9461
|
if (neverGenerateRemote()) {
|
|
9991
|
-
|
|
9992
|
-
const {
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
9462
|
+
await checkFfmpegAvailable();
|
|
9463
|
+
const { outputPath, cleanup } = await createTempVideoEnvironment();
|
|
9464
|
+
try {
|
|
9465
|
+
const escapedText = escapeDrawtextString(text);
|
|
9466
|
+
await execa("ffmpeg", [
|
|
9467
|
+
"-f",
|
|
9468
|
+
"lavfi",
|
|
9469
|
+
"-i",
|
|
9470
|
+
"color=white:s=640x480:d=5",
|
|
9471
|
+
"-vf",
|
|
9472
|
+
`drawtext=fontfile=${getSystemFont()}:text='${escapedText}':fontcolor=black:fontsize=24:x=(w-text_w)/2:y=(h-text_h)/2`,
|
|
9473
|
+
"-y",
|
|
9474
|
+
outputPath
|
|
9475
|
+
]);
|
|
9476
|
+
const base64Video = fs.readFileSync(outputPath).toString("base64");
|
|
9477
|
+
cleanup();
|
|
9478
|
+
return base64Video;
|
|
9479
|
+
} catch (error) {
|
|
9480
|
+
logger_default.error(`Error creating video with ffmpeg: ${error}`);
|
|
9481
|
+
cleanup();
|
|
9482
|
+
throw error;
|
|
9483
|
+
}
|
|
9484
|
+
} else throw new Error("Local video generation requires FFmpeg to be installed. Future versions may support remote generation.");
|
|
10011
9485
|
} catch (error) {
|
|
10012
9486
|
logger_default.error(`Error generating video from text: ${error}`);
|
|
10013
9487
|
return getFallbackBase64(text);
|
|
@@ -10218,6 +9692,7 @@ const Strategies = [
|
|
|
10218
9692
|
},
|
|
10219
9693
|
{
|
|
10220
9694
|
id: "crescendo",
|
|
9695
|
+
requiresGoalExtraction: true,
|
|
10221
9696
|
action: async (testCases, injectVar, config) => {
|
|
10222
9697
|
logger_default.debug(`Adding Crescendo to ${testCases.length} test cases`);
|
|
10223
9698
|
const newTestCases = addCrescendo(testCases, injectVar, config);
|
|
@@ -10227,6 +9702,7 @@ const Strategies = [
|
|
|
10227
9702
|
},
|
|
10228
9703
|
{
|
|
10229
9704
|
id: "custom",
|
|
9705
|
+
requiresGoalExtraction: true,
|
|
10230
9706
|
action: async (testCases, injectVar, config, strategyId = "custom") => {
|
|
10231
9707
|
logger_default.debug(`Adding Custom to ${testCases.length} test cases`);
|
|
10232
9708
|
const newTestCases = addCustom(testCases, injectVar, config, strategyId);
|
|
@@ -10245,6 +9721,7 @@ const Strategies = [
|
|
|
10245
9721
|
},
|
|
10246
9722
|
{
|
|
10247
9723
|
id: "goat",
|
|
9724
|
+
requiresGoalExtraction: true,
|
|
10248
9725
|
action: async (testCases, injectVar, config) => {
|
|
10249
9726
|
logger_default.debug(`Adding GOAT to ${testCases.length} test cases`);
|
|
10250
9727
|
const newTestCases = await addGoatTestCases(testCases, injectVar, config);
|
|
@@ -10254,6 +9731,7 @@ const Strategies = [
|
|
|
10254
9731
|
},
|
|
10255
9732
|
{
|
|
10256
9733
|
id: "indirect-web-pwn",
|
|
9734
|
+
requiresGoalExtraction: true,
|
|
10257
9735
|
action: async (testCases, injectVar, config) => {
|
|
10258
9736
|
logger_default.debug(`Adding Indirect Web Pwn to ${testCases.length} test cases`);
|
|
10259
9737
|
const newTestCases = await addIndirectWebPwnTestCases(testCases, injectVar, config);
|
|
@@ -10290,10 +9768,12 @@ const Strategies = [
|
|
|
10290
9768
|
},
|
|
10291
9769
|
{
|
|
10292
9770
|
id: "jailbreak",
|
|
9771
|
+
requiresGoalExtraction: true,
|
|
10293
9772
|
action: async (testCases, injectVar, config) => {
|
|
10294
|
-
logger_default.
|
|
10295
|
-
|
|
10296
|
-
|
|
9773
|
+
logger_default.warn("Strategy \"jailbreak\" is deprecated. Use \"jailbreak:meta\" instead. The \"jailbreak\" strategy used outdated single-shot optimization techniques.");
|
|
9774
|
+
logger_default.debug(`Adding meta-agent jailbreaks to ${testCases.length} test cases`);
|
|
9775
|
+
const newTestCases = addIterativeJailbreaks(testCases, injectVar, "iterative:meta", config);
|
|
9776
|
+
logger_default.debug(`Added ${newTestCases.length} meta-agent jailbreak test cases`);
|
|
10297
9777
|
return newTestCases;
|
|
10298
9778
|
}
|
|
10299
9779
|
},
|
|
@@ -10317,6 +9797,7 @@ const Strategies = [
|
|
|
10317
9797
|
},
|
|
10318
9798
|
{
|
|
10319
9799
|
id: "jailbreak:tree",
|
|
9800
|
+
requiresGoalExtraction: true,
|
|
10320
9801
|
action: async (testCases, injectVar, config) => {
|
|
10321
9802
|
logger_default.debug(`Adding experimental tree jailbreaks to ${testCases.length} test cases`);
|
|
10322
9803
|
const newTestCases = addIterativeJailbreaks(testCases, injectVar, "iterative:tree", config);
|
|
@@ -10326,6 +9807,7 @@ const Strategies = [
|
|
|
10326
9807
|
},
|
|
10327
9808
|
{
|
|
10328
9809
|
id: "jailbreak:meta",
|
|
9810
|
+
requiresGoalExtraction: true,
|
|
10329
9811
|
action: async (testCases, injectVar, config) => {
|
|
10330
9812
|
logger_default.debug(`Adding meta-agent jailbreaks to ${testCases.length} test cases`);
|
|
10331
9813
|
const newTestCases = addIterativeJailbreaks(testCases, injectVar, "iterative:meta", config);
|
|
@@ -10335,6 +9817,7 @@ const Strategies = [
|
|
|
10335
9817
|
},
|
|
10336
9818
|
{
|
|
10337
9819
|
id: "jailbreak:hydra",
|
|
9820
|
+
requiresGoalExtraction: true,
|
|
10338
9821
|
action: async (testCases, injectVar, config) => {
|
|
10339
9822
|
logger_default.debug(`Adding hydra multi-turn jailbreaks to ${testCases.length} test cases`);
|
|
10340
9823
|
const newTestCases = addHydra(testCases, injectVar, config);
|
|
@@ -11238,7 +10721,7 @@ var CrescendoProvider = class {
|
|
|
11238
10721
|
});
|
|
11239
10722
|
let assertToUse = test?.assert?.find((a) => a.type && a.type.includes(test.metadata?.pluginId));
|
|
11240
10723
|
if (!assertToUse) assertToUse = test?.assert?.find((a) => a.type);
|
|
11241
|
-
const { getGraderById } = await import("./graders-
|
|
10724
|
+
const { getGraderById } = await import("./graders-BCytzXrb.js");
|
|
11242
10725
|
let graderPassed;
|
|
11243
10726
|
const additionalRubric = getGoalRubric(this.userGoal);
|
|
11244
10727
|
while (roundNum < this.maxTurns) try {
|
|
@@ -11913,7 +11396,7 @@ var CustomProvider = class {
|
|
|
11913
11396
|
let lastTransformResult;
|
|
11914
11397
|
let assertToUse = test?.assert?.find((a) => a.type && a.type.includes(test.metadata?.pluginId));
|
|
11915
11398
|
if (!assertToUse) assertToUse = test?.assert?.find((a) => a.type);
|
|
11916
|
-
const { getGraderById } = await import("./graders-
|
|
11399
|
+
const { getGraderById } = await import("./graders-BCytzXrb.js");
|
|
11917
11400
|
let graderPassed;
|
|
11918
11401
|
let storedGraderResult;
|
|
11919
11402
|
const additionalRubric = getGoalRubric(this.userGoal);
|
|
@@ -12395,7 +11878,7 @@ var GoatProvider = class {
|
|
|
12395
11878
|
let assertToUse;
|
|
12396
11879
|
let graderPassed;
|
|
12397
11880
|
let storedGraderResult;
|
|
12398
|
-
const { getGraderById } = await import("./graders-
|
|
11881
|
+
const { getGraderById } = await import("./graders-BCytzXrb.js");
|
|
12399
11882
|
let test;
|
|
12400
11883
|
if (context?.test) {
|
|
12401
11884
|
test = context?.test;
|
|
@@ -12836,7 +12319,7 @@ var HydraProvider = class {
|
|
|
12836
12319
|
let lastTransformResult;
|
|
12837
12320
|
let lastTransformDisplayVars;
|
|
12838
12321
|
let lastFinalAttackPrompt;
|
|
12839
|
-
const { getGraderById } = await import("./graders-
|
|
12322
|
+
const { getGraderById } = await import("./graders-BCytzXrb.js");
|
|
12840
12323
|
let assertToUse = test?.assert?.find((a) => a.type && a.type.includes(test.metadata?.pluginId));
|
|
12841
12324
|
if (!assertToUse) assertToUse = test?.assert?.find((a) => a.type);
|
|
12842
12325
|
let previousTraceSummary;
|
|
@@ -12872,7 +12355,7 @@ var HydraProvider = class {
|
|
|
12872
12355
|
},
|
|
12873
12356
|
vars: {}
|
|
12874
12357
|
}, options);
|
|
12875
|
-
accumulateResponseTokenUsage(totalTokenUsage, agentResp);
|
|
12358
|
+
accumulateResponseTokenUsage(totalTokenUsage, agentResp, { countAsRequest: false });
|
|
12876
12359
|
if (this.agentProvider.delay) await sleep(this.agentProvider.delay);
|
|
12877
12360
|
if (agentResp.error) {
|
|
12878
12361
|
logger_default.debug("[Hydra] Agent provider error", {
|
|
@@ -13195,7 +12678,7 @@ var HydraProvider = class {
|
|
|
13195
12678
|
label: "hydra-learning-update"
|
|
13196
12679
|
},
|
|
13197
12680
|
vars: {}
|
|
13198
|
-
}, options));
|
|
12681
|
+
}, options), { countAsRequest: false });
|
|
13199
12682
|
logger_default.debug("[Hydra] Scan learnings updated", {
|
|
13200
12683
|
scanId,
|
|
13201
12684
|
testRunId
|
|
@@ -13405,7 +12888,8 @@ var IndirectWebPwnProvider = class {
|
|
|
13405
12888
|
fetchPrompt,
|
|
13406
12889
|
attempt: attempt + 1
|
|
13407
12890
|
});
|
|
13408
|
-
const targetResponse = await targetProvider
|
|
12891
|
+
const targetResponse = await getTargetResponse(targetProvider, fetchPrompt, context, options);
|
|
12892
|
+
accumulateResponseTokenUsage(totalTokenUsage, targetResponse);
|
|
13409
12893
|
if (targetResponse.metadata?.webFetchUsed) webFetchActuallyUsed = true;
|
|
13410
12894
|
if (targetResponse.error) {
|
|
13411
12895
|
logger_default.error("[IndirectWebPwn] Target error", { error: targetResponse.error });
|
|
@@ -13431,11 +12915,6 @@ var IndirectWebPwnProvider = class {
|
|
|
13431
12915
|
output: responseOutput
|
|
13432
12916
|
});
|
|
13433
12917
|
lastOutput = responseOutput;
|
|
13434
|
-
if (targetResponse.tokenUsage) {
|
|
13435
|
-
totalTokenUsage.total = (totalTokenUsage.total || 0) + (targetResponse.tokenUsage.total || 0);
|
|
13436
|
-
totalTokenUsage.prompt = (totalTokenUsage.prompt || 0) + (targetResponse.tokenUsage.prompt || 0);
|
|
13437
|
-
totalTokenUsage.completion = (totalTokenUsage.completion || 0) + (targetResponse.tokenUsage.completion || 0);
|
|
13438
|
-
}
|
|
13439
12918
|
const tracking = await this.checkPageFetched(webPage.uuid, evalId);
|
|
13440
12919
|
logger_default.debug("[IndirectWebPwn] Tracking check", {
|
|
13441
12920
|
uuid: webPage.uuid,
|
|
@@ -13679,7 +13158,7 @@ async function runRedteamConversation$2({ context, filters, injectVar, numIterat
|
|
|
13679
13158
|
if (sessionId) sessionIds.push(sessionId);
|
|
13680
13159
|
let assertToUse = test?.assert?.find((a) => a.type && a.type.includes(test.metadata?.pluginId));
|
|
13681
13160
|
if (!assertToUse) assertToUse = test?.assert?.find((a) => a.type);
|
|
13682
|
-
const { getGraderById } = await import("./graders-
|
|
13161
|
+
const { getGraderById } = await import("./graders-BCytzXrb.js");
|
|
13683
13162
|
if (test && assertToUse) {
|
|
13684
13163
|
const grader = getGraderById(assertToUse.type);
|
|
13685
13164
|
if (grader) {
|
|
@@ -14145,11 +13624,11 @@ async function runRedteamConversation$1({ prompt, filters, vars, redteamProvider
|
|
|
14145
13624
|
promptIdx: context?.promptIdx
|
|
14146
13625
|
});
|
|
14147
13626
|
lastResponse = targetResponse;
|
|
13627
|
+
accumulateResponseTokenUsage(totalTokenUsage, targetResponse);
|
|
14148
13628
|
if (targetResponse.error) {
|
|
14149
13629
|
logger_default.debug(`Iteration ${i + 1}: Target provider error: ${targetResponse.error}`);
|
|
14150
13630
|
continue;
|
|
14151
13631
|
}
|
|
14152
|
-
accumulateResponseTokenUsage(totalTokenUsage, targetResponse);
|
|
14153
13632
|
const url = targetResponse.output.match(/(https?:\/\/[^\s)]+)/g);
|
|
14154
13633
|
let imageDescription;
|
|
14155
13634
|
if (url && url.length > 0) try {
|
|
@@ -14169,7 +13648,7 @@ async function runRedteamConversation$1({ prompt, filters, vars, redteamProvider
|
|
|
14169
13648
|
}
|
|
14170
13649
|
}]
|
|
14171
13650
|
}]), void 0, options);
|
|
14172
|
-
accumulateResponseTokenUsage(totalTokenUsage, visionResponse);
|
|
13651
|
+
accumulateResponseTokenUsage(totalTokenUsage, visionResponse, { countAsRequest: false });
|
|
14173
13652
|
if (visionProvider.delay) await sleep(visionProvider.delay);
|
|
14174
13653
|
if (visionResponse.error) {
|
|
14175
13654
|
logger_default.warn(`Iteration ${i + 1}: Vision API error: ${visionResponse.error}`);
|
|
@@ -14396,7 +13875,7 @@ async function runMetaAgentRedteam({ context, filters, injectVar, numIterations,
|
|
|
14396
13875
|
},
|
|
14397
13876
|
vars: {}
|
|
14398
13877
|
}, options);
|
|
14399
|
-
accumulateResponseTokenUsage(totalTokenUsage, agentResp);
|
|
13878
|
+
accumulateResponseTokenUsage(totalTokenUsage, agentResp, { countAsRequest: false });
|
|
14400
13879
|
if (agentProvider.delay) {
|
|
14401
13880
|
logger_default.debug(`[IterativeMeta] Sleeping for ${agentProvider.delay}ms`);
|
|
14402
13881
|
await sleep(agentProvider.delay);
|
|
@@ -14509,7 +13988,7 @@ async function runMetaAgentRedteam({ context, filters, injectVar, numIterations,
|
|
|
14509
13988
|
previousTraceSummary = attackTraceSummary;
|
|
14510
13989
|
let assertToUse = test?.assert?.find((a) => a.type && a.type.includes(test.metadata?.pluginId));
|
|
14511
13990
|
if (!assertToUse) assertToUse = test?.assert?.find((a) => a.type);
|
|
14512
|
-
const { getGraderById } = await import("./graders-
|
|
13991
|
+
const { getGraderById } = await import("./graders-BCytzXrb.js");
|
|
14513
13992
|
if (test && assertToUse) {
|
|
14514
13993
|
const grader = getGraderById(assertToUse.type);
|
|
14515
13994
|
if (grader) {
|
|
@@ -15042,6 +14521,7 @@ async function runRedteamConversation({ context, filters, injectVar, options, pr
|
|
|
15042
14521
|
promptIdx: context?.promptIdx
|
|
15043
14522
|
});
|
|
15044
14523
|
lastResponse = targetResponse;
|
|
14524
|
+
accumulateResponseTokenUsage(totalTokenUsage, targetResponse);
|
|
15045
14525
|
if (targetResponse.error) {
|
|
15046
14526
|
logger_default.info(`[IterativeTree] Target error at depth ${depth}, attempt ${attempts}: ${targetResponse.error}`, { targetResponse });
|
|
15047
14527
|
treeOutputs.push({
|
|
@@ -15066,7 +14546,6 @@ async function runRedteamConversation({ context, filters, injectVar, options, pr
|
|
|
15066
14546
|
continue;
|
|
15067
14547
|
}
|
|
15068
14548
|
invariant(Object.prototype.hasOwnProperty.call(targetResponse, "output"), "[IterativeTree] Target did not return an output property");
|
|
15069
|
-
accumulateResponseTokenUsage(totalTokenUsage, targetResponse);
|
|
15070
14549
|
const containsPenalizedPhrase = checkPenalizedPhrases(targetResponse.output);
|
|
15071
14550
|
const { score, explanation } = await evaluateResponse(gradingProvider, judgeSystemPrompt, targetResponse.output, bestResponse, containsPenalizedPhrase);
|
|
15072
14551
|
logger_default.debug(`[Depth ${depth}, Attempt ${attempts}] Evaluation: score=${score}, penalized=${containsPenalizedPhrase}. Max score so far: ${maxScore}`);
|
|
@@ -15086,7 +14565,7 @@ async function runRedteamConversation({ context, filters, injectVar, options, pr
|
|
|
15086
14565
|
noImprovementCount++;
|
|
15087
14566
|
if (noImprovementCount % 5 === 0) logger_default.debug(`[Depth ${depth}, Attempt ${attempts}] No improvement for ${noImprovementCount} consecutive iterations. Max score: ${maxScore}`);
|
|
15088
14567
|
}
|
|
15089
|
-
const { getGraderById } = await import("./graders-
|
|
14568
|
+
const { getGraderById } = await import("./graders-BCytzXrb.js");
|
|
15090
14569
|
let graderPassed;
|
|
15091
14570
|
let assertToUse = test?.assert?.find((a) => a.type && a.type.includes(test.metadata?.pluginId));
|
|
15092
14571
|
if (!assertToUse) assertToUse = test?.assert?.find((a) => a.type);
|
|
@@ -19275,6 +18754,7 @@ const AWS_BEDROCK_MODELS = {
|
|
|
19275
18754
|
"anthropic.claude-opus-4-1-20250805-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19276
18755
|
"anthropic.claude-opus-4-6-v1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19277
18756
|
"anthropic.claude-opus-4-5-20251101-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
18757
|
+
"anthropic.claude-sonnet-4-6": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19278
18758
|
"anthropic.claude-sonnet-4-5-20250929-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19279
18759
|
"anthropic.claude-haiku-4-5-20251001-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19280
18760
|
"anthropic.claude-sonnet-4-20250514-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
@@ -19312,6 +18792,7 @@ const AWS_BEDROCK_MODELS = {
|
|
|
19312
18792
|
"apac.anthropic.claude-opus-4-1-20250805-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19313
18793
|
"apac.anthropic.claude-opus-4-6-v1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19314
18794
|
"apac.anthropic.claude-opus-4-5-20251101-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
18795
|
+
"apac.anthropic.claude-sonnet-4-6": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19315
18796
|
"apac.anthropic.claude-sonnet-4-5-20250929-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19316
18797
|
"apac.anthropic.claude-haiku-4-5-20251001-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19317
18798
|
"apac.anthropic.claude-sonnet-4-20250514-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
@@ -19328,6 +18809,7 @@ const AWS_BEDROCK_MODELS = {
|
|
|
19328
18809
|
"eu.anthropic.claude-opus-4-1-20250805-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19329
18810
|
"eu.anthropic.claude-opus-4-6-v1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19330
18811
|
"eu.anthropic.claude-opus-4-5-20251101-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
18812
|
+
"eu.anthropic.claude-sonnet-4-6": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19331
18813
|
"eu.anthropic.claude-sonnet-4-5-20250929-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19332
18814
|
"eu.anthropic.claude-haiku-4-5-20251001-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19333
18815
|
"eu.anthropic.claude-sonnet-4-20250514-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
@@ -19353,6 +18835,7 @@ const AWS_BEDROCK_MODELS = {
|
|
|
19353
18835
|
"us.anthropic.claude-opus-4-1-20250805-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19354
18836
|
"us.anthropic.claude-opus-4-6-v1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19355
18837
|
"us.anthropic.claude-opus-4-5-20251101-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
18838
|
+
"us.anthropic.claude-sonnet-4-6": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19356
18839
|
"us.anthropic.claude-sonnet-4-5-20250929-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19357
18840
|
"us.anthropic.claude-haiku-4-5-20251001-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19358
18841
|
"us.anthropic.claude-sonnet-4-20250514-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
@@ -23067,7 +22550,7 @@ var GeminiImageProvider = class {
|
|
|
23067
22550
|
...this.config.imageAspectRatio && { aspectRatio: this.config.imageAspectRatio },
|
|
23068
22551
|
...this.config.imageSize && isGemini3 && { imageSize: this.config.imageSize }
|
|
23069
22552
|
};
|
|
23070
|
-
if (this.config.safetySettings) body.safetySettings = this.config.safetySettings;
|
|
22553
|
+
if (this.config.safetySettings) body.safetySettings = normalizeSafetySettings(this.config.safetySettings);
|
|
23071
22554
|
return body;
|
|
23072
22555
|
}
|
|
23073
22556
|
processResponse(data, cached, latencyMs) {
|
|
@@ -23088,16 +22571,20 @@ var GeminiImageProvider = class {
|
|
|
23088
22571
|
"SPII"
|
|
23089
22572
|
].includes(candidate.finishReason)) return { error: `Response was blocked with finish reason: ${candidate.finishReason}` };
|
|
23090
22573
|
if (!candidate.content?.parts) return { error: "No content parts in response" };
|
|
23091
|
-
const
|
|
22574
|
+
const textParts = [];
|
|
22575
|
+
const imageParts = [];
|
|
23092
22576
|
let totalCost = 0;
|
|
23093
|
-
for (const part of candidate.content.parts) if (part.text)
|
|
22577
|
+
for (const part of candidate.content.parts) if (part.text) textParts.push(part.text);
|
|
23094
22578
|
else if (part.inlineData) {
|
|
23095
22579
|
const mimeType = part.inlineData.mimeType || "image/png";
|
|
23096
22580
|
const base64Data = part.inlineData.data;
|
|
23097
|
-
|
|
22581
|
+
imageParts.push({
|
|
22582
|
+
mimeType,
|
|
22583
|
+
base64Data
|
|
22584
|
+
});
|
|
23098
22585
|
totalCost += this.getCostPerImage();
|
|
23099
22586
|
}
|
|
23100
|
-
if (
|
|
22587
|
+
if (imageParts.length === 0 && textParts.length === 0) return { error: "No valid content generated" };
|
|
23101
22588
|
const tokenUsage = cached ? {
|
|
23102
22589
|
cached: data.usageMetadata?.totalTokenCount,
|
|
23103
22590
|
total: data.usageMetadata?.totalTokenCount,
|
|
@@ -23108,8 +22595,13 @@ var GeminiImageProvider = class {
|
|
|
23108
22595
|
total: data.usageMetadata?.totalTokenCount,
|
|
23109
22596
|
numRequests: 1
|
|
23110
22597
|
};
|
|
22598
|
+
const images = imageParts.length > 0 ? imageParts.map((img) => ({
|
|
22599
|
+
data: toDataUri(img.mimeType, img.base64Data),
|
|
22600
|
+
mimeType: img.mimeType
|
|
22601
|
+
})) : void 0;
|
|
23111
22602
|
return {
|
|
23112
|
-
output:
|
|
22603
|
+
output: imageParts.length > 0 && textParts.length === 0 ? images[0].data : textParts.join("\n\n"),
|
|
22604
|
+
images,
|
|
23113
22605
|
cached,
|
|
23114
22606
|
latencyMs,
|
|
23115
22607
|
cost: totalCost > 0 ? totalCost : void 0,
|
|
@@ -23247,13 +22739,17 @@ var GoogleImageProvider = class {
|
|
|
23247
22739
|
const base64Image = imageData.bytesBase64Encoded;
|
|
23248
22740
|
const mimeType = imageData.mimeType || "image/png";
|
|
23249
22741
|
if (base64Image) {
|
|
23250
|
-
imageOutputs.push(
|
|
22742
|
+
imageOutputs.push({
|
|
22743
|
+
data: toDataUri(mimeType, base64Image),
|
|
22744
|
+
mimeType
|
|
22745
|
+
});
|
|
23251
22746
|
totalCost += costPerImage;
|
|
23252
22747
|
}
|
|
23253
22748
|
}
|
|
23254
22749
|
if (imageOutputs.length === 0) return { error: "No valid images generated" };
|
|
23255
22750
|
return {
|
|
23256
|
-
output: imageOutputs.
|
|
22751
|
+
output: imageOutputs[0].data,
|
|
22752
|
+
images: imageOutputs,
|
|
23257
22753
|
cached,
|
|
23258
22754
|
latencyMs,
|
|
23259
22755
|
cost: totalCost
|
|
@@ -25409,6 +24905,7 @@ var HttpProvider = class {
|
|
|
25409
24905
|
const vars = {
|
|
25410
24906
|
...context?.vars || {},
|
|
25411
24907
|
prompt,
|
|
24908
|
+
...context?.evaluationId ? { evaluationId: context.evaluationId } : {},
|
|
25412
24909
|
...transformedTools !== void 0 ? { tools: serializeForTemplate(transformedTools) } : {},
|
|
25413
24910
|
...transformedToolChoice !== void 0 ? { tool_choice: serializeForTemplate(transformedToolChoice) } : {}
|
|
25414
24911
|
};
|
|
@@ -25632,9 +25129,17 @@ var HttpProvider = class {
|
|
|
25632
25129
|
logger_default.error(`Error parsing session ID: ${String(err)}. Got headers: ${safeJsonStringify(sanitizeObject(responseHeaders, { context: "response headers" }))} and parsed body: ${safeJsonStringify(sanitizeObject(parsedData, { context: "response body" }))}`);
|
|
25633
25130
|
throw err;
|
|
25634
25131
|
}
|
|
25132
|
+
ret.metadata = {
|
|
25133
|
+
...ret.metadata,
|
|
25134
|
+
http: {
|
|
25135
|
+
status,
|
|
25136
|
+
statusText
|
|
25137
|
+
}
|
|
25138
|
+
};
|
|
25635
25139
|
if (context?.debug) {
|
|
25636
25140
|
ret.raw = data;
|
|
25637
25141
|
ret.metadata = {
|
|
25142
|
+
...ret.metadata,
|
|
25638
25143
|
headers: sanitizeObject(responseHeaders, { context: "response headers" }),
|
|
25639
25144
|
transformedRequest: this.config.transformRequest ? transformedPrompt : parsedRequest.body?.text || renderedRequest.trim(),
|
|
25640
25145
|
finalRequestBody: parsedRequest.body?.text,
|
|
@@ -27173,7 +26678,7 @@ var OpenAiAssistantProvider = class extends OpenAiGenericProvider {
|
|
|
27173
26678
|
else outputBlocks.push(`[Unknown step type: ${step.step_details.type}]`);
|
|
27174
26679
|
return {
|
|
27175
26680
|
output: outputBlocks.join("\n\n").trim(),
|
|
27176
|
-
tokenUsage: getTokenUsage$
|
|
26681
|
+
tokenUsage: getTokenUsage$2(run, false)
|
|
27177
26682
|
};
|
|
27178
26683
|
}
|
|
27179
26684
|
};
|
|
@@ -28617,7 +28122,7 @@ var OpenRouterProvider = class extends OpenAiChatCompletionProvider {
|
|
|
28617
28122
|
}
|
|
28618
28123
|
return {
|
|
28619
28124
|
output,
|
|
28620
|
-
tokenUsage: getTokenUsage$
|
|
28125
|
+
tokenUsage: getTokenUsage$2(data, cached),
|
|
28621
28126
|
cached,
|
|
28622
28127
|
cost: calculateOpenAICost(this.modelName, config, data.usage?.prompt_tokens, data.usage?.completion_tokens),
|
|
28623
28128
|
...finishReason && { finishReason }
|
|
@@ -29968,7 +29473,7 @@ var SnowflakeCortexProvider = class extends OpenAiChatCompletionProvider {
|
|
|
29968
29473
|
}
|
|
29969
29474
|
return {
|
|
29970
29475
|
output,
|
|
29971
|
-
tokenUsage: getTokenUsage$
|
|
29476
|
+
tokenUsage: getTokenUsage$2(data, cached),
|
|
29972
29477
|
cached,
|
|
29973
29478
|
latencyMs,
|
|
29974
29479
|
cost: calculateOpenAICost(this.modelName, config, data.usage?.prompt_tokens, data.usage?.completion_tokens),
|
|
@@ -32669,7 +32174,7 @@ const providerMap = [
|
|
|
32669
32174
|
{
|
|
32670
32175
|
test: (providerPath) => providerPath.startsWith("opencode:") || providerPath === "opencode",
|
|
32671
32176
|
create: async (providerPath, providerOptions, context) => {
|
|
32672
|
-
const { OpenCodeSDKProvider } = await import("./opencode-sdk-
|
|
32177
|
+
const { OpenCodeSDKProvider } = await import("./opencode-sdk-CuCztr4P.js");
|
|
32673
32178
|
return new OpenCodeSDKProvider({
|
|
32674
32179
|
...providerOptions,
|
|
32675
32180
|
id: providerPath,
|
|
@@ -32678,10 +32183,17 @@ const providerMap = [
|
|
|
32678
32183
|
});
|
|
32679
32184
|
}
|
|
32680
32185
|
},
|
|
32186
|
+
{
|
|
32187
|
+
test: (providerPath) => providerPath.startsWith("openclaw:") || providerPath === "openclaw",
|
|
32188
|
+
create: async (providerPath, providerOptions, context) => {
|
|
32189
|
+
const { createOpenClawProvider } = await import("./openclaw-CpPrXwf6.js");
|
|
32190
|
+
return createOpenClawProvider(providerPath, providerOptions, context.env);
|
|
32191
|
+
}
|
|
32192
|
+
},
|
|
32681
32193
|
{
|
|
32682
32194
|
test: (providerPath) => providerPath.startsWith("anthropic:claude-agent-sdk") || providerPath.startsWith("anthropic:claude-code"),
|
|
32683
32195
|
create: async (_providerPath, providerOptions, context) => {
|
|
32684
|
-
const { ClaudeCodeSDKProvider } = await import("./claude-agent-sdk-
|
|
32196
|
+
const { ClaudeCodeSDKProvider } = await import("./claude-agent-sdk-6-xTaLwM.js");
|
|
32685
32197
|
return new ClaudeCodeSDKProvider({
|
|
32686
32198
|
...providerOptions,
|
|
32687
32199
|
env: context.env
|
|
@@ -32738,25 +32250,25 @@ const providerMap = [
|
|
|
32738
32250
|
const modelName = splits.slice(2).join(":");
|
|
32739
32251
|
if (modelType === "converse") return new AwsBedrockConverseProvider(modelName, providerOptions);
|
|
32740
32252
|
if (modelType === "nova-sonic" || modelType.includes("amazon.nova-sonic")) {
|
|
32741
|
-
const { NovaSonicProvider } = await import("./nova-sonic-
|
|
32253
|
+
const { NovaSonicProvider } = await import("./nova-sonic-CgaWLDM1.js");
|
|
32742
32254
|
return new NovaSonicProvider("amazon.nova-sonic-v1:0", providerOptions);
|
|
32743
32255
|
}
|
|
32744
32256
|
if (modelType.includes("luma.ray") || modelName.includes("luma.ray")) {
|
|
32745
|
-
const { LumaRayVideoProvider } = await import("./luma-ray-
|
|
32257
|
+
const { LumaRayVideoProvider } = await import("./luma-ray-BOeX-h0M.js");
|
|
32746
32258
|
return new LumaRayVideoProvider(modelName.includes("luma.ray") ? modelName : splits.slice(1).join(":") || "luma.ray-v2:0", providerOptions);
|
|
32747
32259
|
}
|
|
32748
32260
|
if (modelType.includes("amazon.nova-reel") || modelType === "video" && (modelName.includes("amazon.nova-reel") || modelName === "")) {
|
|
32749
|
-
const { NovaReelVideoProvider } = await import("./nova-reel-
|
|
32261
|
+
const { NovaReelVideoProvider } = await import("./nova-reel-DtCjbD5O.js");
|
|
32750
32262
|
return new NovaReelVideoProvider(modelName || "amazon.nova-reel-v1:1", providerOptions);
|
|
32751
32263
|
}
|
|
32752
32264
|
if (modelType === "agents") {
|
|
32753
|
-
const { AwsBedrockAgentsProvider } = await import("./agents-
|
|
32265
|
+
const { AwsBedrockAgentsProvider } = await import("./agents-DETIQHqF.js");
|
|
32754
32266
|
return new AwsBedrockAgentsProvider(modelName, providerOptions);
|
|
32755
32267
|
}
|
|
32756
32268
|
if (modelType === "completion") return new AwsBedrockCompletionProvider(modelName, providerOptions);
|
|
32757
32269
|
if (modelType === "embeddings" || modelType === "embedding") return new AwsBedrockEmbeddingProvider(modelName, providerOptions);
|
|
32758
32270
|
if (modelType === "kb" || modelType === "knowledge-base") {
|
|
32759
|
-
const { AwsBedrockKnowledgeBaseProvider } = await import("./knowledgeBase-
|
|
32271
|
+
const { AwsBedrockKnowledgeBaseProvider } = await import("./knowledgeBase-XJQ0Qyez.js");
|
|
32760
32272
|
return new AwsBedrockKnowledgeBaseProvider(modelName, providerOptions);
|
|
32761
32273
|
}
|
|
32762
32274
|
return new AwsBedrockCompletionProvider(splits.slice(1).join(":"), providerOptions);
|
|
@@ -32766,7 +32278,7 @@ const providerMap = [
|
|
|
32766
32278
|
test: (providerPath) => providerPath.startsWith("bedrock-agent:"),
|
|
32767
32279
|
create: async (providerPath, providerOptions, _context) => {
|
|
32768
32280
|
const agentId = providerPath.substring(14);
|
|
32769
|
-
const { AwsBedrockAgentsProvider } = await import("./agents-
|
|
32281
|
+
const { AwsBedrockAgentsProvider } = await import("./agents-DETIQHqF.js");
|
|
32770
32282
|
return new AwsBedrockAgentsProvider(agentId, providerOptions);
|
|
32771
32283
|
}
|
|
32772
32284
|
},
|
|
@@ -32776,7 +32288,7 @@ const providerMap = [
|
|
|
32776
32288
|
const splits = providerPath.split(":");
|
|
32777
32289
|
const modelType = splits[1];
|
|
32778
32290
|
const endpointName = splits.slice(2).join(":");
|
|
32779
|
-
const { SageMakerCompletionProvider, SageMakerEmbeddingProvider } = await import("./sagemaker-
|
|
32291
|
+
const { SageMakerCompletionProvider, SageMakerEmbeddingProvider } = await import("./sagemaker-CLdUAv5z.js");
|
|
32780
32292
|
if (modelType === "embedding" || modelType === "embeddings") return new SageMakerEmbeddingProvider(endpointName || modelType, providerOptions);
|
|
32781
32293
|
if (splits.length === 2) return new SageMakerCompletionProvider(modelType, providerOptions);
|
|
32782
32294
|
if (endpointName.includes("jumpstart") || modelType === "jumpstart") return new SageMakerCompletionProvider(endpointName, {
|
|
@@ -32817,7 +32329,7 @@ const providerMap = [
|
|
|
32817
32329
|
{
|
|
32818
32330
|
test: (providerPath) => providerPath.startsWith("cloudflare-ai:"),
|
|
32819
32331
|
create: async (providerPath, providerOptions, context) => {
|
|
32820
|
-
const { createCloudflareAiProvider } = await import("./cloudflare-ai-
|
|
32332
|
+
const { createCloudflareAiProvider } = await import("./cloudflare-ai-CUg4BTcj.js");
|
|
32821
32333
|
return createCloudflareAiProvider(providerPath, {
|
|
32822
32334
|
...providerOptions,
|
|
32823
32335
|
env: context.env
|
|
@@ -32827,7 +32339,7 @@ const providerMap = [
|
|
|
32827
32339
|
{
|
|
32828
32340
|
test: (providerPath) => providerPath.startsWith("cloudflare-gateway:"),
|
|
32829
32341
|
create: async (providerPath, providerOptions, context) => {
|
|
32830
|
-
const { createCloudflareGatewayProvider } = await import("./cloudflare-gateway-
|
|
32342
|
+
const { createCloudflareGatewayProvider } = await import("./cloudflare-gateway-_itGuXry.js");
|
|
32831
32343
|
return createCloudflareGatewayProvider(providerPath, {
|
|
32832
32344
|
...providerOptions,
|
|
32833
32345
|
env: context.env
|
|
@@ -32979,27 +32491,27 @@ const providerMap = [
|
|
|
32979
32491
|
create: async (providerPath, providerOptions, context) => {
|
|
32980
32492
|
const modelType = providerPath.split(":")[1];
|
|
32981
32493
|
if (modelType === "image") {
|
|
32982
|
-
const { createHyperbolicImageProvider } = await import("./image-
|
|
32494
|
+
const { createHyperbolicImageProvider } = await import("./image-BXt_7u0v.js");
|
|
32983
32495
|
return createHyperbolicImageProvider(providerPath, {
|
|
32984
32496
|
...providerOptions,
|
|
32985
32497
|
env: context.env
|
|
32986
32498
|
});
|
|
32987
32499
|
}
|
|
32988
32500
|
if (modelType === "audio") {
|
|
32989
|
-
const { createHyperbolicAudioProvider } = await import("./audio-
|
|
32501
|
+
const { createHyperbolicAudioProvider } = await import("./audio-BrJBFN2b.js");
|
|
32990
32502
|
return createHyperbolicAudioProvider(providerPath, {
|
|
32991
32503
|
...providerOptions,
|
|
32992
32504
|
env: context.env
|
|
32993
32505
|
});
|
|
32994
32506
|
}
|
|
32995
|
-
const { createHyperbolicProvider } = await import("./chat-
|
|
32507
|
+
const { createHyperbolicProvider } = await import("./chat-CgyGj2hC.js");
|
|
32996
32508
|
return createHyperbolicProvider(providerPath, providerOptions);
|
|
32997
32509
|
}
|
|
32998
32510
|
},
|
|
32999
32511
|
{
|
|
33000
32512
|
test: (providerPath) => providerPath.startsWith("litellm:"),
|
|
33001
32513
|
create: async (providerPath, providerOptions, context) => {
|
|
33002
|
-
const { createLiteLLMProvider } = await import("./litellm-
|
|
32514
|
+
const { createLiteLLMProvider } = await import("./litellm-CrLJrPIm.js");
|
|
33003
32515
|
return createLiteLLMProvider(providerPath, {
|
|
33004
32516
|
config: providerOptions,
|
|
33005
32517
|
env: context.env
|
|
@@ -33055,7 +32567,7 @@ const providerMap = [
|
|
|
33055
32567
|
const modelType = splits[1];
|
|
33056
32568
|
const modelName = splits.slice(2).join(":");
|
|
33057
32569
|
if (modelType === "codex-sdk" || modelType === "codex") {
|
|
33058
|
-
const { OpenAICodexSDKProvider } = await import("./codex-sdk-
|
|
32570
|
+
const { OpenAICodexSDKProvider } = await import("./codex-sdk-ibXwdglL.js");
|
|
33059
32571
|
return new OpenAICodexSDKProvider({
|
|
33060
32572
|
...providerOptions,
|
|
33061
32573
|
env: context.env
|
|
@@ -33068,7 +32580,7 @@ const providerMap = [
|
|
|
33068
32580
|
if (modelType === "realtime") return new OpenAiRealtimeProvider(modelName || "gpt-4o-realtime-preview-2024-12-17", providerOptions);
|
|
33069
32581
|
if (modelType === "responses") return new OpenAiResponsesProvider(modelName || "gpt-4.1-2025-04-14", providerOptions);
|
|
33070
32582
|
if (modelType === "transcription") {
|
|
33071
|
-
const { OpenAiTranscriptionProvider } = await import("./transcription-
|
|
32583
|
+
const { OpenAiTranscriptionProvider } = await import("./transcription-CYuY5sFO.js");
|
|
33072
32584
|
return new OpenAiTranscriptionProvider(modelName || "gpt-4o-transcribe-diarize", providerOptions);
|
|
33073
32585
|
}
|
|
33074
32586
|
if (OpenAiChatCompletionProvider.OPENAI_CHAT_MODEL_NAMES.includes(modelType)) return new OpenAiChatCompletionProvider(modelType, providerOptions);
|
|
@@ -33076,11 +32588,11 @@ const providerMap = [
|
|
|
33076
32588
|
if (OpenAiRealtimeProvider.OPENAI_REALTIME_MODEL_NAMES.includes(modelType)) return new OpenAiRealtimeProvider(modelType, providerOptions);
|
|
33077
32589
|
if (OpenAiResponsesProvider.OPENAI_RESPONSES_MODEL_NAMES.includes(modelType)) return new OpenAiResponsesProvider(modelType, providerOptions);
|
|
33078
32590
|
if (modelType === "agents") {
|
|
33079
|
-
const { OpenAiAgentsProvider } = await import("./agents-
|
|
32591
|
+
const { OpenAiAgentsProvider } = await import("./agents-GiUianme.js");
|
|
33080
32592
|
return new OpenAiAgentsProvider(modelName || "default-agent", providerOptions);
|
|
33081
32593
|
}
|
|
33082
32594
|
if (modelType === "chatkit") {
|
|
33083
|
-
const { OpenAiChatKitProvider } = await import("./chatkit-
|
|
32595
|
+
const { OpenAiChatKitProvider } = await import("./chatkit-DIrJX8xk.js");
|
|
33084
32596
|
return new OpenAiChatKitProvider(modelName || "", providerOptions);
|
|
33085
32597
|
}
|
|
33086
32598
|
if (modelType === "assistant") return new OpenAiAssistantProvider(modelName, providerOptions);
|
|
@@ -33123,7 +32635,7 @@ const providerMap = [
|
|
|
33123
32635
|
{
|
|
33124
32636
|
test: (providerPath) => providerPath.startsWith("quiverai:"),
|
|
33125
32637
|
create: async (providerPath, providerOptions, context) => {
|
|
33126
|
-
const { createQuiverAiProvider } = await import("./quiverai-
|
|
32638
|
+
const { createQuiverAiProvider } = await import("./quiverai-Bfy2WnE2.js");
|
|
33127
32639
|
return createQuiverAiProvider(providerPath, providerOptions, context.env);
|
|
33128
32640
|
}
|
|
33129
32641
|
},
|
|
@@ -33168,7 +32680,7 @@ const providerMap = [
|
|
|
33168
32680
|
{
|
|
33169
32681
|
test: (providerPath) => providerPath.startsWith("aimlapi:"),
|
|
33170
32682
|
create: async (providerPath, providerOptions, context) => {
|
|
33171
|
-
const { createAimlApiProvider } = await import("./aimlapi-
|
|
32683
|
+
const { createAimlApiProvider } = await import("./aimlapi-CMJpKK-B.js");
|
|
33172
32684
|
return createAimlApiProvider(providerPath, {
|
|
33173
32685
|
...providerOptions,
|
|
33174
32686
|
env: context.env
|
|
@@ -33178,7 +32690,7 @@ const providerMap = [
|
|
|
33178
32690
|
{
|
|
33179
32691
|
test: (providerPath) => providerPath.startsWith("cometapi:"),
|
|
33180
32692
|
create: async (providerPath, providerOptions, context) => {
|
|
33181
|
-
const { createCometApiProvider } = await import("./cometapi-
|
|
32693
|
+
const { createCometApiProvider } = await import("./cometapi-ChAaRjg5.js");
|
|
33182
32694
|
return createCometApiProvider(providerPath, {
|
|
33183
32695
|
...providerOptions,
|
|
33184
32696
|
env: context.env
|
|
@@ -33188,7 +32700,7 @@ const providerMap = [
|
|
|
33188
32700
|
{
|
|
33189
32701
|
test: (providerPath) => providerPath.startsWith("docker:"),
|
|
33190
32702
|
create: async (providerPath, providerOptions, context) => {
|
|
33191
|
-
const { createDockerProvider } = await import("./docker-
|
|
32703
|
+
const { createDockerProvider } = await import("./docker-JAAubMw3.js");
|
|
33192
32704
|
return createDockerProvider(providerPath, {
|
|
33193
32705
|
...providerOptions,
|
|
33194
32706
|
env: context.env
|
|
@@ -33454,7 +32966,7 @@ const providerMap = [
|
|
|
33454
32966
|
{
|
|
33455
32967
|
test: (providerPath) => providerPath.startsWith("transformers:") || providerPath.startsWith("transformers.js:"),
|
|
33456
32968
|
create: async (providerPath, providerOptions, _context) => {
|
|
33457
|
-
const { validateTransformersDependency } = await import("./transformersAvailability-
|
|
32969
|
+
const { validateTransformersDependency } = await import("./transformersAvailability-DEU2naS1.js");
|
|
33458
32970
|
await validateTransformersDependency();
|
|
33459
32971
|
const splits = providerPath.split(":");
|
|
33460
32972
|
if (splits.length < 3) throw new Error(`Invalid Transformers.js provider path: ${providerPath}. Format: transformers:<task>:<model>
|
|
@@ -33474,7 +32986,7 @@ Example: transformers:feature-extraction:Xenova/all-MiniLM-L6-v2`);
|
|
|
33474
32986
|
test: (providerPath) => providerPath === "slack" || providerPath.startsWith("slack:"),
|
|
33475
32987
|
create: async (providerPath, providerOptions, _context) => {
|
|
33476
32988
|
try {
|
|
33477
|
-
const { SlackProvider } = await import("./slack-
|
|
32989
|
+
const { SlackProvider } = await import("./slack-DPqj42Ts.js");
|
|
33478
32990
|
if (providerPath === "slack") return new SlackProvider(providerOptions);
|
|
33479
32991
|
const splits = providerPath.split(":");
|
|
33480
32992
|
if (splits.length < 2) throw new Error("Invalid Slack provider path. Use slack:<channel_id> or slack:channel:<channel_id>");
|
|
@@ -33770,5 +33282,5 @@ function getProviderIds(providerPaths) {
|
|
|
33770
33282
|
}
|
|
33771
33283
|
|
|
33772
33284
|
//#endregion
|
|
33773
|
-
export { DefaultSynthesizeProvider as $, createRateLimitRegistry as A,
|
|
33774
|
-
//# sourceMappingURL=providers-
|
|
33285
|
+
export { DefaultSynthesizeProvider as $, createRateLimitRegistry as A, isCloudProvider as B, collectFileMetadata as C, loadFromPackage as D, isPackagePath as E, getCloudDatabaseId as F, DefaultEmbeddingProvider as G, OpenAiModerationProvider as H, getEvalConfigFromCloud as I, AIStudioChatProvider as J, DefaultGradingProvider as K, getOrgContext as L, PromptfooHarmfulCompletionProvider as M, REDTEAM_MEMORY_POISONING_PLUGIN_ID as N, redteamProviderManager as O, checkCloudPermissions as P, DefaultSuggestionsProvider as Q, getPluginSeverityOverridesFromCloud as R, removePrefix as S, runExtensionHook as T, MistralChatCompletionProvider as U, resolveTeamId as V, MistralEmbeddingProvider as W, DefaultGradingProvider$1 as X, DefaultGradingJsonProvider as Y, DefaultLlmRubricProvider as Z, extractVariablesFromJson as _, resolveProviderConfigs as a, isBasicRefusal as b, Strategies as c, pluginMatchesStrategyTargets as d, AzureModerationProvider as et, checkExfilTracking as f, extractPromptFromTags as g, extractInputVarsFromPrompt as h, resolveProvider as i, parseScriptParts as it, createProviderRateLimitOptions as j, TokenUsageTracker as k, loadStrategy as l, extractGoalFromPrompt as m, loadApiProvider as n, AzureChatCompletionProvider as nt, MCPProvider as o, extractAllPromptsFromTags as p, VertexChatProvider as q, loadApiProviders as r, getFileHashes as rt, GoogleLiveProvider as s, getProviderIds as t, AzureEmbeddingProvider as tt, validateStrategies as u, getSessionId as v, renderPrompt as w, isEmptyResponse as x, getShortPluginId as y, getPoliciesFromCloud as z };
|
|
33286
|
+
//# sourceMappingURL=providers-BiNq_Iyc.js.map
|