promptfoo 0.120.27 → 0.121.2
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 +1 -1
- package/dist/src/{ListApp-8WOe2nT6.js → ListApp-Du7YVwj5.js} +2 -4
- package/dist/src/accounts-B0pgC1oV.js +206 -0
- package/dist/src/{accounts-DVINui-2.js → accounts-Bm2D8Db9.js} +39 -34
- package/dist/src/{accounts-CPDRAMND.js → accounts-CiBLOnA7.js} +38 -33
- package/dist/src/{accounts-Fl2J3_Fu.cjs → accounts-gtkH-5KX.cjs} +77 -78
- package/dist/src/{agentic-utils-D922n6mm.js → agentic-utils-DS1g3GLF.js} +9 -10
- package/dist/src/{agents-BcsN_BgB.js → agents-9qiOy0ho.js} +16 -12
- package/dist/src/{agents-BXLmVsxR.js → agents-CBr9A01V.js} +37 -37
- package/dist/src/{agents-pMfppv9Z.js → agents-CmvBq8LV.js} +16 -18
- package/dist/src/{agents-hqgSV-3o.js → agents-D__IdAlg.js} +39 -40
- package/dist/src/{agents-BO2n8Z0d.cjs → agents-DbRtpYxR.cjs} +37 -40
- package/dist/src/{agents-BdUTAwi-.js → agents-DgF2zDag.js} +37 -42
- package/dist/src/{agents-DgJf2-ez.cjs → agents-Di9DKPzn.cjs} +16 -17
- package/dist/src/{agents-DNvSH78i.js → agents-cLXA8a_8.js} +17 -19
- package/dist/src/{aimlapi-DtgPI0nE.js → aimlapi-B4rcnZgv.js} +15 -17
- package/dist/src/{aimlapi-BE_Tg9Fl.cjs → aimlapi-BvlNH0gr.cjs} +15 -16
- package/dist/src/{aimlapi-DOib86oE.js → aimlapi-CnkC2HqE.js} +16 -18
- package/dist/src/{aimlapi-DTPACCB1.js → aimlapi-DHJU_kcV.js} +15 -4
- package/dist/src/app/assets/index-4LKxG2CG.js +439 -0
- package/dist/src/app/assets/{index-NCn4eVBv.css → index-C3zcsZFQ.css} +1 -1
- package/dist/src/app/assets/vendor-charts-BnDWwBlI.js +36 -0
- package/dist/src/app/index.html +3 -3
- package/dist/src/app/tsconfig.app.tsbuildinfo +1 -1
- package/dist/src/{audio-BnRUGAm_.js → audio-Bkv46et0.js} +6 -5
- package/dist/src/{audio-Cwo68yZS.cjs → audio-CGMyULza.cjs} +6 -7
- package/dist/src/{audio-MSRki4JU.js → audio-ClI_AFre.js} +6 -8
- package/dist/src/{audio-BRYU0BFo.js → audio-Dz3z7s3J.js} +7 -9
- package/dist/src/{base-pGVmXNl4.cjs → base-CGrhspbK.cjs} +36 -38
- package/dist/src/{base-h961VXYk.js → base-CpjcHe4e.js} +11 -13
- package/dist/src/base-DLKtKMFh.js +193 -0
- package/dist/src/{base-XB2tDJrB.js → base-Dy1V8--Z.js} +11 -13
- package/dist/src/blobs-BDbfYdrJ.js +236 -0
- package/dist/src/{blobs-CR5C4Ihh.js → blobs-CBO20krR.js} +9 -12
- package/dist/src/{blobs-BM_e6hCa.js → blobs-CMHN0Qcz.js} +9 -12
- package/dist/src/{blobs-B-KQAFhX.cjs → blobs-D23XLin-.cjs} +34 -37
- package/dist/src/{cache-jsiwsAJv.js → cache-BVeDlD87.js} +132 -117
- package/dist/src/{cache-CIpsoBZR.js → cache-C4Nxf52C.js} +132 -118
- package/dist/src/cache-CeUpFm3M.cjs +5 -0
- package/dist/src/{cache-BTVYfbka.cjs → cache-Dh5WtQps.cjs} +182 -168
- package/dist/src/cache-i1P6crbO.js +756 -0
- package/dist/src/cache-n-RCJ-hL.js +6 -0
- package/dist/src/{chat-BcPjZXIp.js → chat-BiKyneZl.js} +45 -46
- package/dist/src/{chat-D31K7C4u.cjs → chat-C1Qst7jL.cjs} +20 -21
- package/dist/src/{chat-B84t99NW.js → chat-C2jrdPMx.js} +20 -9
- package/dist/src/{chat-BE44YOc6.cjs → chat-CgF-J-Jj.cjs} +65 -66
- package/dist/src/{chat-DwWifjxi.js → chat-CzkrVDfz.js} +20 -22
- package/dist/src/chat-DJIw17u0.js +766 -0
- package/dist/src/{chat-CcUCysjU.js → chat-DqxYYtWA.js} +45 -46
- package/dist/src/{chat-DZM2GUHO.js → chat-qmatte1u.js} +21 -23
- package/dist/src/{chatkit-D67HS_0b.js → chatkit-65VXf5SR.js} +58 -58
- package/dist/src/{chatkit-DAB_qfzI.js → chatkit-Be-Q-a9F.js} +58 -60
- package/dist/src/{chatkit-Biqb_wsD.js → chatkit-BxFvW8KY.js} +58 -60
- package/dist/src/{chatkit-PGG4ZYIn.cjs → chatkit-DKyPi1Gs.cjs} +58 -60
- package/dist/src/chunk-DEq-mXcV.js +15 -0
- package/dist/src/chunk-DRamLcfz.js +16 -0
- package/dist/src/{claude-agent-sdk-SVM6AdBu.js → claude-agent-sdk-Apiy0iaz.js} +31 -31
- package/dist/src/{claude-agent-sdk-C-IOTPfo.js → claude-agent-sdk-D2bJee9S.js} +31 -29
- package/dist/src/{claude-agent-sdk-C9SiaQub.cjs → claude-agent-sdk-D9Z5Pr9X.cjs} +31 -28
- package/dist/src/{claude-agent-sdk-CiluSyW1.js → claude-agent-sdk-DfCoW0E6.js} +33 -20
- package/dist/src/cloud-BBh91EUK.js +4 -0
- package/dist/src/{cloud-CZ-q9Ier.js → cloud-C0dlstV_.js} +7 -9
- package/dist/src/{cloudflare-ai-BahKHyhh.js → cloudflare-ai-8TDxHR0x.js} +16 -18
- package/dist/src/{cloudflare-ai-v_qZD6_q.js → cloudflare-ai-BxAGvfju.js} +17 -19
- package/dist/src/{cloudflare-ai-Dfahv5SY.cjs → cloudflare-ai-CknbZ5LJ.cjs} +16 -17
- package/dist/src/{cloudflare-ai-Dxyt50Nl.js → cloudflare-ai-g7PB6VHR.js} +16 -4
- package/dist/src/{cloudflare-gateway-Bi_FpOFy.js → cloudflare-gateway-B9HWA5wf.js} +23 -23
- package/dist/src/{cloudflare-gateway-BPWoZIzJ.cjs → cloudflare-gateway-BSnDmHYo.cjs} +21 -22
- package/dist/src/{cloudflare-gateway-C0guUNwk.js → cloudflare-gateway-CKDb4dJ8.js} +26 -14
- package/dist/src/{cloudflare-gateway-btS7h1OZ.js → cloudflare-gateway-CP9QEWYS.js} +21 -25
- package/dist/src/{codex-sdk-DSxAnbfT.js → codex-sdk-C6UMlxwV.js} +28 -29
- package/dist/src/{codex-sdk-IYVi9fuM.js → codex-sdk-DUwKWezN.js} +28 -27
- package/dist/src/{codex-sdk-DulY0ZRq.js → codex-sdk-GGAw0qbD.js} +28 -29
- package/dist/src/{codex-sdk-DFKMtAyf.cjs → codex-sdk-fAO0c3yA.cjs} +28 -29
- package/dist/src/{cometapi-DzrR3SR_.js → cometapi-BL9yvj_f.js} +16 -4
- package/dist/src/{cometapi-DIO64tf4.cjs → cometapi-C4xSqeID.cjs} +21 -22
- package/dist/src/{cometapi-C9EEpJzT.js → cometapi-CUQq3H_a.js} +21 -24
- package/dist/src/{cometapi-DkNBMk0G.js → cometapi-DFNiKmSz.js} +17 -19
- package/dist/src/{completion-CG29bfKX.js → completion-5MzrpJxT.js} +11 -13
- package/dist/src/{completion-CCRT4kX1.cjs → completion-CM6oK8PS.cjs} +21 -23
- package/dist/src/{completion-Bgf1VJoq.js → completion-DZ083F31.js} +11 -13
- package/dist/src/completion-qRoZAYRB.js +120 -0
- package/dist/src/{createHash-Dw_iLu31.js → createHash-CTQmL3G2.js} +2 -3
- package/dist/src/{createHash-CYQy4YeL.cjs → createHash-CfZSc0b4.cjs} +13 -14
- package/dist/src/{createHash-CJcfskIZ.js → createHash-Da8fMwqB.js} +2 -3
- package/dist/src/createHash-DmPQkvBh.js +15 -0
- package/dist/src/{docker-D-ayp2FW.js → docker-Bb5dcxr8.js} +18 -20
- package/dist/src/{docker-B81N0t4e.js → docker-BvfL2BrW.js} +19 -21
- package/dist/src/{docker-DNcLR4Ig.cjs → docker-DcF2pRrj.cjs} +18 -19
- package/dist/src/{docker-egERKxCF.js → docker-ExVyLp0S.js} +18 -7
- package/dist/src/entrypoint.js +2 -3
- package/dist/src/{errors-DnGCbnx8.js → errors-P6ll7XSJ.js} +2 -2
- package/dist/src/{esm-B9dPm_BF.js → esm-C03C-mv3.js} +17 -20
- package/dist/src/{esm-D2pZ87fL.js → esm-CaIwzWR5.js} +18 -21
- package/dist/src/esm-Cd1AjG1D.js +379 -0
- package/dist/src/{esm-Ct-Joyue.cjs → esm-CnNt7sI4.cjs} +47 -49
- package/dist/src/eval-B3r2CVXr.js +15 -0
- package/dist/src/{eval-C-Nr6wX_.js → eval-Dg2nG4v2.js} +47 -54
- package/dist/src/evalResult-5xwYnECe.js +12 -0
- package/dist/src/evalResult-71lY93Kj.cjs +10 -0
- package/dist/src/{evalResult-DXMWJ3sx.js → evalResult-BBRNtX4I.js} +10 -11
- package/dist/src/{evalResult-4BzI2tmj.js → evalResult-BDMqrapS.js} +16 -12
- package/dist/src/evalResult-Dx5P5cIv.js +10 -0
- package/dist/src/{evalResult-CX8wQecI.cjs → evalResult-fuaI8HkH.cjs} +20 -21
- package/dist/src/{evaluator-8aGyV12L.js → evaluator-BhoWwp5b.js} +211 -235
- package/dist/src/evaluator-Jx6bRZV6.js +36 -0
- package/dist/src/{extractor-V5x_m1i0.js → extractor-C0EVHewb.js} +22 -24
- package/dist/src/extractor-D25qpmGX.js +374 -0
- package/dist/src/{extractor-CD5yKL-G.js → extractor-DReVID0K.js} +22 -24
- package/dist/src/{extractor-C031XmTA.cjs → extractor-pYLLi3wS.cjs} +37 -39
- package/dist/src/{fetch-BmbD-v1L.cjs → fetch-BPkYtG8K.cjs} +244 -277
- package/dist/src/fetch-BxNb_Lp3.js +5 -0
- package/dist/src/{fetch-D3OHf-lV.js → fetch-Cwxnd8zz.js} +36 -44
- package/dist/src/{fetch-CXZI9RRr.js → fetch-Dxpd4_sr.js} +23 -35
- package/dist/src/fetch-HaqdX7U1.js +780 -0
- package/dist/src/{fileExtensions-ePDqouxn.js → fileExtensions-DnqA1y9x.js} +2 -2
- package/dist/src/{fileExtensions-BpuMmaFL.js → fileExtensions-Ds-foDzt.js} +2 -2
- package/dist/src/fileExtensions-LcDYkU4v.js +85 -0
- package/dist/src/{fileExtensions-DkJYkWUy.cjs → fileExtensions-bYh77CN8.cjs} +27 -28
- package/dist/src/{formatDuration-CdevI3An.js → formatDuration-DgBVMN65.js} +2 -2
- package/dist/src/{genaiTracer-Ce19n68P.js → genaiTracer-70Z8BIuV.js} +2 -3
- package/dist/src/{genaiTracer-CqNnnXrE.js → genaiTracer-C1rxGO8Q.js} +2 -3
- package/dist/src/genaiTracer-D3fD9dNV.js +256 -0
- package/dist/src/{genaiTracer-Dres3qrN.cjs → genaiTracer-DN4dQywX.cjs} +13 -14
- package/dist/src/{graders--1y2u9HO.js → graders-BTeBGqjJ.js} +349 -397
- package/dist/src/graders-B_pgMLS2.js +34 -0
- package/dist/src/{graders-DTeBrzWp.js → graders-Bj_Odv7c.js} +349 -397
- package/dist/src/graders-DErokPDO.cjs +32 -0
- package/dist/src/graders-DP7KFFo-.js +13466 -0
- package/dist/src/graders-DR_uNe54.js +32 -0
- package/dist/src/{graders-DohM2dir.cjs → graders-DU49_J8Y.cjs} +684 -732
- package/dist/src/graders-w3176Wz-.js +32 -0
- package/dist/src/{image-B0U4Hqll.js → image-B02ogr_b.js} +7 -9
- package/dist/src/{image-DmE-niFE.js → image-B0h9VEMc.js} +6 -5
- package/dist/src/{image-CuKHuccK.cjs → image-BLmROtN3.cjs} +29 -30
- package/dist/src/{image-DNEIf_aI.js → image-Bb4vWQLM.js} +6 -8
- package/dist/src/{image-DpKl2F15.cjs → image-C1madmKh.cjs} +6 -7
- package/dist/src/{image-C3wHC9_h.js → image-CHfWvljl.js} +9 -10
- package/dist/src/{image-O1u4bCFg.js → image-DS-o-0ph.js} +9 -10
- package/dist/src/image-Dpxa1Jt6.js +257 -0
- package/dist/src/index.cjs +615 -695
- package/dist/src/index.d.cts +271 -7
- package/dist/src/index.d.ts +271 -3
- package/dist/src/index.js +580 -664
- package/dist/src/{interactiveCheck-Bxj1Swex.js → interactiveCheck-BgLZUIt3.js} +7 -8
- package/dist/src/{invariant-DT20jrBd.js → invariant-BtWWVVhl.js} +2 -2
- package/dist/src/{invariant-1pAf2CD1.js → invariant-Ddh24eXh.js} +2 -2
- package/dist/src/{invariant-CKcJAQ6M.cjs → invariant-kfQ8Bu82.cjs} +7 -8
- package/dist/src/invariant-vgHWClmd.js +25 -0
- package/dist/src/{knowledgeBase-CEzQobWX.js → knowledgeBase-B3OoKIej.js} +14 -9
- package/dist/src/{knowledgeBase-Be_zyW4L.js → knowledgeBase-CYTLHOt1.js} +16 -16
- package/dist/src/{knowledgeBase-BZ41IFwq.js → knowledgeBase-D33Ty2l6.js} +14 -18
- package/dist/src/{knowledgeBase-D-5BMXlr.cjs → knowledgeBase-DOO_BM9b.cjs} +14 -15
- package/dist/src/{litellm-DnbRJ2if.js → litellm-AaeZcZQF.js} +18 -19
- package/dist/src/{litellm-hUSNM_M2.cjs → litellm-I_hbp_dc.cjs} +17 -17
- package/dist/src/{litellm-CRDqPhNI.js → litellm-NbjknEh6.js} +17 -18
- package/dist/src/{litellm-9vR8zpfU.js → litellm-TrljxD9G.js} +17 -5
- package/dist/src/{logger-CG1uZPbQ.js → logger-CT3IKMKA.js} +10 -29
- package/dist/src/{logger-B7sBeGa0.cjs → logger-Cp1GPUjj.cjs} +152 -180
- package/dist/src/logger-DLcq4dWf.js +713 -0
- package/dist/src/{logger-LSBxlt7a.js → logger-KkObSCzq.js} +13 -31
- package/dist/src/{luma-ray-4blv9iZ2.js → luma-ray-BS2_tY8L.js} +22 -21
- package/dist/src/{luma-ray-drvgdpP9.js → luma-ray-DDsjcgZZ.js} +20 -13
- package/dist/src/{luma-ray-Hm3d6VJE.cjs → luma-ray-Due0n7di.cjs} +20 -21
- package/dist/src/{luma-ray-B2__8lYH.js → luma-ray-f6I2fft-.js} +20 -23
- package/dist/src/main.js +1170 -1321
- package/dist/src/{messages-Uee41Mj5.js → messages-BS17jdMx.js} +22 -24
- package/dist/src/{messages-XhiwCbi4.cjs → messages-Bs1kC7P4.cjs} +32 -34
- package/dist/src/{messages-CGPPidQr.js → messages-D0lx5qK7.js} +22 -24
- package/dist/src/messages-ZJk778GH.js +240 -0
- package/dist/src/{meteor-BYykdXrV.js → meteor-44VjEACX.js} +3 -4
- package/dist/src/{meteor-CsopaHrH.js → meteor-D-SotUw9.js} +3 -4
- package/dist/src/{meteor-e-E-2vVl.cjs → meteor-DLZZ3osF.cjs} +3 -4
- package/dist/src/{meteor-C8lGP6P4.js → meteor-DUiCJRC-.js} +3 -4
- package/dist/src/{modelslab-yKz-ZNB4.js → modelslab-Bmni6skY.js} +17 -10
- package/dist/src/{modelslab-E9gO-bYd.js → modelslab-Bx9IrZfS.js} +18 -20
- package/dist/src/{modelslab-lUVW0cmB.cjs → modelslab-CoUX6Jc_.cjs} +17 -18
- package/dist/src/{modelslab-ClBkr8_9.js → modelslab-DRb74SP4.js} +17 -19
- package/dist/src/{nova-reel-Dk8jNpId.js → nova-reel-BfPq-0Yk.js} +20 -13
- package/dist/src/{nova-reel-D8CuO6QH.cjs → nova-reel-C_QM18Xn.cjs} +20 -21
- package/dist/src/{nova-reel-u2eF2Cxm.js → nova-reel-D_W1tjMH.js} +22 -21
- package/dist/src/{nova-reel-P9bwvtYX.js → nova-reel-bgjxilYW.js} +20 -23
- package/dist/src/{nova-sonic-CK2rAiKi.js → nova-sonic-CFb5GYhg.js} +30 -26
- package/dist/src/{nova-sonic-BaqWlkds.js → nova-sonic-DIGQNR07.js} +30 -31
- package/dist/src/{nova-sonic-yZapPLv7.js → nova-sonic-De1HW5fD.js} +31 -32
- package/dist/src/{nova-sonic-Ds1C-dpm.cjs → nova-sonic-zfcljeRp.cjs} +30 -31
- package/dist/src/{openai-DUFopMrH.cjs → openai-Cuif0GEt.cjs} +8 -9
- package/dist/src/{openai-PblZ3jUE.js → openai-DElQ-fPX.js} +3 -4
- package/dist/src/{openai-CcN1B8Sb.js → openai-DhbB7eWK.js} +3 -4
- package/dist/src/openai-j-sE2O7r.js +44 -0
- package/dist/src/{openclaw-B6qqDr_u.cjs → openclaw-CSugPYAr.cjs} +188 -130
- package/dist/src/{openclaw-A-3_loM7.js → openclaw-DiSz3I5L.js} +180 -109
- package/dist/src/{openclaw-a3lylB-V.js → openclaw-DuvJKEW5.js} +178 -124
- package/dist/src/{openclaw-COn6QzDi.js → openclaw-tiVYRtr-.js} +178 -122
- package/dist/src/opencode-sdk-0j6rTWNb.js +562 -0
- package/dist/src/opencode-sdk-B3CWY9h_.js +560 -0
- package/dist/src/opencode-sdk-BL764Jdi.cjs +564 -0
- package/dist/src/opencode-sdk-C2y6UkP2.js +560 -0
- package/dist/src/{otlpReceiver-oyf5wLGC.js → otlpReceiver-C99PPb48.js} +53 -51
- package/dist/src/{otlpReceiver-lXsYVbpj.cjs → otlpReceiver-CGq6LspY.cjs} +53 -55
- package/dist/src/{otlpReceiver-94URx7UW.js → otlpReceiver-CdNBdbsk.js} +53 -55
- package/dist/src/{otlpReceiver-BmmTiMjA.js → otlpReceiver-D89fR-rC.js} +53 -55
- package/dist/src/{providerRegistry-Cq_JK_CJ.js → providerRegistry-B0RUOLI_.js} +7 -8
- package/dist/src/{providerRegistry-DSSHjMKf.js → providerRegistry-CD8MEar9.js} +7 -8
- package/dist/src/{providerRegistry-CvHEVJad.cjs → providerRegistry-Civky8Ar.cjs} +12 -13
- package/dist/src/providerRegistry-DM8rZYol.js +45 -0
- package/dist/src/providers-B7V0njNs.js +32 -0
- package/dist/src/providers-BEwbhv0X.js +30 -0
- package/dist/src/{providers-Iil64vk9.js → providers-BlqUifFg.js} +1543 -1676
- package/dist/src/providers-CH3C7zf7.js +30 -0
- package/dist/src/{providers-DHbjzW2e.cjs → providers-CgKOSgTR.cjs} +1896 -2029
- package/dist/src/providers-D8lF1sqW.js +33246 -0
- package/dist/src/{providers-BnFpbY_s.js → providers-Dk_6ocUX.js} +1536 -1669
- package/dist/src/providers-zyB6k_38.cjs +31 -0
- package/dist/src/{pythonUtils-CcT5LH1M.js → pythonUtils-C3py6GC1.js} +18 -19
- package/dist/src/{pythonUtils-DBbuI3QJ.cjs → pythonUtils-CTU3Y3lw.cjs} +42 -43
- package/dist/src/{pythonUtils-hZ8LeQLv.js → pythonUtils-D5nxkQ0P.js} +18 -19
- package/dist/src/pythonUtils-D6fwaDSg.js +249 -0
- package/dist/src/{quiverai-BuI0tE39.js → quiverai-BbOUOn2L.js} +8 -7
- package/dist/src/{quiverai-DCGSZt4U.js → quiverai-CIaELU_m.js} +8 -10
- package/dist/src/{quiverai-DiMVJQDz.cjs → quiverai-PdShCPox.cjs} +8 -9
- package/dist/src/{quiverai-fQNkExW4.js → quiverai-uH-dcTIr.js} +9 -11
- package/dist/src/{render-Dj1smHEb.js → render-Drod8m7K.js} +4 -5
- package/dist/src/responses-CB2jwoAr.js +660 -0
- package/dist/src/{responses-ghR3IOfy.cjs → responses-D8SBTL64.cjs} +39 -42
- package/dist/src/{responses-DOAFFENS.js → responses-DIR9Ud3j.js} +24 -27
- package/dist/src/{responses-CxzoQoBe.js → responses-WNGNYe3K.js} +24 -27
- package/dist/src/rubyUtils-BUHu6PhO.js +5 -0
- package/dist/src/{rubyUtils-CwbGmgYN.js → rubyUtils-BUVePouc.js} +27 -20
- package/dist/src/rubyUtils-BcuGX77l.js +222 -0
- package/dist/src/{rubyUtils-DudlFZed.js → rubyUtils-Boc4HZzX.js} +18 -19
- package/dist/src/rubyUtils-CP42kMvq.cjs +4 -0
- package/dist/src/{rubyUtils-C8MhKGHb.cjs → rubyUtils-DhCAlxZr.cjs} +48 -50
- package/dist/src/{sagemaker-gmskuyre.js → sagemaker-CNBxx5CJ.js} +75 -70
- package/dist/src/{sagemaker-CcxhlOAR.js → sagemaker-CemTFp2h.js} +75 -79
- package/dist/src/{sagemaker-77zbJ2Q2.cjs → sagemaker-Cl28mZU2.cjs} +75 -76
- package/dist/src/{sagemaker-DuM71dVU.js → sagemaker-YSyBXQQh.js} +77 -77
- package/dist/src/{scanner-DJYiSXQj.js → scanner-BsBlNXNn.js} +100 -121
- package/dist/src/server/index.js +5520 -67427
- package/dist/src/{server-B5v33lvE.cjs → server-C_7Ax-hA.cjs} +57 -67
- package/dist/src/{server-BJ4m4f1D.js → server-CqzrVGpF.js} +26 -29
- package/dist/src/server-CuxBbeSY.js +229 -0
- package/dist/src/server-DA4Cyrrq.js +7 -0
- package/dist/src/server-Dulb-4-K.cjs +5 -0
- package/dist/src/{server-RV_i_YX5.js → server-VWgWb00X.js} +19 -24
- package/dist/src/{signal-BW33JuId.js → signal-4U3mfRvL.js} +9 -11
- package/dist/src/{slack-DEURelTy.cjs → slack-BmVAVGaK.cjs} +7 -8
- package/dist/src/{slack-BQYeW9L3.js → slack-DCUPTzS2.js} +8 -8
- package/dist/src/{slack-BB6yuZzp.js → slack-DOdy_kyv.js} +7 -8
- package/dist/src/{slack-2pRrhhgJ.js → slack-DXMKtA-f.js} +7 -9
- package/dist/src/store-CXGFv4aR.js +228 -0
- package/dist/src/store-CXS-Q_91.js +6 -0
- package/dist/src/{store-D7CgQzAR.cjs → store-DLlFCC4h.cjs} +44 -45
- package/dist/src/{store-DJNsD1iC.js → store-DXilxTl-.js} +40 -36
- package/dist/src/{store-s3SftUwF.js → store-Dim__MDd.js} +34 -35
- package/dist/src/store-eYkaKMwq.cjs +5 -0
- package/dist/src/{tables-DfTsNN7X.js → tables-6YKwjN9-.js} +19 -21
- package/dist/src/tables-DLJPUdUE.js +288 -0
- package/dist/src/{tables-BKTmd6u7.cjs → tables-DPi7wKeM.cjs} +89 -91
- package/dist/src/{tables-DMegD0Xf.js → tables-gftXzE9I.js} +21 -23
- package/dist/src/telemetry-BpMfhthR.cjs +5 -0
- package/dist/src/{telemetry--WAdAfVi.js → telemetry-CMrFgtPB.js} +11 -13
- package/dist/src/telemetry-Cps3mIU-.js +171 -0
- package/dist/src/{telemetry-DQgVBCAb.cjs → telemetry-DaX14Chu.cjs} +21 -24
- package/dist/src/{telemetry-BedSm-bZ.js → telemetry-Dthj_BbD.js} +17 -14
- package/dist/src/telemetry-Dw38hanS.js +7 -0
- package/dist/src/{text-oiSbwSOI.js → text-B_UCRPp2.js} +2 -2
- package/dist/src/{text-oKzCBnK6.cjs → text-CW1cyrwj.cjs} +12 -13
- package/dist/src/{text-B_IrO4GZ.js → text-Db-Wt2u2.js} +2 -2
- package/dist/src/text-TIv0QYnd.js +22 -0
- package/dist/src/{tokenUsageUtils-FZd5O_4A.js → tokenUsageUtils-BDGe-iyI.js} +2 -2
- package/dist/src/{tokenUsageUtils-DmZSD2eU.js → tokenUsageUtils-DflFMjS0.js} +2 -2
- package/dist/src/tokenUsageUtils-NYT-WKS6.js +138 -0
- package/dist/src/{tokenUsageUtils-CXhxVj72.cjs → tokenUsageUtils-bVa1ga6f.cjs} +32 -33
- package/dist/src/{transcription-mYS9vd5v.js → transcription-BNYURcXg.js} +14 -7
- package/dist/src/{transcription-X2-B4vkX.js → transcription-B_OdaHp7.js} +14 -16
- package/dist/src/{transcription-BO1AHegO.cjs → transcription-NLVG9MT1.cjs} +14 -15
- package/dist/src/{transcription-lzBLiTFJ.js → transcription-s6A-bNrZ.js} +15 -17
- package/dist/src/{transform-B1Hi5lWS.cjs → transform-CzK1Q0zl.cjs} +24 -26
- package/dist/src/{transform-DeGlxb0D.js → transform-D5HsjduX.js} +39 -47
- package/dist/src/{transform-CYDILYDe.js → transform-DECvGmzp.js} +15 -13
- package/dist/src/transform-DTGDnAzW.js +6 -0
- package/dist/src/{transform-BEgStbHK.js → transform-DilY9wbS.js} +10 -12
- package/dist/src/{transform-D5PjiWiZ.cjs → transform-DuHvhZpj.cjs} +179 -187
- package/dist/src/transform-aa6tmVpZ.js +216 -0
- package/dist/src/transform-m3qNw4KP.cjs +5 -0
- package/dist/src/transform-uAytVuyX.js +1506 -0
- package/dist/src/{transform-Dfl89yi4.js → transform-vNucnNr0.js} +39 -47
- package/dist/src/{transformersAvailability-SZnTS3pJ.js → transformersAvailability-CEVM2GNQ.js} +2 -2
- package/dist/src/{transformersAvailability-D-glmEy7.cjs → transformersAvailability-CwayUSlh.cjs} +2 -3
- package/dist/src/{transformersAvailability-CjeFXhuJ.js → transformersAvailability-D6c6ROpT.js} +2 -2
- package/dist/src/{types-DWNf48sT.cjs → types-C_7nyzr1.cjs} +538 -574
- package/dist/src/{types-CXQduE9o.js → types-Cbd8uOMq.js} +68 -100
- package/dist/src/types-CzW2QFyi.js +3288 -0
- package/dist/src/{types-C5hEkb-x.js → types-DmyIJ-sR.js} +63 -99
- package/dist/src/{util-CoQjmE3u.js → util-B3xGByQh.js} +4 -5
- package/dist/src/{util-aLhtl3fe.cjs → util-B9vlHIIh.cjs} +208 -223
- package/dist/src/{util-Du96oyYS.js → util-BHGHw5G1.js} +4 -5
- package/dist/src/{util-DQ984syk.js → util-BRYkYPTd.js} +36 -51
- package/dist/src/{util-D9eLdGfa.js → util-BV4XUC0n.js} +5 -6
- package/dist/src/util-Bv6uGDfH.js +293 -0
- package/dist/src/{util-1wWM599Z.cjs → util-BzMcevZc.cjs} +50 -51
- package/dist/src/{util-_h4pVqrz.js → util-C1CeHl-P.js} +36 -51
- package/dist/src/{util-Bm_-UMD_.js → util-CMy69ZgQ.js} +5 -6
- package/dist/src/{util-CyUdMzV0.cjs → util-DGNOS1db.cjs} +34 -35
- package/dist/src/util-Dnmk2mBQ.js +599 -0
- package/dist/src/util-ZzmqNPlg.js +1426 -0
- package/dist/src/{utils-BjLy-Q72.cjs → utils-Cz9qXqII.cjs} +29 -32
- package/dist/src/{utils-CFMn2yHW.js → utils-XiOAgly5.js} +4 -7
- package/dist/src/utils-dLokC-eR.js +94 -0
- package/dist/src/{utils-DvWMzuMx.js → utils-f2-Moju7.js} +4 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -38
- package/dist/src/app/assets/index-B2D0bCSI.js +0 -439
- package/dist/src/app/assets/vendor-charts-CCl15Imd.js +0 -36
- package/dist/src/cache-ChPcurj7.js +0 -6
- package/dist/src/cache-VVu_W-yg.js +0 -8
- package/dist/src/cache-YLNCFEM2.cjs +0 -6
- package/dist/src/chunk-DHDDz29n.js +0 -22
- package/dist/src/chunk-FhC4c-0y.js +0 -21
- package/dist/src/cloud-BndfXy4H.js +0 -5
- package/dist/src/eval-BhHvMY82.js +0 -17
- package/dist/src/evalResult-Dq2gFNQY.js +0 -12
- package/dist/src/evalResult-nmcP5VKH.cjs +0 -12
- package/dist/src/evalResult-trqZjVYh.js +0 -14
- package/dist/src/evaluator-CnfPstzT.js +0 -39
- package/dist/src/fetch-IDPDue6F.cjs +0 -4
- package/dist/src/fetch-hKJ-It8q.js +0 -6
- package/dist/src/fetch-ouKnrWK-.js +0 -4
- package/dist/src/graders-CQn7WUsd.cjs +0 -34
- package/dist/src/graders-DC6QAbpW.js +0 -35
- package/dist/src/graders-DUWz3Y7j.js +0 -37
- package/dist/src/opencode-sdk-4bL9n-Gk.js +0 -382
- package/dist/src/opencode-sdk-BfC2zWcR.js +0 -376
- package/dist/src/opencode-sdk-DMJyuwMg.js +0 -380
- package/dist/src/opencode-sdk-Da-9adza.cjs +0 -383
- package/dist/src/providers-CsXB2Ix-.js +0 -35
- package/dist/src/providers-DO8ltjLC.js +0 -33
- package/dist/src/providers-Dtq-xnXd.cjs +0 -33
- package/dist/src/rubyUtils-BUbcND2f.js +0 -6
- package/dist/src/rubyUtils-Cr55X_KE.js +0 -5
- package/dist/src/rubyUtils-DlIiqoYo.cjs +0 -5
- package/dist/src/server-C2eQH4Gu.js +0 -6
- package/dist/src/server-CXWycu7H.cjs +0 -6
- package/dist/src/server-Q6OGlxxT.js +0 -8
- package/dist/src/store-B3EDO9Q3.js +0 -7
- package/dist/src/store-Dl9F8aw5.js +0 -6
- package/dist/src/store-SnrGrlt9.cjs +0 -6
- package/dist/src/telemetry-BGhiPZtl.js +0 -8
- package/dist/src/telemetry-CFfiYan6.cjs +0 -6
- package/dist/src/telemetry-DHzEduxX.js +0 -6
- package/dist/src/transform-C1x1ZlMQ.cjs +0 -6
- package/dist/src/transform-DYHjFmQu.js +0 -8
- package/dist/src/transform-rmwJT5JQ.js +0 -7
- package/dist/src/transformersAvailability-eJooj0gX.js +0 -35
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { x as parseDataUrl } from "./transform-
|
|
3
|
-
|
|
1
|
+
import { m as calculateCost } from "./fetch-Cwxnd8zz.js";
|
|
2
|
+
import { x as parseDataUrl } from "./transform-vNucnNr0.js";
|
|
4
3
|
//#region src/providers/anthropic/util.ts
|
|
5
4
|
const ANTHROPIC_MODELS = [
|
|
6
5
|
...["claude-sonnet-4-6", "claude-sonnet-4-6-latest"].map((model) => ({
|
|
@@ -288,7 +287,7 @@ function transformWebSearchTool(config) {
|
|
|
288
287
|
if (config.cache_control) tool.cache_control = config.cache_control;
|
|
289
288
|
return tool;
|
|
290
289
|
}
|
|
291
|
-
|
|
292
290
|
//#endregion
|
|
293
291
|
export { parseMessages as a, outputFromMessage as i, calculateAnthropicCost as n, processAnthropicTools as o, getTokenUsage as r, ANTHROPIC_MODELS as t };
|
|
294
|
-
|
|
292
|
+
|
|
293
|
+
//# sourceMappingURL=util-BHGHw5G1.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as getEnvBool, i as
|
|
2
|
-
import { t as invariant } from "./invariant-
|
|
3
|
-
import { o as safeResolve, r as importModule, t as getDirectory } from "./esm-
|
|
4
|
-
import { r as runPython } from "./pythonUtils-
|
|
5
|
-
import { i as isJavascriptFile, t as JAVASCRIPT_EXTENSIONS } from "./fileExtensions-
|
|
6
|
-
import { A as isApiProvider, g as ResultFailureReason, h as OutputFileExtension, j as isProviderOptions } from "./types-
|
|
7
|
-
import {
|
|
1
|
+
import { _ as getEnvBool, i as logger, s as sanitizeObject, w as state } from "./logger-CT3IKMKA.js";
|
|
2
|
+
import { t as invariant } from "./invariant-Ddh24eXh.js";
|
|
3
|
+
import { o as safeResolve, r as importModule, t as getDirectory } from "./esm-Cd1AjG1D.js";
|
|
4
|
+
import { r as runPython } from "./pythonUtils-D5nxkQ0P.js";
|
|
5
|
+
import { i as isJavascriptFile, t as JAVASCRIPT_EXTENSIONS } from "./fileExtensions-DnqA1y9x.js";
|
|
6
|
+
import { A as isApiProvider, g as ResultFailureReason, h as OutputFileExtension, j as isProviderOptions } from "./types-DmyIJ-sR.js";
|
|
7
|
+
import { N as VERSION, O as TERMINAL_MAX_WIDTH, t as fetchWithProxy } from "./fetch-Cwxnd8zz.js";
|
|
8
8
|
import * as fs$1 from "fs";
|
|
9
9
|
import * as path$1 from "path";
|
|
10
10
|
import path from "path";
|
|
@@ -19,7 +19,6 @@ import { parse as parse$1 } from "csv-parse/sync";
|
|
|
19
19
|
import nunjucks from "nunjucks";
|
|
20
20
|
import { XMLBuilder } from "fast-xml-parser";
|
|
21
21
|
import { stringify } from "csv-stringify/sync";
|
|
22
|
-
|
|
23
22
|
//#region src/util/provider.ts
|
|
24
23
|
function canonicalizeProviderId(id) {
|
|
25
24
|
if (id.startsWith("file://")) {
|
|
@@ -190,7 +189,6 @@ function isGoogleProvider(providerId) {
|
|
|
190
189
|
}
|
|
191
190
|
return false;
|
|
192
191
|
}
|
|
193
|
-
|
|
194
192
|
//#endregion
|
|
195
193
|
//#region src/util/comparison.ts
|
|
196
194
|
/**
|
|
@@ -289,7 +287,7 @@ function resultIsForTestCase(result, testCase) {
|
|
|
289
287
|
const isMatch = doVarsMatch && providersMatch;
|
|
290
288
|
if (!isMatch) {
|
|
291
289
|
const varKeys = testVars ? Object.keys(testVars).join(", ") : "none";
|
|
292
|
-
|
|
290
|
+
logger.debug(`[resultIsForTestCase] No match: vars=${doVarsMatch}, providers=${providersMatch}`, {
|
|
293
291
|
testProvider: testProviderId || "none",
|
|
294
292
|
resultProvider: resultProviderId || "none",
|
|
295
293
|
testVarKeys: varKeys
|
|
@@ -297,7 +295,6 @@ function resultIsForTestCase(result, testCase) {
|
|
|
297
295
|
}
|
|
298
296
|
return isMatch;
|
|
299
297
|
}
|
|
300
|
-
|
|
301
298
|
//#endregion
|
|
302
299
|
//#region src/util/env.ts
|
|
303
300
|
/**
|
|
@@ -314,8 +311,8 @@ function setupEnv(envPath) {
|
|
|
314
311
|
return;
|
|
315
312
|
}
|
|
316
313
|
for (const p of paths) if (!fs$1.existsSync(p)) throw new Error(`Environment file not found: ${p}`);
|
|
317
|
-
if (paths.length === 1)
|
|
318
|
-
else
|
|
314
|
+
if (paths.length === 1) logger.info(`Loading environment variables from ${paths[0]}`);
|
|
315
|
+
else logger.info(`Loading environment variables from: ${paths.join(", ")}`);
|
|
319
316
|
const pathArg = paths.length === 1 ? paths[0] : paths;
|
|
320
317
|
dotenv.config({
|
|
321
318
|
path: pathArg,
|
|
@@ -324,7 +321,6 @@ function setupEnv(envPath) {
|
|
|
324
321
|
});
|
|
325
322
|
} else dotenv.config({ quiet: true });
|
|
326
323
|
}
|
|
327
|
-
|
|
328
324
|
//#endregion
|
|
329
325
|
//#region src/util/functions/loadFunction.ts
|
|
330
326
|
const functionCache = {};
|
|
@@ -333,7 +329,7 @@ const functionCache = {};
|
|
|
333
329
|
* @param options Options for loading the function
|
|
334
330
|
* @returns The loaded function
|
|
335
331
|
*/
|
|
336
|
-
async function loadFunction({ filePath, functionName, defaultFunctionName = "func", basePath =
|
|
332
|
+
async function loadFunction({ filePath, functionName, defaultFunctionName = "func", basePath = state.basePath, useCache = true }) {
|
|
337
333
|
const cacheKey = `${filePath}${functionName ? `:${functionName}` : ""}`;
|
|
338
334
|
if (useCache && functionCache[cacheKey]) return functionCache[cacheKey];
|
|
339
335
|
const resolvedPath = basePath ? path.resolve(basePath, filePath) : filePath;
|
|
@@ -354,7 +350,7 @@ async function loadFunction({ filePath, functionName, defaultFunctionName = "fun
|
|
|
354
350
|
if (useCache) functionCache[cacheKey] = func;
|
|
355
351
|
return func;
|
|
356
352
|
} catch (err) {
|
|
357
|
-
|
|
353
|
+
logger.error(`Failed to load function: ${err.message}`);
|
|
358
354
|
throw err;
|
|
359
355
|
}
|
|
360
356
|
}
|
|
@@ -373,7 +369,6 @@ function parseFileUrl(fileUrl) {
|
|
|
373
369
|
};
|
|
374
370
|
return { filePath: urlWithoutProtocol };
|
|
375
371
|
}
|
|
376
|
-
|
|
377
372
|
//#endregion
|
|
378
373
|
//#region src/util/templates.ts
|
|
379
374
|
/**
|
|
@@ -392,7 +387,7 @@ function getNunjucksEngine(filters, throwOnUndefined = false, isGrader = false)
|
|
|
392
387
|
});
|
|
393
388
|
const envGlobals = {
|
|
394
389
|
...getEnvBool("PROMPTFOO_DISABLE_TEMPLATE_ENV_VARS", getEnvBool("PROMPTFOO_SELF_HOSTED", false)) ? {} : process.env,
|
|
395
|
-
...
|
|
390
|
+
...state.config?.env
|
|
396
391
|
};
|
|
397
392
|
env.addGlobal("env", envGlobals);
|
|
398
393
|
env.addFilter("load", function(str) {
|
|
@@ -432,7 +427,6 @@ function extractVariablesFromTemplates(templates) {
|
|
|
432
427
|
for (const template of templates) extractVariablesFromTemplate(template).forEach((variable) => variableSet.add(variable));
|
|
433
428
|
return Array.from(variableSet);
|
|
434
429
|
}
|
|
435
|
-
|
|
436
430
|
//#endregion
|
|
437
431
|
//#region src/util/render.ts
|
|
438
432
|
/**
|
|
@@ -461,10 +455,6 @@ function extractVariablesFromTemplates(templates) {
|
|
|
461
455
|
function renderEnvOnlyInObject(obj, envOverrides, replaceBase) {
|
|
462
456
|
if (getEnvBool("PROMPTFOO_DISABLE_TEMPLATING")) return obj;
|
|
463
457
|
if (typeof obj === "string") {
|
|
464
|
-
if (obj.length > 5e4) {
|
|
465
|
-
logger_default.warn(`String too long (${obj.length} chars) for template matching. Skipping env var rendering.`);
|
|
466
|
-
return obj;
|
|
467
|
-
}
|
|
468
458
|
const nunjucks = getNunjucksEngine();
|
|
469
459
|
const baseEnvGlobals = nunjucks.getGlobal("env");
|
|
470
460
|
const envGlobals = replaceBase ? envOverrides ?? {} : envOverrides ? {
|
|
@@ -478,7 +468,7 @@ function renderEnvOnlyInObject(obj, envOverrides, replaceBase) {
|
|
|
478
468
|
if (match.includes("|") || varName && varName in envGlobals && envGlobals[varName] !== void 0) try {
|
|
479
469
|
return nunjucks.renderString(match, { env: envGlobals });
|
|
480
470
|
} catch (error) {
|
|
481
|
-
|
|
471
|
+
logger.debug(`Failed to render env template "${match}": ${error instanceof Error ? error.message : String(error)}`);
|
|
482
472
|
return match;
|
|
483
473
|
}
|
|
484
474
|
return match;
|
|
@@ -503,7 +493,6 @@ function renderVarsInObject(obj, vars) {
|
|
|
503
493
|
} else if (typeof obj === "function") return renderVarsInObject(obj({ vars }));
|
|
504
494
|
return obj;
|
|
505
495
|
}
|
|
506
|
-
|
|
507
496
|
//#endregion
|
|
508
497
|
//#region src/util/file.ts
|
|
509
498
|
/**
|
|
@@ -514,7 +503,7 @@ function getNunjucksEngineForFilePath() {
|
|
|
514
503
|
const env = nunjucks.configure({ autoescape: false });
|
|
515
504
|
env.addGlobal("env", {
|
|
516
505
|
...process.env,
|
|
517
|
-
...
|
|
506
|
+
...state.config?.env
|
|
518
507
|
});
|
|
519
508
|
return env;
|
|
520
509
|
}
|
|
@@ -541,16 +530,16 @@ function maybeLoadFromExternalFile(filePath, context) {
|
|
|
541
530
|
const renderedFilePath = getNunjucksEngineForFilePath().renderString(filePath, {});
|
|
542
531
|
const { filePath: cleanPath, functionName } = parseFileUrl(renderedFilePath);
|
|
543
532
|
if (context === "assertion" && (cleanPath.endsWith(".py") || isJavascriptFile(cleanPath))) {
|
|
544
|
-
|
|
533
|
+
logger.debug(`Preserving Python/JS file reference in assertion context: ${renderedFilePath}`);
|
|
545
534
|
return renderedFilePath;
|
|
546
535
|
}
|
|
547
536
|
if (context === "vars") {
|
|
548
|
-
|
|
537
|
+
logger.debug(`Preserving file reference in vars context: ${renderedFilePath}`);
|
|
549
538
|
return renderedFilePath;
|
|
550
539
|
}
|
|
551
540
|
if (functionName && (cleanPath.endsWith(".py") || isJavascriptFile(cleanPath))) return renderedFilePath;
|
|
552
541
|
const pathToUse = functionName && !(cleanPath.endsWith(".py") || isJavascriptFile(cleanPath)) ? renderedFilePath.slice(7) : cleanPath;
|
|
553
|
-
const resolvedPath = path$1.resolve(
|
|
542
|
+
const resolvedPath = path$1.resolve(state.basePath || "", pathToUse);
|
|
554
543
|
if (hasMagic(pathToUse)) {
|
|
555
544
|
const matchedFiles = globSync(resolvedPath, { windowsPathsNoEscape: true });
|
|
556
545
|
if (matchedFiles.length === 0) throw new Error(`No files found matching pattern: ${resolvedPath}`);
|
|
@@ -561,7 +550,7 @@ function maybeLoadFromExternalFile(filePath, context) {
|
|
|
561
550
|
contents = fs$1.readFileSync(matchedFile, "utf8");
|
|
562
551
|
} catch (error) {
|
|
563
552
|
if (error.code === "ENOENT") {
|
|
564
|
-
|
|
553
|
+
logger.debug(`File disappeared during glob expansion: ${matchedFile}`);
|
|
565
554
|
continue;
|
|
566
555
|
}
|
|
567
556
|
throw error;
|
|
@@ -771,37 +760,37 @@ async function maybeLoadToolsFromExternalFile(tools, vars) {
|
|
|
771
760
|
const { filePath, functionName } = parseFileUrl(rendered);
|
|
772
761
|
if (functionName && (filePath.endsWith(".py") || isJavascriptFile(filePath))) {
|
|
773
762
|
const fileType = filePath.endsWith(".py") ? "Python" : "JavaScript";
|
|
774
|
-
|
|
763
|
+
logger.debug(`[maybeLoadToolsFromExternalFile] Loading tools from ${fileType} file: ${filePath}:${functionName}`);
|
|
775
764
|
try {
|
|
776
765
|
let toolDefinitions;
|
|
777
766
|
if (filePath.endsWith(".py")) {
|
|
778
|
-
const absPath = safeResolve(
|
|
779
|
-
|
|
767
|
+
const absPath = safeResolve(state.basePath || process.cwd(), filePath);
|
|
768
|
+
logger.debug(`[maybeLoadToolsFromExternalFile] Resolved Python path: ${absPath}`);
|
|
780
769
|
toolDefinitions = await runPython(absPath, functionName, []);
|
|
781
770
|
} else {
|
|
782
|
-
const absPath = safeResolve(
|
|
783
|
-
|
|
771
|
+
const absPath = safeResolve(state.basePath || process.cwd(), filePath);
|
|
772
|
+
logger.debug(`[maybeLoadToolsFromExternalFile] Resolved JavaScript path: ${absPath}`);
|
|
784
773
|
const module = await importModule(absPath);
|
|
785
774
|
const fn = module[functionName] || module.default?.[functionName];
|
|
786
775
|
if (typeof fn !== "function") {
|
|
787
776
|
const availableExports = Object.keys(module).filter((k) => k !== "default");
|
|
788
|
-
const basePath =
|
|
777
|
+
const basePath = state.basePath || process.cwd();
|
|
789
778
|
throw new Error(`Function "${functionName}" not found in ${filePath}. Available exports: ${availableExports.length > 0 ? availableExports.join(", ") : "(none)"}\nResolved from: ${basePath}`);
|
|
790
779
|
}
|
|
791
780
|
toolDefinitions = await Promise.resolve(fn());
|
|
792
781
|
}
|
|
793
782
|
if (!toolDefinitions || typeof toolDefinitions === "string" || typeof toolDefinitions === "number" || typeof toolDefinitions === "boolean") throw new Error(`Function "${functionName}" must return an array or object of tool definitions, but returned: ${toolDefinitions === null ? "null" : typeof toolDefinitions}`);
|
|
794
|
-
|
|
783
|
+
logger.debug(`[maybeLoadToolsFromExternalFile] Successfully loaded ${Array.isArray(toolDefinitions) ? toolDefinitions.length : "object"} tools`);
|
|
795
784
|
return toolDefinitions;
|
|
796
785
|
} catch (err) {
|
|
797
786
|
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
798
|
-
const basePath =
|
|
787
|
+
const basePath = state.basePath || process.cwd();
|
|
799
788
|
throw new Error(`Failed to load tools from ${rendered}:\n${errorMessage}\n\nMake sure the function "${functionName}" exists and returns a valid tool definition array.\nResolved from: ${basePath}`);
|
|
800
789
|
}
|
|
801
790
|
}
|
|
802
791
|
if (filePath.endsWith(".py") || isJavascriptFile(filePath)) {
|
|
803
792
|
const ext = filePath.endsWith(".py") ? "Python" : "JavaScript";
|
|
804
|
-
const basePath =
|
|
793
|
+
const basePath = state.basePath || process.cwd();
|
|
805
794
|
throw new Error(`Cannot load tools from ${rendered}\n${ext} files require a function name. Use this format:\n tools: file://${filePath}:get_tools\n\nYour ${ext} file should export a function that returns tool definitions:\n` + (filePath.endsWith(".py") ? ` def get_tools():\n return [{"type": "function", "function": {...}}]` : ` module.exports.get_tools = () => [{ type: "function", function: {...} }];`) + `\n\nResolved from: ${basePath}`);
|
|
806
795
|
}
|
|
807
796
|
}
|
|
@@ -819,7 +808,6 @@ async function maybeLoadToolsFromExternalFile(tools, vars) {
|
|
|
819
808
|
}
|
|
820
809
|
return loaded;
|
|
821
810
|
}
|
|
822
|
-
|
|
823
811
|
//#endregion
|
|
824
812
|
//#region src/googleSheets.ts
|
|
825
813
|
async function checkGoogleSheetAccess(url) {
|
|
@@ -834,7 +822,7 @@ async function checkGoogleSheetAccess(url) {
|
|
|
834
822
|
status: response.status
|
|
835
823
|
};
|
|
836
824
|
} catch (error) {
|
|
837
|
-
|
|
825
|
+
logger.error(`Error checking sheet access: ${error}`);
|
|
838
826
|
return { public: false };
|
|
839
827
|
}
|
|
840
828
|
}
|
|
@@ -886,7 +874,7 @@ async function fetchCsvFromGoogleSheetAuthenticated(url) {
|
|
|
886
874
|
}
|
|
887
875
|
async function fetchCsvFromGoogleSheet(url) {
|
|
888
876
|
const { public: isPublic } = await checkGoogleSheetAccess(url);
|
|
889
|
-
|
|
877
|
+
logger.debug(`Google Sheets URL: ${url}, isPublic: ${isPublic}`);
|
|
890
878
|
if (isPublic) return fetchCsvFromGoogleSheetUnauthenticated(url);
|
|
891
879
|
return fetchCsvFromGoogleSheetAuthenticated(url);
|
|
892
880
|
}
|
|
@@ -929,7 +917,7 @@ async function writeCsvToGoogleSheet(rows, url) {
|
|
|
929
917
|
});
|
|
930
918
|
range = `${newSheetTitle}!A1:${endColumn}${numRows}`;
|
|
931
919
|
}
|
|
932
|
-
|
|
920
|
+
logger.debug(`Writing CSV to Google Sheets URL: ${url} with ${values.length} rows`);
|
|
933
921
|
await sheets.spreadsheets.values.update({
|
|
934
922
|
spreadsheetId,
|
|
935
923
|
range,
|
|
@@ -938,7 +926,6 @@ async function writeCsvToGoogleSheet(rows, url) {
|
|
|
938
926
|
requestBody: { values }
|
|
939
927
|
});
|
|
940
928
|
}
|
|
941
|
-
|
|
942
929
|
//#endregion
|
|
943
930
|
//#region src/server/utils/evalTableUtils.ts
|
|
944
931
|
/**
|
|
@@ -1137,7 +1124,6 @@ async function streamEvalCsv(eval_, options) {
|
|
|
1137
1124
|
isRedteam
|
|
1138
1125
|
})]));
|
|
1139
1126
|
}
|
|
1140
|
-
|
|
1141
1127
|
//#endregion
|
|
1142
1128
|
//#region src/util/output.ts
|
|
1143
1129
|
const outputToSimpleString = (output) => {
|
|
@@ -1202,7 +1188,7 @@ async function writeJsonOutputSafely(outputPath, evalRecord, shareableUrl) {
|
|
|
1202
1188
|
const isHeapOOM = /heap out of memory|Array buffer allocation failed|ERR_STRING_TOO_LONG/i.test(msg);
|
|
1203
1189
|
if (isStringLen || isHeapOOM) {
|
|
1204
1190
|
const resultCount = await evalRecord.getResultsCount();
|
|
1205
|
-
|
|
1191
|
+
logger.error(`Dataset too large for JSON export (${resultCount} results).`);
|
|
1206
1192
|
throw new Error(`Dataset too large for JSON export. The evaluation has ${resultCount} results which exceeds memory limits. Consider using JSONL format instead: --output output.jsonl`);
|
|
1207
1193
|
} else throw error;
|
|
1208
1194
|
}
|
|
@@ -1221,7 +1207,7 @@ async function writeOutput(outputPath, evalRecord, shareableUrl) {
|
|
|
1221
1207
|
});
|
|
1222
1208
|
return csvRow;
|
|
1223
1209
|
});
|
|
1224
|
-
|
|
1210
|
+
logger.info(`Writing ${rows.length} rows to Google Sheets...`);
|
|
1225
1211
|
await writeCsvToGoogleSheet(rows, outputPath);
|
|
1226
1212
|
return;
|
|
1227
1213
|
}
|
|
@@ -1303,14 +1289,13 @@ async function writeOutput(outputPath, evalRecord, shareableUrl) {
|
|
|
1303
1289
|
async function writeMultipleOutputs(outputPaths, evalRecord, shareableUrl) {
|
|
1304
1290
|
await Promise.all(outputPaths.map((outputPath) => writeOutput(outputPath, evalRecord, shareableUrl)));
|
|
1305
1291
|
}
|
|
1306
|
-
|
|
1307
1292
|
//#endregion
|
|
1308
1293
|
//#region src/util/runtime.ts
|
|
1309
1294
|
function printBorder() {
|
|
1310
1295
|
const border = "=".repeat(TERMINAL_MAX_WIDTH);
|
|
1311
|
-
|
|
1296
|
+
logger.info(border);
|
|
1312
1297
|
}
|
|
1313
|
-
|
|
1314
1298
|
//#endregion
|
|
1315
1299
|
export { getProviderDescription as A, deduplicateTestCases as C, resultIsForTestCase as D, getTestCaseDeduplicationKey as E, isGoogleProvider as M, isOpenAiProvider as N, checkProviderApiKeys as O, isProviderAllowed as P, setupEnv as S, filterRuntimeVars as T, extractVariablesFromTemplate as _, getNunjucksEngineForFilePath as a, loadFunction as b, maybeLoadFromExternalFile as c, maybeLoadToolsFromExternalFile as d, parsePathOrGlob as f, renderVarsInObject as g, renderEnvOnlyInObject as h, fetchCsvFromGoogleSheet as i, isAnthropicProvider as j, doesProviderRefMatch as k, maybeLoadFromExternalFileWithVars as l, readOutput as m, writeMultipleOutputs as n, getResolvedRelativePath as o, readFilters as p, writeOutput as r, maybeLoadConfigFromExternalFile as s, printBorder as t, maybeLoadResponseFormatFromExternalFile as u, extractVariablesFromTemplates as v, extractRuntimeVars as w, parseFileUrl as x, getNunjucksEngine as y };
|
|
1316
|
-
|
|
1300
|
+
|
|
1301
|
+
//# sourceMappingURL=util-BRYkYPTd.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { d as getAjv, m as safeJsonStringify } from "./logger-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { d as getAjv, m as safeJsonStringify } from "./logger-DLcq4dWf.js";
|
|
2
|
+
import { m as calculateCost } from "./fetch-HaqdX7U1.js";
|
|
3
|
+
import { E as maybeLoadFromExternalFileWithVars } from "./util-ZzmqNPlg.js";
|
|
4
4
|
import OpenAI from "openai";
|
|
5
|
-
|
|
6
5
|
//#region src/providers/openai/util.ts
|
|
7
6
|
const ajv = getAjv();
|
|
8
7
|
const OPENAI_CHAT_MODELS = [
|
|
@@ -594,7 +593,7 @@ function formatOpenAiError(data) {
|
|
|
594
593
|
errorMessage += "\n\n" + safeJsonStringify(data, true);
|
|
595
594
|
return errorMessage;
|
|
596
595
|
}
|
|
597
|
-
|
|
598
596
|
//#endregion
|
|
599
597
|
export { calculateOpenAICost as a, getTokenUsage as c, OPENAI_TRANSCRIPTION_MODELS as i, validateFunctionCall as l, OPENAI_COMPLETION_MODELS as n, failApiCall as o, OPENAI_REALTIME_MODELS as r, formatOpenAiError as s, OPENAI_CHAT_MODELS as t };
|
|
600
|
-
|
|
598
|
+
|
|
599
|
+
//# sourceMappingURL=util-BV4XUC0n.js.map
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { m as calculateCost } from "./fetch-HaqdX7U1.js";
|
|
2
|
+
import { x as parseDataUrl } from "./transform-uAytVuyX.js";
|
|
3
|
+
//#region src/providers/anthropic/util.ts
|
|
4
|
+
const ANTHROPIC_MODELS = [
|
|
5
|
+
...["claude-sonnet-4-6", "claude-sonnet-4-6-latest"].map((model) => ({
|
|
6
|
+
id: model,
|
|
7
|
+
cost: {
|
|
8
|
+
input: 3 / 1e6,
|
|
9
|
+
output: 15 / 1e6
|
|
10
|
+
}
|
|
11
|
+
})),
|
|
12
|
+
...["claude-opus-4-6", "claude-opus-4-6-latest"].map((model) => ({
|
|
13
|
+
id: model,
|
|
14
|
+
cost: {
|
|
15
|
+
input: 5 / 1e6,
|
|
16
|
+
output: 25 / 1e6
|
|
17
|
+
}
|
|
18
|
+
})),
|
|
19
|
+
...["claude-opus-4-5-20251101", "claude-opus-4-5-latest"].map((model) => ({
|
|
20
|
+
id: model,
|
|
21
|
+
cost: {
|
|
22
|
+
input: 5 / 1e6,
|
|
23
|
+
output: 25 / 1e6
|
|
24
|
+
}
|
|
25
|
+
})),
|
|
26
|
+
...[
|
|
27
|
+
"claude-opus-4-1-20250805",
|
|
28
|
+
"claude-opus-4-20250514",
|
|
29
|
+
"claude-opus-4-0",
|
|
30
|
+
"claude-opus-4-latest"
|
|
31
|
+
].map((model) => ({
|
|
32
|
+
id: model,
|
|
33
|
+
cost: {
|
|
34
|
+
input: 15 / 1e6,
|
|
35
|
+
output: 75 / 1e6
|
|
36
|
+
}
|
|
37
|
+
})),
|
|
38
|
+
...[
|
|
39
|
+
"claude-sonnet-4-5-20250929",
|
|
40
|
+
"claude-sonnet-4-5-latest",
|
|
41
|
+
"claude-sonnet-4-20250514",
|
|
42
|
+
"claude-sonnet-4-0",
|
|
43
|
+
"claude-sonnet-4-latest"
|
|
44
|
+
].map((model) => ({
|
|
45
|
+
id: model,
|
|
46
|
+
cost: {
|
|
47
|
+
input: 3 / 1e6,
|
|
48
|
+
output: 15 / 1e6
|
|
49
|
+
}
|
|
50
|
+
})),
|
|
51
|
+
...["claude-haiku-4-5-20251001", "claude-haiku-4-5-latest"].map((model) => ({
|
|
52
|
+
id: model,
|
|
53
|
+
cost: {
|
|
54
|
+
input: 1 / 1e6,
|
|
55
|
+
output: 5 / 1e6
|
|
56
|
+
}
|
|
57
|
+
})),
|
|
58
|
+
...["claude-2.0"].map((model) => ({
|
|
59
|
+
id: model,
|
|
60
|
+
cost: {
|
|
61
|
+
input: .008 / 1e3,
|
|
62
|
+
output: .024 / 1e3
|
|
63
|
+
}
|
|
64
|
+
})),
|
|
65
|
+
...["claude-2.1"].map((model) => ({
|
|
66
|
+
id: model,
|
|
67
|
+
cost: {
|
|
68
|
+
input: .008 / 1e3,
|
|
69
|
+
output: .024 / 1e3
|
|
70
|
+
}
|
|
71
|
+
})),
|
|
72
|
+
...["claude-3-haiku-20240307", "claude-3-haiku-latest"].map((model) => ({
|
|
73
|
+
id: model,
|
|
74
|
+
cost: {
|
|
75
|
+
input: 25e-5 / 1e3,
|
|
76
|
+
output: .00125 / 1e3
|
|
77
|
+
}
|
|
78
|
+
})),
|
|
79
|
+
...["claude-3-opus-20240229", "claude-3-opus-latest"].map((model) => ({
|
|
80
|
+
id: model,
|
|
81
|
+
cost: {
|
|
82
|
+
input: .015 / 1e3,
|
|
83
|
+
output: .075 / 1e3
|
|
84
|
+
}
|
|
85
|
+
})),
|
|
86
|
+
...["claude-3-5-haiku-20241022", "claude-3-5-haiku-latest"].map((model) => ({
|
|
87
|
+
id: model,
|
|
88
|
+
cost: {
|
|
89
|
+
input: .8 / 1e6,
|
|
90
|
+
output: 4 / 1e6
|
|
91
|
+
}
|
|
92
|
+
})),
|
|
93
|
+
...[
|
|
94
|
+
"claude-3-5-sonnet-20240620",
|
|
95
|
+
"claude-3-5-sonnet-20241022",
|
|
96
|
+
"claude-3-5-sonnet-latest",
|
|
97
|
+
"claude-3-7-sonnet-20250219",
|
|
98
|
+
"claude-3-7-sonnet-latest"
|
|
99
|
+
].map((model) => ({
|
|
100
|
+
id: model,
|
|
101
|
+
cost: {
|
|
102
|
+
input: 3 / 1e6,
|
|
103
|
+
output: 15 / 1e6
|
|
104
|
+
}
|
|
105
|
+
}))
|
|
106
|
+
];
|
|
107
|
+
function outputFromMessage(message, showThinking) {
|
|
108
|
+
const hasToolUse = message.content.some((block) => block.type === "tool_use");
|
|
109
|
+
const hasThinking = message.content.some((block) => block.type === "thinking" || block.type === "redacted_thinking");
|
|
110
|
+
if (hasToolUse || hasThinking) return message.content.map((block) => {
|
|
111
|
+
if (block.type === "text") return block.text;
|
|
112
|
+
else if (block.type === "thinking" && showThinking) return `Thinking: ${block.thinking}\nSignature: ${block.signature}`;
|
|
113
|
+
else if (block.type === "redacted_thinking" && showThinking) return `Redacted Thinking: ${block.data}`;
|
|
114
|
+
else if (block.type !== "thinking" && block.type !== "redacted_thinking") return JSON.stringify(block);
|
|
115
|
+
return "";
|
|
116
|
+
}).filter((text) => text !== "").join("\n\n");
|
|
117
|
+
return message.content.map((block) => {
|
|
118
|
+
return block.text;
|
|
119
|
+
}).join("\n\n");
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Automatically extracts base64 data from data URLs for Anthropic image content.
|
|
123
|
+
* This ensures compatibility with our universal data URL generation without requiring
|
|
124
|
+
* users to modify their prompt templates with Nunjucks filters.
|
|
125
|
+
*/
|
|
126
|
+
function processAnthropicImageContent(content) {
|
|
127
|
+
return content.map((item) => {
|
|
128
|
+
if (item.type === "image" && item.source && item.source.type === "base64") {
|
|
129
|
+
const parsed = parseDataUrl(item.source.data);
|
|
130
|
+
if (parsed) return {
|
|
131
|
+
...item,
|
|
132
|
+
source: {
|
|
133
|
+
...item.source,
|
|
134
|
+
media_type: item.source.media_type || parsed.mimeType,
|
|
135
|
+
data: parsed.base64Data
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
return item;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
function parseMessages(messages) {
|
|
143
|
+
try {
|
|
144
|
+
const parsed = JSON.parse(messages);
|
|
145
|
+
if (Array.isArray(parsed)) {
|
|
146
|
+
const systemMessage = parsed.find((msg) => msg.role === "system");
|
|
147
|
+
const thinking = parsed.find((msg) => msg.thinking)?.thinking;
|
|
148
|
+
return {
|
|
149
|
+
extractedMessages: parsed.filter((msg) => msg.role && msg.role !== "system").map((msg) => ({
|
|
150
|
+
role: msg.role,
|
|
151
|
+
content: Array.isArray(msg.content) ? processAnthropicImageContent(msg.content) : [{
|
|
152
|
+
type: "text",
|
|
153
|
+
text: msg.content
|
|
154
|
+
}]
|
|
155
|
+
})),
|
|
156
|
+
system: systemMessage ? Array.isArray(systemMessage.content) ? systemMessage.content : [{
|
|
157
|
+
type: "text",
|
|
158
|
+
text: systemMessage.content
|
|
159
|
+
}] : void 0,
|
|
160
|
+
thinking
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
} catch {}
|
|
164
|
+
const lines = messages.split("\n").map((line) => line.trim()).filter((line) => line);
|
|
165
|
+
let system;
|
|
166
|
+
let thinking;
|
|
167
|
+
const extractedMessages = [];
|
|
168
|
+
let currentRole = null;
|
|
169
|
+
let currentContent = [];
|
|
170
|
+
const pushMessage = () => {
|
|
171
|
+
if (currentRole && currentContent.length > 0) {
|
|
172
|
+
extractedMessages.push({
|
|
173
|
+
role: currentRole,
|
|
174
|
+
content: [{
|
|
175
|
+
type: "text",
|
|
176
|
+
text: currentContent.join("\n")
|
|
177
|
+
}]
|
|
178
|
+
});
|
|
179
|
+
currentContent = [];
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
for (const line of lines) if (line.startsWith("system:")) system = [{
|
|
183
|
+
type: "text",
|
|
184
|
+
text: line.slice(7).trim()
|
|
185
|
+
}];
|
|
186
|
+
else if (line.startsWith("thinking:")) try {
|
|
187
|
+
thinking = JSON.parse(line.slice(9).trim());
|
|
188
|
+
} catch {}
|
|
189
|
+
else if (line.startsWith("user:") || line.startsWith("assistant:")) {
|
|
190
|
+
pushMessage();
|
|
191
|
+
currentRole = line.startsWith("user:") ? "user" : "assistant";
|
|
192
|
+
currentContent.push(line.slice(line.indexOf(":") + 1).trim());
|
|
193
|
+
} else if (currentRole) currentContent.push(line);
|
|
194
|
+
else {
|
|
195
|
+
currentRole = "user";
|
|
196
|
+
currentContent.push(line);
|
|
197
|
+
}
|
|
198
|
+
pushMessage();
|
|
199
|
+
if (extractedMessages.length === 0 && !system) extractedMessages.push({
|
|
200
|
+
role: "user",
|
|
201
|
+
content: [{
|
|
202
|
+
type: "text",
|
|
203
|
+
text: messages.trim()
|
|
204
|
+
}]
|
|
205
|
+
});
|
|
206
|
+
return {
|
|
207
|
+
system,
|
|
208
|
+
extractedMessages,
|
|
209
|
+
thinking
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function calculateAnthropicCost(modelName, config, promptTokens, completionTokens) {
|
|
213
|
+
if ([
|
|
214
|
+
"claude-sonnet-4-5-20250929",
|
|
215
|
+
"claude-sonnet-4-5-latest",
|
|
216
|
+
"claude-sonnet-4-6",
|
|
217
|
+
"claude-sonnet-4-6-latest"
|
|
218
|
+
].includes(modelName) && Number.isFinite(promptTokens) && Number.isFinite(completionTokens) && typeof promptTokens !== "undefined" && typeof completionTokens !== "undefined") {
|
|
219
|
+
const inputCost = config.cost ?? (promptTokens > 2e5 ? 6 / 1e6 : 3 / 1e6);
|
|
220
|
+
const outputCost = config.cost ?? (promptTokens > 2e5 ? 22.5 / 1e6 : 15 / 1e6);
|
|
221
|
+
return inputCost * promptTokens + outputCost * completionTokens;
|
|
222
|
+
}
|
|
223
|
+
return calculateCost(modelName, config, promptTokens, completionTokens, ANTHROPIC_MODELS);
|
|
224
|
+
}
|
|
225
|
+
function getTokenUsage(data, cached) {
|
|
226
|
+
if (data.usage) {
|
|
227
|
+
const total_tokens = data.usage.input_tokens + data.usage.output_tokens;
|
|
228
|
+
if (cached) return {
|
|
229
|
+
cached: total_tokens,
|
|
230
|
+
total: total_tokens
|
|
231
|
+
};
|
|
232
|
+
else return {
|
|
233
|
+
total: total_tokens,
|
|
234
|
+
prompt: data.usage.input_tokens || 0,
|
|
235
|
+
completion: data.usage.output_tokens || 0
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
return {};
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Processes tools configuration to handle web fetch and web search tools
|
|
242
|
+
*/
|
|
243
|
+
function processAnthropicTools(tools = []) {
|
|
244
|
+
const processedTools = [];
|
|
245
|
+
const requiredBetaFeatures = [];
|
|
246
|
+
for (const tool of tools) if ("type" in tool) if (tool.type === "web_fetch_20250910") {
|
|
247
|
+
processedTools.push(transformWebFetchTool(tool));
|
|
248
|
+
if (!requiredBetaFeatures.includes("web-fetch-2025-09-10")) requiredBetaFeatures.push("web-fetch-2025-09-10");
|
|
249
|
+
} else if (tool.type === "web_search_20250305") processedTools.push(transformWebSearchTool(tool));
|
|
250
|
+
else processedTools.push(tool);
|
|
251
|
+
else {
|
|
252
|
+
processedTools.push(tool);
|
|
253
|
+
if ("strict" in tool && tool.strict === true) {
|
|
254
|
+
if (!requiredBetaFeatures.includes("structured-outputs-2025-11-13")) requiredBetaFeatures.push("structured-outputs-2025-11-13");
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return {
|
|
258
|
+
processedTools,
|
|
259
|
+
requiredBetaFeatures
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Transform web fetch tool config to Anthropic beta tool format
|
|
264
|
+
*/
|
|
265
|
+
function transformWebFetchTool(config) {
|
|
266
|
+
const tool = {
|
|
267
|
+
type: "web_fetch_20250910",
|
|
268
|
+
name: "web_fetch"
|
|
269
|
+
};
|
|
270
|
+
if (config.max_uses !== void 0) tool.max_uses = config.max_uses;
|
|
271
|
+
if (config.allowed_domains) tool.allowed_domains = config.allowed_domains;
|
|
272
|
+
if (config.blocked_domains) tool.blocked_domains = config.blocked_domains;
|
|
273
|
+
if (config.citations) tool.citations = config.citations;
|
|
274
|
+
if (config.max_content_tokens !== void 0) tool.max_content_tokens = config.max_content_tokens;
|
|
275
|
+
if (config.cache_control) tool.cache_control = config.cache_control;
|
|
276
|
+
return tool;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Transform web search tool config to Anthropic beta tool format
|
|
280
|
+
*/
|
|
281
|
+
function transformWebSearchTool(config) {
|
|
282
|
+
const tool = {
|
|
283
|
+
type: "web_search_20250305",
|
|
284
|
+
name: "web_search"
|
|
285
|
+
};
|
|
286
|
+
if (config.max_uses !== void 0) tool.max_uses = config.max_uses;
|
|
287
|
+
if (config.cache_control) tool.cache_control = config.cache_control;
|
|
288
|
+
return tool;
|
|
289
|
+
}
|
|
290
|
+
//#endregion
|
|
291
|
+
export { parseMessages as a, outputFromMessage as i, calculateAnthropicCost as n, processAnthropicTools as o, getTokenUsage as r, ANTHROPIC_MODELS as t };
|
|
292
|
+
|
|
293
|
+
//# sourceMappingURL=util-Bv6uGDfH.js.map
|