promptfoo 0.121.2 → 0.121.4
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 +2 -0
- package/dist/src/{ListApp-Du7YVwj5.js → ListApp-DQkFNqE9.js} +1 -1
- package/dist/src/{accounts-B0pgC1oV.js → accounts-DdJ2pHMI.js} +5 -5
- package/dist/src/{accounts-CiBLOnA7.js → accounts-DhMYUUbu.js} +5 -5
- package/dist/src/{accounts-gtkH-5KX.cjs → accounts-Dy17bs4D.cjs} +5 -5
- package/dist/src/{accounts-Bm2D8Db9.js → accounts-F9d_5sMC.js} +6 -6
- package/dist/src/{cometapi-C4xSqeID.cjs → agentic-utils-BpX5b23w.cjs} +24 -62
- package/dist/src/{cometapi-CUQq3H_a.js → agentic-utils-P172hM8B.js} +4 -61
- package/dist/src/agentic-utils-qFlm6zes.js +153 -0
- package/dist/src/{agentic-utils-DS1g3GLF.js → agentic-utils-w68v6_Dz.js} +3 -3
- package/dist/src/{agents-CmvBq8LV.js → agents-8FDnTriG.js} +6 -7
- package/dist/src/{agents-DbRtpYxR.cjs → agents-BahDpe5G.cjs} +255 -20
- package/dist/src/{agents-DgF2zDag.js → agents-C-R_jfzI.js} +255 -20
- package/dist/src/{agents-9qiOy0ho.js → agents-CgaMXvLM.js} +5 -7
- package/dist/src/{agents-Di9DKPzn.cjs → agents-D7-HGxUj.cjs} +5 -7
- package/dist/src/{agents-CBr9A01V.js → agents-DJ35I3Nt.js} +255 -20
- package/dist/src/{agents-cLXA8a_8.js → agents-aYPQLf8W.js} +5 -9
- package/dist/src/{agents-D__IdAlg.js → agents-pQeBEXMm.js} +255 -21
- package/dist/src/{aimlapi-B4rcnZgv.js → aimlapi-BCq3MHeL.js} +8 -14
- package/dist/src/{aimlapi-DHJU_kcV.js → aimlapi-BD6J9oKt.js} +7 -14
- package/dist/src/{aimlapi-BvlNH0gr.cjs → aimlapi-qcK4OT55.cjs} +8 -15
- package/dist/src/{aimlapi-CnkC2HqE.js → aimlapi-sgYnkE54.js} +7 -16
- package/dist/src/app/app/tsconfig.app.tsbuildinfo +1 -0
- package/dist/src/app/assets/Report-CQYFezYu.js +1 -0
- package/dist/src/app/assets/index-BXGkeMwh.css +1 -0
- package/dist/src/app/assets/index-BzJt18Jz.js +385 -0
- package/dist/src/app/assets/rolldown-runtime-COnpUsM8.js +1 -0
- package/dist/src/app/assets/scroll-timeline-D9IT_e8Z.js +1 -0
- package/dist/src/app/assets/sync-IjzpWrOE.js +4 -0
- package/dist/src/app/assets/vendor-charts-BNdH8TCw.js +36 -0
- package/dist/src/app/assets/vendor-markdown-Ch00wnNI.js +29 -0
- package/dist/src/app/assets/vendor-react-CVvmk1UB.js +9 -0
- package/dist/src/app/assets/vendor-utils-BnEYbx2Q.js +37 -0
- package/dist/src/app/index.html +7 -7
- package/dist/src/{audio-Dz3z7s3J.js → audio-B7izf48x.js} +4 -5
- package/dist/src/{audio-CGMyULza.cjs → audio-BQtNuYBj.cjs} +4 -4
- package/dist/src/{audio-Bkv46et0.js → audio-COrn8rM6.js} +4 -4
- package/dist/src/{audio-ClI_AFre.js → audio-DcVKoInv.js} +4 -4
- package/dist/src/{base-CGrhspbK.cjs → base-D-670DX8.cjs} +3 -3
- package/dist/src/{base-CpjcHe4e.js → base-PYJvBE1i.js} +3 -3
- package/dist/src/{base-Dy1V8--Z.js → base-fZ9wgg50.js} +3 -3
- package/dist/src/{base-DLKtKMFh.js → base-yrI1Yal4.js} +3 -3
- package/dist/src/{blobs-BDbfYdrJ.js → blobs-BCZavS8s.js} +4 -4
- package/dist/src/{blobs-CMHN0Qcz.js → blobs-BQWqnnvL.js} +4 -4
- package/dist/src/{blobs-CBO20krR.js → blobs-C-F78Kfn.js} +3 -3
- package/dist/src/{blobs-D23XLin-.cjs → blobs-D2FAd1Q5.cjs} +3 -3
- package/dist/src/cache-BIyPcp5v.cjs +376 -0
- package/dist/src/cache-C4Xb-hNb.js +310 -0
- package/dist/src/cache-Cr9oLMUa.js +3 -0
- package/dist/src/cache-D5NZmMiT.js +310 -0
- package/dist/src/cache-DbLsVWB2.cjs +3 -0
- package/dist/src/cache-mb7c8hbp.js +280 -0
- package/dist/src/{chat-C2jrdPMx.js → chat-0bwXjVP0.js} +3 -13
- package/dist/src/{chat-C1Qst7jL.cjs → chat-BPXSW8Bv.cjs} +3 -13
- package/dist/src/{chat-DJIw17u0.js → chat-BfPaS15_.js} +68 -42
- package/dist/src/{chat-CgF-J-Jj.cjs → chat-CclRbxGf.cjs} +68 -42
- package/dist/src/{chat-BiKyneZl.js → chat-Dr3DUQ0D.js} +68 -42
- package/dist/src/{chat-DqxYYtWA.js → chat-I9izLm49.js} +67 -41
- package/dist/src/{chat-CzkrVDfz.js → chat-MKxMnZJZ.js} +3 -13
- package/dist/src/{chat-qmatte1u.js → chat-mW0ORo8G.js} +3 -14
- package/dist/src/{chatkit-DKyPi1Gs.cjs → chatkit-BoWoSgXl.cjs} +4 -4
- package/dist/src/{chatkit-65VXf5SR.js → chatkit-CJnHRRMM.js} +4 -4
- package/dist/src/{chatkit-Be-Q-a9F.js → chatkit-Cv6AhukM.js} +4 -4
- package/dist/src/{chatkit-BxFvW8KY.js → chatkit-zUIVoDos.js} +4 -4
- package/dist/src/{claude-agent-sdk-Apiy0iaz.js → claude-agent-sdk-BQNuLaAK.js} +41 -18
- package/dist/src/{claude-agent-sdk-D9Z5Pr9X.cjs → claude-agent-sdk-CPJo3dBQ.cjs} +45 -22
- package/dist/src/{claude-agent-sdk-D2bJee9S.js → claude-agent-sdk-Dtq_L-Sc.js} +40 -17
- package/dist/src/{claude-agent-sdk-DfCoW0E6.js → claude-agent-sdk-nfAIcxNf.js} +42 -20
- package/dist/src/{cloud-C0dlstV_.js → cloud-DQZ5sVjW.js} +25 -13
- package/dist/src/cloud-Hphvo8kr.js +3 -0
- package/dist/src/{cloudflare-ai-8TDxHR0x.js → cloudflare-ai-BIB567w6.js} +5 -14
- package/dist/src/{cloudflare-ai-g7PB6VHR.js → cloudflare-ai-DGLte7Py.js} +5 -14
- package/dist/src/{cloudflare-ai-CknbZ5LJ.cjs → cloudflare-ai-Dl3N9OVD.cjs} +6 -15
- package/dist/src/{cloudflare-ai-BxAGvfju.js → cloudflare-ai-DlKr0rY7.js} +5 -15
- package/dist/src/{cloudflare-gateway-B9HWA5wf.js → cloudflare-gateway-BDZrYydE.js} +4 -16
- package/dist/src/{cloudflare-gateway-BSnDmHYo.cjs → cloudflare-gateway-BYDp495F.cjs} +4 -15
- package/dist/src/{cloudflare-gateway-CKDb4dJ8.js → cloudflare-gateway-CiIZHU0Q.js} +5 -164
- package/dist/src/{cloudflare-gateway-CP9QEWYS.js → cloudflare-gateway-DI1HNP5F.js} +4 -15
- package/dist/src/codex-sdk-BAmYE7qy.js +3 -0
- package/dist/src/codex-sdk-C2_M2pl_.cjs +1172 -0
- package/dist/src/codex-sdk-CErXn7qh.js +1165 -0
- package/dist/src/codex-sdk-CWEnH70W.cjs +2 -0
- package/dist/src/codex-sdk-CpqiOqDO.js +1164 -0
- package/dist/src/codex-sdk-Rtky3M4I.js +1165 -0
- package/dist/src/{cometapi-BL9yvj_f.js → cometapi-BUlt_ELa.js} +8 -15
- package/dist/src/{cometapi-DFNiKmSz.js → cometapi-CtJ-mS8R.js} +8 -16
- package/dist/src/cometapi-DT-jlVCB.js +55 -0
- package/dist/src/cometapi-UVOryo4W.cjs +55 -0
- package/dist/src/{completion-CM6oK8PS.cjs → completion-BozdoXba.cjs} +7 -62
- package/dist/src/{completion-5MzrpJxT.js → completion-Dnxn7E-j.js} +8 -57
- package/dist/src/{completion-qRoZAYRB.js → completion-HUe8wDhZ.js} +8 -57
- package/dist/src/{completion-DZ083F31.js → completion-x0a_c2y1.js} +8 -57
- package/dist/src/{createHash-CTQmL3G2.js → createHash-4gFQpDDv.js} +3 -3
- package/dist/src/{createHash-CfZSc0b4.cjs → createHash-B7KvgoOD.cjs} +4 -4
- package/dist/src/{createHash-Da8fMwqB.js → createHash-ChI45QR1.js} +3 -3
- package/dist/src/{createHash-DmPQkvBh.js → createHash-CwDVU5xr.js} +3 -3
- package/dist/src/{docker-ExVyLp0S.js → docker-CQmlA2NU.js} +7 -14
- package/dist/src/{docker-Bb5dcxr8.js → docker-ClnmCf1Z.js} +6 -14
- package/dist/src/{docker-BvfL2BrW.js → docker-DCgsveLD.js} +6 -16
- package/dist/src/{docker-DcF2pRrj.cjs → docker-DS4_Osau.cjs} +7 -15
- package/dist/src/embedding-D3xTseo7.js +59 -0
- package/dist/src/embedding-DD9wa3ae.js +58 -0
- package/dist/src/embedding-I45KG3o7.cjs +63 -0
- package/dist/src/embedding-nFbumxcv.js +58 -0
- package/dist/src/entrypoint.js +69 -6
- package/dist/src/{errors-P6ll7XSJ.js → errors-Cw810C93.js} +1 -1
- package/dist/src/{esm-CaIwzWR5.js → esm-C7PnfdF8.js} +16 -7
- package/dist/src/{esm-CnNt7sI4.cjs → esm-CtEPLdAj.cjs} +15 -6
- package/dist/src/{esm-Cd1AjG1D.js → esm-Dh4dOLlt.js} +15 -6
- package/dist/src/{esm-C03C-mv3.js → esm-tVgYPY-f.js} +27 -18
- package/dist/src/eval-CzJFfFO9.js +3 -0
- package/dist/src/{eval-Dg2nG4v2.js → eval-u4UVafl6.js} +49 -20
- package/dist/src/{evalResult-BDMqrapS.js → evalResult-Bgm9ZH31.js} +7 -7
- package/dist/src/{evalResult-BBRNtX4I.js → evalResult-D3hVYFis.js} +7 -7
- package/dist/src/evalResult-D8MT9p0s.js +3 -0
- package/dist/src/evalResult-DElBuddX.js +2 -0
- package/dist/src/evalResult-Dvc-iucu.cjs +2 -0
- package/dist/src/{evalResult-fuaI8HkH.cjs → evalResult-KZqXl4XP.cjs} +7 -7
- package/dist/src/evaluator-CVessDWe.js +3 -0
- package/dist/src/{evaluator-BhoWwp5b.js → evaluator-IvuDYSvQ.js} +3080 -1254
- package/dist/src/{extractor-D25qpmGX.js → extractor-CAfTSraf.js} +6 -6
- package/dist/src/{extractor-DReVID0K.js → extractor-DNSeBVOJ.js} +6 -6
- package/dist/src/{extractor-C0EVHewb.js → extractor-Dk6bRWkv.js} +6 -6
- package/dist/src/{extractor-pYLLi3wS.cjs → extractor-WVPOrH43.cjs} +6 -6
- package/dist/src/{fetch-HaqdX7U1.js → fetch-B0Z3Oe4k.js} +218 -55
- package/dist/src/{fetch-Dxpd4_sr.js → fetch-BEWnXrrG.js} +195 -45
- package/dist/src/fetch-C7bGKDlQ.js +3 -0
- package/dist/src/{fetch-BPkYtG8K.cjs → fetch-CJU5ELPa.cjs} +223 -48
- package/dist/src/{fetch-Cwxnd8zz.js → fetch-Di00EQrc.js} +218 -55
- package/dist/src/{fileExtensions-Ds-foDzt.js → fileExtensions-AWa2ZML4.js} +1 -1
- package/dist/src/{fileExtensions-LcDYkU4v.js → fileExtensions-BArZuxsI.js} +1 -1
- package/dist/src/{formatDuration-DgBVMN65.js → formatDuration-DZzPsexs.js} +1 -1
- package/dist/src/{genaiTracer-D3fD9dNV.js → genaiTracer-COYDi-tC.js} +6 -2
- package/dist/src/{genaiTracer-C1rxGO8Q.js → genaiTracer-DWdZ28hY.js} +6 -2
- package/dist/src/{genaiTracer-70Z8BIuV.js → genaiTracer-XnrcgDCe.js} +6 -2
- package/dist/src/{genaiTracer-DN4dQywX.cjs → genaiTracer-yRuxj9-L.cjs} +7 -3
- package/dist/src/golang/wrapper.go +1 -1
- package/dist/src/{graders-DU49_J8Y.cjs → graders--zknU_uk.cjs} +5747 -3206
- package/dist/src/graders-BOAzQEUe.cjs +2 -0
- package/dist/src/graders-D4BTsZdG2.js +3 -0
- package/dist/src/graders-DOJK1XpV.js +2 -0
- package/dist/src/graders-NAv9LcBn.js +2 -0
- package/dist/src/{graders-BTeBGqjJ.js → graders-Zy3x0zqX.js} +5727 -3218
- package/dist/src/{graders-Bj_Odv7c.js → graders-eIHhRqoC.js} +5719 -3210
- package/dist/src/{graders-DP7KFFo-.js → graders-pvbReLLn.js} +5728 -3219
- package/dist/src/{image-B0h9VEMc.js → image-9302QVqR.js} +4 -4
- package/dist/src/{image-CHfWvljl.js → image-B5Mv-Z3h.js} +8 -8
- package/dist/src/{image-DS-o-0ph.js → image-DVz2RiMF.js} +8 -8
- package/dist/src/{image-C1madmKh.cjs → image-De2FBmYV.cjs} +4 -4
- package/dist/src/{image-B02ogr_b.js → image-dnoUgPrC.js} +4 -5
- package/dist/src/{image-Dpxa1Jt6.js → image-qUpPvmNZ.js} +8 -8
- package/dist/src/{image-Bb4vWQLM.js → image-u7-rKnYU.js} +4 -4
- package/dist/src/{image-BLmROtN3.cjs → image-x6KqLQl4.cjs} +8 -8
- package/dist/src/index.cjs +3728 -1482
- package/dist/src/index.d.cts +3232 -79
- package/dist/src/index.d.ts +3232 -79
- package/dist/src/index.js +3735 -1490
- package/dist/src/{interactiveCheck-BgLZUIt3.js → interactiveCheck-CLERUB0c.js} +2 -2
- package/dist/src/{knowledgeBase-DOO_BM9b.cjs → knowledgeBase-Bpoe_nLu.cjs} +6 -8
- package/dist/src/{knowledgeBase-D33Ty2l6.js → knowledgeBase-Dgc7CBWF.js} +6 -8
- package/dist/src/{knowledgeBase-B3OoKIej.js → knowledgeBase-RhFPGWDc.js} +6 -8
- package/dist/src/{knowledgeBase-CYTLHOt1.js → knowledgeBase-lm9RXSAm.js} +6 -9
- package/dist/src/{litellm-NbjknEh6.js → litellm-C2kqjxqp.js} +6 -14
- package/dist/src/{litellm-I_hbp_dc.cjs → litellm-CoyI4IAl.cjs} +6 -15
- package/dist/src/{litellm-TrljxD9G.js → litellm-DRjpcSa7.js} +5 -14
- package/dist/src/{litellm-AaeZcZQF.js → litellm-p37R1dzQ.js} +5 -16
- package/dist/src/{logger-DLcq4dWf.js → logger-B88EkIn6.js} +48 -23
- package/dist/src/{logger-Cp1GPUjj.cjs → logger-COuQb2xB.cjs} +77 -22
- package/dist/src/{logger-CT3IKMKA.js → logger-Ct2S6Yx-.js} +48 -23
- package/dist/src/{logger-KkObSCzq.js → logger-DksKw1Qc.js} +48 -23
- package/dist/src/{luma-ray-f6I2fft-.js → luma-ray-B863CmuZ.js} +6 -10
- package/dist/src/{luma-ray-DDsjcgZZ.js → luma-ray-BTTLtqQ8.js} +7 -10
- package/dist/src/{luma-ray-Due0n7di.cjs → luma-ray-BxVKaW2a.cjs} +6 -10
- package/dist/src/{luma-ray-BS2_tY8L.js → luma-ray-KgTCXrZC.js} +6 -12
- package/dist/src/main.d.ts +1 -26
- package/dist/src/main.js +1011 -548
- package/dist/src/{messages-Bs1kC7P4.cjs → messages-811uVVW5.cjs} +74 -19
- package/dist/src/{messages-BS17jdMx.js → messages-BTQz42fn.js} +74 -19
- package/dist/src/{messages-ZJk778GH.js → messages-MYTQ2TWp.js} +74 -19
- package/dist/src/{messages-D0lx5qK7.js → messages-zWbkLLHz.js} +74 -19
- package/dist/src/{meteor-D-SotUw9.js → meteor-CU5UAE-H.js} +1 -1
- package/dist/src/{meteor-DLZZ3osF.cjs → meteor-Co1VQ1u5.cjs} +1 -1
- package/dist/src/{meteor-44VjEACX.js → meteor-DHdzY1Ss.js} +1 -1
- package/dist/src/{meteor-DUiCJRC-.js → meteor-DuAFv6gF.js} +1 -1
- package/dist/src/{modelslab-Bmni6skY.js → modelslab-D0erNWKe.js} +7 -10
- package/dist/src/{modelslab-DRb74SP4.js → modelslab-DIq-6y7x.js} +7 -10
- package/dist/src/{modelslab-CoUX6Jc_.cjs → modelslab-Dk1JAtVo.cjs} +7 -10
- package/dist/src/{modelslab-Bx9IrZfS.js → modelslab-wu9yi5GE.js} +7 -11
- package/dist/src/{nova-reel-BfPq-0Yk.js → nova-reel-CCFRfeRb.js} +7 -10
- package/dist/src/{nova-reel-C_QM18Xn.cjs → nova-reel-CrLXVKQf.cjs} +6 -10
- package/dist/src/{nova-reel-bgjxilYW.js → nova-reel-DQrm74ng.js} +6 -10
- package/dist/src/{nova-reel-D_W1tjMH.js → nova-reel-gr11WG7f.js} +6 -12
- package/dist/src/{nova-sonic-DIGQNR07.js → nova-sonic-BYdp-QLs.js} +5 -7
- package/dist/src/{nova-sonic-CFb5GYhg.js → nova-sonic-B_ZXcUJB.js} +4 -7
- package/dist/src/{nova-sonic-De1HW5fD.js → nova-sonic-TDgrlTk7.js} +4 -9
- package/dist/src/{nova-sonic-zfcljeRp.cjs → nova-sonic-i5tUvXKn.cjs} +4 -7
- package/dist/src/{openai-DElQ-fPX.js → openai-DhVEmgeZ.js} +6 -3
- package/dist/src/{openai-DhbB7eWK.js → openai-Qsvz25mV.js} +6 -3
- package/dist/src/{openai-Cuif0GEt.cjs → openai-URNyItar.cjs} +6 -3
- package/dist/src/{openai-j-sE2O7r.js → openai-iYtrXzOX.js} +6 -3
- package/dist/src/openclaw-CLWrW03k.js +1200 -0
- package/dist/src/openclaw-CnQ363Wi.js +1199 -0
- package/dist/src/openclaw-CwzlQSQX.js +1199 -0
- package/dist/src/openclaw-wX9rtfke.cjs +1205 -0
- package/dist/src/{opencode-sdk-B3CWY9h_.js → opencode-sdk-BUu5Nevv.js} +12 -14
- package/dist/src/{opencode-sdk-BL764Jdi.cjs → opencode-sdk-BZ2idgYA.cjs} +16 -18
- package/dist/src/{opencode-sdk-0j6rTWNb.js → opencode-sdk-BxD8vXp_.js} +12 -15
- package/dist/src/{opencode-sdk-C2y6UkP2.js → opencode-sdk-GI2KaAXq.js} +12 -14
- package/dist/src/{otlpReceiver-C99PPb48.js → otlpReceiver-B2z58l4e.js} +154 -98
- package/dist/src/{otlpReceiver-CGq6LspY.cjs → otlpReceiver-BfcVq2Nq.cjs} +154 -98
- package/dist/src/{otlpReceiver-D89fR-rC.js → otlpReceiver-BntK801g.js} +154 -98
- package/dist/src/{otlpReceiver-CdNBdbsk.js → otlpReceiver-DmVulbhC.js} +154 -98
- package/dist/src/{providerRegistry-CD8MEar9.js → providerRegistry-Bvh8mv85.js} +2 -2
- package/dist/src/{providerRegistry-DM8rZYol.js → providerRegistry-CPQ_CmVO.js} +2 -2
- package/dist/src/{providerRegistry-Civky8Ar.cjs → providerRegistry-CQMdTmHP.cjs} +2 -2
- package/dist/src/{providerRegistry-B0RUOLI_.js → providerRegistry-CWoPjKFZ.js} +2 -2
- package/dist/src/{providers-CgKOSgTR.cjs → providers-1eKkXBKp.cjs} +1435 -930
- package/dist/src/{providers-BlqUifFg.js → providers-BV_KMZje.js} +1419 -944
- package/dist/src/providers-Bp4S-FvO.js +2 -0
- package/dist/src/providers-DV3ax9e_.cjs +3 -0
- package/dist/src/{providers-D8lF1sqW.js → providers-Domz_llv.js} +1427 -952
- package/dist/src/{providers-Dk_6ocUX.js → providers-DruaQfwu.js} +1424 -949
- package/dist/src/providers-iUt5fbAN.js +3 -0
- package/dist/src/providers-u9Enmfok.js +2 -0
- package/dist/src/python/persistent_wrapper.py +0 -5
- package/dist/src/{pythonUtils-D6fwaDSg.js → pythonUtils-C2UQ30Rz.js} +4 -4
- package/dist/src/{pythonUtils-D5nxkQ0P.js → pythonUtils-Cldx7huE.js} +4 -4
- package/dist/src/{pythonUtils-C3py6GC1.js → pythonUtils-CnndUbW-.js} +3 -3
- package/dist/src/{pythonUtils-CTU3Y3lw.cjs → pythonUtils-tAJvvpS-.cjs} +3 -3
- package/dist/src/{quiverai-CIaELU_m.js → quiverai-CtWi6x_g.js} +4 -4
- package/dist/src/{quiverai-PdShCPox.cjs → quiverai-DFotyafY.cjs} +4 -4
- package/dist/src/{quiverai-BbOUOn2L.js → quiverai-DR0SnIQV.js} +4 -4
- package/dist/src/{quiverai-uH-dcTIr.js → quiverai-aPPvXOgn.js} +4 -5
- package/dist/src/render-CH-62LbA.js +135 -0
- package/dist/src/render-CMEpfLaO.js +136 -0
- package/dist/src/{render-Drod8m7K.js → render-CgVDrJmM.js} +2 -3
- package/dist/src/render-DHIZ6_k8.js +135 -0
- package/dist/src/render-DfQSFxGE.cjs +165 -0
- package/dist/src/{responses-DIR9Ud3j.js → responses--OsX2aYW.js} +23 -14
- package/dist/src/{responses-D8SBTL64.cjs → responses-Bi9vBuW_.cjs} +24 -15
- package/dist/src/{responses-CB2jwoAr.js → responses-C-flexAY.js} +24 -15
- package/dist/src/{responses-WNGNYe3K.js → responses-DL9m8CyY.js} +24 -15
- package/dist/src/{rubyUtils-DhCAlxZr.cjs → rubyUtils-B6eljPuh.cjs} +3 -3
- package/dist/src/{rubyUtils-BcuGX77l.js → rubyUtils-CYSQEG4a.js} +3 -3
- package/dist/src/rubyUtils-D1L2d3jb.js +3 -0
- package/dist/src/rubyUtils-DUbq4tff.cjs +2 -0
- package/dist/src/{rubyUtils-BUVePouc.js → rubyUtils-DVLeA2jg.js} +3 -3
- package/dist/src/{rubyUtils-Boc4HZzX.js → rubyUtils-DsGrTx8R.js} +3 -3
- package/dist/src/{sagemaker-CNBxx5CJ.js → sagemaker-BVkaG2-l.js} +14 -18
- package/dist/src/{sagemaker-CemTFp2h.js → sagemaker-BveBvuxm.js} +14 -18
- package/dist/src/{sagemaker-YSyBXQQh.js → sagemaker-D67yzMzs.js} +14 -19
- package/dist/src/{sagemaker-Cl28mZU2.cjs → sagemaker-XnfhheQv.cjs} +14 -18
- package/dist/src/{scanner-BsBlNXNn.js → scanner-1DqWi1Ej.js} +130 -35
- package/dist/src/server/golang/wrapper.go +1 -1
- package/dist/src/server/index.js +3757 -1511
- package/dist/src/server/python/persistent_wrapper.py +0 -5
- package/dist/src/{server-CqzrVGpF.js → server-BNYztJkh.js} +128 -9
- package/dist/src/{server-CuxBbeSY.js → server-BSB45Nt9.js} +127 -8
- package/dist/src/{server-VWgWb00X.js → server-D6Il2Sob.js} +126 -7
- package/dist/src/server-DCtHUqlp.js +3 -0
- package/dist/src/server-DaA2eR26.cjs +2 -0
- package/dist/src/{server-C_7Ax-hA.cjs → server-Dx2TyCH2.cjs} +140 -6
- package/dist/src/{signal-4U3mfRvL.js → signal-CE5G3a7x.js} +3 -3
- package/dist/src/{slack-BmVAVGaK.cjs → slack-1Rhq0EoV.cjs} +2 -2
- package/dist/src/{slack-DCUPTzS2.js → slack-D5Wpy8LM.js} +2 -2
- package/dist/src/{slack-DXMKtA-f.js → slack-DDUe-5MC.js} +2 -2
- package/dist/src/{slack-DOdy_kyv.js → slack-acRb0IqQ.js} +2 -2
- package/dist/src/store-CWOSz6D_.cjs +2 -0
- package/dist/src/{store-Dim__MDd.js → store-CYEy5J2D.js} +17 -5
- package/dist/src/{store-DLlFCC4h.cjs → store-DAAyxcy6.cjs} +17 -5
- package/dist/src/store-DCDBhv7B.js +3 -0
- package/dist/src/{store-CXGFv4aR.js → store-Dn9HUkdW.js} +17 -5
- package/dist/src/{store-DXilxTl-.js → store-M0b1WfYb.js} +17 -5
- package/dist/src/{tables-gftXzE9I.js → tables-C4CH3zRr.js} +3 -3
- package/dist/src/{tables-DLJPUdUE.js → tables-CsWou1Bx.js} +3 -3
- package/dist/src/{tables-6YKwjN9-.js → tables-DQ4WU5tX.js} +3 -3
- package/dist/src/{tables-DPi7wKeM.cjs → tables-DUfh1F7Z.cjs} +3 -3
- package/dist/src/telemetry-C1IqxcdW.js +3 -0
- package/dist/src/telemetry-C4ZEa_es.cjs +2 -0
- package/dist/src/{telemetry-CMrFgtPB.js → telemetry-CQPez_Jp.js} +4 -4
- package/dist/src/{telemetry-DaX14Chu.cjs → telemetry-Dsw_faFj.cjs} +4 -4
- package/dist/src/{telemetry-Dthj_BbD.js → telemetry-Dvqxv3YC.js} +4 -4
- package/dist/src/{telemetry-Cps3mIU-.js → telemetry-dbaJ0E98.js} +4 -4
- package/dist/src/{text-CW1cyrwj.cjs → text-BVi-cLPJ.cjs} +1 -1
- package/dist/src/{text-B_UCRPp2.js → text-CZr46tp_.js} +1 -1
- package/dist/src/{text-TIv0QYnd.js → text-DHxdyQqT.js} +1 -1
- package/dist/src/{text-Db-Wt2u2.js → text-KvuD2Iko.js} +1 -1
- package/dist/src/{tokenUsageUtils-bVa1ga6f.cjs → tokenUsageUtils-Bb7DkZPz.cjs} +7 -3
- package/dist/src/{tokenUsageUtils-NYT-WKS6.js → tokenUsageUtils-C-bmyHoE.js} +7 -3
- package/dist/src/{tokenUsageUtils-DflFMjS0.js → tokenUsageUtils-CXrvO-wA.js} +7 -3
- package/dist/src/{transcription-NLVG9MT1.cjs → transcription-BvjmiYB1.cjs} +12 -16
- package/dist/src/{transcription-BNYURcXg.js → transcription-CJspiD2c.js} +11 -14
- package/dist/src/{transcription-B_OdaHp7.js → transcription-DuWDupG7.js} +10 -14
- package/dist/src/{transcription-s6A-bNrZ.js → transcription-V2HaAmy2.js} +10 -16
- package/dist/src/{transform-DECvGmzp.js → transform-Bbg6A8Jk.js} +4 -4
- package/dist/src/{transform-vNucnNr0.js → transform-CG0ehZNG.js} +11 -7
- package/dist/src/{transform-DuHvhZpj.cjs → transform-CTeuTR3S.cjs} +31 -9
- package/dist/src/{transform-CzK1Q0zl.cjs → transform-CUnzlsbn.cjs} +4 -4
- package/dist/src/{transform-aa6tmVpZ.js → transform-DYX1_Xnh.js} +5 -5
- package/dist/src/transform-DgKlRr73.cjs +2 -0
- package/dist/src/transform-M6ITAESf.js +3 -0
- package/dist/src/{transform-DilY9wbS.js → transform-UN5UGu8U.js} +5 -5
- package/dist/src/{transform-uAytVuyX.js → transform-lQrDE1BQ.js} +11 -7
- package/dist/src/{transform-D5HsjduX.js → transform-zDhMmzwX.js} +11 -7
- package/dist/src/{transformersAvailability-CEVM2GNQ.js → transformersAvailability-CcHusyhw.js} +1 -1
- package/dist/src/{transformersAvailability-CwayUSlh.cjs → transformersAvailability-Cju9mHgR.cjs} +1 -1
- package/dist/src/{transformersAvailability-D6c6ROpT.js → transformersAvailability-DLlROWhg.js} +1 -1
- package/dist/src/{types-DmyIJ-sR.js → types-BGQDAP8i.js} +357 -22
- package/dist/src/{types-CzW2QFyi.js → types-Bgh5SOn6.js} +358 -24
- package/dist/src/{types-C_7nyzr1.cjs → types-CeaeaZdP.cjs} +393 -22
- package/dist/src/{types-Cbd8uOMq.js → types-Dm9JM6Vb.js} +368 -23
- package/dist/src/{util-BHGHw5G1.js → util-BYvQUPp7.js} +138 -36
- package/dist/src/{util-B9vlHIIh.cjs → util-Bxn8emtE.cjs} +15 -168
- package/dist/src/{util-ZzmqNPlg.js → util-C8e5uydV.js} +19 -142
- package/dist/src/{util-CMy69ZgQ.js → util-C9J8ahRn.js} +18 -4
- package/dist/src/{util-BzMcevZc.cjs → util-CN3SrLT4.cjs} +18 -4
- package/dist/src/{util-BV4XUC0n.js → util-D3q0WQ-0.js} +18 -4
- package/dist/src/{util-Dnmk2mBQ.js → util-D9TisOyk.js} +18 -4
- package/dist/src/{util-B3xGByQh.js → util-DDs-7g6-.js} +138 -36
- package/dist/src/{util-Bv6uGDfH.js → util-DvU2Pw8c.js} +138 -36
- package/dist/src/{util-C1CeHl-P.js → util-DxWpWjhc.js} +13 -136
- package/dist/src/{util-BRYkYPTd.js → util-oGMLA7vc.js} +17 -140
- package/dist/src/{util-DGNOS1db.cjs → util-olYL5C6N.cjs} +143 -35
- package/dist/src/{utils-Cz9qXqII.cjs → utils-B05gLxER.cjs} +6 -4
- package/dist/src/{utils-f2-Moju7.js → utils-BLJKfv0y.js} +6 -4
- package/dist/src/{utils-dLokC-eR.js → utils-DJfvjyMj.js} +6 -4
- package/dist/src/{utils-XiOAgly5.js → utils-hXtCYanr.js} +6 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +66 -57
- package/dist/src/app/assets/index-4LKxG2CG.js +0 -439
- package/dist/src/app/assets/index-C3zcsZFQ.css +0 -1
- package/dist/src/app/assets/scroll-timeline-BdJZVXlz.js +0 -1
- package/dist/src/app/assets/sync-9qqYcY-B.js +0 -4
- package/dist/src/app/assets/vendor-charts-BnDWwBlI.js +0 -36
- package/dist/src/app/assets/vendor-markdown-0tekx3KX.js +0 -29
- package/dist/src/app/assets/vendor-react-AtKqiNEf.js +0 -4
- package/dist/src/app/assets/vendor-syntax-D06x6TQF.js +0 -2
- package/dist/src/app/assets/vendor-utils-BvMHZmO7.js +0 -37
- package/dist/src/app/tsconfig.app.tsbuildinfo +0 -1
- package/dist/src/cache-BVeDlD87.js +0 -726
- package/dist/src/cache-C4Nxf52C.js +0 -756
- package/dist/src/cache-CeUpFm3M.cjs +0 -5
- package/dist/src/cache-Dh5WtQps.cjs +0 -816
- package/dist/src/cache-i1P6crbO.js +0 -756
- package/dist/src/cache-n-RCJ-hL.js +0 -6
- package/dist/src/cloud-BBh91EUK.js +0 -4
- package/dist/src/codex-sdk-C6UMlxwV.js +0 -665
- package/dist/src/codex-sdk-DUwKWezN.js +0 -665
- package/dist/src/codex-sdk-GGAw0qbD.js +0 -666
- package/dist/src/codex-sdk-fAO0c3yA.cjs +0 -669
- package/dist/src/eval-B3r2CVXr.js +0 -15
- package/dist/src/evalResult-5xwYnECe.js +0 -12
- package/dist/src/evalResult-71lY93Kj.cjs +0 -10
- package/dist/src/evalResult-Dx5P5cIv.js +0 -10
- package/dist/src/evaluator-Jx6bRZV6.js +0 -36
- package/dist/src/fetch-BxNb_Lp3.js +0 -5
- package/dist/src/graders-B_pgMLS2.js +0 -34
- package/dist/src/graders-DErokPDO.cjs +0 -32
- package/dist/src/graders-DR_uNe54.js +0 -32
- package/dist/src/graders-w3176Wz-.js +0 -32
- package/dist/src/openclaw-CSugPYAr.cjs +0 -586
- package/dist/src/openclaw-DiSz3I5L.js +0 -582
- package/dist/src/openclaw-DuvJKEW5.js +0 -580
- package/dist/src/openclaw-tiVYRtr-.js +0 -580
- package/dist/src/providers-B7V0njNs.js +0 -32
- package/dist/src/providers-BEwbhv0X.js +0 -30
- package/dist/src/providers-CH3C7zf7.js +0 -30
- package/dist/src/providers-zyB6k_38.cjs +0 -31
- package/dist/src/rubyUtils-BUHu6PhO.js +0 -5
- package/dist/src/rubyUtils-CP42kMvq.cjs +0 -4
- package/dist/src/server-DA4Cyrrq.js +0 -7
- package/dist/src/server-Dulb-4-K.cjs +0 -5
- package/dist/src/store-CXS-Q_91.js +0 -6
- package/dist/src/store-eYkaKMwq.cjs +0 -5
- package/dist/src/telemetry-BpMfhthR.cjs +0 -5
- package/dist/src/telemetry-Dw38hanS.js +0 -7
- package/dist/src/tokenUsageUtils-BDGe-iyI.js +0 -138
- package/dist/src/transform-DTGDnAzW.js +0 -6
- package/dist/src/transform-m3qNw4KP.cjs +0 -5
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { S as getEnvBool, a as logger, f as sanitizeObject, k as state } from "./logger-B88EkIn6.js";
|
|
2
|
+
import { A as TERMINAL_MAX_WIDTH, I as VERSION, t as fetchWithProxy } from "./fetch-B0Z3Oe4k.js";
|
|
3
3
|
import { t as invariant } from "./invariant-vgHWClmd.js";
|
|
4
|
-
import { o as safeResolve, r as importModule, t as getDirectory } from "./esm-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { o as safeResolve, r as importModule, t as getDirectory } from "./esm-Dh4dOLlt.js";
|
|
5
|
+
import { a as getNunjucksEngine, n as renderVarsInObject } from "./render-DHIZ6_k8.js";
|
|
6
|
+
import { m as isProviderOptions, o as OutputFileExtension, p as isApiProvider, s as ResultFailureReason } from "./types-Bgh5SOn6.js";
|
|
7
|
+
import { i as isJavascriptFile, t as JAVASCRIPT_EXTENSIONS } from "./fileExtensions-BArZuxsI.js";
|
|
8
|
+
import { r as runPython } from "./pythonUtils-Cldx7huE.js";
|
|
8
9
|
import dotenv from "dotenv";
|
|
9
|
-
import * as fs$
|
|
10
|
+
import * as fs$2 from "fs";
|
|
10
11
|
import * as path$1 from "path";
|
|
11
12
|
import path from "path";
|
|
12
13
|
import * as os$1 from "os";
|
|
13
14
|
import yaml from "js-yaml";
|
|
14
15
|
import * as fsPromises from "fs/promises";
|
|
15
16
|
import dedent from "dedent";
|
|
17
|
+
import nunjucks from "nunjucks";
|
|
16
18
|
import { parse as parse$1 } from "csv-parse/sync";
|
|
17
19
|
import { globSync, hasMagic } from "glob";
|
|
18
|
-
import nunjucks from "nunjucks";
|
|
19
20
|
import deepEqual from "fast-deep-equal";
|
|
20
21
|
import { XMLBuilder } from "fast-xml-parser";
|
|
21
22
|
import { stringify } from "csv-stringify/sync";
|
|
@@ -67,130 +68,6 @@ function parseFileUrl(fileUrl) {
|
|
|
67
68
|
return { filePath: urlWithoutProtocol };
|
|
68
69
|
}
|
|
69
70
|
//#endregion
|
|
70
|
-
//#region src/util/templates.ts
|
|
71
|
-
/**
|
|
72
|
-
* Get a Nunjucks engine instance with optional filters and configuration.
|
|
73
|
-
* @param filters - Optional map of custom Nunjucks filters.
|
|
74
|
-
* @param throwOnUndefined - Whether to throw an error on undefined variables.
|
|
75
|
-
* @param isGrader - Whether this engine is being used in a grader context.
|
|
76
|
-
* Nunjucks is always enabled in grader mode.
|
|
77
|
-
* @returns A configured Nunjucks environment.
|
|
78
|
-
*/
|
|
79
|
-
function getNunjucksEngine(filters, throwOnUndefined = false, isGrader = false) {
|
|
80
|
-
if (!isGrader && getEnvBool("PROMPTFOO_DISABLE_TEMPLATING")) return { renderString: (template) => template };
|
|
81
|
-
const env = nunjucks.configure({
|
|
82
|
-
autoescape: false,
|
|
83
|
-
throwOnUndefined
|
|
84
|
-
});
|
|
85
|
-
const envGlobals = {
|
|
86
|
-
...getEnvBool("PROMPTFOO_DISABLE_TEMPLATE_ENV_VARS", getEnvBool("PROMPTFOO_SELF_HOSTED", false)) ? {} : process.env,
|
|
87
|
-
...state.config?.env
|
|
88
|
-
};
|
|
89
|
-
env.addGlobal("env", envGlobals);
|
|
90
|
-
env.addFilter("load", function(str) {
|
|
91
|
-
return JSON.parse(str);
|
|
92
|
-
});
|
|
93
|
-
if (filters) for (const [name, filter] of Object.entries(filters)) env.addFilter(name, filter);
|
|
94
|
-
return env;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Parse Nunjucks template to extract variables.
|
|
98
|
-
* @param template - The Nunjucks template string.
|
|
99
|
-
* @returns An array of variables used in the template.
|
|
100
|
-
*/
|
|
101
|
-
function extractVariablesFromTemplate(template) {
|
|
102
|
-
const variableSet = /* @__PURE__ */ new Set();
|
|
103
|
-
const regex = /\{\{[\s]*([^{}\s|]+)[\s]*(?:\|[^}]+)?\}\}|\{%[\s]*(?:if|for)[\s]+([^{}\s]+)[\s]*.*?%\}/g;
|
|
104
|
-
template = template.replace(/\{#[\s\S]*?#\}/g, "");
|
|
105
|
-
let match;
|
|
106
|
-
while ((match = regex.exec(template)) !== null) {
|
|
107
|
-
const variable = match[1] || match[2];
|
|
108
|
-
if (variable) variableSet.add(variable);
|
|
109
|
-
}
|
|
110
|
-
const forLoopRegex = /\{%[\s]*for[\s]+(\w+)[\s]+in[\s]+(\w+)[\s]*%\}/g;
|
|
111
|
-
while ((match = forLoopRegex.exec(template)) !== null) {
|
|
112
|
-
variableSet.delete(match[1]);
|
|
113
|
-
variableSet.add(match[2]);
|
|
114
|
-
}
|
|
115
|
-
return Array.from(variableSet);
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Extract variables from multiple Nunjucks templates.
|
|
119
|
-
* @param templates - An array of Nunjucks template strings.
|
|
120
|
-
* @returns An array of variables used in the templates.
|
|
121
|
-
*/
|
|
122
|
-
function extractVariablesFromTemplates(templates) {
|
|
123
|
-
const variableSet = /* @__PURE__ */ new Set();
|
|
124
|
-
for (const template of templates) extractVariablesFromTemplate(template).forEach((variable) => variableSet.add(variable));
|
|
125
|
-
return Array.from(variableSet);
|
|
126
|
-
}
|
|
127
|
-
//#endregion
|
|
128
|
-
//#region src/util/render.ts
|
|
129
|
-
/**
|
|
130
|
-
* Renders ONLY environment variable templates in an object, leaving all other templates untouched.
|
|
131
|
-
* This allows env vars to be resolved at provider load time while preserving runtime var templates.
|
|
132
|
-
*
|
|
133
|
-
* Supports full Nunjucks syntax for env vars including filters and expressions:
|
|
134
|
-
* - {{ env.VAR_NAME }}
|
|
135
|
-
* - {{ env['VAR-NAME'] }}
|
|
136
|
-
* - {{ env["VAR-NAME"] }}
|
|
137
|
-
* - {{ env.VAR | default('fallback') }}
|
|
138
|
-
* - {{ env.VAR | upper }}
|
|
139
|
-
*
|
|
140
|
-
* Preserves non-env templates for runtime rendering:
|
|
141
|
-
* - {{ vars.x }} - preserved as literal
|
|
142
|
-
* - {{ prompt }} - preserved as literal
|
|
143
|
-
*
|
|
144
|
-
* Implementation: Uses regex to find env templates, delegates to Nunjucks for rendering.
|
|
145
|
-
* This ensures full Nunjucks feature support while preserving non-env templates.
|
|
146
|
-
*
|
|
147
|
-
* @param obj - The object to process
|
|
148
|
-
* @param envOverrides - Optional env vars to merge with (or replace) the base env
|
|
149
|
-
* @param replaceBase - If true, envOverrides replaces the base env entirely instead of merging
|
|
150
|
-
* @returns The object with only env templates rendered
|
|
151
|
-
*/
|
|
152
|
-
function renderEnvOnlyInObject(obj, envOverrides, replaceBase) {
|
|
153
|
-
if (getEnvBool("PROMPTFOO_DISABLE_TEMPLATING")) return obj;
|
|
154
|
-
if (typeof obj === "string") {
|
|
155
|
-
const nunjucks = getNunjucksEngine();
|
|
156
|
-
const baseEnvGlobals = nunjucks.getGlobal("env");
|
|
157
|
-
const envGlobals = replaceBase ? envOverrides ?? {} : envOverrides ? {
|
|
158
|
-
...baseEnvGlobals,
|
|
159
|
-
...envOverrides
|
|
160
|
-
} : baseEnvGlobals;
|
|
161
|
-
return obj.replace(/\{\{(?:[^}]|\}(?!\}))*\}\}/g, (match) => {
|
|
162
|
-
if (!match.match(/\benv\.|env\[/)) return match;
|
|
163
|
-
const varMatch = match.match(/env\.(\w+)|env\[['"]([^'"]+)['"]\]/);
|
|
164
|
-
const varName = varMatch?.[1] || varMatch?.[2];
|
|
165
|
-
if (match.includes("|") || varName && varName in envGlobals && envGlobals[varName] !== void 0) try {
|
|
166
|
-
return nunjucks.renderString(match, { env: envGlobals });
|
|
167
|
-
} catch (error) {
|
|
168
|
-
logger.debug(`Failed to render env template "${match}": ${error instanceof Error ? error.message : String(error)}`);
|
|
169
|
-
return match;
|
|
170
|
-
}
|
|
171
|
-
return match;
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
if (Array.isArray(obj)) return obj.map((item) => renderEnvOnlyInObject(item, envOverrides, replaceBase));
|
|
175
|
-
if (typeof obj === "object" && obj !== null) {
|
|
176
|
-
const result = {};
|
|
177
|
-
for (const key in obj) result[key] = renderEnvOnlyInObject(obj[key], envOverrides, replaceBase);
|
|
178
|
-
return result;
|
|
179
|
-
}
|
|
180
|
-
return obj;
|
|
181
|
-
}
|
|
182
|
-
function renderVarsInObject(obj, vars) {
|
|
183
|
-
if (!vars || getEnvBool("PROMPTFOO_DISABLE_TEMPLATING")) return obj;
|
|
184
|
-
if (typeof obj === "string") return getNunjucksEngine().renderString(obj, vars);
|
|
185
|
-
if (Array.isArray(obj)) return obj.map((item) => renderVarsInObject(item, vars));
|
|
186
|
-
if (typeof obj === "object" && obj !== null) {
|
|
187
|
-
const result = {};
|
|
188
|
-
for (const key in obj) result[key] = renderVarsInObject(obj[key], vars);
|
|
189
|
-
return result;
|
|
190
|
-
} else if (typeof obj === "function") return renderVarsInObject(obj({ vars }));
|
|
191
|
-
return obj;
|
|
192
|
-
}
|
|
193
|
-
//#endregion
|
|
194
71
|
//#region src/util/file.ts
|
|
195
72
|
/**
|
|
196
73
|
* Simple Nunjucks engine specifically for file paths
|
|
@@ -244,7 +121,7 @@ function maybeLoadFromExternalFile(filePath, context) {
|
|
|
244
121
|
for (const matchedFile of matchedFiles) {
|
|
245
122
|
let contents;
|
|
246
123
|
try {
|
|
247
|
-
contents = fs$
|
|
124
|
+
contents = fs$2.readFileSync(matchedFile, "utf8");
|
|
248
125
|
} catch (error) {
|
|
249
126
|
if (error.code === "ENOENT") {
|
|
250
127
|
logger.debug(`File disappeared during glob expansion: ${matchedFile}`);
|
|
@@ -272,7 +149,7 @@ function maybeLoadFromExternalFile(filePath, context) {
|
|
|
272
149
|
const finalPath = resolvedPath;
|
|
273
150
|
let contents;
|
|
274
151
|
try {
|
|
275
|
-
contents = fs$
|
|
152
|
+
contents = fs$2.readFileSync(finalPath, "utf8");
|
|
276
153
|
} catch (error) {
|
|
277
154
|
if (error.code === "ENOENT") throw new Error(`File does not exist: ${finalPath}`);
|
|
278
155
|
throw new Error(`Failed to read file ${finalPath}: ${error}`);
|
|
@@ -315,10 +192,10 @@ function getResolvedRelativePath(filePath, isCloudConfig) {
|
|
|
315
192
|
*/
|
|
316
193
|
function maybeLoadConfigFromExternalFile(config, context) {
|
|
317
194
|
if (Array.isArray(config)) return config.map((item) => maybeLoadConfigFromExternalFile(item, context));
|
|
318
|
-
if (
|
|
195
|
+
if (typeof config === "object" && config !== null) {
|
|
319
196
|
const result = {};
|
|
320
197
|
for (const key of Object.keys(config)) {
|
|
321
|
-
const childContext = key === "value" &&
|
|
198
|
+
const childContext = key === "value" && "type" in config && typeof config.type === "string" && (config.type === "python" || config.type === "javascript") ? "assertion" : key === "vars" ? "vars" : context;
|
|
322
199
|
result[key] = maybeLoadConfigFromExternalFile(config[key], childContext);
|
|
323
200
|
}
|
|
324
201
|
return result;
|
|
@@ -350,7 +227,7 @@ function parsePathOrGlob(basePath, promptPath) {
|
|
|
350
227
|
}
|
|
351
228
|
let stats;
|
|
352
229
|
try {
|
|
353
|
-
stats = fs$
|
|
230
|
+
stats = fs$2.statSync(path$1.join(basePath, filename));
|
|
354
231
|
} catch (err) {
|
|
355
232
|
if (getEnvBool("PROMPTFOO_STRICT_FILES")) throw err;
|
|
356
233
|
}
|
|
@@ -367,7 +244,7 @@ function parsePathOrGlob(basePath, promptPath) {
|
|
|
367
244
|
function readOutput(outputPath) {
|
|
368
245
|
const ext = path$1.parse(outputPath).ext.slice(1);
|
|
369
246
|
switch (ext) {
|
|
370
|
-
case "json": return JSON.parse(fs$
|
|
247
|
+
case "json": return JSON.parse(fs$2.readFileSync(outputPath, "utf-8"));
|
|
371
248
|
default: throw new Error(`Unsupported output file format: ${ext} currently only supports json`);
|
|
372
249
|
}
|
|
373
250
|
}
|
|
@@ -797,7 +674,7 @@ function setupEnv(envPath) {
|
|
|
797
674
|
dotenv.config({ quiet: true });
|
|
798
675
|
return;
|
|
799
676
|
}
|
|
800
|
-
for (const p of paths) if (!fs$
|
|
677
|
+
for (const p of paths) if (!fs$2.existsSync(p)) throw new Error(`Environment file not found: ${p}`);
|
|
801
678
|
if (paths.length === 1) logger.info(`Loading environment variables from ${paths[0]}`);
|
|
802
679
|
else logger.info(`Loading environment variables from: ${paths.join(", ")}`);
|
|
803
680
|
const pathArg = paths.length === 1 ? paths[0] : paths;
|
|
@@ -1193,7 +1070,7 @@ async function streamEvalCsv(eval_, options) {
|
|
|
1193
1070
|
testIdx: result.testIdx,
|
|
1194
1071
|
vars: varNames.map((varName) => {
|
|
1195
1072
|
const value = result.testCase?.vars?.[varName];
|
|
1196
|
-
return value
|
|
1073
|
+
return value === void 0 ? "" : String(value);
|
|
1197
1074
|
}),
|
|
1198
1075
|
outputs: new Array(numPrompts).fill(null),
|
|
1199
1076
|
test: { description: result.testCase?.description }
|
|
@@ -1421,6 +1298,6 @@ function printBorder() {
|
|
|
1421
1298
|
logger.info(border);
|
|
1422
1299
|
}
|
|
1423
1300
|
//#endregion
|
|
1424
|
-
export { readFilters as A, getResolvedRelativePath as C, maybeLoadResponseFormatFromExternalFile as D, maybeLoadFromExternalFileWithVars as E,
|
|
1301
|
+
export { readFilters as A, getResolvedRelativePath as C, maybeLoadResponseFormatFromExternalFile as D, maybeLoadFromExternalFileWithVars as E, loadFunction as M, parseFileUrl as N, maybeLoadToolsFromExternalFile as O, getNunjucksEngineForFilePath as S, maybeLoadFromExternalFile as T, getProviderDescription as _, evalTableToJson as a, isOpenAiProvider as b, fetchCsvFromGoogleSheet as c, extractRuntimeVars as d, filterRuntimeVars as f, doesProviderRefMatch as g, checkProviderApiKeys as h, ComparisonEvalNotFoundError as i, readOutput as j, parsePathOrGlob as k, setupEnv as l, resultIsForTestCase as m, writeMultipleOutputs as n, generateEvalCsv as o, getTestCaseDeduplicationKey as p, writeOutput as r, mergeComparisonTables as s, printBorder as t, deduplicateTestCases as u, isAnthropicProvider as v, maybeLoadConfigFromExternalFile as w, isProviderAllowed as x, isGoogleProvider as y };
|
|
1425
1302
|
|
|
1426
|
-
//# sourceMappingURL=util-
|
|
1303
|
+
//# sourceMappingURL=util-C8e5uydV.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { m as maybeLoadFromExternalFileWithVars } from "./util-
|
|
2
|
+
import { v as getAjv, x as safeJsonStringify } from "./logger-DksKw1Qc.js";
|
|
3
|
+
import { h as calculateCost } from "./fetch-BEWnXrrG.js";
|
|
4
|
+
import { m as maybeLoadFromExternalFileWithVars } from "./util-DxWpWjhc.js";
|
|
5
5
|
import OpenAI from "openai";
|
|
6
6
|
//#region src/providers/openai/util.ts
|
|
7
7
|
const ajv = getAjv();
|
|
@@ -363,6 +363,20 @@ const OPENAI_CHAT_MODELS = [
|
|
|
363
363
|
output: 15 / 1e6
|
|
364
364
|
}
|
|
365
365
|
})),
|
|
366
|
+
...["gpt-5.4-mini", "gpt-5.4-mini-2026-03-17"].map((model) => ({
|
|
367
|
+
id: model,
|
|
368
|
+
cost: {
|
|
369
|
+
input: .75 / 1e6,
|
|
370
|
+
output: 4.5 / 1e6
|
|
371
|
+
}
|
|
372
|
+
})),
|
|
373
|
+
...["gpt-5.4-nano", "gpt-5.4-nano-2026-03-17"].map((model) => ({
|
|
374
|
+
id: model,
|
|
375
|
+
cost: {
|
|
376
|
+
input: .2 / 1e6,
|
|
377
|
+
output: 1.25 / 1e6
|
|
378
|
+
}
|
|
379
|
+
})),
|
|
366
380
|
...["gpt-5.4-pro", "gpt-5.4-pro-2026-03-05"].map((model) => ({
|
|
367
381
|
id: model,
|
|
368
382
|
cost: {
|
|
@@ -597,4 +611,4 @@ function formatOpenAiError(data) {
|
|
|
597
611
|
//#endregion
|
|
598
612
|
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 };
|
|
599
613
|
|
|
600
|
-
//# sourceMappingURL=util-
|
|
614
|
+
//# sourceMappingURL=util-C9J8ahRn.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_logger = require("./logger-
|
|
2
|
-
const require_util = require("./util-
|
|
3
|
-
const require_fetch = require("./fetch-
|
|
1
|
+
const require_logger = require("./logger-COuQb2xB.cjs");
|
|
2
|
+
const require_util = require("./util-Bxn8emtE.cjs");
|
|
3
|
+
const require_fetch = require("./fetch-CJU5ELPa.cjs");
|
|
4
4
|
let openai = require("openai");
|
|
5
5
|
openai = require_logger.__toESM(openai);
|
|
6
6
|
//#region src/providers/openai/util.ts
|
|
@@ -363,6 +363,20 @@ const OPENAI_CHAT_MODELS = [
|
|
|
363
363
|
output: 15 / 1e6
|
|
364
364
|
}
|
|
365
365
|
})),
|
|
366
|
+
...["gpt-5.4-mini", "gpt-5.4-mini-2026-03-17"].map((model) => ({
|
|
367
|
+
id: model,
|
|
368
|
+
cost: {
|
|
369
|
+
input: .75 / 1e6,
|
|
370
|
+
output: 4.5 / 1e6
|
|
371
|
+
}
|
|
372
|
+
})),
|
|
373
|
+
...["gpt-5.4-nano", "gpt-5.4-nano-2026-03-17"].map((model) => ({
|
|
374
|
+
id: model,
|
|
375
|
+
cost: {
|
|
376
|
+
input: .2 / 1e6,
|
|
377
|
+
output: 1.25 / 1e6
|
|
378
|
+
}
|
|
379
|
+
})),
|
|
366
380
|
...["gpt-5.4-pro", "gpt-5.4-pro-2026-03-05"].map((model) => ({
|
|
367
381
|
id: model,
|
|
368
382
|
cost: {
|
|
@@ -650,4 +664,4 @@ Object.defineProperty(exports, "validateFunctionCall", {
|
|
|
650
664
|
}
|
|
651
665
|
});
|
|
652
666
|
|
|
653
|
-
//# sourceMappingURL=util-
|
|
667
|
+
//# sourceMappingURL=util-CN3SrLT4.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { E as maybeLoadFromExternalFileWithVars } from "./util-
|
|
1
|
+
import { g as getAjv, y as safeJsonStringify } from "./logger-B88EkIn6.js";
|
|
2
|
+
import { g as calculateCost } from "./fetch-B0Z3Oe4k.js";
|
|
3
|
+
import { E as maybeLoadFromExternalFileWithVars } from "./util-C8e5uydV.js";
|
|
4
4
|
import OpenAI from "openai";
|
|
5
5
|
//#region src/providers/openai/util.ts
|
|
6
6
|
const ajv = getAjv();
|
|
@@ -362,6 +362,20 @@ const OPENAI_CHAT_MODELS = [
|
|
|
362
362
|
output: 15 / 1e6
|
|
363
363
|
}
|
|
364
364
|
})),
|
|
365
|
+
...["gpt-5.4-mini", "gpt-5.4-mini-2026-03-17"].map((model) => ({
|
|
366
|
+
id: model,
|
|
367
|
+
cost: {
|
|
368
|
+
input: .75 / 1e6,
|
|
369
|
+
output: 4.5 / 1e6
|
|
370
|
+
}
|
|
371
|
+
})),
|
|
372
|
+
...["gpt-5.4-nano", "gpt-5.4-nano-2026-03-17"].map((model) => ({
|
|
373
|
+
id: model,
|
|
374
|
+
cost: {
|
|
375
|
+
input: .2 / 1e6,
|
|
376
|
+
output: 1.25 / 1e6
|
|
377
|
+
}
|
|
378
|
+
})),
|
|
365
379
|
...["gpt-5.4-pro", "gpt-5.4-pro-2026-03-05"].map((model) => ({
|
|
366
380
|
id: model,
|
|
367
381
|
cost: {
|
|
@@ -596,4 +610,4 @@ function formatOpenAiError(data) {
|
|
|
596
610
|
//#endregion
|
|
597
611
|
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 };
|
|
598
612
|
|
|
599
|
-
//# sourceMappingURL=util-
|
|
613
|
+
//# sourceMappingURL=util-D3q0WQ-0.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as maybeLoadFromExternalFileWithVars } from "./util-
|
|
3
|
-
import {
|
|
1
|
+
import { g as getAjv, y as safeJsonStringify } from "./logger-Ct2S6Yx-.js";
|
|
2
|
+
import { l as maybeLoadFromExternalFileWithVars } from "./util-oGMLA7vc.js";
|
|
3
|
+
import { g as calculateCost } from "./fetch-Di00EQrc.js";
|
|
4
4
|
import OpenAI from "openai";
|
|
5
5
|
//#region src/providers/openai/util.ts
|
|
6
6
|
const ajv = getAjv();
|
|
@@ -362,6 +362,20 @@ const OPENAI_CHAT_MODELS = [
|
|
|
362
362
|
output: 15 / 1e6
|
|
363
363
|
}
|
|
364
364
|
})),
|
|
365
|
+
...["gpt-5.4-mini", "gpt-5.4-mini-2026-03-17"].map((model) => ({
|
|
366
|
+
id: model,
|
|
367
|
+
cost: {
|
|
368
|
+
input: .75 / 1e6,
|
|
369
|
+
output: 4.5 / 1e6
|
|
370
|
+
}
|
|
371
|
+
})),
|
|
372
|
+
...["gpt-5.4-nano", "gpt-5.4-nano-2026-03-17"].map((model) => ({
|
|
373
|
+
id: model,
|
|
374
|
+
cost: {
|
|
375
|
+
input: .2 / 1e6,
|
|
376
|
+
output: 1.25 / 1e6
|
|
377
|
+
}
|
|
378
|
+
})),
|
|
365
379
|
...["gpt-5.4-pro", "gpt-5.4-pro-2026-03-05"].map((model) => ({
|
|
366
380
|
id: model,
|
|
367
381
|
cost: {
|
|
@@ -596,4 +610,4 @@ function formatOpenAiError(data) {
|
|
|
596
610
|
//#endregion
|
|
597
611
|
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 };
|
|
598
612
|
|
|
599
|
-
//# sourceMappingURL=util-
|
|
613
|
+
//# sourceMappingURL=util-D9TisOyk.js.map
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { h as calculateCost } from "./fetch-BEWnXrrG.js";
|
|
3
|
+
import { w as parseDataUrl } from "./transform-zDhMmzwX.js";
|
|
4
4
|
//#region src/providers/anthropic/util.ts
|
|
5
5
|
const ANTHROPIC_MODELS = [
|
|
6
|
+
...["claude-mythos-preview"].map((model) => ({
|
|
7
|
+
id: model,
|
|
8
|
+
cost: {
|
|
9
|
+
input: 25 / 1e6,
|
|
10
|
+
output: 125 / 1e6
|
|
11
|
+
}
|
|
12
|
+
})),
|
|
6
13
|
...["claude-sonnet-4-6", "claude-sonnet-4-6-latest"].map((model) => ({
|
|
7
14
|
id: model,
|
|
8
15
|
cost: {
|
|
@@ -17,7 +24,11 @@ const ANTHROPIC_MODELS = [
|
|
|
17
24
|
output: 25 / 1e6
|
|
18
25
|
}
|
|
19
26
|
})),
|
|
20
|
-
...[
|
|
27
|
+
...[
|
|
28
|
+
"claude-opus-4-5",
|
|
29
|
+
"claude-opus-4-5-20251101",
|
|
30
|
+
"claude-opus-4-5-latest"
|
|
31
|
+
].map((model) => ({
|
|
21
32
|
id: model,
|
|
22
33
|
cost: {
|
|
23
34
|
input: 5 / 1e6,
|
|
@@ -25,6 +36,7 @@ const ANTHROPIC_MODELS = [
|
|
|
25
36
|
}
|
|
26
37
|
})),
|
|
27
38
|
...[
|
|
39
|
+
"claude-opus-4-1",
|
|
28
40
|
"claude-opus-4-1-20250805",
|
|
29
41
|
"claude-opus-4-20250514",
|
|
30
42
|
"claude-opus-4-0",
|
|
@@ -37,6 +49,7 @@ const ANTHROPIC_MODELS = [
|
|
|
37
49
|
}
|
|
38
50
|
})),
|
|
39
51
|
...[
|
|
52
|
+
"claude-sonnet-4-5",
|
|
40
53
|
"claude-sonnet-4-5-20250929",
|
|
41
54
|
"claude-sonnet-4-5-latest",
|
|
42
55
|
"claude-sonnet-4-20250514",
|
|
@@ -49,7 +62,11 @@ const ANTHROPIC_MODELS = [
|
|
|
49
62
|
output: 15 / 1e6
|
|
50
63
|
}
|
|
51
64
|
})),
|
|
52
|
-
...[
|
|
65
|
+
...[
|
|
66
|
+
"claude-haiku-4-5",
|
|
67
|
+
"claude-haiku-4-5-20251001",
|
|
68
|
+
"claude-haiku-4-5-latest"
|
|
69
|
+
].map((model) => ({
|
|
53
70
|
id: model,
|
|
54
71
|
cost: {
|
|
55
72
|
input: 1 / 1e6,
|
|
@@ -210,31 +227,72 @@ function parseMessages(messages) {
|
|
|
210
227
|
thinking
|
|
211
228
|
};
|
|
212
229
|
}
|
|
213
|
-
|
|
230
|
+
/**
|
|
231
|
+
* Compute input cost with Anthropic cache pricing applied.
|
|
232
|
+
* Anthropic docs: input_tokens is the non-cached portion; cache_read and cache_creation are additive.
|
|
233
|
+
* Cache reads cost 10% of base rate (90% discount), cache writes cost 125% of base rate (25% surcharge).
|
|
234
|
+
*/
|
|
235
|
+
function calculateCacheInputCost(baseInputRate, uncachedInputTokens, cacheRead, cacheCreation) {
|
|
236
|
+
return uncachedInputTokens * baseInputRate + cacheRead * baseInputRate * .1 + cacheCreation * baseInputRate * 1.25;
|
|
237
|
+
}
|
|
238
|
+
function calculateAnthropicCost(modelName, config, promptTokens, completionTokens, cacheReadTokens, cacheCreationTokens) {
|
|
239
|
+
if (config.cost != null) return calculateCost(modelName, config, promptTokens, completionTokens, ANTHROPIC_MODELS);
|
|
240
|
+
if (!Number.isFinite(promptTokens) || !Number.isFinite(completionTokens) || typeof promptTokens === "undefined" || typeof completionTokens === "undefined") return calculateCost(modelName, config, promptTokens, completionTokens, ANTHROPIC_MODELS);
|
|
241
|
+
const cacheRead = cacheReadTokens ?? 0;
|
|
242
|
+
const cacheCreation = cacheCreationTokens ?? 0;
|
|
243
|
+
const effectiveInputTokens = promptTokens + cacheRead + cacheCreation;
|
|
214
244
|
if ([
|
|
245
|
+
"claude-sonnet-4-5",
|
|
215
246
|
"claude-sonnet-4-5-20250929",
|
|
216
247
|
"claude-sonnet-4-5-latest",
|
|
217
248
|
"claude-sonnet-4-6",
|
|
218
249
|
"claude-sonnet-4-6-latest"
|
|
219
|
-
].includes(modelName)
|
|
220
|
-
const
|
|
221
|
-
const
|
|
222
|
-
|
|
250
|
+
].includes(modelName)) {
|
|
251
|
+
const isLongContext = effectiveInputTokens > 2e5;
|
|
252
|
+
const baseInputRate = isLongContext ? 6 / 1e6 : 3 / 1e6;
|
|
253
|
+
const outputRate = isLongContext ? 22.5 / 1e6 : 15 / 1e6;
|
|
254
|
+
return calculateCacheInputCost(baseInputRate, promptTokens, cacheRead, cacheCreation) + completionTokens * outputRate;
|
|
255
|
+
}
|
|
256
|
+
if (cacheRead || cacheCreation) {
|
|
257
|
+
const modelInfo = ANTHROPIC_MODELS.find((m) => m.id === modelName);
|
|
258
|
+
if (modelInfo) return calculateCacheInputCost(modelInfo.cost.input, promptTokens, cacheRead, cacheCreation) + completionTokens * modelInfo.cost.output;
|
|
223
259
|
}
|
|
224
260
|
return calculateCost(modelName, config, promptTokens, completionTokens, ANTHROPIC_MODELS);
|
|
225
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* Extract refusal details from the Anthropic stop_details field.
|
|
264
|
+
* Returns a human-readable string if the response was refused, or undefined otherwise.
|
|
265
|
+
*/
|
|
266
|
+
function getRefusalDetails(data) {
|
|
267
|
+
if (data.stop_reason !== "refusal" || !data.stop_details) return;
|
|
268
|
+
const details = data.stop_details;
|
|
269
|
+
const parts = ["Content refused by Anthropic safety filters"];
|
|
270
|
+
if (details.category) parts.push(`category: ${details.category}`);
|
|
271
|
+
if (details.explanation) parts.push(`explanation: ${details.explanation}`);
|
|
272
|
+
return parts.join(" — ");
|
|
273
|
+
}
|
|
226
274
|
function getTokenUsage(data, cached) {
|
|
227
275
|
if (data.usage) {
|
|
228
|
-
const
|
|
276
|
+
const cacheRead = data.usage.cache_read_input_tokens ?? 0;
|
|
277
|
+
const cacheCreation = data.usage.cache_creation_input_tokens ?? 0;
|
|
278
|
+
const allInputTokens = (data.usage.input_tokens ?? 0) + cacheRead + cacheCreation;
|
|
279
|
+
const total_tokens = allInputTokens + (data.usage.output_tokens ?? 0);
|
|
229
280
|
if (cached) return {
|
|
230
281
|
cached: total_tokens,
|
|
231
282
|
total: total_tokens
|
|
232
283
|
};
|
|
233
|
-
else
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
284
|
+
else {
|
|
285
|
+
const usage = {
|
|
286
|
+
total: total_tokens,
|
|
287
|
+
prompt: allInputTokens,
|
|
288
|
+
completion: data.usage.output_tokens ?? 0
|
|
289
|
+
};
|
|
290
|
+
if (data.usage.cache_read_input_tokens != null || data.usage.cache_creation_input_tokens != null) usage.completionDetails = {
|
|
291
|
+
cacheReadInputTokens: cacheRead,
|
|
292
|
+
cacheCreationInputTokens: cacheCreation
|
|
293
|
+
};
|
|
294
|
+
return usage;
|
|
295
|
+
}
|
|
238
296
|
}
|
|
239
297
|
return {};
|
|
240
298
|
}
|
|
@@ -244,16 +302,20 @@ function getTokenUsage(data, cached) {
|
|
|
244
302
|
function processAnthropicTools(tools = []) {
|
|
245
303
|
const processedTools = [];
|
|
246
304
|
const requiredBetaFeatures = [];
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
if (
|
|
255
|
-
|
|
256
|
-
|
|
305
|
+
const addRequiredBetaFeature = (feature) => {
|
|
306
|
+
if (!requiredBetaFeatures.includes(feature)) requiredBetaFeatures.push(feature);
|
|
307
|
+
};
|
|
308
|
+
for (const tool of tools) {
|
|
309
|
+
if ("type" in tool) if (tool.type === "web_fetch_20250910") {
|
|
310
|
+
processedTools.push(transformWebFetchTool(tool));
|
|
311
|
+
addRequiredBetaFeature("web-fetch-2025-09-10");
|
|
312
|
+
} else if (tool.type === "web_fetch_20260209") processedTools.push(transformWebFetchTool20260209(tool));
|
|
313
|
+
else if (tool.type === "web_fetch_20260309") processedTools.push(transformWebFetchToolV2(tool));
|
|
314
|
+
else if (tool.type === "web_search_20250305") processedTools.push(transformWebSearchTool(tool));
|
|
315
|
+
else if (tool.type === "web_search_20260209") processedTools.push(transformWebSearchTool20260209(tool));
|
|
316
|
+
else processedTools.push(tool);
|
|
317
|
+
else processedTools.push(tool);
|
|
318
|
+
if ("strict" in tool && tool.strict === true) addRequiredBetaFeature("structured-outputs-2025-11-13");
|
|
257
319
|
}
|
|
258
320
|
return {
|
|
259
321
|
processedTools,
|
|
@@ -261,21 +323,54 @@ function processAnthropicTools(tools = []) {
|
|
|
261
323
|
};
|
|
262
324
|
}
|
|
263
325
|
/**
|
|
264
|
-
*
|
|
326
|
+
* Apply shared web fetch tool fields from config onto the SDK tool object.
|
|
265
327
|
*/
|
|
328
|
+
function applyWebFetchFields(tool, config) {
|
|
329
|
+
if (config.allowed_callers !== void 0) tool.allowed_callers = config.allowed_callers;
|
|
330
|
+
if (config.max_uses !== void 0) tool.max_uses = config.max_uses;
|
|
331
|
+
if (config.allowed_domains !== void 0) tool.allowed_domains = config.allowed_domains;
|
|
332
|
+
if (config.blocked_domains !== void 0) tool.blocked_domains = config.blocked_domains;
|
|
333
|
+
if (config.citations !== void 0) tool.citations = config.citations;
|
|
334
|
+
if (config.max_content_tokens !== void 0) tool.max_content_tokens = config.max_content_tokens;
|
|
335
|
+
if (config.cache_control !== void 0) tool.cache_control = config.cache_control;
|
|
336
|
+
if (config.defer_loading !== void 0) tool.defer_loading = config.defer_loading;
|
|
337
|
+
if (config.strict !== void 0) tool.strict = config.strict;
|
|
338
|
+
}
|
|
266
339
|
function transformWebFetchTool(config) {
|
|
267
340
|
const tool = {
|
|
268
341
|
type: "web_fetch_20250910",
|
|
269
342
|
name: "web_fetch"
|
|
270
343
|
};
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
344
|
+
applyWebFetchFields(tool, config);
|
|
345
|
+
return tool;
|
|
346
|
+
}
|
|
347
|
+
function transformWebFetchTool20260209(config) {
|
|
348
|
+
const tool = {
|
|
349
|
+
type: "web_fetch_20260209",
|
|
350
|
+
name: "web_fetch"
|
|
351
|
+
};
|
|
352
|
+
applyWebFetchFields(tool, config);
|
|
353
|
+
return tool;
|
|
354
|
+
}
|
|
355
|
+
function transformWebFetchToolV2(config) {
|
|
356
|
+
const tool = {
|
|
357
|
+
type: "web_fetch_20260309",
|
|
358
|
+
name: "web_fetch"
|
|
359
|
+
};
|
|
360
|
+
applyWebFetchFields(tool, config);
|
|
361
|
+
if (config.use_cache !== void 0) tool.use_cache = config.use_cache;
|
|
277
362
|
return tool;
|
|
278
363
|
}
|
|
364
|
+
function applyWebSearchFields(tool, config) {
|
|
365
|
+
if (config.allowed_callers !== void 0) tool.allowed_callers = config.allowed_callers;
|
|
366
|
+
if (config.allowed_domains !== void 0) tool.allowed_domains = config.allowed_domains;
|
|
367
|
+
if (config.blocked_domains !== void 0) tool.blocked_domains = config.blocked_domains;
|
|
368
|
+
if (config.cache_control !== void 0) tool.cache_control = config.cache_control;
|
|
369
|
+
if (config.defer_loading !== void 0) tool.defer_loading = config.defer_loading;
|
|
370
|
+
if (config.max_uses !== void 0) tool.max_uses = config.max_uses;
|
|
371
|
+
if (config.strict !== void 0) tool.strict = config.strict;
|
|
372
|
+
if (config.user_location !== void 0) tool.user_location = config.user_location;
|
|
373
|
+
}
|
|
279
374
|
/**
|
|
280
375
|
* Transform web search tool config to Anthropic beta tool format
|
|
281
376
|
*/
|
|
@@ -284,11 +379,18 @@ function transformWebSearchTool(config) {
|
|
|
284
379
|
type: "web_search_20250305",
|
|
285
380
|
name: "web_search"
|
|
286
381
|
};
|
|
287
|
-
|
|
288
|
-
|
|
382
|
+
applyWebSearchFields(tool, config);
|
|
383
|
+
return tool;
|
|
384
|
+
}
|
|
385
|
+
function transformWebSearchTool20260209(config) {
|
|
386
|
+
const tool = {
|
|
387
|
+
type: "web_search_20260209",
|
|
388
|
+
name: "web_search"
|
|
389
|
+
};
|
|
390
|
+
applyWebSearchFields(tool, config);
|
|
289
391
|
return tool;
|
|
290
392
|
}
|
|
291
393
|
//#endregion
|
|
292
|
-
export {
|
|
394
|
+
export { outputFromMessage as a, getTokenUsage as i, calculateAnthropicCost as n, parseMessages as o, getRefusalDetails as r, processAnthropicTools as s, ANTHROPIC_MODELS as t };
|
|
293
395
|
|
|
294
|
-
//# sourceMappingURL=util-
|
|
396
|
+
//# sourceMappingURL=util-DDs-7g6-.js.map
|