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
|
-
const require_logger = require('./logger-
|
|
1
|
+
const require_logger = require('./logger-BdZ-IqBc.cjs');
|
|
2
2
|
const require_invariant = require('./invariant-CKcJAQ6M.cjs');
|
|
3
|
-
const require_esm = require('./esm-
|
|
4
|
-
const require_pythonUtils = require('./pythonUtils-
|
|
3
|
+
const require_esm = require('./esm-BQkx5roy.cjs');
|
|
4
|
+
const require_pythonUtils = require('./pythonUtils-DZ6EbdY4.cjs');
|
|
5
5
|
const require_fileExtensions = require('./fileExtensions-DkJYkWUy.cjs');
|
|
6
|
-
const require_transform = require('./transform-
|
|
7
|
-
const require_types = require('./types-
|
|
8
|
-
const require_util = require('./util-
|
|
9
|
-
const require_fetch = require('./fetch-
|
|
10
|
-
const require_cache = require('./cache-
|
|
11
|
-
const require_extractor = require('./extractor-
|
|
12
|
-
const require_genaiTracer = require('./genaiTracer-
|
|
13
|
-
const require_chat = require('./chat-
|
|
14
|
-
const require_tokenUsageUtils = require('./tokenUsageUtils-
|
|
15
|
-
const require_transform$1 = require('./transform-
|
|
16
|
-
const require_messages = require('./messages-
|
|
17
|
-
const require_util$1 = require('./util-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
6
|
+
const require_transform = require('./transform-Kd6u-oNm.cjs');
|
|
7
|
+
const require_types = require('./types-BIfttHrT.cjs');
|
|
8
|
+
const require_util = require('./util-DUYOvxAy.cjs');
|
|
9
|
+
const require_fetch = require('./fetch-ZMn_oemb.cjs');
|
|
10
|
+
const require_cache = require('./cache-7xULbvt3.cjs');
|
|
11
|
+
const require_extractor = require('./extractor-DbhlYEeo.cjs');
|
|
12
|
+
const require_genaiTracer = require('./genaiTracer-CQlpZkrp.cjs');
|
|
13
|
+
const require_chat = require('./chat-C4zqjObh.cjs');
|
|
14
|
+
const require_tokenUsageUtils = require('./tokenUsageUtils-CXhxVj72.cjs');
|
|
15
|
+
const require_transform$1 = require('./transform-ivxEY4f7.cjs');
|
|
16
|
+
const require_messages = require('./messages-DXV3Qh8_.cjs');
|
|
17
|
+
const require_util$1 = require('./util-DkFTvieG.cjs');
|
|
18
|
+
const require_responses = require('./responses-zOtKtnY_.cjs');
|
|
19
|
+
const require_openai = require('./openai-Bigwjgo1.cjs');
|
|
20
|
+
const require_util$2 = require('./util-C08Kns6-.cjs');
|
|
21
|
+
const require_completion = require('./completion-DDyL3Cb2.cjs');
|
|
22
|
+
const require_accounts = require('./accounts-BzEY8H3v.cjs');
|
|
23
|
+
const require_server = require('./server-CgUQ25qW.cjs');
|
|
24
|
+
const require_blobs = require('./blobs-673H0jCl.cjs');
|
|
25
|
+
const require_tables = require('./tables-B9E1kRp-.cjs');
|
|
26
|
+
const require_telemetry = require('./telemetry-D0_yFdtU.cjs');
|
|
27
|
+
const require_text = require('./text-DF2hMKdg.cjs');
|
|
28
|
+
const require_store = require('./store-BqwfFEyF.cjs');
|
|
29
|
+
const require_base = require('./base-f71xxWai.cjs');
|
|
30
|
+
const require_image = require('./image-C3BjJUAU.cjs');
|
|
31
|
+
const require_providerRegistry = require('./providerRegistry-lc7a7utN.cjs');
|
|
32
|
+
const require_rubyUtils = require('./rubyUtils-DCVaJ3mc.cjs');
|
|
32
33
|
let fs = require("fs");
|
|
33
34
|
fs = require_logger.__toESM(fs);
|
|
34
35
|
let path = require("path");
|
|
@@ -63,6 +64,7 @@ let node_crypto = require("node:crypto");
|
|
|
63
64
|
let drizzle_orm = require("drizzle-orm");
|
|
64
65
|
let events = require("events");
|
|
65
66
|
let cli_progress = require("cli-progress");
|
|
67
|
+
let execa = require("execa");
|
|
66
68
|
let ws = require("ws");
|
|
67
69
|
ws = require_logger.__toESM(ws);
|
|
68
70
|
let http = require("http");
|
|
@@ -158,179 +160,6 @@ var ScriptCompletionProvider = class {
|
|
|
158
160
|
}
|
|
159
161
|
};
|
|
160
162
|
|
|
161
|
-
//#endregion
|
|
162
|
-
//#region src/providers/functionCallbackUtils.ts
|
|
163
|
-
/**
|
|
164
|
-
* Handles function callback execution for AI providers.
|
|
165
|
-
* Provides a unified way to execute function callbacks across different provider formats.
|
|
166
|
-
*/
|
|
167
|
-
var FunctionCallbackHandler = class {
|
|
168
|
-
loadedCallbacks = {};
|
|
169
|
-
mcpToolNames = null;
|
|
170
|
-
constructor(mcpClient) {
|
|
171
|
-
this.mcpClient = mcpClient;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Processes a function call by executing its callback or returning the original call
|
|
175
|
-
* @param call The function call to process (can be various formats)
|
|
176
|
-
* @param callbacks Configuration mapping function names to callbacks
|
|
177
|
-
* @param context Optional context to pass to the callback
|
|
178
|
-
* @returns The result of processing
|
|
179
|
-
*/
|
|
180
|
-
async processCall(call, callbacks, context) {
|
|
181
|
-
const functionInfo = this.extractFunctionInfo(call);
|
|
182
|
-
if (this.mcpClient && functionInfo) {
|
|
183
|
-
if (this.mcpToolNames === null) {
|
|
184
|
-
const mcpTools = this.mcpClient.getAllTools();
|
|
185
|
-
this.mcpToolNames = new Set(mcpTools.map((tool) => tool.name));
|
|
186
|
-
}
|
|
187
|
-
if (this.mcpToolNames.has(functionInfo.name)) return await this.executeMcpTool(functionInfo.name, functionInfo.arguments);
|
|
188
|
-
}
|
|
189
|
-
if (!functionInfo || !callbacks || !callbacks[functionInfo.name]) return {
|
|
190
|
-
output: typeof call === "string" ? call : JSON.stringify(call),
|
|
191
|
-
isError: false
|
|
192
|
-
};
|
|
193
|
-
try {
|
|
194
|
-
return {
|
|
195
|
-
output: await this.executeCallback(functionInfo.name, functionInfo.arguments || "{}", callbacks, context),
|
|
196
|
-
isError: false
|
|
197
|
-
};
|
|
198
|
-
} catch (error) {
|
|
199
|
-
require_logger.logger_default.debug(`Function callback failed for ${functionInfo.name}: ${error}`);
|
|
200
|
-
return {
|
|
201
|
-
output: typeof call === "string" ? call : JSON.stringify(call),
|
|
202
|
-
isError: true
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Processes multiple function calls
|
|
208
|
-
* @param calls Array of calls or a single call
|
|
209
|
-
* @param callbacks Configuration mapping function names to callbacks
|
|
210
|
-
* @param context Optional context to pass to callbacks
|
|
211
|
-
* @param options Processing options
|
|
212
|
-
* @returns Processed output in appropriate format
|
|
213
|
-
*/
|
|
214
|
-
async processCalls(calls, callbacks, context, _options) {
|
|
215
|
-
if (!calls) return calls;
|
|
216
|
-
const isArray = Array.isArray(calls);
|
|
217
|
-
const callsArray = isArray ? calls : [calls];
|
|
218
|
-
const results = await Promise.all(callsArray.map((call) => this.processCall(call, callbacks, context)));
|
|
219
|
-
if (results.some((r, index) => !r.isError && r.output !== JSON.stringify(callsArray[index]))) {
|
|
220
|
-
const outputs = results.map((r) => r.output);
|
|
221
|
-
if (!isArray && outputs.length === 1) return outputs[0];
|
|
222
|
-
return outputs.every((o) => typeof o === "string") ? outputs.join("\n") : outputs;
|
|
223
|
-
}
|
|
224
|
-
if (!isArray && results.length === 1) return results[0].output;
|
|
225
|
-
return calls;
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Extracts function name and arguments from various call formats
|
|
229
|
-
*/
|
|
230
|
-
extractFunctionInfo(call) {
|
|
231
|
-
if (!call || typeof call !== "object") return null;
|
|
232
|
-
if (call.name && typeof call.name === "string") return {
|
|
233
|
-
name: call.name,
|
|
234
|
-
arguments: call.arguments
|
|
235
|
-
};
|
|
236
|
-
if (call.type === "function" && call.function?.name) return {
|
|
237
|
-
name: call.function.name,
|
|
238
|
-
arguments: call.function.arguments
|
|
239
|
-
};
|
|
240
|
-
return null;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Executes a function callback
|
|
244
|
-
*/
|
|
245
|
-
async executeCallback(functionName, args, callbacks, context) {
|
|
246
|
-
let callback = this.loadedCallbacks[functionName];
|
|
247
|
-
if (!callback) {
|
|
248
|
-
const callbackConfig = callbacks[functionName];
|
|
249
|
-
if (typeof callbackConfig === "string") if (callbackConfig.startsWith("file://")) callback = await this.loadExternalFunction(callbackConfig);
|
|
250
|
-
else callback = new Function("return " + callbackConfig)();
|
|
251
|
-
else if (typeof callbackConfig === "function") callback = callbackConfig;
|
|
252
|
-
else throw new Error(`Invalid callback configuration for ${functionName}`);
|
|
253
|
-
this.loadedCallbacks[functionName] = callback;
|
|
254
|
-
}
|
|
255
|
-
const result = await callback(args, context);
|
|
256
|
-
return typeof result === "string" ? result : JSON.stringify(result);
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Loads a function from an external file
|
|
260
|
-
*/
|
|
261
|
-
async loadExternalFunction(fileRef) {
|
|
262
|
-
let filePath = fileRef.slice(7);
|
|
263
|
-
let functionName;
|
|
264
|
-
if (filePath.includes(":")) {
|
|
265
|
-
const splits = filePath.split(":");
|
|
266
|
-
if (splits[0] && require_fileExtensions.isJavascriptFile(splits[0])) [filePath, functionName] = splits;
|
|
267
|
-
}
|
|
268
|
-
try {
|
|
269
|
-
const resolvedPath = path.default.resolve(require_logger.cliState_default.basePath || "", filePath);
|
|
270
|
-
require_logger.logger_default.debug(`Loading function from ${resolvedPath}${functionName ? `:${functionName}` : ""}`);
|
|
271
|
-
const mod = await require_esm.importModule(resolvedPath);
|
|
272
|
-
const func = functionName && mod[functionName] ? mod[functionName] : mod.default || mod;
|
|
273
|
-
if (typeof func !== "function") throw new Error(`Expected ${resolvedPath}${functionName ? `:${functionName}` : ""} to export a function, got ${typeof func}`);
|
|
274
|
-
return func;
|
|
275
|
-
} catch (error) {
|
|
276
|
-
throw new Error(`Failed to load function from ${fileRef}: ${error}`);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Executes an MCP tool
|
|
281
|
-
*/
|
|
282
|
-
async executeMcpTool(toolName, args) {
|
|
283
|
-
try {
|
|
284
|
-
if (!this.mcpClient) throw new Error("MCP client not available");
|
|
285
|
-
const parsedArgs = args == null || args === "" ? {} : typeof args === "string" ? JSON.parse(args) : args;
|
|
286
|
-
const result = await this.mcpClient.callTool(toolName, parsedArgs);
|
|
287
|
-
if (result?.error) return {
|
|
288
|
-
output: `MCP Tool Error (${toolName}): ${result.error}`,
|
|
289
|
-
isError: true
|
|
290
|
-
};
|
|
291
|
-
const normalizeContent = (content) => {
|
|
292
|
-
if (content == null) return "";
|
|
293
|
-
if (typeof content === "string") return content;
|
|
294
|
-
if (Array.isArray(content)) return content.map((part) => {
|
|
295
|
-
if (typeof part === "string") return part;
|
|
296
|
-
if (part && typeof part === "object") {
|
|
297
|
-
if ("text" in part && part.text != null) return String(part.text);
|
|
298
|
-
if ("json" in part) return JSON.stringify(part.json);
|
|
299
|
-
if ("data" in part) return JSON.stringify(part.data);
|
|
300
|
-
return JSON.stringify(part);
|
|
301
|
-
}
|
|
302
|
-
return String(part);
|
|
303
|
-
}).join("\n");
|
|
304
|
-
return JSON.stringify(content);
|
|
305
|
-
};
|
|
306
|
-
return {
|
|
307
|
-
output: `MCP Tool Result (${toolName}): ${normalizeContent(result?.content)}`,
|
|
308
|
-
isError: false
|
|
309
|
-
};
|
|
310
|
-
} catch (error) {
|
|
311
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
312
|
-
require_logger.logger_default.debug(`MCP tool execution failed for ${toolName}: ${errorMessage}`);
|
|
313
|
-
return {
|
|
314
|
-
output: `MCP Tool Error (${toolName}): ${errorMessage}`,
|
|
315
|
-
isError: true
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* Sets the MCP client, preserving any loaded callbacks
|
|
321
|
-
*/
|
|
322
|
-
setMcpClient(client) {
|
|
323
|
-
this.mcpClient = client;
|
|
324
|
-
this.mcpToolNames = null;
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* Clears the cached callbacks
|
|
328
|
-
*/
|
|
329
|
-
clearCache() {
|
|
330
|
-
this.loadedCallbacks = {};
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
|
|
334
163
|
//#endregion
|
|
335
164
|
//#region src/providers/azure/defaults.ts
|
|
336
165
|
const DEFAULT_AZURE_API_VERSION = "2024-12-01-preview";
|
|
@@ -1109,6 +938,13 @@ const AZURE_MODELS = [
|
|
|
1109
938
|
output: 6 / 1e6
|
|
1110
939
|
}
|
|
1111
940
|
},
|
|
941
|
+
{
|
|
942
|
+
id: "claude-sonnet-4-6",
|
|
943
|
+
cost: {
|
|
944
|
+
input: 3 / 1e6,
|
|
945
|
+
output: 15 / 1e6
|
|
946
|
+
}
|
|
947
|
+
},
|
|
1112
948
|
{
|
|
1113
949
|
id: "claude-opus-4-6",
|
|
1114
950
|
cost: {
|
|
@@ -1403,6 +1239,13 @@ const AZURE_MODELS = [
|
|
|
1403
1239
|
output: .026 / 1e6
|
|
1404
1240
|
}
|
|
1405
1241
|
},
|
|
1242
|
+
{
|
|
1243
|
+
id: "Mistral-Large-3",
|
|
1244
|
+
cost: {
|
|
1245
|
+
input: .5 / 1e6,
|
|
1246
|
+
output: 1.5 / 1e6
|
|
1247
|
+
}
|
|
1248
|
+
},
|
|
1406
1249
|
{
|
|
1407
1250
|
id: "Mistral-Large-2411",
|
|
1408
1251
|
cost: {
|
|
@@ -1686,13 +1529,13 @@ var AzureChatCompletionProvider = class extends AzureGenericProvider {
|
|
|
1686
1529
|
functionCallbackHandler;
|
|
1687
1530
|
constructor(...args) {
|
|
1688
1531
|
super(...args);
|
|
1689
|
-
this.functionCallbackHandler = new FunctionCallbackHandler();
|
|
1532
|
+
this.functionCallbackHandler = new require_responses.FunctionCallbackHandler();
|
|
1690
1533
|
if (this.config.mcp?.enabled) this.initializationPromise = this.initializeMCP();
|
|
1691
1534
|
}
|
|
1692
1535
|
async initializeMCP() {
|
|
1693
1536
|
this.mcpClient = new require_chat.MCPClient(this.config.mcp);
|
|
1694
1537
|
await this.mcpClient.initialize();
|
|
1695
|
-
this.functionCallbackHandler = new FunctionCallbackHandler(this.mcpClient);
|
|
1538
|
+
this.functionCallbackHandler = new require_responses.FunctionCallbackHandler(this.mcpClient);
|
|
1696
1539
|
}
|
|
1697
1540
|
async cleanup() {
|
|
1698
1541
|
if (this.mcpClient) {
|
|
@@ -2461,7 +2304,7 @@ var AIStudioChatProvider = class extends GoogleGenericProvider {
|
|
|
2461
2304
|
temperature: config.temperature,
|
|
2462
2305
|
topP: config.topP,
|
|
2463
2306
|
topK: config.topK,
|
|
2464
|
-
safetySettings: config.safetySettings,
|
|
2307
|
+
safetySettings: require_transform$1.normalizeSafetySettings(config.safetySettings),
|
|
2465
2308
|
stopSequences: config.stopSequences,
|
|
2466
2309
|
maxOutputTokens: config.maxOutputTokens
|
|
2467
2310
|
};
|
|
@@ -2535,7 +2378,7 @@ var AIStudioChatProvider = class extends GoogleGenericProvider {
|
|
|
2535
2378
|
...config.maxOutputTokens !== void 0 && { maxOutputTokens: config.maxOutputTokens },
|
|
2536
2379
|
...config.generationConfig
|
|
2537
2380
|
},
|
|
2538
|
-
safetySettings: config.safetySettings,
|
|
2381
|
+
safetySettings: require_transform$1.normalizeSafetySettings(config.safetySettings),
|
|
2539
2382
|
...config.toolConfig ? { toolConfig: config.toolConfig } : {},
|
|
2540
2383
|
...allTools.length > 0 ? { tools: allTools } : {},
|
|
2541
2384
|
...systemInstruction ? { system_instruction: systemInstruction } : {}
|
|
@@ -2854,7 +2697,7 @@ var VertexChatProvider = class extends GoogleGenericProvider {
|
|
|
2854
2697
|
topK: config.topK,
|
|
2855
2698
|
...config.generationConfig
|
|
2856
2699
|
},
|
|
2857
|
-
...config.safetySettings ? { safetySettings: config.safetySettings } : {},
|
|
2700
|
+
...config.safetySettings ? { safetySettings: require_transform$1.normalizeSafetySettings(config.safetySettings) } : {},
|
|
2858
2701
|
...config.toolConfig ? { toolConfig: config.toolConfig } : {},
|
|
2859
2702
|
...allTools.length > 0 ? { tools: allTools } : {},
|
|
2860
2703
|
...systemInstruction ? { systemInstruction } : {},
|
|
@@ -3068,7 +2911,7 @@ var VertexChatProvider = class extends GoogleGenericProvider {
|
|
|
3068
2911
|
parameters: {
|
|
3069
2912
|
context: this.config.context,
|
|
3070
2913
|
examples: this.config.examples,
|
|
3071
|
-
safetySettings: this.config.safetySettings,
|
|
2914
|
+
safetySettings: require_transform$1.normalizeSafetySettings(this.config.safetySettings),
|
|
3072
2915
|
stopSequences: this.config.stopSequences,
|
|
3073
2916
|
temperature: this.config.temperature,
|
|
3074
2917
|
maxOutputTokens: this.config.maxOutputTokens,
|
|
@@ -3419,7 +3262,7 @@ const MISTRAL_EMBEDDING_MODELS = [{
|
|
|
3419
3262
|
output: .1 / 1e6
|
|
3420
3263
|
}
|
|
3421
3264
|
}];
|
|
3422
|
-
function getTokenUsage$
|
|
3265
|
+
function getTokenUsage$1(data, cached) {
|
|
3423
3266
|
if (data.usage) if (cached) return {
|
|
3424
3267
|
cached: data.usage.total_tokens,
|
|
3425
3268
|
total: data.usage.total_tokens,
|
|
@@ -3553,7 +3396,7 @@ var MistralChatCompletionProvider = class MistralChatCompletionProvider {
|
|
|
3553
3396
|
if (!data.choices || !data.choices[0] || !data.choices[0].message.content) return { error: `Malformed response data: ${JSON.stringify(data)}` };
|
|
3554
3397
|
const result = {
|
|
3555
3398
|
output: data.choices[0].message.content,
|
|
3556
|
-
tokenUsage: getTokenUsage$
|
|
3399
|
+
tokenUsage: getTokenUsage$1(data, cached),
|
|
3557
3400
|
cached,
|
|
3558
3401
|
cost: calculateMistralCost(this.modelName, config, data.usage?.prompt_tokens, data.usage?.completion_tokens)
|
|
3559
3402
|
};
|
|
@@ -3630,7 +3473,7 @@ var MistralEmbeddingProvider = class {
|
|
|
3630
3473
|
try {
|
|
3631
3474
|
const embedding = data?.data?.[0]?.embedding;
|
|
3632
3475
|
if (!embedding) throw new Error("No embedding found in Mistral Embedding API response");
|
|
3633
|
-
const tokenUsage = getTokenUsage$
|
|
3476
|
+
const tokenUsage = getTokenUsage$1(data, cached);
|
|
3634
3477
|
const promptTokens = tokenUsage.prompt || 0;
|
|
3635
3478
|
const completionTokens = 0;
|
|
3636
3479
|
return {
|
|
@@ -3771,472 +3614,6 @@ var OpenAiModerationProvider = class OpenAiModerationProvider extends require_op
|
|
|
3771
3614
|
}
|
|
3772
3615
|
};
|
|
3773
3616
|
|
|
3774
|
-
//#endregion
|
|
3775
|
-
//#region src/providers/responses/processor.ts
|
|
3776
|
-
/**
|
|
3777
|
-
* Extract user-facing metadata from response data.
|
|
3778
|
-
* Only includes fields that are useful for users viewing eval results.
|
|
3779
|
-
*/
|
|
3780
|
-
function extractMetadata(data, processedOutput) {
|
|
3781
|
-
const metadata = {};
|
|
3782
|
-
if (typeof data.id === "string" && data.id) metadata.responseId = data.id;
|
|
3783
|
-
if (typeof data.model === "string" && data.model) metadata.model = data.model;
|
|
3784
|
-
if (Array.isArray(processedOutput.annotations) && processedOutput.annotations.length > 0) metadata.annotations = processedOutput.annotations;
|
|
3785
|
-
return metadata;
|
|
3786
|
-
}
|
|
3787
|
-
/**
|
|
3788
|
-
* Extract token usage from response data, handling both OpenAI Chat Completions format
|
|
3789
|
-
* (prompt_tokens, completion_tokens) and Azure Responses format (input_tokens, output_tokens)
|
|
3790
|
-
*/
|
|
3791
|
-
function getTokenUsage$1(data, cached) {
|
|
3792
|
-
if (data.usage) if (cached) {
|
|
3793
|
-
const totalTokens = data.usage.total_tokens || (data.usage.input_tokens || 0) + (data.usage.output_tokens || 0);
|
|
3794
|
-
return {
|
|
3795
|
-
cached: totalTokens,
|
|
3796
|
-
total: totalTokens,
|
|
3797
|
-
numRequests: 1
|
|
3798
|
-
};
|
|
3799
|
-
} else {
|
|
3800
|
-
const promptTokens = data.usage.prompt_tokens || data.usage.input_tokens || 0;
|
|
3801
|
-
const completionTokens = data.usage.completion_tokens || data.usage.output_tokens || 0;
|
|
3802
|
-
return {
|
|
3803
|
-
total: data.usage.total_tokens || promptTokens + completionTokens,
|
|
3804
|
-
prompt: promptTokens,
|
|
3805
|
-
completion: completionTokens,
|
|
3806
|
-
numRequests: 1,
|
|
3807
|
-
...data.usage.completion_tokens_details ? { completionDetails: {
|
|
3808
|
-
reasoning: data.usage.completion_tokens_details.reasoning_tokens,
|
|
3809
|
-
acceptedPrediction: data.usage.completion_tokens_details.accepted_prediction_tokens,
|
|
3810
|
-
rejectedPrediction: data.usage.completion_tokens_details.rejected_prediction_tokens
|
|
3811
|
-
} } : {}
|
|
3812
|
-
};
|
|
3813
|
-
}
|
|
3814
|
-
return {};
|
|
3815
|
-
}
|
|
3816
|
-
/**
|
|
3817
|
-
* Shared response processor for OpenAI and Azure Responses APIs.
|
|
3818
|
-
* Handles all response types with identical logic to ensure feature parity.
|
|
3819
|
-
*/
|
|
3820
|
-
var ResponsesProcessor = class {
|
|
3821
|
-
constructor(config) {
|
|
3822
|
-
this.config = config;
|
|
3823
|
-
}
|
|
3824
|
-
async processResponseOutput(data, requestConfig, cached) {
|
|
3825
|
-
require_logger.logger_default.debug(`Processing ${this.config.providerType} responses output`, {
|
|
3826
|
-
responseId: data.id,
|
|
3827
|
-
model: data.model
|
|
3828
|
-
});
|
|
3829
|
-
if (data.error) return { error: require_util$2.formatOpenAiError(data) };
|
|
3830
|
-
try {
|
|
3831
|
-
const context = {
|
|
3832
|
-
config: requestConfig,
|
|
3833
|
-
cached,
|
|
3834
|
-
data
|
|
3835
|
-
};
|
|
3836
|
-
const processedOutput = await this.processOutput(data.output, context);
|
|
3837
|
-
if (processedOutput.isRefusal) return {
|
|
3838
|
-
output: processedOutput.refusal,
|
|
3839
|
-
tokenUsage: getTokenUsage$1(data, cached),
|
|
3840
|
-
isRefusal: true,
|
|
3841
|
-
cached,
|
|
3842
|
-
cost: this.config.costCalculator(this.config.modelName, data.usage, requestConfig),
|
|
3843
|
-
raw: data,
|
|
3844
|
-
metadata: extractMetadata(data, processedOutput)
|
|
3845
|
-
};
|
|
3846
|
-
let finalOutput = processedOutput.result;
|
|
3847
|
-
if (requestConfig.response_format?.type === "json_schema" && typeof finalOutput === "string") try {
|
|
3848
|
-
finalOutput = JSON.parse(finalOutput);
|
|
3849
|
-
} catch (error) {
|
|
3850
|
-
require_logger.logger_default.error(`Failed to parse JSON output: ${error}`);
|
|
3851
|
-
}
|
|
3852
|
-
const result = {
|
|
3853
|
-
output: finalOutput,
|
|
3854
|
-
tokenUsage: getTokenUsage$1(data, cached),
|
|
3855
|
-
cached,
|
|
3856
|
-
cost: this.config.costCalculator(this.config.modelName, data.usage, requestConfig),
|
|
3857
|
-
raw: data,
|
|
3858
|
-
metadata: extractMetadata(data, processedOutput)
|
|
3859
|
-
};
|
|
3860
|
-
if (processedOutput.annotations && processedOutput.annotations.length > 0) result.raw = {
|
|
3861
|
-
...data,
|
|
3862
|
-
annotations: processedOutput.annotations
|
|
3863
|
-
};
|
|
3864
|
-
return result;
|
|
3865
|
-
} catch (err) {
|
|
3866
|
-
return { error: `Error parsing response: ${String(err)}\nResponse: ${JSON.stringify(data)}` };
|
|
3867
|
-
}
|
|
3868
|
-
}
|
|
3869
|
-
async processOutput(output, context) {
|
|
3870
|
-
if (this.config.modelName.includes("deep-research")) require_logger.logger_default.debug(`Deep research response structure: ${JSON.stringify(context.data, null, 2)}`);
|
|
3871
|
-
if (!output || !Array.isArray(output) || output.length === 0) throw new Error("Invalid response format: Missing output array");
|
|
3872
|
-
let result = "";
|
|
3873
|
-
let refusal = "";
|
|
3874
|
-
let isRefusal = false;
|
|
3875
|
-
const annotations = [];
|
|
3876
|
-
for (const item of output) {
|
|
3877
|
-
if (!item || typeof item !== "object") {
|
|
3878
|
-
require_logger.logger_default.warn(`Skipping invalid output item: ${JSON.stringify(item)}`);
|
|
3879
|
-
continue;
|
|
3880
|
-
}
|
|
3881
|
-
const processed = await this.processOutputItem(item, context);
|
|
3882
|
-
if (processed.isRefusal) {
|
|
3883
|
-
refusal = processed.content || "";
|
|
3884
|
-
isRefusal = true;
|
|
3885
|
-
} else if (processed.content) if (result) result += "\n" + processed.content;
|
|
3886
|
-
else result = processed.content;
|
|
3887
|
-
if (processed.annotations) annotations.push(...processed.annotations);
|
|
3888
|
-
}
|
|
3889
|
-
return {
|
|
3890
|
-
result,
|
|
3891
|
-
refusal,
|
|
3892
|
-
isRefusal,
|
|
3893
|
-
annotations: annotations.length > 0 ? annotations : void 0
|
|
3894
|
-
};
|
|
3895
|
-
}
|
|
3896
|
-
async processOutputItem(item, context) {
|
|
3897
|
-
switch (item.type) {
|
|
3898
|
-
case "function_call": return await this.processFunctionCall(item, context);
|
|
3899
|
-
case "message": return await this.processMessage(item, context);
|
|
3900
|
-
case "tool_result": return this.processToolResult(item);
|
|
3901
|
-
case "reasoning": return this.processReasoning(item);
|
|
3902
|
-
case "web_search_call": return this.processWebSearch(item);
|
|
3903
|
-
case "code_interpreter_call": return this.processCodeInterpreter(item);
|
|
3904
|
-
case "mcp_list_tools": return this.processMcpListTools(item);
|
|
3905
|
-
case "mcp_call": return this.processMcpCall(item);
|
|
3906
|
-
case "mcp_approval_request": return this.processMcpApprovalRequest(item);
|
|
3907
|
-
default:
|
|
3908
|
-
require_logger.logger_default.debug(`Unknown output item type: ${item.type}`);
|
|
3909
|
-
return {};
|
|
3910
|
-
}
|
|
3911
|
-
}
|
|
3912
|
-
async processFunctionCall(item, context) {
|
|
3913
|
-
let functionResult;
|
|
3914
|
-
if (item.arguments === "{}" && item.status === "completed") functionResult = JSON.stringify({
|
|
3915
|
-
type: "function_call",
|
|
3916
|
-
name: item.name,
|
|
3917
|
-
status: "no_arguments_provided",
|
|
3918
|
-
note: "Function called but no arguments were extracted. Consider using the correct Responses API tool format."
|
|
3919
|
-
});
|
|
3920
|
-
else functionResult = await this.config.functionCallbackHandler.processCalls(item, context.config.functionToolCallbacks);
|
|
3921
|
-
return { content: functionResult };
|
|
3922
|
-
}
|
|
3923
|
-
async processMessage(item, context) {
|
|
3924
|
-
if (item.role !== "assistant") return {};
|
|
3925
|
-
let content = "";
|
|
3926
|
-
let isRefusal = false;
|
|
3927
|
-
let refusal = "";
|
|
3928
|
-
const annotations = [];
|
|
3929
|
-
if (item.content) for (const contentItem of item.content) {
|
|
3930
|
-
if (!contentItem || typeof contentItem !== "object") {
|
|
3931
|
-
require_logger.logger_default.warn(`Skipping invalid content item: ${JSON.stringify(contentItem)}`);
|
|
3932
|
-
continue;
|
|
3933
|
-
}
|
|
3934
|
-
if (contentItem.type === "output_text") {
|
|
3935
|
-
content += contentItem.text;
|
|
3936
|
-
if (Array.isArray(contentItem.annotations) && contentItem.annotations.length > 0) annotations.push(...contentItem.annotations);
|
|
3937
|
-
} else if (contentItem.type === "tool_use" || contentItem.type === "function_call") content = await this.config.functionCallbackHandler.processCalls(contentItem, context.config.functionToolCallbacks);
|
|
3938
|
-
else if (contentItem.type === "refusal") {
|
|
3939
|
-
refusal = contentItem.refusal;
|
|
3940
|
-
isRefusal = true;
|
|
3941
|
-
}
|
|
3942
|
-
}
|
|
3943
|
-
else if (item.refusal) {
|
|
3944
|
-
refusal = item.refusal;
|
|
3945
|
-
isRefusal = true;
|
|
3946
|
-
}
|
|
3947
|
-
return {
|
|
3948
|
-
content: isRefusal ? refusal : content,
|
|
3949
|
-
isRefusal,
|
|
3950
|
-
annotations: annotations.length > 0 ? annotations : void 0
|
|
3951
|
-
};
|
|
3952
|
-
}
|
|
3953
|
-
processToolResult(item) {
|
|
3954
|
-
return Promise.resolve({ content: JSON.stringify(item) });
|
|
3955
|
-
}
|
|
3956
|
-
processReasoning(item) {
|
|
3957
|
-
if (!item.summary || !item.summary.length) return Promise.resolve({});
|
|
3958
|
-
const reasoningText = `Reasoning: ${item.summary.map((s) => s.text).join("\n")}`;
|
|
3959
|
-
return Promise.resolve({ content: reasoningText });
|
|
3960
|
-
}
|
|
3961
|
-
processWebSearch(item) {
|
|
3962
|
-
let content = "";
|
|
3963
|
-
const action = item.action;
|
|
3964
|
-
if (action) if (action.type === "search") content = `Web Search: "${action.query}"`;
|
|
3965
|
-
else if (action.type === "open_page") content = `Opening page: ${action.url}`;
|
|
3966
|
-
else if (action.type === "find_in_page") content = `Finding in page: "${action.query}"`;
|
|
3967
|
-
else content = `Web action: ${action.type}`;
|
|
3968
|
-
else content = `Web Search Call (status: ${item.status || "unknown"})`;
|
|
3969
|
-
if (item.status === "failed" && item.error) content += ` (Error: ${item.error})`;
|
|
3970
|
-
return Promise.resolve({ content });
|
|
3971
|
-
}
|
|
3972
|
-
processCodeInterpreter(item) {
|
|
3973
|
-
let content = `Code Interpreter: ${item.code || "Running code..."}`;
|
|
3974
|
-
if (item.status === "failed" && item.error) content += ` (Error: ${item.error})`;
|
|
3975
|
-
return Promise.resolve({ content });
|
|
3976
|
-
}
|
|
3977
|
-
processMcpListTools(item) {
|
|
3978
|
-
const content = `MCP Tools from ${item.server_label}: ${JSON.stringify(item.tools, null, 2)}`;
|
|
3979
|
-
return Promise.resolve({ content });
|
|
3980
|
-
}
|
|
3981
|
-
processMcpCall(item) {
|
|
3982
|
-
let content;
|
|
3983
|
-
if (item.error) content = `MCP Tool Error (${item.name}): ${item.error}`;
|
|
3984
|
-
else content = `MCP Tool Result (${item.name}): ${item.output}`;
|
|
3985
|
-
return Promise.resolve({ content });
|
|
3986
|
-
}
|
|
3987
|
-
processMcpApprovalRequest(item) {
|
|
3988
|
-
const content = `MCP Approval Required for ${item.server_label}.${item.name}: ${item.arguments}`;
|
|
3989
|
-
return Promise.resolve({ content });
|
|
3990
|
-
}
|
|
3991
|
-
};
|
|
3992
|
-
|
|
3993
|
-
//#endregion
|
|
3994
|
-
//#region src/providers/openai/responses.ts
|
|
3995
|
-
var OpenAiResponsesProvider = class extends require_openai.OpenAiGenericProvider {
|
|
3996
|
-
functionCallbackHandler = new FunctionCallbackHandler();
|
|
3997
|
-
processor;
|
|
3998
|
-
static OPENAI_RESPONSES_MODEL_NAMES = [
|
|
3999
|
-
"gpt-4o",
|
|
4000
|
-
"gpt-4o-2024-08-06",
|
|
4001
|
-
"gpt-4o-2024-11-20",
|
|
4002
|
-
"gpt-4o-2024-05-13",
|
|
4003
|
-
"gpt-4o-2024-07-18",
|
|
4004
|
-
"gpt-4o-mini",
|
|
4005
|
-
"gpt-4o-mini-2024-07-18",
|
|
4006
|
-
"gpt-4.1",
|
|
4007
|
-
"gpt-4.1-2025-04-14",
|
|
4008
|
-
"gpt-4.1-mini",
|
|
4009
|
-
"gpt-4.1-mini-2025-04-14",
|
|
4010
|
-
"gpt-4.1-nano",
|
|
4011
|
-
"gpt-4.1-nano-2025-04-14",
|
|
4012
|
-
"gpt-5",
|
|
4013
|
-
"gpt-5-2025-08-07",
|
|
4014
|
-
"gpt-5-chat",
|
|
4015
|
-
"gpt-5-chat-latest",
|
|
4016
|
-
"gpt-5-nano",
|
|
4017
|
-
"gpt-5-nano-2025-08-07",
|
|
4018
|
-
"gpt-5-mini",
|
|
4019
|
-
"gpt-5-mini-2025-08-07",
|
|
4020
|
-
"gpt-5-pro",
|
|
4021
|
-
"gpt-5-pro-2025-10-06",
|
|
4022
|
-
"gpt-5.1",
|
|
4023
|
-
"gpt-5.1-2025-11-13",
|
|
4024
|
-
"gpt-5.1-mini",
|
|
4025
|
-
"gpt-5.1-nano",
|
|
4026
|
-
"gpt-5.1-codex",
|
|
4027
|
-
"gpt-5.1-codex-max",
|
|
4028
|
-
"gpt-5.1-chat-latest",
|
|
4029
|
-
"gpt-5.2",
|
|
4030
|
-
"gpt-5.2-2025-12-11",
|
|
4031
|
-
"gpt-audio",
|
|
4032
|
-
"gpt-audio-2025-08-28",
|
|
4033
|
-
"gpt-audio-mini",
|
|
4034
|
-
"gpt-audio-mini-2025-10-06",
|
|
4035
|
-
"computer-use-preview",
|
|
4036
|
-
"computer-use-preview-2025-03-11",
|
|
4037
|
-
"o1",
|
|
4038
|
-
"o1-2024-12-17",
|
|
4039
|
-
"o1-preview",
|
|
4040
|
-
"o1-preview-2024-09-12",
|
|
4041
|
-
"o1-mini",
|
|
4042
|
-
"o1-mini-2024-09-12",
|
|
4043
|
-
"o1-pro",
|
|
4044
|
-
"o1-pro-2025-03-19",
|
|
4045
|
-
"o3-pro",
|
|
4046
|
-
"o3-pro-2025-06-10",
|
|
4047
|
-
"o3",
|
|
4048
|
-
"o3-2025-04-16",
|
|
4049
|
-
"o4-mini",
|
|
4050
|
-
"o4-mini-2025-04-16",
|
|
4051
|
-
"o3-mini",
|
|
4052
|
-
"o3-mini-2025-01-31",
|
|
4053
|
-
"codex-mini-latest",
|
|
4054
|
-
"gpt-5-codex",
|
|
4055
|
-
"o3-deep-research",
|
|
4056
|
-
"o3-deep-research-2025-06-26",
|
|
4057
|
-
"o4-mini-deep-research",
|
|
4058
|
-
"o4-mini-deep-research-2025-06-26"
|
|
4059
|
-
];
|
|
4060
|
-
config;
|
|
4061
|
-
constructor(modelName, options = {}) {
|
|
4062
|
-
super(modelName, options);
|
|
4063
|
-
this.config = options.config || {};
|
|
4064
|
-
this.processor = new ResponsesProcessor({
|
|
4065
|
-
modelName: this.modelName,
|
|
4066
|
-
providerType: "openai",
|
|
4067
|
-
functionCallbackHandler: this.functionCallbackHandler,
|
|
4068
|
-
costCalculator: (modelName, usage, config) => require_util$2.calculateOpenAICost(modelName, config, usage?.input_tokens, usage?.output_tokens, 0, 0) ?? 0
|
|
4069
|
-
});
|
|
4070
|
-
}
|
|
4071
|
-
isGPT5Model() {
|
|
4072
|
-
return this.modelName.startsWith("gpt-5") || this.modelName.includes("/gpt-5");
|
|
4073
|
-
}
|
|
4074
|
-
isReasoningModel() {
|
|
4075
|
-
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();
|
|
4076
|
-
}
|
|
4077
|
-
supportsTemperature() {
|
|
4078
|
-
return !this.isReasoningModel();
|
|
4079
|
-
}
|
|
4080
|
-
async getOpenAiBody(prompt, context, _callApiOptions) {
|
|
4081
|
-
const config = {
|
|
4082
|
-
...this.config,
|
|
4083
|
-
...context?.prompt?.config
|
|
4084
|
-
};
|
|
4085
|
-
let input;
|
|
4086
|
-
try {
|
|
4087
|
-
const parsedJson = JSON.parse(prompt);
|
|
4088
|
-
if (Array.isArray(parsedJson)) input = parsedJson;
|
|
4089
|
-
else input = prompt;
|
|
4090
|
-
} catch {
|
|
4091
|
-
input = prompt;
|
|
4092
|
-
}
|
|
4093
|
-
const isReasoningModel = this.isReasoningModel();
|
|
4094
|
-
const maxOutputTokens = config.max_output_tokens ?? (isReasoningModel ? require_logger.getEnvInt("OPENAI_MAX_COMPLETION_TOKENS") : require_logger.getEnvInt("OPENAI_MAX_TOKENS", 1024));
|
|
4095
|
-
const temperature = this.supportsTemperature() ? config.temperature ?? require_logger.getEnvFloat("OPENAI_TEMPERATURE", 0) : void 0;
|
|
4096
|
-
const reasoningEffort = isReasoningModel ? require_util.renderVarsInObject(config.reasoning_effort, context?.vars) : void 0;
|
|
4097
|
-
const instructions = config.instructions;
|
|
4098
|
-
const responseFormat = require_util.maybeLoadResponseFormatFromExternalFile(config.response_format, context?.vars);
|
|
4099
|
-
let textFormat;
|
|
4100
|
-
if (responseFormat) if (responseFormat.type === "json_object") textFormat = { format: { type: "json_object" } };
|
|
4101
|
-
else if (responseFormat.type === "json_schema") {
|
|
4102
|
-
const schema = responseFormat.schema || responseFormat.json_schema?.schema;
|
|
4103
|
-
textFormat = { format: {
|
|
4104
|
-
type: "json_schema",
|
|
4105
|
-
name: responseFormat.json_schema?.name || responseFormat.name || "response_schema",
|
|
4106
|
-
schema,
|
|
4107
|
-
strict: true
|
|
4108
|
-
} };
|
|
4109
|
-
} else textFormat = { format: { type: "text" } };
|
|
4110
|
-
else textFormat = { format: { type: "text" } };
|
|
4111
|
-
if (this.isGPT5Model() && config.verbosity) textFormat = {
|
|
4112
|
-
...textFormat,
|
|
4113
|
-
verbosity: config.verbosity
|
|
4114
|
-
};
|
|
4115
|
-
const loadedTools = config.tools ? await require_util.maybeLoadToolsFromExternalFile(config.tools, context?.vars) : void 0;
|
|
4116
|
-
const body = {
|
|
4117
|
-
model: this.modelName,
|
|
4118
|
-
input,
|
|
4119
|
-
...maxOutputTokens !== void 0 ? { max_output_tokens: maxOutputTokens } : {},
|
|
4120
|
-
...reasoningEffort ? { reasoning: { effort: reasoningEffort } } : {},
|
|
4121
|
-
...temperature !== void 0 ? { temperature } : {},
|
|
4122
|
-
...instructions ? { instructions } : {},
|
|
4123
|
-
...config.top_p !== void 0 || require_logger.getEnvString("OPENAI_TOP_P") ? { top_p: config.top_p ?? require_logger.getEnvFloat("OPENAI_TOP_P", 1) } : {},
|
|
4124
|
-
...loadedTools ? { tools: loadedTools } : {},
|
|
4125
|
-
...config.tool_choice ? { tool_choice: config.tool_choice } : {},
|
|
4126
|
-
...config.max_tool_calls ? { max_tool_calls: config.max_tool_calls } : {},
|
|
4127
|
-
...config.previous_response_id ? { previous_response_id: config.previous_response_id } : {},
|
|
4128
|
-
text: textFormat,
|
|
4129
|
-
...config.truncation ? { truncation: config.truncation } : {},
|
|
4130
|
-
...config.metadata ? { metadata: config.metadata } : {},
|
|
4131
|
-
..."parallel_tool_calls" in config ? { parallel_tool_calls: Boolean(config.parallel_tool_calls) } : {},
|
|
4132
|
-
...config.stream ? { stream: config.stream } : {},
|
|
4133
|
-
..."store" in config ? { store: Boolean(config.store) } : {},
|
|
4134
|
-
...config.background ? { background: config.background } : {},
|
|
4135
|
-
...config.webhook_url ? { webhook_url: config.webhook_url } : {},
|
|
4136
|
-
...config.user ? { user: config.user } : {},
|
|
4137
|
-
...config.passthrough || {}
|
|
4138
|
-
};
|
|
4139
|
-
if (config.reasoning && this.isReasoningModel()) body.reasoning = config.reasoning;
|
|
4140
|
-
return {
|
|
4141
|
-
body,
|
|
4142
|
-
config: {
|
|
4143
|
-
...config,
|
|
4144
|
-
tools: loadedTools,
|
|
4145
|
-
response_format: responseFormat
|
|
4146
|
-
}
|
|
4147
|
-
};
|
|
4148
|
-
}
|
|
4149
|
-
async callApi(prompt, context, callApiOptions) {
|
|
4150
|
-
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.");
|
|
4151
|
-
const { body, config } = await this.getOpenAiBody(prompt, context, callApiOptions);
|
|
4152
|
-
const isDeepResearchModel = this.modelName.includes("deep-research");
|
|
4153
|
-
if (isDeepResearchModel) {
|
|
4154
|
-
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` };
|
|
4155
|
-
const mcpTools = config.tools?.filter((tool) => tool.type === "mcp") || [];
|
|
4156
|
-
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` };
|
|
4157
|
-
}
|
|
4158
|
-
let timeout = require_fetch.REQUEST_TIMEOUT_MS;
|
|
4159
|
-
if (isDeepResearchModel || this.modelName.includes("gpt-5-pro")) {
|
|
4160
|
-
const evalTimeout = require_logger.getEnvInt("PROMPTFOO_EVAL_TIMEOUT_MS", 0);
|
|
4161
|
-
timeout = evalTimeout > 0 ? evalTimeout : require_fetch.LONG_RUNNING_MODEL_TIMEOUT_MS;
|
|
4162
|
-
require_logger.logger_default.debug(`Using timeout of ${timeout}ms for long-running model ${this.modelName}`);
|
|
4163
|
-
}
|
|
4164
|
-
let data;
|
|
4165
|
-
let status;
|
|
4166
|
-
let statusText;
|
|
4167
|
-
let cached = false;
|
|
4168
|
-
let deleteFromCache;
|
|
4169
|
-
let responseHeaders;
|
|
4170
|
-
try {
|
|
4171
|
-
({data, cached, status, statusText, deleteFromCache, headers: responseHeaders} = await require_cache.fetchWithCache(`${this.getApiUrl()}/responses`, {
|
|
4172
|
-
method: "POST",
|
|
4173
|
-
headers: {
|
|
4174
|
-
"Content-Type": "application/json",
|
|
4175
|
-
Authorization: `Bearer ${this.getApiKey()}`,
|
|
4176
|
-
...this.getOrganization() ? { "OpenAI-Organization": this.getOrganization() } : {},
|
|
4177
|
-
...config.headers
|
|
4178
|
-
},
|
|
4179
|
-
body: JSON.stringify(body)
|
|
4180
|
-
}, timeout, "json", context?.bustCache ?? context?.debug, this.config.maxRetries));
|
|
4181
|
-
if (status < 200 || status >= 300) {
|
|
4182
|
-
const errorMessage = `API error: ${status} ${statusText}\n${typeof data === "string" ? data : JSON.stringify(data)}`;
|
|
4183
|
-
if (typeof data === "object" && data?.error?.code === "invalid_prompt") return {
|
|
4184
|
-
output: errorMessage,
|
|
4185
|
-
tokenUsage: data?.usage ? require_util$2.getTokenUsage(data, cached) : void 0,
|
|
4186
|
-
isRefusal: true,
|
|
4187
|
-
metadata: { http: {
|
|
4188
|
-
status,
|
|
4189
|
-
statusText,
|
|
4190
|
-
headers: responseHeaders ?? {}
|
|
4191
|
-
} }
|
|
4192
|
-
};
|
|
4193
|
-
return {
|
|
4194
|
-
error: errorMessage,
|
|
4195
|
-
metadata: { http: {
|
|
4196
|
-
status,
|
|
4197
|
-
statusText,
|
|
4198
|
-
headers: responseHeaders ?? {}
|
|
4199
|
-
} }
|
|
4200
|
-
};
|
|
4201
|
-
}
|
|
4202
|
-
} catch (err) {
|
|
4203
|
-
require_logger.logger_default.error(`API call error: ${String(err)}`);
|
|
4204
|
-
await deleteFromCache?.();
|
|
4205
|
-
return {
|
|
4206
|
-
error: `API call error: ${String(err)}`,
|
|
4207
|
-
metadata: { http: {
|
|
4208
|
-
status: 0,
|
|
4209
|
-
statusText: "Error",
|
|
4210
|
-
headers: responseHeaders ?? {}
|
|
4211
|
-
} }
|
|
4212
|
-
};
|
|
4213
|
-
}
|
|
4214
|
-
if (data.error?.message) {
|
|
4215
|
-
await deleteFromCache?.();
|
|
4216
|
-
return {
|
|
4217
|
-
error: require_util$2.formatOpenAiError(data),
|
|
4218
|
-
metadata: { http: {
|
|
4219
|
-
status,
|
|
4220
|
-
statusText,
|
|
4221
|
-
headers: responseHeaders ?? {}
|
|
4222
|
-
} }
|
|
4223
|
-
};
|
|
4224
|
-
}
|
|
4225
|
-
const result = await this.processor.processResponseOutput(data, config, cached);
|
|
4226
|
-
return {
|
|
4227
|
-
...result,
|
|
4228
|
-
metadata: {
|
|
4229
|
-
...result.metadata,
|
|
4230
|
-
http: {
|
|
4231
|
-
status,
|
|
4232
|
-
statusText,
|
|
4233
|
-
headers: responseHeaders ?? {}
|
|
4234
|
-
}
|
|
4235
|
-
}
|
|
4236
|
-
};
|
|
4237
|
-
}
|
|
4238
|
-
};
|
|
4239
|
-
|
|
4240
3617
|
//#endregion
|
|
4241
3618
|
//#region src/util/cloud.ts
|
|
4242
3619
|
const PERMISSION_CHECK_SERVER_FEATURE_NAME = "config-permission-check-endpoint";
|
|
@@ -4297,6 +3674,98 @@ async function getProviderFromCloud(id) {
|
|
|
4297
3674
|
throw new Error(`Failed to fetch provider from cloud: ${id}.`);
|
|
4298
3675
|
}
|
|
4299
3676
|
}
|
|
3677
|
+
function isRecord(value) {
|
|
3678
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
3679
|
+
}
|
|
3680
|
+
async function fetchCloudConfig(path) {
|
|
3681
|
+
const response = await makeRequest(path, "GET");
|
|
3682
|
+
if (!response.ok) {
|
|
3683
|
+
const errorMessage = typeof response.text === "function" ? await response.text() : "";
|
|
3684
|
+
require_logger.logger_default.error(`[Cloud] Failed to fetch config from cloud: ${errorMessage}. HTTP Status: ${response.status} -- ${response.statusText}.`);
|
|
3685
|
+
throw new Error(`Failed to fetch config from cloud: ${response.statusText}`);
|
|
3686
|
+
}
|
|
3687
|
+
return response.json();
|
|
3688
|
+
}
|
|
3689
|
+
function looksLikeEvalConfig(config) {
|
|
3690
|
+
return "providers" in config || "providerIds" in config || "prompts" in config || "tests" in config || "testCases" in config;
|
|
3691
|
+
}
|
|
3692
|
+
function extractEvalConfigPayload(body) {
|
|
3693
|
+
if (!isRecord(body)) throw new Error("Invalid cloud eval config response: expected a JSON object.");
|
|
3694
|
+
const bodyConfig = isRecord(body.config) ? body.config : void 0;
|
|
3695
|
+
if (!bodyConfig) {
|
|
3696
|
+
if (looksLikeEvalConfig(body)) return body;
|
|
3697
|
+
throw new Error("Invalid cloud eval config response: missing \"config\" object.");
|
|
3698
|
+
}
|
|
3699
|
+
const nestedConfig = isRecord(bodyConfig.config) ? bodyConfig.config : void 0;
|
|
3700
|
+
if (!nestedConfig) return {
|
|
3701
|
+
...bodyConfig,
|
|
3702
|
+
...typeof bodyConfig.name !== "string" && typeof body.name === "string" ? { name: body.name } : {}
|
|
3703
|
+
};
|
|
3704
|
+
return {
|
|
3705
|
+
...nestedConfig,
|
|
3706
|
+
...typeof nestedConfig.name !== "string" && typeof bodyConfig.name === "string" ? { name: bodyConfig.name } : {}
|
|
3707
|
+
};
|
|
3708
|
+
}
|
|
3709
|
+
function normalizeCloudEvalProvider(provider) {
|
|
3710
|
+
if (typeof provider !== "string") return provider;
|
|
3711
|
+
if (provider.startsWith(require_fetch.CLOUD_PROVIDER_PREFIX) || !require_types.isUuid(provider)) return provider;
|
|
3712
|
+
return `${require_fetch.CLOUD_PROVIDER_PREFIX}${provider}`;
|
|
3713
|
+
}
|
|
3714
|
+
function normalizeCloudEvalPrompt(prompt) {
|
|
3715
|
+
if (typeof prompt === "string") return prompt;
|
|
3716
|
+
if (isRecord(prompt)) {
|
|
3717
|
+
if (typeof prompt.content === "string") return prompt.content;
|
|
3718
|
+
if (typeof prompt.raw === "string") return prompt.raw;
|
|
3719
|
+
}
|
|
3720
|
+
return String(prompt ?? "");
|
|
3721
|
+
}
|
|
3722
|
+
function normalizeEvalConfig(config) {
|
|
3723
|
+
const providers = Array.isArray(config.providers) ? config.providers : Array.isArray(config.providerIds) ? config.providerIds : [];
|
|
3724
|
+
const prompts = Array.isArray(config.prompts) ? config.prompts : [];
|
|
3725
|
+
const tests = Array.isArray(config.tests) ? config.tests : Array.isArray(config.testCases) ? config.testCases : [];
|
|
3726
|
+
const commandLineOptions = {
|
|
3727
|
+
...isRecord(config.commandLineOptions) ? config.commandLineOptions : {},
|
|
3728
|
+
...config.maxConcurrency != null ? { maxConcurrency: config.maxConcurrency } : {},
|
|
3729
|
+
...config.delay != null ? { delay: config.delay } : {},
|
|
3730
|
+
...config.verbose != null ? { verbose: config.verbose } : {}
|
|
3731
|
+
};
|
|
3732
|
+
const normalizedConfig = {
|
|
3733
|
+
...config,
|
|
3734
|
+
providers: providers.map(normalizeCloudEvalProvider),
|
|
3735
|
+
prompts: prompts.map(normalizeCloudEvalPrompt),
|
|
3736
|
+
tests
|
|
3737
|
+
};
|
|
3738
|
+
if (Object.keys(commandLineOptions).length > 0) normalizedConfig.commandLineOptions = commandLineOptions;
|
|
3739
|
+
else delete normalizedConfig.commandLineOptions;
|
|
3740
|
+
if (typeof config.description === "string" && config.description.trim().length > 0) normalizedConfig.description = config.description;
|
|
3741
|
+
else if (typeof config.name === "string" && config.name.trim().length > 0) normalizedConfig.description = config.name;
|
|
3742
|
+
delete normalizedConfig.providerIds;
|
|
3743
|
+
delete normalizedConfig.testCases;
|
|
3744
|
+
delete normalizedConfig.maxConcurrency;
|
|
3745
|
+
delete normalizedConfig.delay;
|
|
3746
|
+
delete normalizedConfig.verbose;
|
|
3747
|
+
return normalizedConfig;
|
|
3748
|
+
}
|
|
3749
|
+
/**
|
|
3750
|
+
* Fetches an eval configuration from PromptFoo Cloud by ID.
|
|
3751
|
+
* The response may contain legacy eval fields, which are normalized into UnifiedConfig.
|
|
3752
|
+
* @param id - The unique identifier of the cloud eval configuration
|
|
3753
|
+
* @returns Promise resolving to a normalized unified configuration object
|
|
3754
|
+
* @throws Error if cloud is not enabled, config not found, or response shape is invalid
|
|
3755
|
+
*/
|
|
3756
|
+
async function getEvalConfigFromCloud(id) {
|
|
3757
|
+
if (!require_fetch.cloudConfig.isEnabled()) throw new Error(`Could not fetch Config ${id} from cloud. Cloud config is not enabled. Please run \`promptfoo auth login\` to login.`);
|
|
3758
|
+
try {
|
|
3759
|
+
const config = normalizeEvalConfig(extractEvalConfigPayload(await fetchCloudConfig(`configs/${id}`)));
|
|
3760
|
+
require_logger.logger_default.info(`Eval config fetched from cloud: ${id}`);
|
|
3761
|
+
return config;
|
|
3762
|
+
} catch (e) {
|
|
3763
|
+
require_logger.logger_default.error(`Failed to fetch eval config from cloud: ${id}.`);
|
|
3764
|
+
require_logger.logger_default.error(String(e));
|
|
3765
|
+
if (e instanceof Error) throw e;
|
|
3766
|
+
throw new Error(String(e));
|
|
3767
|
+
}
|
|
3768
|
+
}
|
|
4300
3769
|
/**
|
|
4301
3770
|
* Checks if a provider path represents a cloud-based provider.
|
|
4302
3771
|
* @param providerPath - The provider path to check
|
|
@@ -5900,7 +5369,7 @@ async function loadRedteamProvider({ provider, jsonOnly = false, preferSmallMode
|
|
|
5900
5369
|
ret = redteamProvider;
|
|
5901
5370
|
} else if (typeof redteamProvider === "string" || require_types.isProviderOptions(redteamProvider)) {
|
|
5902
5371
|
require_logger.logger_default.debug(`Loading ${purpose} provider`, { provider: redteamProvider });
|
|
5903
|
-
ret = (await (await Promise.resolve().then(() => require("./providers-
|
|
5372
|
+
ret = (await (await Promise.resolve().then(() => require("./providers-BMZZmPBJ.cjs"))).loadApiProviders([redteamProvider]))[0];
|
|
5904
5373
|
} else {
|
|
5905
5374
|
const defaultModel = preferSmallModel ? ATTACKER_MODEL_SMALL : ATTACKER_MODEL;
|
|
5906
5375
|
require_logger.logger_default.debug(`Using default ${purpose} provider: ${defaultModel}`);
|
|
@@ -6179,7 +5648,7 @@ async function externalizeResponseForRedteamHistory(response, context) {
|
|
|
6179
5648
|
*/
|
|
6180
5649
|
async function tryUnblocking({ messages, lastResponse, goal, purpose }) {
|
|
6181
5650
|
try {
|
|
6182
|
-
const { checkServerFeatureSupport } = await Promise.resolve().then(() => require("./server-
|
|
5651
|
+
const { checkServerFeatureSupport } = await Promise.resolve().then(() => require("./server-XpGXFHkS.cjs"));
|
|
6183
5652
|
const supportsUnblocking = await checkServerFeatureSupport("blocking-question-analysis", "2025-06-16T14:49:11-07:00");
|
|
6184
5653
|
if (!require_logger.getEnvBool("PROMPTFOO_ENABLE_UNBLOCKING")) {
|
|
6185
5654
|
require_logger.logger_default.debug("[Unblocking] Disabled by default (set PROMPTFOO_ENABLE_UNBLOCKING=true to enable)");
|
|
@@ -9948,7 +9417,6 @@ async function addImageToBase64(testCases, injectVar, config = {}) {
|
|
|
9948
9417
|
|
|
9949
9418
|
//#endregion
|
|
9950
9419
|
//#region src/redteam/strategies/simpleVideo.ts
|
|
9951
|
-
let ffmpegCache = null;
|
|
9952
9420
|
function shouldShowProgressBar() {
|
|
9953
9421
|
return !require_logger.cliState_default.webUI && require_logger.logger_default.level !== "debug";
|
|
9954
9422
|
}
|
|
@@ -9965,25 +9433,29 @@ function getSystemFont() {
|
|
|
9965
9433
|
return "DejaVu-Sans";
|
|
9966
9434
|
}
|
|
9967
9435
|
}
|
|
9968
|
-
|
|
9969
|
-
|
|
9436
|
+
let ffmpegAvailable = false;
|
|
9437
|
+
async function checkFfmpegAvailable() {
|
|
9438
|
+
if (ffmpegAvailable) return;
|
|
9970
9439
|
try {
|
|
9971
|
-
|
|
9972
|
-
|
|
9440
|
+
await (0, execa.execa)("ffmpeg", ["-version"]);
|
|
9441
|
+
ffmpegAvailable = true;
|
|
9973
9442
|
} catch (error) {
|
|
9974
|
-
|
|
9975
|
-
|
|
9443
|
+
throw new Error(`To use the video strategy, FFmpeg must be installed on your system:
|
|
9444
|
+
- macOS: brew install ffmpeg
|
|
9445
|
+
- Ubuntu/Debian: apt-get install ffmpeg
|
|
9446
|
+
- Windows: Download from ffmpeg.org
|
|
9447
|
+
Error: ${error}`);
|
|
9976
9448
|
}
|
|
9977
9449
|
}
|
|
9978
|
-
|
|
9450
|
+
function escapeDrawtextString(text) {
|
|
9451
|
+
return text.replace(/\\/g, "\\\\").replace(/'/g, "'\\''").replace(/:/g, "\\:").replace(/\n/g, "\\n").replace(/%/g, "%%");
|
|
9452
|
+
}
|
|
9453
|
+
async function createTempVideoEnvironment() {
|
|
9979
9454
|
const tempDir = path.default.join(os.default.tmpdir(), "promptfoo-video");
|
|
9980
9455
|
if (!fs.default.existsSync(tempDir)) fs.default.mkdirSync(tempDir, { recursive: true });
|
|
9981
|
-
const
|
|
9982
|
-
const outputPath = path.default.join(tempDir, "output-video.mp4");
|
|
9983
|
-
fs.default.writeFileSync(textFilePath, text);
|
|
9456
|
+
const outputPath = path.default.join(tempDir, `output-video-${(0, crypto$1.randomUUID)()}.mp4`);
|
|
9984
9457
|
const cleanup = () => {
|
|
9985
9458
|
try {
|
|
9986
|
-
if (fs.default.existsSync(textFilePath)) fs.default.unlinkSync(textFilePath);
|
|
9987
9459
|
if (fs.default.existsSync(outputPath)) fs.default.unlinkSync(outputPath);
|
|
9988
9460
|
} catch (error) {
|
|
9989
9461
|
require_logger.logger_default.warn(`Failed to clean up temporary files: ${error}`);
|
|
@@ -9991,7 +9463,6 @@ async function createTempVideoEnvironment(text) {
|
|
|
9991
9463
|
};
|
|
9992
9464
|
return {
|
|
9993
9465
|
tempDir,
|
|
9994
|
-
textFilePath,
|
|
9995
9466
|
outputPath,
|
|
9996
9467
|
cleanup
|
|
9997
9468
|
};
|
|
@@ -10002,26 +9473,29 @@ function getFallbackBase64(text) {
|
|
|
10002
9473
|
async function textToVideo(text) {
|
|
10003
9474
|
try {
|
|
10004
9475
|
if (require_server.neverGenerateRemote()) {
|
|
10005
|
-
|
|
10006
|
-
const {
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
9476
|
+
await checkFfmpegAvailable();
|
|
9477
|
+
const { outputPath, cleanup } = await createTempVideoEnvironment();
|
|
9478
|
+
try {
|
|
9479
|
+
const escapedText = escapeDrawtextString(text);
|
|
9480
|
+
await (0, execa.execa)("ffmpeg", [
|
|
9481
|
+
"-f",
|
|
9482
|
+
"lavfi",
|
|
9483
|
+
"-i",
|
|
9484
|
+
"color=white:s=640x480:d=5",
|
|
9485
|
+
"-vf",
|
|
9486
|
+
`drawtext=fontfile=${getSystemFont()}:text='${escapedText}':fontcolor=black:fontsize=24:x=(w-text_w)/2:y=(h-text_h)/2`,
|
|
9487
|
+
"-y",
|
|
9488
|
+
outputPath
|
|
9489
|
+
]);
|
|
9490
|
+
const base64Video = fs.default.readFileSync(outputPath).toString("base64");
|
|
9491
|
+
cleanup();
|
|
9492
|
+
return base64Video;
|
|
9493
|
+
} catch (error) {
|
|
9494
|
+
require_logger.logger_default.error(`Error creating video with ffmpeg: ${error}`);
|
|
9495
|
+
cleanup();
|
|
9496
|
+
throw error;
|
|
9497
|
+
}
|
|
9498
|
+
} else throw new Error("Local video generation requires FFmpeg to be installed. Future versions may support remote generation.");
|
|
10025
9499
|
} catch (error) {
|
|
10026
9500
|
require_logger.logger_default.error(`Error generating video from text: ${error}`);
|
|
10027
9501
|
return getFallbackBase64(text);
|
|
@@ -10232,6 +9706,7 @@ const Strategies = [
|
|
|
10232
9706
|
},
|
|
10233
9707
|
{
|
|
10234
9708
|
id: "crescendo",
|
|
9709
|
+
requiresGoalExtraction: true,
|
|
10235
9710
|
action: async (testCases, injectVar, config) => {
|
|
10236
9711
|
require_logger.logger_default.debug(`Adding Crescendo to ${testCases.length} test cases`);
|
|
10237
9712
|
const newTestCases = addCrescendo(testCases, injectVar, config);
|
|
@@ -10241,6 +9716,7 @@ const Strategies = [
|
|
|
10241
9716
|
},
|
|
10242
9717
|
{
|
|
10243
9718
|
id: "custom",
|
|
9719
|
+
requiresGoalExtraction: true,
|
|
10244
9720
|
action: async (testCases, injectVar, config, strategyId = "custom") => {
|
|
10245
9721
|
require_logger.logger_default.debug(`Adding Custom to ${testCases.length} test cases`);
|
|
10246
9722
|
const newTestCases = addCustom(testCases, injectVar, config, strategyId);
|
|
@@ -10259,6 +9735,7 @@ const Strategies = [
|
|
|
10259
9735
|
},
|
|
10260
9736
|
{
|
|
10261
9737
|
id: "goat",
|
|
9738
|
+
requiresGoalExtraction: true,
|
|
10262
9739
|
action: async (testCases, injectVar, config) => {
|
|
10263
9740
|
require_logger.logger_default.debug(`Adding GOAT to ${testCases.length} test cases`);
|
|
10264
9741
|
const newTestCases = await addGoatTestCases(testCases, injectVar, config);
|
|
@@ -10268,6 +9745,7 @@ const Strategies = [
|
|
|
10268
9745
|
},
|
|
10269
9746
|
{
|
|
10270
9747
|
id: "indirect-web-pwn",
|
|
9748
|
+
requiresGoalExtraction: true,
|
|
10271
9749
|
action: async (testCases, injectVar, config) => {
|
|
10272
9750
|
require_logger.logger_default.debug(`Adding Indirect Web Pwn to ${testCases.length} test cases`);
|
|
10273
9751
|
const newTestCases = await addIndirectWebPwnTestCases(testCases, injectVar, config);
|
|
@@ -10304,10 +9782,12 @@ const Strategies = [
|
|
|
10304
9782
|
},
|
|
10305
9783
|
{
|
|
10306
9784
|
id: "jailbreak",
|
|
9785
|
+
requiresGoalExtraction: true,
|
|
10307
9786
|
action: async (testCases, injectVar, config) => {
|
|
10308
|
-
require_logger.logger_default.
|
|
10309
|
-
|
|
10310
|
-
|
|
9787
|
+
require_logger.logger_default.warn("Strategy \"jailbreak\" is deprecated. Use \"jailbreak:meta\" instead. The \"jailbreak\" strategy used outdated single-shot optimization techniques.");
|
|
9788
|
+
require_logger.logger_default.debug(`Adding meta-agent jailbreaks to ${testCases.length} test cases`);
|
|
9789
|
+
const newTestCases = addIterativeJailbreaks(testCases, injectVar, "iterative:meta", config);
|
|
9790
|
+
require_logger.logger_default.debug(`Added ${newTestCases.length} meta-agent jailbreak test cases`);
|
|
10311
9791
|
return newTestCases;
|
|
10312
9792
|
}
|
|
10313
9793
|
},
|
|
@@ -10331,6 +9811,7 @@ const Strategies = [
|
|
|
10331
9811
|
},
|
|
10332
9812
|
{
|
|
10333
9813
|
id: "jailbreak:tree",
|
|
9814
|
+
requiresGoalExtraction: true,
|
|
10334
9815
|
action: async (testCases, injectVar, config) => {
|
|
10335
9816
|
require_logger.logger_default.debug(`Adding experimental tree jailbreaks to ${testCases.length} test cases`);
|
|
10336
9817
|
const newTestCases = addIterativeJailbreaks(testCases, injectVar, "iterative:tree", config);
|
|
@@ -10340,6 +9821,7 @@ const Strategies = [
|
|
|
10340
9821
|
},
|
|
10341
9822
|
{
|
|
10342
9823
|
id: "jailbreak:meta",
|
|
9824
|
+
requiresGoalExtraction: true,
|
|
10343
9825
|
action: async (testCases, injectVar, config) => {
|
|
10344
9826
|
require_logger.logger_default.debug(`Adding meta-agent jailbreaks to ${testCases.length} test cases`);
|
|
10345
9827
|
const newTestCases = addIterativeJailbreaks(testCases, injectVar, "iterative:meta", config);
|
|
@@ -10349,6 +9831,7 @@ const Strategies = [
|
|
|
10349
9831
|
},
|
|
10350
9832
|
{
|
|
10351
9833
|
id: "jailbreak:hydra",
|
|
9834
|
+
requiresGoalExtraction: true,
|
|
10352
9835
|
action: async (testCases, injectVar, config) => {
|
|
10353
9836
|
require_logger.logger_default.debug(`Adding hydra multi-turn jailbreaks to ${testCases.length} test cases`);
|
|
10354
9837
|
const newTestCases = addHydra(testCases, injectVar, config);
|
|
@@ -11252,7 +10735,7 @@ var CrescendoProvider = class {
|
|
|
11252
10735
|
});
|
|
11253
10736
|
let assertToUse = test?.assert?.find((a) => a.type && a.type.includes(test.metadata?.pluginId));
|
|
11254
10737
|
if (!assertToUse) assertToUse = test?.assert?.find((a) => a.type);
|
|
11255
|
-
const { getGraderById } = await Promise.resolve().then(() => require("./graders-
|
|
10738
|
+
const { getGraderById } = await Promise.resolve().then(() => require("./graders-CGZQShfJ.cjs"));
|
|
11256
10739
|
let graderPassed;
|
|
11257
10740
|
const additionalRubric = getGoalRubric(this.userGoal);
|
|
11258
10741
|
while (roundNum < this.maxTurns) try {
|
|
@@ -11927,7 +11410,7 @@ var CustomProvider = class {
|
|
|
11927
11410
|
let lastTransformResult;
|
|
11928
11411
|
let assertToUse = test?.assert?.find((a) => a.type && a.type.includes(test.metadata?.pluginId));
|
|
11929
11412
|
if (!assertToUse) assertToUse = test?.assert?.find((a) => a.type);
|
|
11930
|
-
const { getGraderById } = await Promise.resolve().then(() => require("./graders-
|
|
11413
|
+
const { getGraderById } = await Promise.resolve().then(() => require("./graders-CGZQShfJ.cjs"));
|
|
11931
11414
|
let graderPassed;
|
|
11932
11415
|
let storedGraderResult;
|
|
11933
11416
|
const additionalRubric = getGoalRubric(this.userGoal);
|
|
@@ -12409,7 +11892,7 @@ var GoatProvider = class {
|
|
|
12409
11892
|
let assertToUse;
|
|
12410
11893
|
let graderPassed;
|
|
12411
11894
|
let storedGraderResult;
|
|
12412
|
-
const { getGraderById } = await Promise.resolve().then(() => require("./graders-
|
|
11895
|
+
const { getGraderById } = await Promise.resolve().then(() => require("./graders-CGZQShfJ.cjs"));
|
|
12413
11896
|
let test;
|
|
12414
11897
|
if (context?.test) {
|
|
12415
11898
|
test = context?.test;
|
|
@@ -12850,7 +12333,7 @@ var HydraProvider = class {
|
|
|
12850
12333
|
let lastTransformResult;
|
|
12851
12334
|
let lastTransformDisplayVars;
|
|
12852
12335
|
let lastFinalAttackPrompt;
|
|
12853
|
-
const { getGraderById } = await Promise.resolve().then(() => require("./graders-
|
|
12336
|
+
const { getGraderById } = await Promise.resolve().then(() => require("./graders-CGZQShfJ.cjs"));
|
|
12854
12337
|
let assertToUse = test?.assert?.find((a) => a.type && a.type.includes(test.metadata?.pluginId));
|
|
12855
12338
|
if (!assertToUse) assertToUse = test?.assert?.find((a) => a.type);
|
|
12856
12339
|
let previousTraceSummary;
|
|
@@ -12886,7 +12369,7 @@ var HydraProvider = class {
|
|
|
12886
12369
|
},
|
|
12887
12370
|
vars: {}
|
|
12888
12371
|
}, options);
|
|
12889
|
-
require_tokenUsageUtils.accumulateResponseTokenUsage(totalTokenUsage, agentResp);
|
|
12372
|
+
require_tokenUsageUtils.accumulateResponseTokenUsage(totalTokenUsage, agentResp, { countAsRequest: false });
|
|
12890
12373
|
if (this.agentProvider.delay) await require_fetch.sleep(this.agentProvider.delay);
|
|
12891
12374
|
if (agentResp.error) {
|
|
12892
12375
|
require_logger.logger_default.debug("[Hydra] Agent provider error", {
|
|
@@ -13209,7 +12692,7 @@ var HydraProvider = class {
|
|
|
13209
12692
|
label: "hydra-learning-update"
|
|
13210
12693
|
},
|
|
13211
12694
|
vars: {}
|
|
13212
|
-
}, options));
|
|
12695
|
+
}, options), { countAsRequest: false });
|
|
13213
12696
|
require_logger.logger_default.debug("[Hydra] Scan learnings updated", {
|
|
13214
12697
|
scanId,
|
|
13215
12698
|
testRunId
|
|
@@ -13419,7 +12902,8 @@ var IndirectWebPwnProvider = class {
|
|
|
13419
12902
|
fetchPrompt,
|
|
13420
12903
|
attempt: attempt + 1
|
|
13421
12904
|
});
|
|
13422
|
-
const targetResponse = await targetProvider
|
|
12905
|
+
const targetResponse = await getTargetResponse(targetProvider, fetchPrompt, context, options);
|
|
12906
|
+
require_tokenUsageUtils.accumulateResponseTokenUsage(totalTokenUsage, targetResponse);
|
|
13423
12907
|
if (targetResponse.metadata?.webFetchUsed) webFetchActuallyUsed = true;
|
|
13424
12908
|
if (targetResponse.error) {
|
|
13425
12909
|
require_logger.logger_default.error("[IndirectWebPwn] Target error", { error: targetResponse.error });
|
|
@@ -13445,11 +12929,6 @@ var IndirectWebPwnProvider = class {
|
|
|
13445
12929
|
output: responseOutput
|
|
13446
12930
|
});
|
|
13447
12931
|
lastOutput = responseOutput;
|
|
13448
|
-
if (targetResponse.tokenUsage) {
|
|
13449
|
-
totalTokenUsage.total = (totalTokenUsage.total || 0) + (targetResponse.tokenUsage.total || 0);
|
|
13450
|
-
totalTokenUsage.prompt = (totalTokenUsage.prompt || 0) + (targetResponse.tokenUsage.prompt || 0);
|
|
13451
|
-
totalTokenUsage.completion = (totalTokenUsage.completion || 0) + (targetResponse.tokenUsage.completion || 0);
|
|
13452
|
-
}
|
|
13453
12932
|
const tracking = await this.checkPageFetched(webPage.uuid, evalId);
|
|
13454
12933
|
require_logger.logger_default.debug("[IndirectWebPwn] Tracking check", {
|
|
13455
12934
|
uuid: webPage.uuid,
|
|
@@ -13693,7 +13172,7 @@ async function runRedteamConversation$2({ context, filters, injectVar, numIterat
|
|
|
13693
13172
|
if (sessionId) sessionIds.push(sessionId);
|
|
13694
13173
|
let assertToUse = test?.assert?.find((a) => a.type && a.type.includes(test.metadata?.pluginId));
|
|
13695
13174
|
if (!assertToUse) assertToUse = test?.assert?.find((a) => a.type);
|
|
13696
|
-
const { getGraderById } = await Promise.resolve().then(() => require("./graders-
|
|
13175
|
+
const { getGraderById } = await Promise.resolve().then(() => require("./graders-CGZQShfJ.cjs"));
|
|
13697
13176
|
if (test && assertToUse) {
|
|
13698
13177
|
const grader = getGraderById(assertToUse.type);
|
|
13699
13178
|
if (grader) {
|
|
@@ -14159,11 +13638,11 @@ async function runRedteamConversation$1({ prompt, filters, vars, redteamProvider
|
|
|
14159
13638
|
promptIdx: context?.promptIdx
|
|
14160
13639
|
});
|
|
14161
13640
|
lastResponse = targetResponse;
|
|
13641
|
+
require_tokenUsageUtils.accumulateResponseTokenUsage(totalTokenUsage, targetResponse);
|
|
14162
13642
|
if (targetResponse.error) {
|
|
14163
13643
|
require_logger.logger_default.debug(`Iteration ${i + 1}: Target provider error: ${targetResponse.error}`);
|
|
14164
13644
|
continue;
|
|
14165
13645
|
}
|
|
14166
|
-
require_tokenUsageUtils.accumulateResponseTokenUsage(totalTokenUsage, targetResponse);
|
|
14167
13646
|
const url = targetResponse.output.match(/(https?:\/\/[^\s)]+)/g);
|
|
14168
13647
|
let imageDescription;
|
|
14169
13648
|
if (url && url.length > 0) try {
|
|
@@ -14183,7 +13662,7 @@ async function runRedteamConversation$1({ prompt, filters, vars, redteamProvider
|
|
|
14183
13662
|
}
|
|
14184
13663
|
}]
|
|
14185
13664
|
}]), void 0, options);
|
|
14186
|
-
require_tokenUsageUtils.accumulateResponseTokenUsage(totalTokenUsage, visionResponse);
|
|
13665
|
+
require_tokenUsageUtils.accumulateResponseTokenUsage(totalTokenUsage, visionResponse, { countAsRequest: false });
|
|
14187
13666
|
if (visionProvider.delay) await require_fetch.sleep(visionProvider.delay);
|
|
14188
13667
|
if (visionResponse.error) {
|
|
14189
13668
|
require_logger.logger_default.warn(`Iteration ${i + 1}: Vision API error: ${visionResponse.error}`);
|
|
@@ -14410,7 +13889,7 @@ async function runMetaAgentRedteam({ context, filters, injectVar, numIterations,
|
|
|
14410
13889
|
},
|
|
14411
13890
|
vars: {}
|
|
14412
13891
|
}, options);
|
|
14413
|
-
require_tokenUsageUtils.accumulateResponseTokenUsage(totalTokenUsage, agentResp);
|
|
13892
|
+
require_tokenUsageUtils.accumulateResponseTokenUsage(totalTokenUsage, agentResp, { countAsRequest: false });
|
|
14414
13893
|
if (agentProvider.delay) {
|
|
14415
13894
|
require_logger.logger_default.debug(`[IterativeMeta] Sleeping for ${agentProvider.delay}ms`);
|
|
14416
13895
|
await require_fetch.sleep(agentProvider.delay);
|
|
@@ -14523,7 +14002,7 @@ async function runMetaAgentRedteam({ context, filters, injectVar, numIterations,
|
|
|
14523
14002
|
previousTraceSummary = attackTraceSummary;
|
|
14524
14003
|
let assertToUse = test?.assert?.find((a) => a.type && a.type.includes(test.metadata?.pluginId));
|
|
14525
14004
|
if (!assertToUse) assertToUse = test?.assert?.find((a) => a.type);
|
|
14526
|
-
const { getGraderById } = await Promise.resolve().then(() => require("./graders-
|
|
14005
|
+
const { getGraderById } = await Promise.resolve().then(() => require("./graders-CGZQShfJ.cjs"));
|
|
14527
14006
|
if (test && assertToUse) {
|
|
14528
14007
|
const grader = getGraderById(assertToUse.type);
|
|
14529
14008
|
if (grader) {
|
|
@@ -15056,6 +14535,7 @@ async function runRedteamConversation({ context, filters, injectVar, options, pr
|
|
|
15056
14535
|
promptIdx: context?.promptIdx
|
|
15057
14536
|
});
|
|
15058
14537
|
lastResponse = targetResponse;
|
|
14538
|
+
require_tokenUsageUtils.accumulateResponseTokenUsage(totalTokenUsage, targetResponse);
|
|
15059
14539
|
if (targetResponse.error) {
|
|
15060
14540
|
require_logger.logger_default.info(`[IterativeTree] Target error at depth ${depth}, attempt ${attempts}: ${targetResponse.error}`, { targetResponse });
|
|
15061
14541
|
treeOutputs.push({
|
|
@@ -15080,7 +14560,6 @@ async function runRedteamConversation({ context, filters, injectVar, options, pr
|
|
|
15080
14560
|
continue;
|
|
15081
14561
|
}
|
|
15082
14562
|
require_invariant.invariant(Object.prototype.hasOwnProperty.call(targetResponse, "output"), "[IterativeTree] Target did not return an output property");
|
|
15083
|
-
require_tokenUsageUtils.accumulateResponseTokenUsage(totalTokenUsage, targetResponse);
|
|
15084
14563
|
const containsPenalizedPhrase = checkPenalizedPhrases(targetResponse.output);
|
|
15085
14564
|
const { score, explanation } = await evaluateResponse(gradingProvider, judgeSystemPrompt, targetResponse.output, bestResponse, containsPenalizedPhrase);
|
|
15086
14565
|
require_logger.logger_default.debug(`[Depth ${depth}, Attempt ${attempts}] Evaluation: score=${score}, penalized=${containsPenalizedPhrase}. Max score so far: ${maxScore}`);
|
|
@@ -15100,7 +14579,7 @@ async function runRedteamConversation({ context, filters, injectVar, options, pr
|
|
|
15100
14579
|
noImprovementCount++;
|
|
15101
14580
|
if (noImprovementCount % 5 === 0) require_logger.logger_default.debug(`[Depth ${depth}, Attempt ${attempts}] No improvement for ${noImprovementCount} consecutive iterations. Max score: ${maxScore}`);
|
|
15102
14581
|
}
|
|
15103
|
-
const { getGraderById } = await Promise.resolve().then(() => require("./graders-
|
|
14582
|
+
const { getGraderById } = await Promise.resolve().then(() => require("./graders-CGZQShfJ.cjs"));
|
|
15104
14583
|
let graderPassed;
|
|
15105
14584
|
let assertToUse = test?.assert?.find((a) => a.type && a.type.includes(test.metadata?.pluginId));
|
|
15106
14585
|
if (!assertToUse) assertToUse = test?.assert?.find((a) => a.type);
|
|
@@ -15980,7 +15459,7 @@ var AnthropicCompletionProvider = class extends require_messages.AnthropicGeneri
|
|
|
15980
15459
|
//#region src/providers/azure/assistant.ts
|
|
15981
15460
|
var AzureAssistantProvider = class extends AzureGenericProvider {
|
|
15982
15461
|
assistantConfig;
|
|
15983
|
-
functionCallbackHandler = new FunctionCallbackHandler();
|
|
15462
|
+
functionCallbackHandler = new require_responses.FunctionCallbackHandler();
|
|
15984
15463
|
constructor(deploymentName, options = {}) {
|
|
15985
15464
|
super(deploymentName, options);
|
|
15986
15465
|
this.assistantConfig = options.config || {};
|
|
@@ -16877,11 +16356,11 @@ var AzureFoundryAgentProvider = class extends AzureGenericProvider {
|
|
|
16877
16356
|
//#region src/providers/azure/responses.ts
|
|
16878
16357
|
const AZURE_RESPONSES_API_VERSION = "preview";
|
|
16879
16358
|
var AzureResponsesProvider = class extends AzureGenericProvider {
|
|
16880
|
-
functionCallbackHandler = new FunctionCallbackHandler();
|
|
16359
|
+
functionCallbackHandler = new require_responses.FunctionCallbackHandler();
|
|
16881
16360
|
processor;
|
|
16882
16361
|
constructor(...args) {
|
|
16883
16362
|
super(...args);
|
|
16884
|
-
this.processor = new ResponsesProcessor({
|
|
16363
|
+
this.processor = new require_responses.ResponsesProcessor({
|
|
16885
16364
|
modelName: this.deploymentName,
|
|
16886
16365
|
providerType: "azure",
|
|
16887
16366
|
functionCallbackHandler: this.functionCallbackHandler,
|
|
@@ -19289,6 +18768,7 @@ const AWS_BEDROCK_MODELS = {
|
|
|
19289
18768
|
"anthropic.claude-opus-4-1-20250805-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19290
18769
|
"anthropic.claude-opus-4-6-v1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19291
18770
|
"anthropic.claude-opus-4-5-20251101-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
18771
|
+
"anthropic.claude-sonnet-4-6": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19292
18772
|
"anthropic.claude-sonnet-4-5-20250929-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19293
18773
|
"anthropic.claude-haiku-4-5-20251001-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19294
18774
|
"anthropic.claude-sonnet-4-20250514-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
@@ -19326,6 +18806,7 @@ const AWS_BEDROCK_MODELS = {
|
|
|
19326
18806
|
"apac.anthropic.claude-opus-4-1-20250805-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19327
18807
|
"apac.anthropic.claude-opus-4-6-v1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19328
18808
|
"apac.anthropic.claude-opus-4-5-20251101-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
18809
|
+
"apac.anthropic.claude-sonnet-4-6": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19329
18810
|
"apac.anthropic.claude-sonnet-4-5-20250929-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19330
18811
|
"apac.anthropic.claude-haiku-4-5-20251001-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19331
18812
|
"apac.anthropic.claude-sonnet-4-20250514-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
@@ -19342,6 +18823,7 @@ const AWS_BEDROCK_MODELS = {
|
|
|
19342
18823
|
"eu.anthropic.claude-opus-4-1-20250805-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19343
18824
|
"eu.anthropic.claude-opus-4-6-v1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19344
18825
|
"eu.anthropic.claude-opus-4-5-20251101-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
18826
|
+
"eu.anthropic.claude-sonnet-4-6": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19345
18827
|
"eu.anthropic.claude-sonnet-4-5-20250929-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19346
18828
|
"eu.anthropic.claude-haiku-4-5-20251001-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19347
18829
|
"eu.anthropic.claude-sonnet-4-20250514-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
@@ -19367,6 +18849,7 @@ const AWS_BEDROCK_MODELS = {
|
|
|
19367
18849
|
"us.anthropic.claude-opus-4-1-20250805-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19368
18850
|
"us.anthropic.claude-opus-4-6-v1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19369
18851
|
"us.anthropic.claude-opus-4-5-20251101-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
18852
|
+
"us.anthropic.claude-sonnet-4-6": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19370
18853
|
"us.anthropic.claude-sonnet-4-5-20250929-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19371
18854
|
"us.anthropic.claude-haiku-4-5-20251001-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
19372
18855
|
"us.anthropic.claude-sonnet-4-20250514-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
@@ -23081,7 +22564,7 @@ var GeminiImageProvider = class {
|
|
|
23081
22564
|
...this.config.imageAspectRatio && { aspectRatio: this.config.imageAspectRatio },
|
|
23082
22565
|
...this.config.imageSize && isGemini3 && { imageSize: this.config.imageSize }
|
|
23083
22566
|
};
|
|
23084
|
-
if (this.config.safetySettings) body.safetySettings = this.config.safetySettings;
|
|
22567
|
+
if (this.config.safetySettings) body.safetySettings = require_transform$1.normalizeSafetySettings(this.config.safetySettings);
|
|
23085
22568
|
return body;
|
|
23086
22569
|
}
|
|
23087
22570
|
processResponse(data, cached, latencyMs) {
|
|
@@ -23102,16 +22585,20 @@ var GeminiImageProvider = class {
|
|
|
23102
22585
|
"SPII"
|
|
23103
22586
|
].includes(candidate.finishReason)) return { error: `Response was blocked with finish reason: ${candidate.finishReason}` };
|
|
23104
22587
|
if (!candidate.content?.parts) return { error: "No content parts in response" };
|
|
23105
|
-
const
|
|
22588
|
+
const textParts = [];
|
|
22589
|
+
const imageParts = [];
|
|
23106
22590
|
let totalCost = 0;
|
|
23107
|
-
for (const part of candidate.content.parts) if (part.text)
|
|
22591
|
+
for (const part of candidate.content.parts) if (part.text) textParts.push(part.text);
|
|
23108
22592
|
else if (part.inlineData) {
|
|
23109
22593
|
const mimeType = part.inlineData.mimeType || "image/png";
|
|
23110
22594
|
const base64Data = part.inlineData.data;
|
|
23111
|
-
|
|
22595
|
+
imageParts.push({
|
|
22596
|
+
mimeType,
|
|
22597
|
+
base64Data
|
|
22598
|
+
});
|
|
23112
22599
|
totalCost += this.getCostPerImage();
|
|
23113
22600
|
}
|
|
23114
|
-
if (
|
|
22601
|
+
if (imageParts.length === 0 && textParts.length === 0) return { error: "No valid content generated" };
|
|
23115
22602
|
const tokenUsage = cached ? {
|
|
23116
22603
|
cached: data.usageMetadata?.totalTokenCount,
|
|
23117
22604
|
total: data.usageMetadata?.totalTokenCount,
|
|
@@ -23122,8 +22609,13 @@ var GeminiImageProvider = class {
|
|
|
23122
22609
|
total: data.usageMetadata?.totalTokenCount,
|
|
23123
22610
|
numRequests: 1
|
|
23124
22611
|
};
|
|
22612
|
+
const images = imageParts.length > 0 ? imageParts.map((img) => ({
|
|
22613
|
+
data: require_transform$1.toDataUri(img.mimeType, img.base64Data),
|
|
22614
|
+
mimeType: img.mimeType
|
|
22615
|
+
})) : void 0;
|
|
23125
22616
|
return {
|
|
23126
|
-
output:
|
|
22617
|
+
output: imageParts.length > 0 && textParts.length === 0 ? images[0].data : textParts.join("\n\n"),
|
|
22618
|
+
images,
|
|
23127
22619
|
cached,
|
|
23128
22620
|
latencyMs,
|
|
23129
22621
|
cost: totalCost > 0 ? totalCost : void 0,
|
|
@@ -23261,13 +22753,17 @@ var GoogleImageProvider = class {
|
|
|
23261
22753
|
const base64Image = imageData.bytesBase64Encoded;
|
|
23262
22754
|
const mimeType = imageData.mimeType || "image/png";
|
|
23263
22755
|
if (base64Image) {
|
|
23264
|
-
imageOutputs.push(
|
|
22756
|
+
imageOutputs.push({
|
|
22757
|
+
data: require_transform$1.toDataUri(mimeType, base64Image),
|
|
22758
|
+
mimeType
|
|
22759
|
+
});
|
|
23265
22760
|
totalCost += costPerImage;
|
|
23266
22761
|
}
|
|
23267
22762
|
}
|
|
23268
22763
|
if (imageOutputs.length === 0) return { error: "No valid images generated" };
|
|
23269
22764
|
return {
|
|
23270
|
-
output: imageOutputs.
|
|
22765
|
+
output: imageOutputs[0].data,
|
|
22766
|
+
images: imageOutputs,
|
|
23271
22767
|
cached,
|
|
23272
22768
|
latencyMs,
|
|
23273
22769
|
cost: totalCost
|
|
@@ -24183,7 +23679,7 @@ const GROQ_API_BASE_URL = "https://api.groq.com/openai/v1";
|
|
|
24183
23679
|
* groq:responses:openai/gpt-oss-120b
|
|
24184
23680
|
* groq:responses:qwen/qwen3-32b
|
|
24185
23681
|
*/
|
|
24186
|
-
var GroqResponsesProvider = class extends OpenAiResponsesProvider {
|
|
23682
|
+
var GroqResponsesProvider = class extends require_responses.OpenAiResponsesProvider {
|
|
24187
23683
|
get apiKey() {
|
|
24188
23684
|
return this.config?.apiKey;
|
|
24189
23685
|
}
|
|
@@ -25423,6 +24919,7 @@ var HttpProvider = class {
|
|
|
25423
24919
|
const vars = {
|
|
25424
24920
|
...context?.vars || {},
|
|
25425
24921
|
prompt,
|
|
24922
|
+
...context?.evaluationId ? { evaluationId: context.evaluationId } : {},
|
|
25426
24923
|
...transformedTools !== void 0 ? { tools: serializeForTemplate(transformedTools) } : {},
|
|
25427
24924
|
...transformedToolChoice !== void 0 ? { tool_choice: serializeForTemplate(transformedToolChoice) } : {}
|
|
25428
24925
|
};
|
|
@@ -25646,9 +25143,17 @@ var HttpProvider = class {
|
|
|
25646
25143
|
require_logger.logger_default.error(`Error parsing session ID: ${String(err)}. Got headers: ${require_logger.safeJsonStringify(require_logger.sanitizeObject(responseHeaders, { context: "response headers" }))} and parsed body: ${require_logger.safeJsonStringify(require_logger.sanitizeObject(parsedData, { context: "response body" }))}`);
|
|
25647
25144
|
throw err;
|
|
25648
25145
|
}
|
|
25146
|
+
ret.metadata = {
|
|
25147
|
+
...ret.metadata,
|
|
25148
|
+
http: {
|
|
25149
|
+
status,
|
|
25150
|
+
statusText
|
|
25151
|
+
}
|
|
25152
|
+
};
|
|
25649
25153
|
if (context?.debug) {
|
|
25650
25154
|
ret.raw = data;
|
|
25651
25155
|
ret.metadata = {
|
|
25156
|
+
...ret.metadata,
|
|
25652
25157
|
headers: require_logger.sanitizeObject(responseHeaders, { context: "response headers" }),
|
|
25653
25158
|
transformedRequest: this.config.transformRequest ? transformedPrompt : parsedRequest.body?.text || renderedRequest.trim(),
|
|
25654
25159
|
finalRequestBody: parsedRequest.body?.text,
|
|
@@ -31776,13 +31281,13 @@ var XAIResponsesProvider = class {
|
|
|
31776
31281
|
modelName;
|
|
31777
31282
|
config;
|
|
31778
31283
|
env;
|
|
31779
|
-
functionCallbackHandler = new FunctionCallbackHandler();
|
|
31284
|
+
functionCallbackHandler = new require_responses.FunctionCallbackHandler();
|
|
31780
31285
|
processor;
|
|
31781
31286
|
constructor(modelName, options = {}) {
|
|
31782
31287
|
this.modelName = modelName;
|
|
31783
31288
|
this.config = options.config || {};
|
|
31784
31289
|
this.env = options.env;
|
|
31785
|
-
this.processor = new ResponsesProcessor({
|
|
31290
|
+
this.processor = new require_responses.ResponsesProcessor({
|
|
31786
31291
|
modelName: this.modelName,
|
|
31787
31292
|
providerType: "xai",
|
|
31788
31293
|
functionCallbackHandler: this.functionCallbackHandler,
|
|
@@ -32683,7 +32188,7 @@ const providerMap = [
|
|
|
32683
32188
|
{
|
|
32684
32189
|
test: (providerPath) => providerPath.startsWith("opencode:") || providerPath === "opencode",
|
|
32685
32190
|
create: async (providerPath, providerOptions, context) => {
|
|
32686
|
-
const { OpenCodeSDKProvider } = await Promise.resolve().then(() => require("./opencode-sdk-
|
|
32191
|
+
const { OpenCodeSDKProvider } = await Promise.resolve().then(() => require("./opencode-sdk-mqF-Oj3f.cjs"));
|
|
32687
32192
|
return new OpenCodeSDKProvider({
|
|
32688
32193
|
...providerOptions,
|
|
32689
32194
|
id: providerPath,
|
|
@@ -32692,10 +32197,17 @@ const providerMap = [
|
|
|
32692
32197
|
});
|
|
32693
32198
|
}
|
|
32694
32199
|
},
|
|
32200
|
+
{
|
|
32201
|
+
test: (providerPath) => providerPath.startsWith("openclaw:") || providerPath === "openclaw",
|
|
32202
|
+
create: async (providerPath, providerOptions, context) => {
|
|
32203
|
+
const { createOpenClawProvider } = await Promise.resolve().then(() => require("./openclaw-DDSfq5fp.cjs"));
|
|
32204
|
+
return createOpenClawProvider(providerPath, providerOptions, context.env);
|
|
32205
|
+
}
|
|
32206
|
+
},
|
|
32695
32207
|
{
|
|
32696
32208
|
test: (providerPath) => providerPath.startsWith("anthropic:claude-agent-sdk") || providerPath.startsWith("anthropic:claude-code"),
|
|
32697
32209
|
create: async (_providerPath, providerOptions, context) => {
|
|
32698
|
-
const { ClaudeCodeSDKProvider } = await Promise.resolve().then(() => require("./claude-agent-sdk-
|
|
32210
|
+
const { ClaudeCodeSDKProvider } = await Promise.resolve().then(() => require("./claude-agent-sdk-BzxF6NIJ.cjs"));
|
|
32699
32211
|
return new ClaudeCodeSDKProvider({
|
|
32700
32212
|
...providerOptions,
|
|
32701
32213
|
env: context.env
|
|
@@ -32752,25 +32264,25 @@ const providerMap = [
|
|
|
32752
32264
|
const modelName = splits.slice(2).join(":");
|
|
32753
32265
|
if (modelType === "converse") return new AwsBedrockConverseProvider(modelName, providerOptions);
|
|
32754
32266
|
if (modelType === "nova-sonic" || modelType.includes("amazon.nova-sonic")) {
|
|
32755
|
-
const { NovaSonicProvider } = await Promise.resolve().then(() => require("./nova-sonic-
|
|
32267
|
+
const { NovaSonicProvider } = await Promise.resolve().then(() => require("./nova-sonic-BoRSY_U6.cjs"));
|
|
32756
32268
|
return new NovaSonicProvider("amazon.nova-sonic-v1:0", providerOptions);
|
|
32757
32269
|
}
|
|
32758
32270
|
if (modelType.includes("luma.ray") || modelName.includes("luma.ray")) {
|
|
32759
|
-
const { LumaRayVideoProvider } = await Promise.resolve().then(() => require("./luma-ray-
|
|
32271
|
+
const { LumaRayVideoProvider } = await Promise.resolve().then(() => require("./luma-ray-C0RkI3lt.cjs"));
|
|
32760
32272
|
return new LumaRayVideoProvider(modelName.includes("luma.ray") ? modelName : splits.slice(1).join(":") || "luma.ray-v2:0", providerOptions);
|
|
32761
32273
|
}
|
|
32762
32274
|
if (modelType.includes("amazon.nova-reel") || modelType === "video" && (modelName.includes("amazon.nova-reel") || modelName === "")) {
|
|
32763
|
-
const { NovaReelVideoProvider } = await Promise.resolve().then(() => require("./nova-reel-
|
|
32275
|
+
const { NovaReelVideoProvider } = await Promise.resolve().then(() => require("./nova-reel-D9FXq3Mt.cjs"));
|
|
32764
32276
|
return new NovaReelVideoProvider(modelName || "amazon.nova-reel-v1:1", providerOptions);
|
|
32765
32277
|
}
|
|
32766
32278
|
if (modelType === "agents") {
|
|
32767
|
-
const { AwsBedrockAgentsProvider } = await Promise.resolve().then(() => require("./agents-
|
|
32279
|
+
const { AwsBedrockAgentsProvider } = await Promise.resolve().then(() => require("./agents-C7BiinFI.cjs"));
|
|
32768
32280
|
return new AwsBedrockAgentsProvider(modelName, providerOptions);
|
|
32769
32281
|
}
|
|
32770
32282
|
if (modelType === "completion") return new AwsBedrockCompletionProvider(modelName, providerOptions);
|
|
32771
32283
|
if (modelType === "embeddings" || modelType === "embedding") return new AwsBedrockEmbeddingProvider(modelName, providerOptions);
|
|
32772
32284
|
if (modelType === "kb" || modelType === "knowledge-base") {
|
|
32773
|
-
const { AwsBedrockKnowledgeBaseProvider } = await Promise.resolve().then(() => require("./knowledgeBase-
|
|
32285
|
+
const { AwsBedrockKnowledgeBaseProvider } = await Promise.resolve().then(() => require("./knowledgeBase-Bnb00xKs.cjs"));
|
|
32774
32286
|
return new AwsBedrockKnowledgeBaseProvider(modelName, providerOptions);
|
|
32775
32287
|
}
|
|
32776
32288
|
return new AwsBedrockCompletionProvider(splits.slice(1).join(":"), providerOptions);
|
|
@@ -32780,7 +32292,7 @@ const providerMap = [
|
|
|
32780
32292
|
test: (providerPath) => providerPath.startsWith("bedrock-agent:"),
|
|
32781
32293
|
create: async (providerPath, providerOptions, _context) => {
|
|
32782
32294
|
const agentId = providerPath.substring(14);
|
|
32783
|
-
const { AwsBedrockAgentsProvider } = await Promise.resolve().then(() => require("./agents-
|
|
32295
|
+
const { AwsBedrockAgentsProvider } = await Promise.resolve().then(() => require("./agents-C7BiinFI.cjs"));
|
|
32784
32296
|
return new AwsBedrockAgentsProvider(agentId, providerOptions);
|
|
32785
32297
|
}
|
|
32786
32298
|
},
|
|
@@ -32790,7 +32302,7 @@ const providerMap = [
|
|
|
32790
32302
|
const splits = providerPath.split(":");
|
|
32791
32303
|
const modelType = splits[1];
|
|
32792
32304
|
const endpointName = splits.slice(2).join(":");
|
|
32793
|
-
const { SageMakerCompletionProvider, SageMakerEmbeddingProvider } = await Promise.resolve().then(() => require("./sagemaker-
|
|
32305
|
+
const { SageMakerCompletionProvider, SageMakerEmbeddingProvider } = await Promise.resolve().then(() => require("./sagemaker-DwNnEVYt.cjs"));
|
|
32794
32306
|
if (modelType === "embedding" || modelType === "embeddings") return new SageMakerEmbeddingProvider(endpointName || modelType, providerOptions);
|
|
32795
32307
|
if (splits.length === 2) return new SageMakerCompletionProvider(modelType, providerOptions);
|
|
32796
32308
|
if (endpointName.includes("jumpstart") || modelType === "jumpstart") return new SageMakerCompletionProvider(endpointName, {
|
|
@@ -32831,7 +32343,7 @@ const providerMap = [
|
|
|
32831
32343
|
{
|
|
32832
32344
|
test: (providerPath) => providerPath.startsWith("cloudflare-ai:"),
|
|
32833
32345
|
create: async (providerPath, providerOptions, context) => {
|
|
32834
|
-
const { createCloudflareAiProvider } = await Promise.resolve().then(() => require("./cloudflare-ai-
|
|
32346
|
+
const { createCloudflareAiProvider } = await Promise.resolve().then(() => require("./cloudflare-ai-BAQ0u_dg.cjs"));
|
|
32835
32347
|
return createCloudflareAiProvider(providerPath, {
|
|
32836
32348
|
...providerOptions,
|
|
32837
32349
|
env: context.env
|
|
@@ -32841,7 +32353,7 @@ const providerMap = [
|
|
|
32841
32353
|
{
|
|
32842
32354
|
test: (providerPath) => providerPath.startsWith("cloudflare-gateway:"),
|
|
32843
32355
|
create: async (providerPath, providerOptions, context) => {
|
|
32844
|
-
const { createCloudflareGatewayProvider } = await Promise.resolve().then(() => require("./cloudflare-gateway-
|
|
32356
|
+
const { createCloudflareGatewayProvider } = await Promise.resolve().then(() => require("./cloudflare-gateway-C0sgfr_z.cjs"));
|
|
32845
32357
|
return createCloudflareGatewayProvider(providerPath, {
|
|
32846
32358
|
...providerOptions,
|
|
32847
32359
|
env: context.env
|
|
@@ -32993,27 +32505,27 @@ const providerMap = [
|
|
|
32993
32505
|
create: async (providerPath, providerOptions, context) => {
|
|
32994
32506
|
const modelType = providerPath.split(":")[1];
|
|
32995
32507
|
if (modelType === "image") {
|
|
32996
|
-
const { createHyperbolicImageProvider } = await Promise.resolve().then(() => require("./image-
|
|
32508
|
+
const { createHyperbolicImageProvider } = await Promise.resolve().then(() => require("./image-D10zEe1f.cjs"));
|
|
32997
32509
|
return createHyperbolicImageProvider(providerPath, {
|
|
32998
32510
|
...providerOptions,
|
|
32999
32511
|
env: context.env
|
|
33000
32512
|
});
|
|
33001
32513
|
}
|
|
33002
32514
|
if (modelType === "audio") {
|
|
33003
|
-
const { createHyperbolicAudioProvider } = await Promise.resolve().then(() => require("./audio-
|
|
32515
|
+
const { createHyperbolicAudioProvider } = await Promise.resolve().then(() => require("./audio-BWjyvHn9.cjs"));
|
|
33004
32516
|
return createHyperbolicAudioProvider(providerPath, {
|
|
33005
32517
|
...providerOptions,
|
|
33006
32518
|
env: context.env
|
|
33007
32519
|
});
|
|
33008
32520
|
}
|
|
33009
|
-
const { createHyperbolicProvider } = await Promise.resolve().then(() => require("./chat-
|
|
32521
|
+
const { createHyperbolicProvider } = await Promise.resolve().then(() => require("./chat-Fl6TZJRS.cjs"));
|
|
33010
32522
|
return createHyperbolicProvider(providerPath, providerOptions);
|
|
33011
32523
|
}
|
|
33012
32524
|
},
|
|
33013
32525
|
{
|
|
33014
32526
|
test: (providerPath) => providerPath.startsWith("litellm:"),
|
|
33015
32527
|
create: async (providerPath, providerOptions, context) => {
|
|
33016
|
-
const { createLiteLLMProvider } = await Promise.resolve().then(() => require("./litellm-
|
|
32528
|
+
const { createLiteLLMProvider } = await Promise.resolve().then(() => require("./litellm-BrnZhMcL.cjs"));
|
|
33017
32529
|
return createLiteLLMProvider(providerPath, {
|
|
33018
32530
|
config: providerOptions,
|
|
33019
32531
|
env: context.env
|
|
@@ -33069,7 +32581,7 @@ const providerMap = [
|
|
|
33069
32581
|
const modelType = splits[1];
|
|
33070
32582
|
const modelName = splits.slice(2).join(":");
|
|
33071
32583
|
if (modelType === "codex-sdk" || modelType === "codex") {
|
|
33072
|
-
const { OpenAICodexSDKProvider } = await Promise.resolve().then(() => require("./codex-sdk-
|
|
32584
|
+
const { OpenAICodexSDKProvider } = await Promise.resolve().then(() => require("./codex-sdk-wTEpMM_X.cjs"));
|
|
33073
32585
|
return new OpenAICodexSDKProvider({
|
|
33074
32586
|
...providerOptions,
|
|
33075
32587
|
env: context.env
|
|
@@ -33080,21 +32592,21 @@ const providerMap = [
|
|
|
33080
32592
|
if (modelType === "completion") return new require_completion.OpenAiCompletionProvider(modelName || "gpt-3.5-turbo-instruct", providerOptions);
|
|
33081
32593
|
if (modelType === "moderation") return new OpenAiModerationProvider(modelName || "omni-moderation-latest", providerOptions);
|
|
33082
32594
|
if (modelType === "realtime") return new OpenAiRealtimeProvider(modelName || "gpt-4o-realtime-preview-2024-12-17", providerOptions);
|
|
33083
|
-
if (modelType === "responses") return new OpenAiResponsesProvider(modelName || "gpt-4.1-2025-04-14", providerOptions);
|
|
32595
|
+
if (modelType === "responses") return new require_responses.OpenAiResponsesProvider(modelName || "gpt-4.1-2025-04-14", providerOptions);
|
|
33084
32596
|
if (modelType === "transcription") {
|
|
33085
|
-
const { OpenAiTranscriptionProvider } = await Promise.resolve().then(() => require("./transcription-
|
|
32597
|
+
const { OpenAiTranscriptionProvider } = await Promise.resolve().then(() => require("./transcription-FNIz3YOe.cjs"));
|
|
33086
32598
|
return new OpenAiTranscriptionProvider(modelName || "gpt-4o-transcribe-diarize", providerOptions);
|
|
33087
32599
|
}
|
|
33088
32600
|
if (require_chat.OpenAiChatCompletionProvider.OPENAI_CHAT_MODEL_NAMES.includes(modelType)) return new require_chat.OpenAiChatCompletionProvider(modelType, providerOptions);
|
|
33089
32601
|
if (require_completion.OpenAiCompletionProvider.OPENAI_COMPLETION_MODEL_NAMES.includes(modelType)) return new require_completion.OpenAiCompletionProvider(modelType, providerOptions);
|
|
33090
32602
|
if (OpenAiRealtimeProvider.OPENAI_REALTIME_MODEL_NAMES.includes(modelType)) return new OpenAiRealtimeProvider(modelType, providerOptions);
|
|
33091
|
-
if (OpenAiResponsesProvider.OPENAI_RESPONSES_MODEL_NAMES.includes(modelType)) return new OpenAiResponsesProvider(modelType, providerOptions);
|
|
32603
|
+
if (require_responses.OpenAiResponsesProvider.OPENAI_RESPONSES_MODEL_NAMES.includes(modelType)) return new require_responses.OpenAiResponsesProvider(modelType, providerOptions);
|
|
33092
32604
|
if (modelType === "agents") {
|
|
33093
|
-
const { OpenAiAgentsProvider } = await Promise.resolve().then(() => require("./agents-
|
|
32605
|
+
const { OpenAiAgentsProvider } = await Promise.resolve().then(() => require("./agents-CwM7re15.cjs"));
|
|
33094
32606
|
return new OpenAiAgentsProvider(modelName || "default-agent", providerOptions);
|
|
33095
32607
|
}
|
|
33096
32608
|
if (modelType === "chatkit") {
|
|
33097
|
-
const { OpenAiChatKitProvider } = await Promise.resolve().then(() => require("./chatkit-
|
|
32609
|
+
const { OpenAiChatKitProvider } = await Promise.resolve().then(() => require("./chatkit-e25Ziu17.cjs"));
|
|
33098
32610
|
return new OpenAiChatKitProvider(modelName || "", providerOptions);
|
|
33099
32611
|
}
|
|
33100
32612
|
if (modelType === "assistant") return new OpenAiAssistantProvider(modelName, providerOptions);
|
|
@@ -33137,7 +32649,7 @@ const providerMap = [
|
|
|
33137
32649
|
{
|
|
33138
32650
|
test: (providerPath) => providerPath.startsWith("quiverai:"),
|
|
33139
32651
|
create: async (providerPath, providerOptions, context) => {
|
|
33140
|
-
const { createQuiverAiProvider } = await Promise.resolve().then(() => require("./quiverai-
|
|
32652
|
+
const { createQuiverAiProvider } = await Promise.resolve().then(() => require("./quiverai-BNfIwKCO.cjs"));
|
|
33141
32653
|
return createQuiverAiProvider(providerPath, providerOptions, context.env);
|
|
33142
32654
|
}
|
|
33143
32655
|
},
|
|
@@ -33182,7 +32694,7 @@ const providerMap = [
|
|
|
33182
32694
|
{
|
|
33183
32695
|
test: (providerPath) => providerPath.startsWith("aimlapi:"),
|
|
33184
32696
|
create: async (providerPath, providerOptions, context) => {
|
|
33185
|
-
const { createAimlApiProvider } = await Promise.resolve().then(() => require("./aimlapi-
|
|
32697
|
+
const { createAimlApiProvider } = await Promise.resolve().then(() => require("./aimlapi-DoGLcQW_.cjs"));
|
|
33186
32698
|
return createAimlApiProvider(providerPath, {
|
|
33187
32699
|
...providerOptions,
|
|
33188
32700
|
env: context.env
|
|
@@ -33192,7 +32704,7 @@ const providerMap = [
|
|
|
33192
32704
|
{
|
|
33193
32705
|
test: (providerPath) => providerPath.startsWith("cometapi:"),
|
|
33194
32706
|
create: async (providerPath, providerOptions, context) => {
|
|
33195
|
-
const { createCometApiProvider } = await Promise.resolve().then(() => require("./cometapi-
|
|
32707
|
+
const { createCometApiProvider } = await Promise.resolve().then(() => require("./cometapi-JbvOJSCO.cjs"));
|
|
33196
32708
|
return createCometApiProvider(providerPath, {
|
|
33197
32709
|
...providerOptions,
|
|
33198
32710
|
env: context.env
|
|
@@ -33202,7 +32714,7 @@ const providerMap = [
|
|
|
33202
32714
|
{
|
|
33203
32715
|
test: (providerPath) => providerPath.startsWith("docker:"),
|
|
33204
32716
|
create: async (providerPath, providerOptions, context) => {
|
|
33205
|
-
const { createDockerProvider } = await Promise.resolve().then(() => require("./docker-
|
|
32717
|
+
const { createDockerProvider } = await Promise.resolve().then(() => require("./docker-Ckw-j7Rr.cjs"));
|
|
33206
32718
|
return createDockerProvider(providerPath, {
|
|
33207
32719
|
...providerOptions,
|
|
33208
32720
|
env: context.env
|
|
@@ -33468,7 +32980,7 @@ const providerMap = [
|
|
|
33468
32980
|
{
|
|
33469
32981
|
test: (providerPath) => providerPath.startsWith("transformers:") || providerPath.startsWith("transformers.js:"),
|
|
33470
32982
|
create: async (providerPath, providerOptions, _context) => {
|
|
33471
|
-
const { validateTransformersDependency } = await Promise.resolve().then(() => require("./transformersAvailability-
|
|
32983
|
+
const { validateTransformersDependency } = await Promise.resolve().then(() => require("./transformersAvailability-Bkep3ka7.cjs"));
|
|
33472
32984
|
await validateTransformersDependency();
|
|
33473
32985
|
const splits = providerPath.split(":");
|
|
33474
32986
|
if (splits.length < 3) throw new Error(`Invalid Transformers.js provider path: ${providerPath}. Format: transformers:<task>:<model>
|
|
@@ -33488,7 +33000,7 @@ Example: transformers:feature-extraction:Xenova/all-MiniLM-L6-v2`);
|
|
|
33488
33000
|
test: (providerPath) => providerPath === "slack" || providerPath.startsWith("slack:"),
|
|
33489
33001
|
create: async (providerPath, providerOptions, _context) => {
|
|
33490
33002
|
try {
|
|
33491
|
-
const { SlackProvider } = await Promise.resolve().then(() => require("./slack-
|
|
33003
|
+
const { SlackProvider } = await Promise.resolve().then(() => require("./slack-BtMkB6xP.cjs"));
|
|
33492
33004
|
if (providerPath === "slack") return new SlackProvider(providerOptions);
|
|
33493
33005
|
const splits = providerPath.split(":");
|
|
33494
33006
|
if (splits.length < 2) throw new Error("Invalid Slack provider path. Use slack:<channel_id> or slack:channel:<channel_id>");
|
|
@@ -33880,12 +33392,6 @@ Object.defineProperty(exports, 'OpenAiModerationProvider', {
|
|
|
33880
33392
|
return OpenAiModerationProvider;
|
|
33881
33393
|
}
|
|
33882
33394
|
});
|
|
33883
|
-
Object.defineProperty(exports, 'OpenAiResponsesProvider', {
|
|
33884
|
-
enumerable: true,
|
|
33885
|
-
get: function () {
|
|
33886
|
-
return OpenAiResponsesProvider;
|
|
33887
|
-
}
|
|
33888
|
-
});
|
|
33889
33395
|
Object.defineProperty(exports, 'PromptfooHarmfulCompletionProvider', {
|
|
33890
33396
|
enumerable: true,
|
|
33891
33397
|
get: function () {
|
|
@@ -33982,6 +33488,12 @@ Object.defineProperty(exports, 'getCloudDatabaseId', {
|
|
|
33982
33488
|
return getCloudDatabaseId;
|
|
33983
33489
|
}
|
|
33984
33490
|
});
|
|
33491
|
+
Object.defineProperty(exports, 'getEvalConfigFromCloud', {
|
|
33492
|
+
enumerable: true,
|
|
33493
|
+
get: function () {
|
|
33494
|
+
return getEvalConfigFromCloud;
|
|
33495
|
+
}
|
|
33496
|
+
});
|
|
33985
33497
|
Object.defineProperty(exports, 'getFileHashes', {
|
|
33986
33498
|
enumerable: true,
|
|
33987
33499
|
get: function () {
|
|
@@ -34132,4 +33644,4 @@ Object.defineProperty(exports, 'validateStrategies', {
|
|
|
34132
33644
|
return validateStrategies;
|
|
34133
33645
|
}
|
|
34134
33646
|
});
|
|
34135
|
-
//# sourceMappingURL=providers-
|
|
33647
|
+
//# sourceMappingURL=providers-BNKVY53V.cjs.map
|