promptfoo 0.125.0 → 0.125.1
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 +3 -3
- package/dist/src/accounts-BOxNYxVN.js +229 -0
- package/dist/src/accounts-BezXLdAW.cjs +276 -0
- package/dist/src/accounts-CPISMNlh.js +227 -0
- package/dist/src/accounts-vJBPs89d.js +222 -0
- package/dist/src/agentWorkspace-Bom7SpF2.js +592 -0
- package/dist/src/agentWorkspace-CEomAcws.cjs +619 -0
- package/dist/src/agentWorkspace-DPtMLrlI.js +593 -0
- package/dist/src/agentWorkspace-DkAeEYLz.js +592 -0
- package/dist/src/agentic-utils-121v7mJo.js +197 -0
- package/dist/src/agentic-utils-CBWD_rcd.cjs +237 -0
- package/dist/src/agentic-utils-D8wyQwPG.js +198 -0
- package/dist/src/agentic-utils-EP1QkQCs.js +197 -0
- package/dist/src/agents-Br3ah8iA.js +778 -0
- package/dist/src/agents-C5wj_UTv.js +777 -0
- package/dist/src/agents-C9Efp4mC.js +266 -0
- package/dist/src/agents-CQYwaVCO.js +267 -0
- package/dist/src/agents-CjCd4Vo8.js +777 -0
- package/dist/src/agents-DRWiCHYz.js +266 -0
- package/dist/src/agents-F2rhx0iL.cjs +266 -0
- package/dist/src/agents-RTYyy69h.cjs +777 -0
- package/dist/src/agents-api-CY72O86e.js +711 -0
- package/dist/src/agents-api-CsSsC21b.js +710 -0
- package/dist/src/agents-api-DN-ibDc8.js +710 -0
- package/dist/src/agents-api-cNDsCCv1.cjs +710 -0
- package/dist/src/ai.studio-Bj6Dyi6o.js +2 -0
- package/dist/src/ai.studio-C-e0LzyW.js +369 -0
- package/dist/src/ai.studio-CR8M6Aqf.cjs +391 -0
- package/dist/src/ai.studio-YKk7F0tv.js +374 -0
- package/dist/src/aimlapi-BGunsuTu.js +30 -0
- package/dist/src/aimlapi-BkzcfBsL.js +29 -0
- package/dist/src/aimlapi-DXFcEdP8.js +28 -0
- package/dist/src/aimlapi-r-8iCcAw.cjs +29 -0
- package/dist/src/anthropicMessages-7-YNRgQR.js +114 -0
- package/dist/src/anthropicMessages-C8m9Whrd.cjs +114 -0
- package/dist/src/anthropicMessages-DS1vXD0f.js +115 -0
- package/dist/src/anthropicMessages-DmvGkz-0.js +114 -0
- package/dist/src/app/assets/index-CrdXWTXm.js +392 -0
- package/dist/src/app/browser-inventory.json +4 -4
- package/dist/src/app/index.html +1 -1
- package/dist/src/audio-BLgFgyw-.cjs +104 -0
- package/dist/src/audio-C2sibT7Q.js +104 -0
- package/dist/src/audio-DXEXb03H.js +104 -0
- package/dist/src/audio-TkvojpwO.js +105 -0
- package/dist/src/authoritativeMarkupInjection-BAT9B-Wj.js +79 -0
- package/dist/src/authoritativeMarkupInjection-B_yHETKT.js +78 -0
- package/dist/src/authoritativeMarkupInjection-BfjecQ3Q.cjs +78 -0
- package/dist/src/authoritativeMarkupInjection-D-hDKrhD.js +78 -0
- package/dist/src/aws-B_9unI_-.js +1149 -0
- package/dist/src/aws-D0FY3qkc.js +2433 -0
- package/dist/src/aws-Dh1-a90n.js +2433 -0
- package/dist/src/aws-qskKGczY.cjs +2454 -0
- package/dist/src/base-CaWlBkVz.js +462 -0
- package/dist/src/base-CcViNwVs.js +255 -0
- package/dist/src/base-CsVbPJkU.cjs +467 -0
- package/dist/src/base-DNK9py25.js +255 -0
- package/dist/src/base-DlH5tjEZ.js +463 -0
- package/dist/src/base-DyLOZ_iX.js +256 -0
- package/dist/src/base-RRYXfG7l.cjs +305 -0
- package/dist/src/base-oXVgvtVn.js +462 -0
- package/dist/src/bedrock-BP17ZXbR.cjs +2 -0
- package/dist/src/bedrock-CsjM1dOt.js +1300 -0
- package/dist/src/bedrock-CzPwj8GO.js +1 -0
- package/dist/src/bedrock-eGXZw8oh.js +1 -0
- package/dist/src/bedrock-tSWjmXdj.js +2 -0
- package/dist/src/bestOfN-BQ93nUKV.js +160 -0
- package/dist/src/bestOfN-ByGGwlcb.cjs +161 -0
- package/dist/src/bestOfN-CbP7csHr.js +159 -0
- package/dist/src/bestOfN-xn6i2Xs2.js +159 -0
- package/dist/src/cache-CHq9hPz9.js +2 -0
- package/dist/src/cache-D-9eZN3I.js +754 -0
- package/dist/src/cache-DSm6t1MZ.js +741 -0
- package/dist/src/cache-DeF5zIEN.js +782 -0
- package/dist/src/cache-iG87oYan.cjs +856 -0
- package/dist/src/cerebras-CTtM4yMH.js +98 -0
- package/dist/src/cerebras-CogcJ3ce.cjs +97 -0
- package/dist/src/cerebras-DmkRypTh.js +97 -0
- package/dist/src/cerebras-GUp0B8JY.js +97 -0
- package/dist/src/chat-B4ihd3fw.js +226 -0
- package/dist/src/chat-B9cAQ_rS.js +227 -0
- package/dist/src/chat-BU7EB4R-.cjs +76 -0
- package/dist/src/chat-C8yxJ2-s.cjs +226 -0
- package/dist/src/chat-ClTFM3qq.js +934 -0
- package/dist/src/chat-Cnq0Is68.js +123 -0
- package/dist/src/chat-CwrurR57.cjs +987 -0
- package/dist/src/chat-D0lsojPv.js +124 -0
- package/dist/src/chat-D7_8yFIx.js +76 -0
- package/dist/src/chat-DCoETlLG.js +226 -0
- package/dist/src/chat-DHE7xaTR.js +76 -0
- package/dist/src/chat-DmhT6rz2.cjs +123 -0
- package/dist/src/chat-DvfMe8KI.js +123 -0
- package/dist/src/chat-DwP5kVnl.js +935 -0
- package/dist/src/chat-MB7U-QE2.js +77 -0
- package/dist/src/chat-zCWuBKAj.js +934 -0
- package/dist/src/claude-agent-sdk-23bIVI75.js +999 -0
- package/dist/src/claude-agent-sdk-BACpnIJi.cjs +1005 -0
- package/dist/src/claude-agent-sdk-BlYlmcEr.js +999 -0
- package/dist/src/claude-agent-sdk-Cr-jqJZl.js +1000 -0
- package/dist/src/client-BktbiPx9.cjs +357 -0
- package/dist/src/client-CjztEBmW.js +351 -0
- package/dist/src/client-mRs2UvH9.js +351 -0
- package/dist/src/client-uCz0ydjC.js +352 -0
- package/dist/src/cloud-BtYF555L.js +2 -0
- package/dist/src/cloud-CVSUEmAy.js +287 -0
- package/dist/src/cloud-D7Ifb-Fl.js +599 -0
- package/dist/src/cloud-DB5oK5NX.cjs +666 -0
- package/dist/src/cloud-ecu989Em.js +657 -0
- package/dist/src/cloud-ramjGURF.js +599 -0
- package/dist/src/cloudflare-ai-BfDkIjO8.js +133 -0
- package/dist/src/cloudflare-ai-D9HaXz1M.js +134 -0
- package/dist/src/cloudflare-ai-HrD5WUK8.js +132 -0
- package/dist/src/cloudflare-ai-Qdj8aKP2.cjs +133 -0
- package/dist/src/cloudflare-gateway-C81uKETQ.js +276 -0
- package/dist/src/cloudflare-gateway-CX5Z9X0k.js +276 -0
- package/dist/src/cloudflare-gateway-DW-og8gb.js +277 -0
- package/dist/src/cloudflare-gateway-iRyXo9n2.cjs +276 -0
- package/dist/src/codex-app-server-BFIrSgdy.js +2155 -0
- package/dist/src/codex-app-server-By1eDVD4.js +2 -0
- package/dist/src/codex-app-server-DKsF4qmY.js +2156 -0
- package/dist/src/codex-app-server-n7n4uZzC.cjs +2162 -0
- package/dist/src/codex-app-server-xAoELVxu.js +2155 -0
- package/dist/src/codex-sdk-C2ZLxa6r.js +1552 -0
- package/dist/src/codex-sdk-CzG02tQt.cjs +1588 -0
- package/dist/src/codex-sdk-DNxAOhiV.js +2 -0
- package/dist/src/codex-sdk-DT3aQezK.js +1557 -0
- package/dist/src/codex-sdk-pw9DpcJP.js +1557 -0
- package/dist/src/codex-security-B0bLmXJF.js +406 -0
- package/dist/src/codex-security-BhYs-3iY.js +406 -0
- package/dist/src/codex-security-DQcOfxYW.js +407 -0
- package/dist/src/codex-security-DsCWr6GZ.cjs +411 -0
- package/dist/src/cometapi-B16asPLX.cjs +55 -0
- package/dist/src/cometapi-MgTbZA_H.js +53 -0
- package/dist/src/cometapi-i33vKzPV.js +55 -0
- package/dist/src/cometapi-wK2UWK0X.js +56 -0
- package/dist/src/compatible-COj8ZCy9.js +24 -0
- package/dist/src/compatible-CRSsIUGb.cjs +24 -0
- package/dist/src/compatible-Dy1vCcNF.js +25 -0
- package/dist/src/compatible-aUItQrpk.js +24 -0
- package/dist/src/completion-Bn7COFMk.js +119 -0
- package/dist/src/completion-Bub2N48b.js +118 -0
- package/dist/src/completion-Cf2G9OlM.cjs +123 -0
- package/dist/src/conversationScoring-BiTYJ9MD.js +374 -0
- package/dist/src/conversationScoring-CKL47uIu.js +373 -0
- package/dist/src/conversationScoring-DCvQKp6k.cjs +398 -0
- package/dist/src/conversationScoring-DLNJtDZI.js +373 -0
- package/dist/src/crescendo-5iLk9WiJ.cjs +734 -0
- package/dist/src/crescendo-B5ylG7kW.js +733 -0
- package/dist/src/crescendo-BD7k6TIx.js +730 -0
- package/dist/src/crescendo-DqO2Ch0P.js +732 -0
- package/dist/src/custom-8rv_aG2K.js +617 -0
- package/dist/src/custom-BOtrIHFN.js +619 -0
- package/dist/src/custom-BvN8seCs.cjs +620 -0
- package/dist/src/custom-Cld9v_Y4.js +618 -0
- package/dist/src/dataUrl-BdHUey2l.cjs +3187 -0
- package/dist/src/dataUrl-DBMifX6C.js +3133 -0
- package/dist/src/dataUrl-DUSr-ZvI.js +2868 -0
- package/dist/src/decisions-CLazADTw.js +516 -0
- package/dist/src/decisions-D5X93awq.js +515 -0
- package/dist/src/decisions-DmaeArEn.js +515 -0
- package/dist/src/decisions-DyQJyHJz.cjs +514 -0
- package/dist/src/docker-C9NYQFeu.js +94 -0
- package/dist/src/docker-CGq3mMol.cjs +94 -0
- package/dist/src/docker-DOm7nmpl.js +95 -0
- package/dist/src/docker-skFN-Kfo.js +93 -0
- package/dist/src/embedding-0UbzkTk9.js +82 -0
- package/dist/src/embedding-DTrSDt7k.cjs +86 -0
- package/dist/src/embedding-j2ORNl5H.js +81 -0
- package/dist/src/envoy-BvS8XTQO.js +60 -0
- package/dist/src/envoy-Cn6Hzw0e.js +60 -0
- package/dist/src/envoy-DC3KWcUY.cjs +60 -0
- package/dist/src/envoy-DetHjo5B.js +61 -0
- package/dist/src/eval-Cer9dPe9.js +1920 -0
- package/dist/src/eval-CytYmI2Z.js +2 -0
- package/dist/src/evalResult-DzOq5wt9.js +1300 -0
- package/dist/src/evaluator-BxCmvGtv.js +10578 -0
- package/dist/src/evaluator-Ct7YDELm.js +2 -0
- package/dist/src/evaluatorHelpers-B_AwIrsl.js +600 -0
- package/dist/src/evaluatorHelpers-D1Tpc7gd.js +601 -0
- package/dist/src/evaluatorHelpers-DRR3rLq0.cjs +622 -0
- package/dist/src/fetch-B5KxZuKu.js +1559 -0
- package/dist/src/fetch-BG_Jl7ty.js +1556 -0
- package/dist/src/fetch-BKlgUg08.cjs +1853 -0
- package/dist/src/fetch-C9Fsja0R.js +2 -0
- package/dist/src/fetch-CM7P8KWA.cjs +14 -0
- package/dist/src/fetch-D0FkIB3G.js +9 -0
- package/dist/src/fetch-RXHsZF-J.js +1280 -0
- package/dist/src/fetch-rSECy8jR.js +10 -0
- package/dist/src/functionCallbackUtils-BB9tmf6a.cjs +262 -0
- package/dist/src/functionCallbackUtils-BXk2iY01.js +246 -0
- package/dist/src/functionCallbackUtils-B_cYp7P5.js +245 -0
- package/dist/src/functionCallbackUtils-BfXnPo0o.js +245 -0
- package/dist/src/gemini-image-BXLMADDz.js +471 -0
- package/dist/src/gemini-image-BYUZyEUx.js +472 -0
- package/dist/src/gemini-image-DSt1QubZ.cjs +471 -0
- package/dist/src/gemini-image-DdNDMiZ_.js +471 -0
- package/dist/src/goat-9b-uU_k6.js +514 -0
- package/dist/src/goat-BCJuiDd0.js +515 -0
- package/dist/src/goat-CmAHbemm.js +512 -0
- package/dist/src/goat-DdOTdyoS.cjs +515 -0
- package/dist/src/goblin-Bp5C5lyb.js +22 -0
- package/dist/src/goblin-Dmr7GItI.js +23 -0
- package/dist/src/goblin-DpM8wxlf.cjs +22 -0
- package/dist/src/goblin-cJyH6Pq-.js +22 -0
- package/dist/src/google-B6eaPAbE.js +142 -0
- package/dist/src/google-D-FStdN6.cjs +142 -0
- package/dist/src/google-DAC7BsCW.js +142 -0
- package/dist/src/google-Id18H0Va.js +143 -0
- package/dist/src/graders-BjNQWkaB.js +2 -0
- package/dist/src/graders-CqdIp_vl.js +15470 -0
- package/dist/src/hydra-6Ouh74DE.js +610 -0
- package/dist/src/hydra-BHjhZnLB.cjs +612 -0
- package/dist/src/hydra-BL6k2REV.js +2 -0
- package/dist/src/hydra-BWUc0o67.js +613 -0
- package/dist/src/hydra-CUkEOLKw.js +612 -0
- package/dist/src/image-B6hG_xhb.js +481 -0
- package/dist/src/image-BFaq7Krd.cjs +209 -0
- package/dist/src/image-Bql5C0N9.cjs +504 -0
- package/dist/src/image-BtZfI2pT.js +163 -0
- package/dist/src/image-CIM4oN7Z.cjs +163 -0
- package/dist/src/image-CbAl7Jpu.js +209 -0
- package/dist/src/image-CiYm_yFw.js +209 -0
- package/dist/src/image-DCMNvBiV.js +163 -0
- package/dist/src/image-DL7pIuUZ.js +210 -0
- package/dist/src/image-ey0kxF8o.js +164 -0
- package/dist/src/image-smgIk3rE.js +482 -0
- package/dist/src/index.cjs +27 -27
- package/dist/src/index.d.cts +8 -8
- package/dist/src/index.js +27 -27
- package/dist/src/indirectWebPwn-B_-UpWY5.js +285 -0
- package/dist/src/indirectWebPwn-Cz3SLiEq.js +434 -0
- package/dist/src/indirectWebPwn-D2s8zGiM.cjs +463 -0
- package/dist/src/indirectWebPwn-DXbj2wGu.cjs +285 -0
- package/dist/src/indirectWebPwn-D_4H44E6.js +285 -0
- package/dist/src/indirectWebPwn-L044SrpV.js +434 -0
- package/dist/src/indirectWebPwn-cnmvdavH.js +435 -0
- package/dist/src/indirectWebPwn-zUBzsqTt.js +286 -0
- package/dist/src/interactions-Bu3oVQ-j.js +850 -0
- package/dist/src/interactions-CND010Lh.cjs +850 -0
- package/dist/src/interactions-DAx7tqUz.js +851 -0
- package/dist/src/interactions-DPkIumeh.js +850 -0
- package/dist/src/iterative-BO4JRnpG.js +545 -0
- package/dist/src/iterative-CAK-k9rz.js +548 -0
- package/dist/src/iterative-CDgHc0xO.cjs +549 -0
- package/dist/src/iterative-CXJlHLl9.js +547 -0
- package/dist/src/iterativeImage-BEdGKSmh.cjs +419 -0
- package/dist/src/iterativeImage-BfL0QZw5.js +417 -0
- package/dist/src/iterativeImage-C9KhnibC.js +417 -0
- package/dist/src/iterativeImage-btjkOfWG.js +418 -0
- package/dist/src/iterativeMeta-B5Bdw6QA.js +437 -0
- package/dist/src/iterativeMeta-C3mI4gpT.js +440 -0
- package/dist/src/iterativeMeta-Co2BKyqS.cjs +439 -0
- package/dist/src/iterativeMeta-DD8ihRWD.js +439 -0
- package/dist/src/iterativeTree-AMi4GV2O.js +878 -0
- package/dist/src/iterativeTree-C8FJOEje.cjs +879 -0
- package/dist/src/iterativeTree-CvrY1f2Z.js +877 -0
- package/dist/src/iterativeTree-bPtESmaD.js +876 -0
- package/dist/src/knowledgeBase-Cf5871e3.js +163 -0
- package/dist/src/knowledgeBase-D2PQhqLH.js +164 -0
- package/dist/src/knowledgeBase-DpoMw1IH.cjs +163 -0
- package/dist/src/knowledgeBase-npGFl763.js +163 -0
- package/dist/src/litellm-BBB5DQdt.cjs +146 -0
- package/dist/src/litellm-Bo43ow7r.js +145 -0
- package/dist/src/litellm-CaU8CMLS.js +146 -0
- package/dist/src/litellm-wY7Unh8o.js +147 -0
- package/dist/src/live-5g2w-M-E.js +891 -0
- package/dist/src/live-BfaXsDyD.cjs +891 -0
- package/dist/src/live-C1xewnGD.js +2 -0
- package/dist/src/live-DaF7nYy5.js +892 -0
- package/dist/src/live-lp3urLUw.js +891 -0
- package/dist/src/luma-ray-B7zvKGVG.js +309 -0
- package/dist/src/luma-ray-DCf5fnrz.cjs +309 -0
- package/dist/src/luma-ray-DepBcn6z.js +309 -0
- package/dist/src/luma-ray-XQC4M1pt.js +310 -0
- package/dist/src/main.js +26 -26
- package/dist/src/mantleChat-7xm95vSV.js +154 -0
- package/dist/src/mantleChat-CXhAs5RD.js +155 -0
- package/dist/src/mantleChat-CcE-zjfj.cjs +154 -0
- package/dist/src/mantleChat-Cpefl7Zm.js +154 -0
- package/dist/src/mcp-B0V0ikdM.js +84 -0
- package/dist/src/mcp-CV2k2gwj.js +85 -0
- package/dist/src/memoryPoisoning-BC5FQQWZ.js +111 -0
- package/dist/src/memoryPoisoning-BDwrtZKX.js +111 -0
- package/dist/src/memoryPoisoning-BFemS_FF.js +112 -0
- package/dist/src/memoryPoisoning-DRs2rbVV.cjs +111 -0
- package/dist/src/messages-Bc5oZoAJ.js +1128 -0
- package/dist/src/messages-BkaH8fRW.js +1127 -0
- package/dist/src/messages-CoHlziS5.js +1127 -0
- package/dist/src/messages-Cv_m6kYs.cjs +1161 -0
- package/dist/src/mischievousUser-BcyFxrqJ.js +51 -0
- package/dist/src/mischievousUser-BlhOQSd2.js +52 -0
- package/dist/src/mischievousUser-BuQiKE8D.js +51 -0
- package/dist/src/mischievousUser-ChIOk6cT.cjs +51 -0
- package/dist/src/modelslab-BXIWBTgX.js +171 -0
- package/dist/src/modelslab-ChVsUiaJ.js +170 -0
- package/dist/src/modelslab-DZ6BFlDv.js +170 -0
- package/dist/src/modelslab-DhRr-vyo.cjs +170 -0
- package/dist/src/nova-reel-BL8DrN4_.js +272 -0
- package/dist/src/nova-reel-BiOMUm5q.cjs +272 -0
- package/dist/src/nova-reel-CTsya1hV.js +273 -0
- package/dist/src/nova-reel-kgBY4Svd.js +272 -0
- package/dist/src/nova-sonic-CaSSA3Jq.cjs +374 -0
- package/dist/src/nova-sonic-DLpmoGsR.js +375 -0
- package/dist/src/nova-sonic-DwWc4SoN.js +374 -0
- package/dist/src/nova-sonic-qnReTaXm.js +374 -0
- package/dist/src/novita-B5mAt3Ui.js +114 -0
- package/dist/src/novita-D57vCjDD.js +116 -0
- package/dist/src/novita-ITRtG8IJ.js +115 -0
- package/dist/src/novita-Rh3T13YO.cjs +115 -0
- package/dist/src/nscale-8V7iZ_pI.js +210 -0
- package/dist/src/nscale-BQnMv4pH.cjs +209 -0
- package/dist/src/nscale-BWZXHZVF.js +209 -0
- package/dist/src/nscale-BqrHiUqU.js +207 -0
- package/dist/src/openaiResponses-BMtGTu8R.js +317 -0
- package/dist/src/openaiResponses-CvcI_viE.js +318 -0
- package/dist/src/openaiResponses-DYPZEMX1.cjs +318 -0
- package/dist/src/openaiResponses-DZTg1-kb.js +319 -0
- package/dist/src/openclaw-BeKuig4g.js +1338 -0
- package/dist/src/openclaw-COkdQ83y.js +1337 -0
- package/dist/src/openclaw-CSoX_HQ5.cjs +1344 -0
- package/dist/src/openclaw-DJlhPGCb.js +1336 -0
- package/dist/src/opencode-sdk-BEJftEs6.cjs +1018 -0
- package/dist/src/opencode-sdk-DMvBB3V7.js +1013 -0
- package/dist/src/opencode-sdk-Df7hMjLO.js +1012 -0
- package/dist/src/opencode-sdk-bQp5Xf3W.js +1012 -0
- package/dist/src/openinterpreter-B3GgVZjK.js +431 -0
- package/dist/src/openinterpreter-BiGcU-HN.cjs +435 -0
- package/dist/src/openinterpreter-Buj2l3Eh.js +432 -0
- package/dist/src/openinterpreter-C3_Cg5b_.js +431 -0
- package/dist/src/pricing-0Pampf0q.cjs +999 -0
- package/dist/src/pricing-B8VdhEhY.js +976 -0
- package/dist/src/pricing-CtLA-rKA.js +976 -0
- package/dist/src/promptfoo-4OkHtH9P.cjs +341 -0
- package/dist/src/promptfoo-Bhpm7sH6.js +286 -0
- package/dist/src/promptfoo-BqV8ogVA.js +285 -0
- package/dist/src/promptfoo-S1Q9OHk_.js +286 -0
- package/dist/src/providers-B5zs1ZRv.js +24437 -0
- package/dist/src/providers-Cd6CJh6m.js +2 -0
- package/dist/src/providers-CpJlgHET.js +24039 -0
- package/dist/src/providers-CzvLvK6G.cjs +24180 -0
- package/dist/src/quiverai-1E_IvLHn.js +325 -0
- package/dist/src/quiverai-BXH004Vv.js +325 -0
- package/dist/src/quiverai-Ccya2z8Y.cjs +325 -0
- package/dist/src/quiverai-Cez57oe-.js +326 -0
- package/dist/src/registry-3zX_M9Ik.js +131 -0
- package/dist/src/registry-AuCrKTvS.js +132 -0
- package/dist/src/registry-CxXWKtQG.js +131 -0
- package/dist/src/registry-DG3o66JQ.cjs +131 -0
- package/dist/src/remoteGeneration-CAtvamG6.js +370 -0
- package/dist/src/remoteGeneration-CF225pDl.cjs +482 -0
- package/dist/src/remoteGeneration-DtnqocnL.js +370 -0
- package/dist/src/remoteGeneration-g3KvW-sP.js +371 -0
- package/dist/src/responses-BMbaUXQI.js +1098 -0
- package/dist/src/responses-B_TOSof-.js +1099 -0
- package/dist/src/responses-v-yANwTA.cjs +1109 -0
- package/dist/src/runtimeTransform-BBZv-oUZ.js +156 -0
- package/dist/src/runtimeTransform-DT2v5ovW.js +156 -0
- package/dist/src/runtimeTransform-GXXEIXdS.cjs +161 -0
- package/dist/src/runtimeTransform-JTwBQc-P.js +157 -0
- package/dist/src/sagemaker-B8D0L4rj.cjs +716 -0
- package/dist/src/sagemaker-CR2_AGdB.js +713 -0
- package/dist/src/sagemaker-Cd9qSQUV.js +714 -0
- package/dist/src/sagemaker-mKlltN4p.js +713 -0
- package/dist/src/scanner-PG_8lh8r.js +1971 -0
- package/dist/src/server/index.js +55 -55
- package/dist/src/server-Bmh7sd9F.js +155 -0
- package/dist/src/server-C7b8z6aC.js +63 -0
- package/dist/src/server-CAcovgtL.js +2 -0
- package/dist/src/server-CuuMfKlh.cjs +74 -0
- package/dist/src/server-DMPCj9jy.js +189 -0
- package/dist/src/session-BksXvRH_.cjs +69 -0
- package/dist/src/session-DOxUjqGQ.js +63 -0
- package/dist/src/session-Dujsc-b9.js +62 -0
- package/dist/src/session-VjtIxREd.js +62 -0
- package/dist/src/shared-Bkyz_7e5.cjs +2185 -0
- package/dist/src/shared-DDJg8ycC.js +1929 -0
- package/dist/src/shared-Dh3yfRBd.js +1927 -0
- package/dist/src/shared-tfPT8Tna.js +1928 -0
- package/dist/src/simulatedUser-6JdkyL3k.cjs +252 -0
- package/dist/src/simulatedUser-CFr2mr3M.js +248 -0
- package/dist/src/simulatedUser-DjwwUqx-.js +247 -0
- package/dist/src/slack-C_gIYiUs.js +144 -0
- package/dist/src/slack-DhNbz9CM.cjs +144 -0
- package/dist/src/slack-Dm2iI1zu.js +145 -0
- package/dist/src/strategies-BIY-bNul.js +2248 -0
- package/dist/src/strategies-C1KQQj9G.cjs +2420 -0
- package/dist/src/strategies-DM_3mReG.js +2385 -0
- package/dist/src/telemetry-BhMTibZO.js +2 -0
- package/dist/src/telemetry-C04d25BM.cjs +216 -0
- package/dist/src/telemetry-CIqy4fSC.js +201 -0
- package/dist/src/telemetry-CXozp_6C.js +205 -0
- package/dist/src/telemetry-g7PkBxmY.js +205 -0
- package/dist/src/togetherai-BvCim68-.js +50 -0
- package/dist/src/togetherai-CWyDCA9m.cjs +49 -0
- package/dist/src/togetherai-CeSE31vK.js +49 -0
- package/dist/src/togetherai-_2W0URf8.js +48 -0
- package/dist/src/traceContext-Brw3Oe41.js +1016 -0
- package/dist/src/traceContext-DpAYv27G.js +1015 -0
- package/dist/src/traceContext-KSqhzZI2.cjs +1032 -0
- package/dist/src/transcription-BySopazW.js +175 -0
- package/dist/src/transcription-DO4UPkRI.cjs +178 -0
- package/dist/src/transcription-RJGBa-pC.js +176 -0
- package/dist/src/transcription-fZenF3G5.js +175 -0
- package/dist/src/transform-BzhRc5z2.js +125 -0
- package/dist/src/transform-CPQu05u6.cjs +154 -0
- package/dist/src/transform-DAED8imp.js +126 -0
- package/dist/src/transform-DIOIQDmM.js +125 -0
- package/dist/src/typesafe-ByE0Kxfg.js +253 -0
- package/dist/src/typesafe-CFqGFY34.js +253 -0
- package/dist/src/typesafe-DCWIw-CP.cjs +253 -0
- package/dist/src/typesafe-DyHFV5Qk.js +254 -0
- package/dist/src/util-BHkj9joz.js +2049 -0
- package/dist/src/util-CICwIpmu.cjs +934 -0
- package/dist/src/util-CePiY2xZ.js +286 -0
- package/dist/src/util-CgT3uf4p.js +743 -0
- package/dist/src/util-Cj9drvOY.js +1770 -0
- package/dist/src/util-ClJRjlQA.cjs +357 -0
- package/dist/src/util-Cxf8VF2M.js +395 -0
- package/dist/src/util-D7RdV7rS.js +395 -0
- package/dist/src/util-DMNFhk47.js +351 -0
- package/dist/src/util-DNzh3M0z.js +396 -0
- package/dist/src/util-Df7rfMGb.cjs +2305 -0
- package/dist/src/util-Kf0KnG_6.js +2051 -0
- package/dist/src/util-LEbeiYw_.js +743 -0
- package/dist/src/util-WH8CgVs4.js +352 -0
- package/dist/src/util-cx6Xw8Lw.cjs +478 -0
- package/dist/src/util-qzBqirBH.js +2050 -0
- package/dist/src/vertex-CBAMfRz3.js +854 -0
- package/dist/src/vertex-CMP2IpN9.js +2 -0
- package/dist/src/vertex-CZ5YOotT.js +848 -0
- package/dist/src/vertex-DNsh1F1M.cjs +871 -0
- package/dist/src/vertexLive-BTXYj3-F.js +55 -0
- package/dist/src/vertexLive-Ba_LAqEF.cjs +55 -0
- package/dist/src/vertexLive-DM4sFaaj.js +56 -0
- package/dist/src/vertexLive-JqZOw7HC.js +55 -0
- package/dist/src/video-BY7Q2Gii.cjs +706 -0
- package/dist/src/video-CYElP-CK.js +703 -0
- package/dist/src/video-C_AdEDH0.js +702 -0
- package/dist/src/video-DGvjQ_4j.js +702 -0
- package/package.json +1 -1
- package/dist/src/accounts-Dpb43yde.cjs +0 -276
- package/dist/src/accounts-GKrO1olH.js +0 -229
- package/dist/src/accounts-e4FGOsji.js +0 -227
- package/dist/src/accounts-sUiEJfkB.js +0 -222
- package/dist/src/agentWorkspace-B8A_wuMR.cjs +0 -619
- package/dist/src/agentWorkspace-DSPIscXR.js +0 -593
- package/dist/src/agentWorkspace-DxUqd-XK.js +0 -592
- package/dist/src/agentWorkspace-n0uOJXhD.js +0 -592
- package/dist/src/agentic-utils-9bCj4twQ.js +0 -197
- package/dist/src/agentic-utils-CyCLuLoj.js +0 -197
- package/dist/src/agentic-utils-D23qtOlx.cjs +0 -237
- package/dist/src/agentic-utils-DuBMMNCw.js +0 -198
- package/dist/src/agents-6hDRNoYD.js +0 -777
- package/dist/src/agents-B8w2o7Sc.cjs +0 -777
- package/dist/src/agents-Ck0NXl7v.js +0 -777
- package/dist/src/agents-CwT3B1qB.js +0 -778
- package/dist/src/agents-DOLjfOEq.js +0 -266
- package/dist/src/agents-OcF9hq--.js +0 -267
- package/dist/src/agents-api-CnZZt8bn.cjs +0 -710
- package/dist/src/agents-api-D04u3bmL.js +0 -711
- package/dist/src/agents-api-DWw0_Vio.js +0 -710
- package/dist/src/agents-api-IWHEwp8i.js +0 -710
- package/dist/src/agents-mHt2Mh9O.cjs +0 -266
- package/dist/src/agents-sICccZCA.js +0 -266
- package/dist/src/ai.studio-Ci4rypDT.js +0 -2
- package/dist/src/ai.studio-KkQ6KaHa.js +0 -369
- package/dist/src/ai.studio-gSXK2cGI.js +0 -374
- package/dist/src/ai.studio-nQF_B4DH.cjs +0 -391
- package/dist/src/aimlapi-BeSk5BDV.js +0 -30
- package/dist/src/aimlapi-CzNUhdKu.cjs +0 -29
- package/dist/src/aimlapi-DCkazDPI.js +0 -29
- package/dist/src/aimlapi-WeH5B6K1.js +0 -28
- package/dist/src/anthropicMessages-AcNWTpYO.js +0 -115
- package/dist/src/anthropicMessages-BUtvzbpL.js +0 -114
- package/dist/src/anthropicMessages-DTWhZDCd.js +0 -114
- package/dist/src/anthropicMessages-lGVnSgyx.cjs +0 -114
- package/dist/src/app/assets/index-CyEI5aDN.js +0 -392
- package/dist/src/audio-BE_Duiu1.js +0 -104
- package/dist/src/audio-CiUd00k2.cjs +0 -104
- package/dist/src/audio-Dop6omna.js +0 -105
- package/dist/src/audio-EZNTInr_.js +0 -104
- package/dist/src/authoritativeMarkupInjection-BUqH6hNk.js +0 -78
- package/dist/src/authoritativeMarkupInjection-BmbJdJO0.cjs +0 -78
- package/dist/src/authoritativeMarkupInjection-Cpz12Y3w.js +0 -78
- package/dist/src/authoritativeMarkupInjection-W4XfcH91.js +0 -79
- package/dist/src/aws-B2Jqbnet.js +0 -2433
- package/dist/src/aws-DHtuUIzQ.js +0 -1149
- package/dist/src/aws-DLqXP6wY.js +0 -2433
- package/dist/src/aws-DfduhmwL.cjs +0 -2454
- package/dist/src/base-B9L2Xvpc.js +0 -255
- package/dist/src/base-BTZnIsuH.cjs +0 -305
- package/dist/src/base-BhaWNQPJ.js +0 -462
- package/dist/src/base-Br-G_Xou.js +0 -256
- package/dist/src/base-Bzo8hiUS.cjs +0 -467
- package/dist/src/base-C82fd2jq.js +0 -463
- package/dist/src/base-CRdQwC1W.js +0 -462
- package/dist/src/base-CjGwZNOQ.js +0 -255
- package/dist/src/bedrock-BdMru_ro.js +0 -1300
- package/dist/src/bedrock-CBUmfLX1.cjs +0 -2
- package/dist/src/bedrock-DBDxBaF9.js +0 -2
- package/dist/src/bedrock-DDrECM21.js +0 -1
- package/dist/src/bedrock-DVwkgvRS.js +0 -1
- package/dist/src/bestOfN-AKF5beq4.js +0 -159
- package/dist/src/bestOfN-C1UIVGJV.js +0 -160
- package/dist/src/bestOfN-DlkETbXy.cjs +0 -161
- package/dist/src/bestOfN-XIfEgU-g.js +0 -159
- package/dist/src/cache-BZaVoKaA.js +0 -2
- package/dist/src/cache-CEYhFUsH.js +0 -741
- package/dist/src/cache-Cbw1zH6q.js +0 -782
- package/dist/src/cache-CdaZNb75.js +0 -754
- package/dist/src/cache-DpuIzPxh.cjs +0 -856
- package/dist/src/cerebras-Bpn6FPkJ.js +0 -97
- package/dist/src/cerebras-CqJ0BRCJ.cjs +0 -97
- package/dist/src/cerebras-D4ILa_TY.js +0 -97
- package/dist/src/cerebras-DR8uc7ee.js +0 -98
- package/dist/src/chat-B7PZfaYp.cjs +0 -987
- package/dist/src/chat-BVuSjdEb.js +0 -227
- package/dist/src/chat-BsaZRjXN.js +0 -76
- package/dist/src/chat-C5liqe3Y.js +0 -226
- package/dist/src/chat-C9hyHf5B.js +0 -124
- package/dist/src/chat-CFLalAck.js +0 -226
- package/dist/src/chat-CN8JGrHu.js +0 -76
- package/dist/src/chat-CaHBBpCb.js +0 -123
- package/dist/src/chat-CcbLSghx.js +0 -123
- package/dist/src/chat-CoSN6sr2.js +0 -934
- package/dist/src/chat-CsJRFX8a.cjs +0 -226
- package/dist/src/chat-DFoZLvO_.js +0 -934
- package/dist/src/chat-DiLQvL7r.js +0 -77
- package/dist/src/chat-F6qVSDk3.cjs +0 -123
- package/dist/src/chat-Oq4FaJgI.cjs +0 -76
- package/dist/src/chat-knMfQUKz.js +0 -935
- package/dist/src/claude-agent-sdk-CJkOLpnI.js +0 -999
- package/dist/src/claude-agent-sdk-Ckn76PRD.js +0 -999
- package/dist/src/claude-agent-sdk-DX0gTr11.cjs +0 -1005
- package/dist/src/claude-agent-sdk-LMeikxoR.js +0 -1000
- package/dist/src/client-BFf1r6Z8.js +0 -352
- package/dist/src/client-CdXyDdDi.js +0 -351
- package/dist/src/client-DV8XMu7i.js +0 -351
- package/dist/src/client-iEXtOBKW.cjs +0 -357
- package/dist/src/cloud-B02qcpjf.js +0 -2
- package/dist/src/cloud-BlHP-g1v.cjs +0 -666
- package/dist/src/cloud-C9BI4isF.js +0 -287
- package/dist/src/cloud-CTTLNdvj.js +0 -657
- package/dist/src/cloud-D5X5yQ_d.js +0 -599
- package/dist/src/cloud-QxPkpsHA.js +0 -599
- package/dist/src/cloudflare-ai-DRTRT1fc.js +0 -132
- package/dist/src/cloudflare-ai-DgaXapAV.cjs +0 -133
- package/dist/src/cloudflare-ai-DkuJXijS.js +0 -134
- package/dist/src/cloudflare-ai-wy9QCHku.js +0 -133
- package/dist/src/cloudflare-gateway-9cAN8g29.cjs +0 -276
- package/dist/src/cloudflare-gateway-BVFMD292.js +0 -277
- package/dist/src/cloudflare-gateway-BuUI4p6I.js +0 -276
- package/dist/src/cloudflare-gateway-TlYHizbW.js +0 -276
- package/dist/src/codex-app-server-BPz_feug.cjs +0 -2162
- package/dist/src/codex-app-server-C9noXM9C.js +0 -2155
- package/dist/src/codex-app-server-CEmD-Y5U.js +0 -2
- package/dist/src/codex-app-server-DZolc18r.js +0 -2156
- package/dist/src/codex-app-server-Dd0A37nO.js +0 -2155
- package/dist/src/codex-sdk-BbxjBvBk.cjs +0 -1588
- package/dist/src/codex-sdk-BpXeIs-_.js +0 -1557
- package/dist/src/codex-sdk-BtQp5X0f.js +0 -1552
- package/dist/src/codex-sdk-CH0v9Bk1.js +0 -2
- package/dist/src/codex-sdk-CgrN7JB8.js +0 -1557
- package/dist/src/codex-security-B5fENNUr.js +0 -406
- package/dist/src/codex-security-C6uuJx-y.cjs +0 -411
- package/dist/src/codex-security-CifWtZR_.js +0 -407
- package/dist/src/codex-security-Kg2bOEKy.js +0 -406
- package/dist/src/cometapi-BFpIDLIx.js +0 -55
- package/dist/src/cometapi-C6O2PIrN.js +0 -56
- package/dist/src/cometapi-D5Yupc6F.js +0 -53
- package/dist/src/cometapi-DzgIwJzJ.cjs +0 -55
- package/dist/src/compatible-0jhmVfOp.js +0 -25
- package/dist/src/compatible-DdtwWdJi.cjs +0 -24
- package/dist/src/compatible-Di4nR3sU.js +0 -24
- package/dist/src/compatible-iJKLWdnf.js +0 -24
- package/dist/src/completion-B0_hVUDG.js +0 -119
- package/dist/src/completion-BdI6v0-Q.cjs +0 -123
- package/dist/src/completion-CWcJscwv.js +0 -118
- package/dist/src/conversationScoring-99EOPJRa.js +0 -373
- package/dist/src/conversationScoring-BIq4J0Cq.js +0 -374
- package/dist/src/conversationScoring-DARyeATr.cjs +0 -398
- package/dist/src/conversationScoring-DS48t4Hb.js +0 -373
- package/dist/src/crescendo-CebvXIu4.js +0 -730
- package/dist/src/crescendo-CxrLS0oo.js +0 -732
- package/dist/src/crescendo-DZQXBSkj.js +0 -733
- package/dist/src/crescendo-wjEx68uD.cjs +0 -734
- package/dist/src/custom-BiQ-aUNw.cjs +0 -620
- package/dist/src/custom-ByyB5Z93.js +0 -619
- package/dist/src/custom-C5jOevNb.js +0 -617
- package/dist/src/custom-CCrsCz8o.js +0 -618
- package/dist/src/dataUrl-C9J7wz9H.js +0 -3133
- package/dist/src/dataUrl-CGsBT7UZ.cjs +0 -3187
- package/dist/src/dataUrl-CzKvvWNO.js +0 -2868
- package/dist/src/decisions-BTusXCUx.cjs +0 -514
- package/dist/src/decisions-BYtL9edD.js +0 -515
- package/dist/src/decisions-jYix_gCF.js +0 -515
- package/dist/src/decisions-nxxfHRAN.js +0 -516
- package/dist/src/docker-DDIv4zkg.js +0 -93
- package/dist/src/docker-DVLp_5OG.js +0 -94
- package/dist/src/docker-INm9w0SY.cjs +0 -94
- package/dist/src/docker-sGuoCul_.js +0 -95
- package/dist/src/embedding-CAhqLLrR.js +0 -82
- package/dist/src/embedding-D94GAsti.cjs +0 -86
- package/dist/src/embedding-zb4MAzQy.js +0 -81
- package/dist/src/envoy-BMPszwEa.cjs +0 -60
- package/dist/src/envoy-Bp-s39_8.js +0 -60
- package/dist/src/envoy-BswDt-Ou.js +0 -61
- package/dist/src/envoy-rVbYcV80.js +0 -60
- package/dist/src/eval-B1-XfrC7.js +0 -2
- package/dist/src/eval-pC4qCvLw.js +0 -1920
- package/dist/src/evalResult-CzjCb5bd.js +0 -1300
- package/dist/src/evaluator-CNq2K7J_.js +0 -10578
- package/dist/src/evaluator-LtfxdxEu.js +0 -2
- package/dist/src/evaluatorHelpers-C5J0NYpQ.js +0 -601
- package/dist/src/evaluatorHelpers-DcdCglCs.cjs +0 -622
- package/dist/src/evaluatorHelpers-Rvb88W6B.js +0 -600
- package/dist/src/fetch-5HtnNhHg.js +0 -1556
- package/dist/src/fetch-BCwjoIFd.js +0 -1559
- package/dist/src/fetch-BhfUnKen.js +0 -1280
- package/dist/src/fetch-C08w4vVl.js +0 -9
- package/dist/src/fetch-DBxy8Tlb.cjs +0 -14
- package/dist/src/fetch-DYte6oQX.cjs +0 -1853
- package/dist/src/fetch-ElpfcAVG.js +0 -10
- package/dist/src/fetch-lM1OIaSt.js +0 -2
- package/dist/src/functionCallbackUtils-BCAdWfHO.js +0 -246
- package/dist/src/functionCallbackUtils-BYq9qOhG.js +0 -245
- package/dist/src/functionCallbackUtils-ByWkmVud.cjs +0 -262
- package/dist/src/functionCallbackUtils-D_C_JaFd.js +0 -245
- package/dist/src/gemini-image-CAlwaJhZ.js +0 -471
- package/dist/src/gemini-image-DJoVoOnZ.cjs +0 -471
- package/dist/src/gemini-image-Waio-9Xx.js +0 -472
- package/dist/src/gemini-image-vbY6Ftbf.js +0 -471
- package/dist/src/goat-BWbtyY9c.js +0 -512
- package/dist/src/goat-CXzzeCOQ.cjs +0 -515
- package/dist/src/goat-CfgvzSgZ.js +0 -514
- package/dist/src/goat-DLeoIHBp.js +0 -515
- package/dist/src/goblin-CmfCfwqk.cjs +0 -22
- package/dist/src/goblin-CtcaORRH.js +0 -22
- package/dist/src/goblin-DF6DDhM-.js +0 -22
- package/dist/src/goblin-Nai0xxBV.js +0 -23
- package/dist/src/google-ClpkLtKL.cjs +0 -142
- package/dist/src/google-CrFgKu9k.js +0 -143
- package/dist/src/google-Dj_EIBqS.js +0 -142
- package/dist/src/google-e4-vARv6.js +0 -142
- package/dist/src/graders-BN1IIa71.js +0 -15470
- package/dist/src/graders-C5sCfSP5.js +0 -2
- package/dist/src/hydra-B7RfXVBK.js +0 -2
- package/dist/src/hydra-C1cFN-Jg.js +0 -613
- package/dist/src/hydra-CK6Uc1ia.js +0 -612
- package/dist/src/hydra-Dg65rAP_.js +0 -610
- package/dist/src/hydra-Fqx8l_Xu.cjs +0 -612
- package/dist/src/image-BdlUDAtp.js +0 -163
- package/dist/src/image-C-KwEhwt.cjs +0 -163
- package/dist/src/image-C76fp6NK.cjs +0 -209
- package/dist/src/image-D75ehv3D.js +0 -482
- package/dist/src/image-DKtc5v5W.js +0 -209
- package/dist/src/image-DT_xOkJY.js +0 -163
- package/dist/src/image-DVpdllEE.js +0 -209
- package/dist/src/image-DXZ8AzMf.js +0 -481
- package/dist/src/image-DZl_1mvy.js +0 -164
- package/dist/src/image-DcTD7Ak0.cjs +0 -504
- package/dist/src/image-ndxEvBKB.js +0 -210
- package/dist/src/indirectWebPwn-70WA5x_q.js +0 -435
- package/dist/src/indirectWebPwn-BRVyd3qV.cjs +0 -463
- package/dist/src/indirectWebPwn-BsJVsu0q.js +0 -285
- package/dist/src/indirectWebPwn-Cw6yJu0i.js +0 -285
- package/dist/src/indirectWebPwn-D-PhJzo4.js +0 -286
- package/dist/src/indirectWebPwn-DRPHt2I8.js +0 -434
- package/dist/src/indirectWebPwn-DXtfFhd9.cjs +0 -285
- package/dist/src/indirectWebPwn-DvpNouzc.js +0 -434
- package/dist/src/interactions-5ixfW7Cl.js +0 -850
- package/dist/src/interactions-BOUzfmg1.cjs +0 -850
- package/dist/src/interactions-CSSXcGNc.js +0 -851
- package/dist/src/interactions-WB_sgkN0.js +0 -850
- package/dist/src/iterative-BShRNqjC.cjs +0 -549
- package/dist/src/iterative-BcW_ELtB.js +0 -548
- package/dist/src/iterative-BpHbHz8B.js +0 -547
- package/dist/src/iterative-YcchP12d.js +0 -545
- package/dist/src/iterativeImage-BMFE5Hl7.cjs +0 -419
- package/dist/src/iterativeImage-CkSaYLMY.js +0 -417
- package/dist/src/iterativeImage-DAEUlQX_.js +0 -418
- package/dist/src/iterativeImage-DeUSkEnj.js +0 -417
- package/dist/src/iterativeMeta-DbdaKdEO.cjs +0 -439
- package/dist/src/iterativeMeta-DcF9JWEK.js +0 -437
- package/dist/src/iterativeMeta-DkfPqWIC.js +0 -439
- package/dist/src/iterativeMeta-DkrpnVSs.js +0 -440
- package/dist/src/iterativeTree-CEMY1FhE.cjs +0 -879
- package/dist/src/iterativeTree-Cv5W4tX9.js +0 -877
- package/dist/src/iterativeTree-DGvomd3M.js +0 -876
- package/dist/src/iterativeTree-KbtC2Mkz.js +0 -878
- package/dist/src/knowledgeBase-AYRXn4wO.js +0 -163
- package/dist/src/knowledgeBase-BNqQfx01.js +0 -163
- package/dist/src/knowledgeBase-C0IaCCVs.js +0 -164
- package/dist/src/knowledgeBase-C2uj6wK4.cjs +0 -163
- package/dist/src/litellm-CN1ScAwZ.js +0 -147
- package/dist/src/litellm-CTjwiKSa.js +0 -146
- package/dist/src/litellm-Cd4Nj5ue.js +0 -145
- package/dist/src/litellm-DMqLpEBg.cjs +0 -146
- package/dist/src/live-Bt50-InO.cjs +0 -891
- package/dist/src/live-Bu2ujadG.js +0 -2
- package/dist/src/live-C3M52i3p.js +0 -891
- package/dist/src/live-CRfHMO3B.js +0 -892
- package/dist/src/live-iCIpO14m.js +0 -891
- package/dist/src/luma-ray-B8eHC4c8.cjs +0 -309
- package/dist/src/luma-ray-BIvkPw0s.js +0 -309
- package/dist/src/luma-ray-ChsiBxMA.js +0 -309
- package/dist/src/luma-ray-DAvKrInz.js +0 -310
- package/dist/src/mantleChat-5YeEXAZI.js +0 -154
- package/dist/src/mantleChat-D--mW3hl.js +0 -154
- package/dist/src/mantleChat-DHP3siNg.cjs +0 -154
- package/dist/src/mantleChat-wBfAX46o.js +0 -155
- package/dist/src/mcp-49jlEcTQ.js +0 -85
- package/dist/src/mcp-__PIz81I.js +0 -84
- package/dist/src/memoryPoisoning-Chxge74M.js +0 -111
- package/dist/src/memoryPoisoning-QH6NCUVE.js +0 -112
- package/dist/src/memoryPoisoning-tCxZt8Nz.js +0 -111
- package/dist/src/memoryPoisoning-ymrRItRR.cjs +0 -111
- package/dist/src/messages-BE_eZ7NA.js +0 -1127
- package/dist/src/messages-Bo638ShI.js +0 -1127
- package/dist/src/messages-BzR0-NQ1.js +0 -1128
- package/dist/src/messages-Cbg5Pfd0.cjs +0 -1161
- package/dist/src/mischievousUser-BtED2Z5Z.cjs +0 -51
- package/dist/src/mischievousUser-KqSOjrDJ.js +0 -51
- package/dist/src/mischievousUser-YMD41YNZ.js +0 -51
- package/dist/src/mischievousUser-zBxlNdCu.js +0 -52
- package/dist/src/modelslab-B8gZxtfE.js +0 -171
- package/dist/src/modelslab-C7bmVpTB.js +0 -170
- package/dist/src/modelslab-CCeQCTZg.js +0 -170
- package/dist/src/modelslab-CvBJGv7y.cjs +0 -170
- package/dist/src/nova-reel-BOEWsEKA.cjs +0 -272
- package/dist/src/nova-reel-BtyBXq5M.js +0 -273
- package/dist/src/nova-reel-C1eF3-EE.js +0 -272
- package/dist/src/nova-reel-YhgrxEKT.js +0 -272
- package/dist/src/nova-sonic-BaERP20w.js +0 -374
- package/dist/src/nova-sonic-CxgM3O-P.cjs +0 -374
- package/dist/src/nova-sonic-DJS22fC3.js +0 -375
- package/dist/src/nova-sonic-DwvwHyRX.js +0 -374
- package/dist/src/novita-D1l2tG0O.js +0 -116
- package/dist/src/novita-D84VM3v0.cjs +0 -115
- package/dist/src/novita-DGInvwfR.js +0 -115
- package/dist/src/novita-vXHkXhTg.js +0 -114
- package/dist/src/nscale-CU0Ldr00.js +0 -209
- package/dist/src/nscale-ClfKlQeM.cjs +0 -209
- package/dist/src/nscale-DxaVnF0x.js +0 -210
- package/dist/src/nscale-_poVxIrO.js +0 -207
- package/dist/src/openaiResponses-CJGsneNj.js +0 -317
- package/dist/src/openaiResponses-CKSl5Sdg.js +0 -319
- package/dist/src/openaiResponses-DC8rzFUc.js +0 -318
- package/dist/src/openaiResponses-rMHIA3dV.cjs +0 -318
- package/dist/src/openclaw-CCbvsNFW.cjs +0 -1344
- package/dist/src/openclaw-CZw1lCDZ.js +0 -1336
- package/dist/src/openclaw-ChFLgC-a.js +0 -1338
- package/dist/src/openclaw-DrPMoRrH.js +0 -1337
- package/dist/src/opencode-sdk-2EfIDhFp.cjs +0 -1018
- package/dist/src/opencode-sdk-CHw3F845.js +0 -1013
- package/dist/src/opencode-sdk-D0EGGxvy.js +0 -1012
- package/dist/src/opencode-sdk-jSS7NI2Q.js +0 -1012
- package/dist/src/openinterpreter-CY622xHC.js +0 -431
- package/dist/src/openinterpreter-DATyhuhP.js +0 -432
- package/dist/src/openinterpreter-DDUMyIf1.js +0 -431
- package/dist/src/openinterpreter-s5Tz6Lid.cjs +0 -435
- package/dist/src/pricing-C498twd2.js +0 -976
- package/dist/src/pricing-DBd_bMIh.cjs +0 -999
- package/dist/src/pricing-ISrMCskv.js +0 -976
- package/dist/src/promptfoo-6p0WG2ih.js +0 -286
- package/dist/src/promptfoo-BQRfgNs_.js +0 -285
- package/dist/src/promptfoo-Bqo88z20.cjs +0 -341
- package/dist/src/promptfoo-Cq5AVI3I.js +0 -286
- package/dist/src/providers-ATbeMX5E.cjs +0 -24180
- package/dist/src/providers-B7F1FiNI.js +0 -2
- package/dist/src/providers-DazIw8mI.js +0 -24039
- package/dist/src/providers-QvGlNAD0.js +0 -24437
- package/dist/src/quiverai-BPlNcLkV.cjs +0 -325
- package/dist/src/quiverai-By99-YmJ.js +0 -325
- package/dist/src/quiverai-CmmByDqo.js +0 -325
- package/dist/src/quiverai-HZkoJJqw.js +0 -326
- package/dist/src/registry-BLTnTfjT.cjs +0 -131
- package/dist/src/registry-BMC-COHT.js +0 -132
- package/dist/src/registry-C8UZtmBp.js +0 -131
- package/dist/src/registry-CfwEUYXG.js +0 -131
- package/dist/src/remoteGeneration-Bgg6kC5V.js +0 -370
- package/dist/src/remoteGeneration-CKJFE960.cjs +0 -482
- package/dist/src/remoteGeneration-DaxwJDKv.js +0 -370
- package/dist/src/remoteGeneration-vHMGVKr1.js +0 -371
- package/dist/src/responses-BvnyIHrq.js +0 -1099
- package/dist/src/responses-CERAgvf-.js +0 -1098
- package/dist/src/responses-CwgjeuOg.cjs +0 -1109
- package/dist/src/runtimeTransform-3RF9Avyg.cjs +0 -161
- package/dist/src/runtimeTransform-C51Z5j4H.js +0 -156
- package/dist/src/runtimeTransform-CKE_Iyv8.js +0 -157
- package/dist/src/runtimeTransform-Cs11xJpj.js +0 -156
- package/dist/src/sagemaker-BJ4dOCxE.js +0 -713
- package/dist/src/sagemaker-Bt3JUAWq.js +0 -714
- package/dist/src/sagemaker-QVKyLgLF.cjs +0 -716
- package/dist/src/sagemaker-l3IB8iTs.js +0 -713
- package/dist/src/scanner-DGjIiTZ1.js +0 -1971
- package/dist/src/server-BNaLZH6u.js +0 -63
- package/dist/src/server-CBMuQul3.js +0 -189
- package/dist/src/server-CMKKIzKv.cjs +0 -74
- package/dist/src/server-CN2IS9Cs.js +0 -155
- package/dist/src/server-ua4cqbjC.js +0 -2
- package/dist/src/session-CQIjq_HZ.cjs +0 -69
- package/dist/src/session-FTlg8sEu.js +0 -62
- package/dist/src/session-GBQXtPWp.js +0 -63
- package/dist/src/session-_0-rTdwY.js +0 -62
- package/dist/src/shared-BtuO-OAM.js +0 -1927
- package/dist/src/shared-Ci78wTZX.js +0 -1928
- package/dist/src/shared-Dd3rimdM.js +0 -1929
- package/dist/src/shared-KAjFxRre.cjs +0 -2185
- package/dist/src/simulatedUser--OjW6xCx.js +0 -247
- package/dist/src/simulatedUser-D0-slRye.cjs +0 -252
- package/dist/src/simulatedUser-D1Kh_cwA.js +0 -248
- package/dist/src/slack-BX0FUevO.js +0 -144
- package/dist/src/slack-CcwXFiJE.cjs +0 -144
- package/dist/src/slack-CnfqKfXp.js +0 -145
- package/dist/src/strategies-2ntcK4tN.js +0 -2248
- package/dist/src/strategies-DZIW7Zcs.js +0 -2385
- package/dist/src/strategies-YRDF2j-N.cjs +0 -2420
- package/dist/src/telemetry-CL8CVA4p.js +0 -205
- package/dist/src/telemetry-Cix90qqz.js +0 -201
- package/dist/src/telemetry-CkmlqTjV.js +0 -205
- package/dist/src/telemetry-DQH7l5bb.js +0 -2
- package/dist/src/telemetry-DUCXc1-r.cjs +0 -216
- package/dist/src/togetherai-3yUt5Ck7.js +0 -49
- package/dist/src/togetherai-BJUByLwt.cjs +0 -49
- package/dist/src/togetherai-Bh6KZkmd.js +0 -50
- package/dist/src/togetherai-DDl9yk3b.js +0 -48
- package/dist/src/traceContext-BiJVppjT.cjs +0 -1032
- package/dist/src/traceContext-CKKluULP.js +0 -1016
- package/dist/src/traceContext-D3Sk8fO-.js +0 -1015
- package/dist/src/transcription-BoVQKIVz.js +0 -175
- package/dist/src/transcription-Bs5u8780.js +0 -175
- package/dist/src/transcription-Dl654d1p.cjs +0 -178
- package/dist/src/transcription-VEvhM1Fu.js +0 -176
- package/dist/src/transform-BAbkGpvl.js +0 -125
- package/dist/src/transform-C_j4hUH8.js +0 -126
- package/dist/src/transform-Da86hs4M.cjs +0 -154
- package/dist/src/transform-_i1raQNo.js +0 -125
- package/dist/src/typesafe-CKXBeh82.cjs +0 -253
- package/dist/src/typesafe-D3VaGeNm.js +0 -253
- package/dist/src/typesafe-DYM-SFNH.js +0 -253
- package/dist/src/typesafe-LXmSbw8F.js +0 -254
- package/dist/src/util-41rb0XHX.js +0 -743
- package/dist/src/util-B0WlHYFM.js +0 -2049
- package/dist/src/util-BD1R_PsR.js +0 -1770
- package/dist/src/util-BLbM_ItC.js +0 -395
- package/dist/src/util-C72P0iIa.js +0 -352
- package/dist/src/util-C7MpGlJ6.cjs +0 -2305
- package/dist/src/util-CCtqagKc.js +0 -286
- package/dist/src/util-CM2Ec_uY.js +0 -2051
- package/dist/src/util-CSSAWO8v.js +0 -351
- package/dist/src/util-CkQc-fx3.cjs +0 -934
- package/dist/src/util-DcOlFTFa.cjs +0 -478
- package/dist/src/util-DluGTGVB.js +0 -395
- package/dist/src/util-PfQ60chz.js +0 -743
- package/dist/src/util-f14-CPij.js +0 -396
- package/dist/src/util-l9pXX3Eu.cjs +0 -357
- package/dist/src/util-o_BnlYqS.js +0 -2050
- package/dist/src/vertex-B_-gQgzc.js +0 -2
- package/dist/src/vertex-CU4gqoYa.js +0 -854
- package/dist/src/vertex-DZ42UHb3.js +0 -848
- package/dist/src/vertex-DsYQJA0T.cjs +0 -871
- package/dist/src/vertexLive-BvIaHKGB.js +0 -55
- package/dist/src/vertexLive-CTULqNx7.js +0 -56
- package/dist/src/vertexLive-DjJ_YQBe.cjs +0 -55
- package/dist/src/vertexLive-STUGcteB.js +0 -55
- package/dist/src/video-CAQGmtEV.js +0 -703
- package/dist/src/video-_FSTWlwX.js +0 -702
- package/dist/src/video-aBPJPWdt.js +0 -702
- package/dist/src/video-gDjkWv5m.cjs +0 -706
|
@@ -0,0 +1,1300 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Q as getEnvString, X as getEnvInt, Y as getEnvFloat, c as logger } from "./logger-pCNnmVuz.js";
|
|
3
|
+
import { f as parseChatPrompt } from "./shared-DS_sDrmK.js";
|
|
4
|
+
import { c as maybeLoadToolsFromExternalFile } from "./file-DnhgJopr.js";
|
|
5
|
+
import "./util-Cj9drvOY.js";
|
|
6
|
+
import { d as isCacheEnabled, o as getCache } from "./cache-D-9eZN3I.js";
|
|
7
|
+
import { d as createEmptyTokenUsage } from "./tokenUsageUtils-CHs91tUW.js";
|
|
8
|
+
import { A as parseMessages, C as isForcedToolChoiceUnsupportedClaudeModel, M as resolveClaudeSamplingParams, O as normalizeClaudeThinkingConfig, T as isThinkingOnByDefaultClaudeModel, f as getTokenUsage, k as outputFromMessage, p as isAlwaysOnAdaptiveThinkingClaudeModel, s as clampMaxTokensForThinkingBudget, w as isSamplingParamsDeprecatedClaudeModel, x as isClaudeThinkingEnabled } from "./util-TfpE49TI.js";
|
|
9
|
+
import { u as requiresBedrockAnthropicMessagesModel } from "./routing-D4szcohi.js";
|
|
10
|
+
import { c as novaParseMessages, i as INFERENCE_PROFILE_PREFIX, n as createBedrockCacheKeyHash, s as novaOutputFromMessage, t as AwsBedrockGenericProvider } from "./base-DyLOZ_iX.js";
|
|
11
|
+
import { i as isBedrockGrok46Profile, n as calculateBedrockInvokeModelCost } from "./pricing-BLSYUBjO.js";
|
|
12
|
+
import dedent from "dedent";
|
|
13
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
14
|
+
//#region src/providers/bedrock/index.ts
|
|
15
|
+
const coerceStrToNum = (value) => value === void 0 ? void 0 : typeof value === "string" ? Number(value) : value;
|
|
16
|
+
function getNovaTokenUsage(responseJson) {
|
|
17
|
+
const usage = responseJson?.usage;
|
|
18
|
+
if (!usage) return missingBedrockTokenUsage();
|
|
19
|
+
return {
|
|
20
|
+
prompt: coerceStrToNum(usage.inputTokens),
|
|
21
|
+
completion: coerceStrToNum(usage.outputTokens),
|
|
22
|
+
total: coerceStrToNum(usage.totalTokens),
|
|
23
|
+
numRequests: 1
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function getCohereTokenUsage(responseJson) {
|
|
27
|
+
if (responseJson?.meta?.billed_units) {
|
|
28
|
+
const inputTokens = coerceStrToNum(responseJson.meta.billed_units.input_tokens);
|
|
29
|
+
const outputTokens = coerceStrToNum(responseJson.meta.billed_units.output_tokens);
|
|
30
|
+
return {
|
|
31
|
+
prompt: inputTokens,
|
|
32
|
+
completion: outputTokens,
|
|
33
|
+
total: (inputTokens ?? 0) + (outputTokens ?? 0),
|
|
34
|
+
numRequests: 1
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return missingBedrockTokenUsage();
|
|
38
|
+
}
|
|
39
|
+
function missingBedrockTokenUsage() {
|
|
40
|
+
return {
|
|
41
|
+
prompt: void 0,
|
|
42
|
+
completion: void 0,
|
|
43
|
+
total: void 0,
|
|
44
|
+
numRequests: 1
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function parseValue(value, defaultValue) {
|
|
48
|
+
if (typeof defaultValue === "number") {
|
|
49
|
+
if (typeof value === "string") return Number.isNaN(Number.parseFloat(value)) ? defaultValue : Number.parseFloat(value);
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
function addConfigParam(params, key, configValue, envValue, defaultValue) {
|
|
55
|
+
if (configValue !== void 0 || envValue !== void 0 || defaultValue !== void 0) params[key] = configValue ?? (envValue === void 0 ? defaultValue : parseValue(envValue, defaultValue));
|
|
56
|
+
}
|
|
57
|
+
function getOpenAiCompatibleTokenUsage(responseJson, _promptText) {
|
|
58
|
+
const usage = responseJson?.usage;
|
|
59
|
+
return {
|
|
60
|
+
prompt: coerceStrToNum(usage?.prompt_tokens),
|
|
61
|
+
completion: coerceStrToNum(usage?.completion_tokens),
|
|
62
|
+
total: coerceStrToNum(usage?.total_tokens),
|
|
63
|
+
numRequests: 1
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const BEDROCK_MISTRAL_CHAT_MODEL = {
|
|
67
|
+
params: async (config, prompt, stop, _modelName) => {
|
|
68
|
+
const params = { messages: parseChatPrompt(prompt, [{
|
|
69
|
+
role: "user",
|
|
70
|
+
content: prompt
|
|
71
|
+
}]) };
|
|
72
|
+
addConfigParam(params, "max_tokens", config?.max_tokens, getEnvInt("MISTRAL_MAX_TOKENS"), 1024);
|
|
73
|
+
addConfigParam(params, "temperature", config?.temperature, getEnvFloat("MISTRAL_TEMPERATURE"), 0);
|
|
74
|
+
addConfigParam(params, "top_p", config?.top_p, getEnvFloat("MISTRAL_TOP_P"), 1);
|
|
75
|
+
if (stop && stop.length > 0) addConfigParam(params, "stop", stop);
|
|
76
|
+
return params;
|
|
77
|
+
},
|
|
78
|
+
output: (_config, responseJson) => {
|
|
79
|
+
if (responseJson?.choices && Array.isArray(responseJson.choices)) return responseJson.choices[0]?.message?.content;
|
|
80
|
+
},
|
|
81
|
+
tokenUsage: (responseJson, _promptText) => {
|
|
82
|
+
if (responseJson?.prompt_tokens !== void 0 && responseJson?.completion_tokens !== void 0) {
|
|
83
|
+
const promptTokens = coerceStrToNum(responseJson.prompt_tokens);
|
|
84
|
+
const completionTokens = coerceStrToNum(responseJson.completion_tokens);
|
|
85
|
+
return {
|
|
86
|
+
prompt: promptTokens,
|
|
87
|
+
completion: completionTokens,
|
|
88
|
+
total: (promptTokens ?? 0) + (completionTokens ?? 0),
|
|
89
|
+
numRequests: 1
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (responseJson?.usage?.prompt_tokens !== void 0 && responseJson?.usage?.completion_tokens !== void 0) {
|
|
93
|
+
const promptTokens = coerceStrToNum(responseJson.usage.prompt_tokens);
|
|
94
|
+
const completionTokens = coerceStrToNum(responseJson.usage.completion_tokens);
|
|
95
|
+
return {
|
|
96
|
+
prompt: promptTokens,
|
|
97
|
+
completion: completionTokens,
|
|
98
|
+
total: coerceStrToNum(responseJson.usage.total_tokens) ?? (promptTokens !== void 0 && completionTokens !== void 0 ? promptTokens + completionTokens : void 0),
|
|
99
|
+
numRequests: 1
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return missingBedrockTokenUsage();
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const BEDROCK_DEEPSEEK_CHAT_MODEL = {
|
|
106
|
+
params: async (config, prompt, stop, _modelName) => {
|
|
107
|
+
const params = { messages: parseChatPrompt(prompt, [{
|
|
108
|
+
role: "user",
|
|
109
|
+
content: prompt
|
|
110
|
+
}]) };
|
|
111
|
+
addConfigParam(params, "max_tokens", config?.max_tokens, getEnvInt("AWS_BEDROCK_MAX_TOKENS"), void 0);
|
|
112
|
+
addConfigParam(params, "temperature", config?.temperature, getEnvFloat("AWS_BEDROCK_TEMPERATURE"), 0);
|
|
113
|
+
addConfigParam(params, "top_p", config?.top_p, getEnvFloat("AWS_BEDROCK_TOP_P"), 1);
|
|
114
|
+
if (stop && stop.length > 0) addConfigParam(params, "stop", stop);
|
|
115
|
+
return params;
|
|
116
|
+
},
|
|
117
|
+
output: (_config, responseJson) => {
|
|
118
|
+
if (responseJson.error) throw new Error(`DeepSeek API error: ${responseJson.error}`);
|
|
119
|
+
return responseJson.choices?.[0]?.message?.content;
|
|
120
|
+
},
|
|
121
|
+
tokenUsage: getOpenAiCompatibleTokenUsage
|
|
122
|
+
};
|
|
123
|
+
const LlamaVersion = {
|
|
124
|
+
V2: 2,
|
|
125
|
+
V3: 3,
|
|
126
|
+
V3_1: 3.1,
|
|
127
|
+
V3_2: 3.2,
|
|
128
|
+
V3_3: 3.3,
|
|
129
|
+
V4: 4
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Extracts base64 image data from an image block.
|
|
133
|
+
* Handles multiple formats: data URL, source.bytes, source.data, image_url.url
|
|
134
|
+
*/
|
|
135
|
+
function extractImageData(block) {
|
|
136
|
+
const imageUrl = block.image_url?.url || block.type === "image_url" && block.url;
|
|
137
|
+
if (typeof imageUrl === "string" && imageUrl.startsWith("data:")) {
|
|
138
|
+
const matches = imageUrl.match(/^data:image\/[^;]+;base64,(.+)$/);
|
|
139
|
+
if (matches) return matches[1];
|
|
140
|
+
}
|
|
141
|
+
const imageData = block.image || block;
|
|
142
|
+
if (imageData.source?.bytes) {
|
|
143
|
+
const rawBytes = imageData.source.bytes;
|
|
144
|
+
if (typeof rawBytes === "string") {
|
|
145
|
+
if (rawBytes.startsWith("data:")) {
|
|
146
|
+
const matches = rawBytes.match(/^data:image\/[^;]+;base64,(.+)$/);
|
|
147
|
+
if (matches) return matches[1];
|
|
148
|
+
}
|
|
149
|
+
return rawBytes;
|
|
150
|
+
} else if (Buffer.isBuffer(rawBytes)) return rawBytes.toString("base64");
|
|
151
|
+
}
|
|
152
|
+
if (imageData.source?.data) {
|
|
153
|
+
const data = imageData.source.data;
|
|
154
|
+
if (data.startsWith("data:")) {
|
|
155
|
+
const matches = data.match(/^data:image\/[^;]+;base64,(.+)$/);
|
|
156
|
+
if (matches) return matches[1];
|
|
157
|
+
}
|
|
158
|
+
return data;
|
|
159
|
+
}
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Extracts text and images from message content for Llama 3.2 Vision.
|
|
164
|
+
* Returns text with <|image|> tokens at image positions, plus base64 images array.
|
|
165
|
+
*
|
|
166
|
+
* @param content - The message content (string or array of content blocks)
|
|
167
|
+
* @returns ExtractedContent with text (including image tokens) and images array
|
|
168
|
+
*/
|
|
169
|
+
function extractTextAndImages(content) {
|
|
170
|
+
if (typeof content === "string") return {
|
|
171
|
+
text: content.trim(),
|
|
172
|
+
images: []
|
|
173
|
+
};
|
|
174
|
+
if (Array.isArray(content)) {
|
|
175
|
+
const parts = [];
|
|
176
|
+
const images = [];
|
|
177
|
+
for (const block of content) if (typeof block === "string") parts.push(block);
|
|
178
|
+
else if (block.type === "text" && block.text) parts.push(block.text);
|
|
179
|
+
else if (block.text && !block.type) parts.push(block.text);
|
|
180
|
+
else if (block.type === "image" || block.type === "image_url" || block.image || block.image_url) {
|
|
181
|
+
const imageData = extractImageData(block);
|
|
182
|
+
if (imageData) {
|
|
183
|
+
images.push(imageData);
|
|
184
|
+
parts.push("<|image|>");
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
text: parts.join("").trim(),
|
|
189
|
+
images
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
text: String(content).trim(),
|
|
194
|
+
images: []
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Extracts text content from a message, handling both string and array formats.
|
|
199
|
+
* Throws an error if the content contains non-text items (images, etc.) since
|
|
200
|
+
* the legacy InvokeModel API doesn't support multimodal content.
|
|
201
|
+
*
|
|
202
|
+
* @param content - The message content (string or array of content blocks)
|
|
203
|
+
* @param modelName - The model name for error messaging
|
|
204
|
+
* @returns The extracted text content as a string
|
|
205
|
+
* @throws Error if multimodal content is detected
|
|
206
|
+
*/
|
|
207
|
+
function extractTextContent(content, modelName) {
|
|
208
|
+
if (typeof content === "string") return content.trim();
|
|
209
|
+
if (Array.isArray(content)) {
|
|
210
|
+
const textParts = [];
|
|
211
|
+
let hasNonTextContent = false;
|
|
212
|
+
for (const block of content) if (typeof block === "string") textParts.push(block);
|
|
213
|
+
else if (block.type === "text" && block.text) textParts.push(block.text);
|
|
214
|
+
else if (block.text && !block.type) textParts.push(block.text);
|
|
215
|
+
else if (block.type === "image" || block.type === "image_url" || block.image || block.image_url) hasNonTextContent = true;
|
|
216
|
+
if (hasNonTextContent) {
|
|
217
|
+
const modelInfo = modelName ? ` (${modelName})` : "";
|
|
218
|
+
throw new Error(`Multimodal content (images) detected but the legacy Bedrock Llama provider${modelInfo} does not support images. Please use the Converse API provider instead:\n\n Change: bedrock:${modelName || "<model-id>"}\n To: bedrock:converse:${modelName || "<model-id>"}\n\nThe Converse API supports multimodal content for vision-capable models like Llama 3.2 11B/90B.`);
|
|
219
|
+
}
|
|
220
|
+
return textParts.join(" ").trim();
|
|
221
|
+
}
|
|
222
|
+
return String(content).trim();
|
|
223
|
+
}
|
|
224
|
+
const formatPromptLlama2Chat = (messages, modelName) => {
|
|
225
|
+
if (messages.length === 0) return "";
|
|
226
|
+
let formattedPrompt = "<s>";
|
|
227
|
+
let systemMessageIncluded = false;
|
|
228
|
+
for (let i = 0; i < messages.length; i++) {
|
|
229
|
+
const message = messages[i];
|
|
230
|
+
const textContent = extractTextContent(message.content, modelName);
|
|
231
|
+
switch (message.role) {
|
|
232
|
+
case "system":
|
|
233
|
+
if (!systemMessageIncluded) {
|
|
234
|
+
formattedPrompt += `[INST] <<SYS>>\n${textContent}\n<</SYS>>\n\n`;
|
|
235
|
+
systemMessageIncluded = true;
|
|
236
|
+
}
|
|
237
|
+
break;
|
|
238
|
+
case "user":
|
|
239
|
+
if (i === 0 && !systemMessageIncluded) formattedPrompt += `[INST] ${textContent} [/INST]`;
|
|
240
|
+
else if (i === 0 && systemMessageIncluded) formattedPrompt += `${textContent} [/INST]`;
|
|
241
|
+
else if (i > 0 && messages[i - 1].role === "assistant") formattedPrompt += `<s>[INST] ${textContent} [/INST]`;
|
|
242
|
+
else formattedPrompt += `${textContent} [/INST]`;
|
|
243
|
+
break;
|
|
244
|
+
case "assistant":
|
|
245
|
+
formattedPrompt += ` ${textContent} </s>`;
|
|
246
|
+
break;
|
|
247
|
+
default: throw new Error(`Unexpected role: ${message.role}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return formattedPrompt;
|
|
251
|
+
};
|
|
252
|
+
const formatPromptLlama3Instruct = (messages, modelName) => {
|
|
253
|
+
let formattedPrompt = "<|begin_of_text|>";
|
|
254
|
+
for (const message of messages) {
|
|
255
|
+
const textContent = extractTextContent(message.content, modelName);
|
|
256
|
+
formattedPrompt += dedent`
|
|
257
|
+
<|start_header_id|>${message.role}<|end_header_id|>
|
|
258
|
+
|
|
259
|
+
${textContent}<|eot_id|>`;
|
|
260
|
+
}
|
|
261
|
+
formattedPrompt += "<|start_header_id|>assistant<|end_header_id|>";
|
|
262
|
+
return formattedPrompt;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Formats a Llama 3.2 Vision prompt with images.
|
|
266
|
+
* Extracts images from messages and inserts <|image|> tokens at appropriate positions.
|
|
267
|
+
*
|
|
268
|
+
* @param messages - Array of chat messages
|
|
269
|
+
* @returns Object containing the formatted prompt and array of base64 images
|
|
270
|
+
*/
|
|
271
|
+
const formatPromptLlama32Vision = (messages) => {
|
|
272
|
+
let formattedPrompt = "<|begin_of_text|>";
|
|
273
|
+
const allImages = [];
|
|
274
|
+
for (const message of messages) {
|
|
275
|
+
const { text, images } = extractTextAndImages(message.content);
|
|
276
|
+
allImages.push(...images);
|
|
277
|
+
formattedPrompt += dedent`
|
|
278
|
+
<|start_header_id|>${message.role}<|end_header_id|>
|
|
279
|
+
|
|
280
|
+
${text}<|eot_id|>`;
|
|
281
|
+
}
|
|
282
|
+
formattedPrompt += "<|start_header_id|>assistant<|end_header_id|>";
|
|
283
|
+
return {
|
|
284
|
+
prompt: formattedPrompt,
|
|
285
|
+
images: allImages
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
const formatPromptLlama4 = (messages, modelName) => {
|
|
289
|
+
let formattedPrompt = "<|begin_of_text|>";
|
|
290
|
+
for (const message of messages) {
|
|
291
|
+
const textContent = extractTextContent(message.content, modelName);
|
|
292
|
+
formattedPrompt += dedent`<|header_start|>${message.role}<|header_end|>
|
|
293
|
+
|
|
294
|
+
${textContent}<|eot|>`;
|
|
295
|
+
}
|
|
296
|
+
formattedPrompt += "<|header_start|>assistant<|header_end|>";
|
|
297
|
+
return formattedPrompt;
|
|
298
|
+
};
|
|
299
|
+
const getLlamaModelHandler = (version) => {
|
|
300
|
+
if (![
|
|
301
|
+
LlamaVersion.V2,
|
|
302
|
+
LlamaVersion.V3,
|
|
303
|
+
LlamaVersion.V3_1,
|
|
304
|
+
LlamaVersion.V3_2,
|
|
305
|
+
LlamaVersion.V3_3,
|
|
306
|
+
LlamaVersion.V4
|
|
307
|
+
].includes(version)) throw new Error(`Unsupported LLAMA version: ${version}`);
|
|
308
|
+
return {
|
|
309
|
+
params: async (config, prompt, _stop, modelName) => {
|
|
310
|
+
const messages = parseChatPrompt(prompt, [{
|
|
311
|
+
role: "user",
|
|
312
|
+
content: prompt
|
|
313
|
+
}]);
|
|
314
|
+
let finalPrompt;
|
|
315
|
+
let images = [];
|
|
316
|
+
switch (version) {
|
|
317
|
+
case LlamaVersion.V2:
|
|
318
|
+
finalPrompt = formatPromptLlama2Chat(messages, modelName);
|
|
319
|
+
break;
|
|
320
|
+
case LlamaVersion.V3:
|
|
321
|
+
case LlamaVersion.V3_1:
|
|
322
|
+
case LlamaVersion.V3_3:
|
|
323
|
+
finalPrompt = formatPromptLlama3Instruct(messages, modelName);
|
|
324
|
+
break;
|
|
325
|
+
case LlamaVersion.V3_2:
|
|
326
|
+
if (modelName && (/11b/i.test(modelName) || /90b/i.test(modelName))) {
|
|
327
|
+
const result = formatPromptLlama32Vision(messages);
|
|
328
|
+
finalPrompt = result.prompt;
|
|
329
|
+
images = result.images;
|
|
330
|
+
} else finalPrompt = formatPromptLlama3Instruct(messages, modelName);
|
|
331
|
+
break;
|
|
332
|
+
case LlamaVersion.V4:
|
|
333
|
+
finalPrompt = formatPromptLlama4(messages, modelName);
|
|
334
|
+
break;
|
|
335
|
+
default: throw new Error(`Unsupported LLAMA version: ${version}`);
|
|
336
|
+
}
|
|
337
|
+
const params = { prompt: finalPrompt };
|
|
338
|
+
if (images.length > 0) params.images = images;
|
|
339
|
+
addConfigParam(params, "temperature", config?.temperature, getEnvFloat("AWS_BEDROCK_TEMPERATURE"), 0);
|
|
340
|
+
addConfigParam(params, "top_p", config?.top_p, getEnvFloat("AWS_BEDROCK_TOP_P"), 1);
|
|
341
|
+
addConfigParam(params, "max_gen_len", config?.max_gen_len, getEnvInt("AWS_BEDROCK_MAX_GEN_LEN"), 1024);
|
|
342
|
+
return params;
|
|
343
|
+
},
|
|
344
|
+
output: (_config, responseJson) => responseJson?.generation,
|
|
345
|
+
tokenUsage: (responseJson, _promptText) => {
|
|
346
|
+
if (responseJson?.usage) return {
|
|
347
|
+
prompt: coerceStrToNum(responseJson.usage.prompt_tokens),
|
|
348
|
+
completion: coerceStrToNum(responseJson.usage.completion_tokens),
|
|
349
|
+
total: coerceStrToNum(responseJson.usage.total_tokens),
|
|
350
|
+
numRequests: 1
|
|
351
|
+
};
|
|
352
|
+
const promptTokens = responseJson?.prompt_token_count;
|
|
353
|
+
const completionTokens = responseJson?.generation_token_count;
|
|
354
|
+
if (promptTokens !== void 0 && completionTokens !== void 0) {
|
|
355
|
+
const promptTokensNum = coerceStrToNum(promptTokens);
|
|
356
|
+
const completionTokensNum = coerceStrToNum(completionTokens);
|
|
357
|
+
return {
|
|
358
|
+
prompt: promptTokensNum,
|
|
359
|
+
completion: completionTokensNum,
|
|
360
|
+
total: (promptTokensNum ?? 0) + (completionTokensNum ?? 0),
|
|
361
|
+
numRequests: 1
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
return missingBedrockTokenUsage();
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
const BEDROCK_MODEL = {
|
|
369
|
+
AI21: {
|
|
370
|
+
params: async (config, prompt, _stop, _modelName) => {
|
|
371
|
+
const params = { messages: parseChatPrompt(prompt, [{
|
|
372
|
+
role: "user",
|
|
373
|
+
content: prompt
|
|
374
|
+
}]) };
|
|
375
|
+
addConfigParam(params, "max_tokens", config?.max_tokens, getEnvInt("AWS_BEDROCK_MAX_TOKENS"), void 0);
|
|
376
|
+
addConfigParam(params, "temperature", config?.temperature, getEnvFloat("AWS_BEDROCK_TEMPERATURE"), 0);
|
|
377
|
+
addConfigParam(params, "top_p", config?.top_p, getEnvFloat("AWS_BEDROCK_TOP_P"), 1);
|
|
378
|
+
addConfigParam(params, "stop", config?.stop, getEnvString("AWS_BEDROCK_STOP"));
|
|
379
|
+
addConfigParam(params, "frequency_penalty", config?.frequency_penalty, getEnvFloat("AWS_BEDROCK_FREQUENCY_PENALTY"));
|
|
380
|
+
addConfigParam(params, "presence_penalty", config?.presence_penalty, getEnvFloat("AWS_BEDROCK_PRESENCE_PENALTY"));
|
|
381
|
+
return params;
|
|
382
|
+
},
|
|
383
|
+
output: (_config, responseJson) => {
|
|
384
|
+
if (responseJson.error) throw new Error(`AI21 API error: ${responseJson.error}`);
|
|
385
|
+
return responseJson.choices?.[0]?.message?.content;
|
|
386
|
+
},
|
|
387
|
+
tokenUsage: getOpenAiCompatibleTokenUsage
|
|
388
|
+
},
|
|
389
|
+
AMAZON_NOVA: {
|
|
390
|
+
params: async (config, prompt, _stop, _modelName) => {
|
|
391
|
+
let messages;
|
|
392
|
+
let systemPrompt;
|
|
393
|
+
try {
|
|
394
|
+
const parsed = JSON.parse(prompt);
|
|
395
|
+
if (Array.isArray(parsed)) {
|
|
396
|
+
messages = parsed.map((msg) => ({
|
|
397
|
+
role: msg.role,
|
|
398
|
+
content: Array.isArray(msg.content) ? msg.content : [{ text: msg.content }]
|
|
399
|
+
})).filter((msg) => msg.role !== "system");
|
|
400
|
+
const systemMessage = parsed.find((msg) => msg.role === "system");
|
|
401
|
+
if (systemMessage) systemPrompt = [{ text: systemMessage.content }];
|
|
402
|
+
} else {
|
|
403
|
+
const { system, extractedMessages } = novaParseMessages(prompt);
|
|
404
|
+
messages = extractedMessages;
|
|
405
|
+
if (system) systemPrompt = [{ text: system }];
|
|
406
|
+
}
|
|
407
|
+
} catch {
|
|
408
|
+
const { system, extractedMessages } = novaParseMessages(prompt);
|
|
409
|
+
messages = extractedMessages;
|
|
410
|
+
if (system) systemPrompt = [{ text: system }];
|
|
411
|
+
}
|
|
412
|
+
const params = { messages };
|
|
413
|
+
if (systemPrompt) addConfigParam(params, "system", systemPrompt, void 0, void 0);
|
|
414
|
+
const inferenceConfig = config.interfaceConfig ? { ...config.interfaceConfig } : {};
|
|
415
|
+
addConfigParam(inferenceConfig, "max_new_tokens", config?.interfaceConfig?.max_new_tokens, getEnvInt("AWS_BEDROCK_MAX_TOKENS"), void 0);
|
|
416
|
+
addConfigParam(inferenceConfig, "temperature", config?.interfaceConfig?.temperature, getEnvFloat("AWS_BEDROCK_TEMPERATURE"), 0);
|
|
417
|
+
addConfigParam(params, "inferenceConfig", inferenceConfig, void 0, void 0);
|
|
418
|
+
addConfigParam(params, "toolConfig", config.toolConfig, void 0, void 0);
|
|
419
|
+
return params;
|
|
420
|
+
},
|
|
421
|
+
output: (_config, responseJson) => novaOutputFromMessage(responseJson),
|
|
422
|
+
tokenUsage: (responseJson, _promptText) => getNovaTokenUsage(responseJson)
|
|
423
|
+
},
|
|
424
|
+
/**
|
|
425
|
+
* Amazon Nova 2 model handler with extended thinking (reasoning) support.
|
|
426
|
+
* Supports reasoningConfig with maxReasoningEffort levels: low, medium, high.
|
|
427
|
+
*/
|
|
428
|
+
AMAZON_NOVA_2: {
|
|
429
|
+
params: async (config, prompt, _stop, _modelName) => {
|
|
430
|
+
let messages;
|
|
431
|
+
let systemPrompt;
|
|
432
|
+
try {
|
|
433
|
+
const parsed = JSON.parse(prompt);
|
|
434
|
+
if (Array.isArray(parsed)) {
|
|
435
|
+
messages = parsed.map((msg) => ({
|
|
436
|
+
role: msg.role,
|
|
437
|
+
content: Array.isArray(msg.content) ? msg.content : [{ text: msg.content }]
|
|
438
|
+
})).filter((msg) => msg.role !== "system");
|
|
439
|
+
const systemMessage = parsed.find((msg) => msg.role === "system");
|
|
440
|
+
if (systemMessage) systemPrompt = [{ text: systemMessage.content }];
|
|
441
|
+
} else {
|
|
442
|
+
const { system, extractedMessages } = novaParseMessages(prompt);
|
|
443
|
+
messages = extractedMessages;
|
|
444
|
+
if (system) systemPrompt = [{ text: system }];
|
|
445
|
+
}
|
|
446
|
+
} catch {
|
|
447
|
+
const { system, extractedMessages } = novaParseMessages(prompt);
|
|
448
|
+
messages = extractedMessages;
|
|
449
|
+
if (system) systemPrompt = [{ text: system }];
|
|
450
|
+
}
|
|
451
|
+
const params = { messages };
|
|
452
|
+
if (systemPrompt) addConfigParam(params, "system", systemPrompt, void 0, void 0);
|
|
453
|
+
const reasoningEnabled = config.reasoningConfig?.type === "enabled";
|
|
454
|
+
const isHighEffort = config.reasoningConfig?.maxReasoningEffort === "high";
|
|
455
|
+
const inferenceConfig = {};
|
|
456
|
+
if (config.interfaceConfig) {
|
|
457
|
+
const { max_new_tokens: _maxTokens, temperature: _temp, ...otherParams } = config.interfaceConfig;
|
|
458
|
+
Object.assign(inferenceConfig, otherParams);
|
|
459
|
+
}
|
|
460
|
+
if (!(reasoningEnabled && isHighEffort)) addConfigParam(inferenceConfig, "max_new_tokens", config?.interfaceConfig?.max_new_tokens, getEnvInt("AWS_BEDROCK_MAX_TOKENS"), void 0);
|
|
461
|
+
if (!reasoningEnabled) addConfigParam(inferenceConfig, "temperature", config?.interfaceConfig?.temperature, getEnvFloat("AWS_BEDROCK_TEMPERATURE"), 0);
|
|
462
|
+
addConfigParam(params, "inferenceConfig", inferenceConfig, void 0, void 0);
|
|
463
|
+
addConfigParam(params, "toolConfig", config.toolConfig, void 0, void 0);
|
|
464
|
+
if (config.reasoningConfig) addConfigParam(params, "reasoningConfig", config.reasoningConfig, void 0, void 0);
|
|
465
|
+
return params;
|
|
466
|
+
},
|
|
467
|
+
output: (config, responseJson) => {
|
|
468
|
+
const content = responseJson.output?.message?.content;
|
|
469
|
+
if (!content || !Array.isArray(content)) return novaOutputFromMessage(responseJson);
|
|
470
|
+
if (content.some((block) => block.toolUse?.toolUseId)) return content.map((block) => {
|
|
471
|
+
if (block.text) return null;
|
|
472
|
+
return JSON.stringify(block.toolUse);
|
|
473
|
+
}).filter((block) => block).join("\n\n");
|
|
474
|
+
const parts = [];
|
|
475
|
+
const showThinking = config.showThinking !== false;
|
|
476
|
+
for (const block of content) if (block.reasoningContent && showThinking) {
|
|
477
|
+
const reasoningText = block.reasoningContent?.reasoningText?.text;
|
|
478
|
+
if (reasoningText) parts.push(`<thinking>\n${reasoningText}\n</thinking>`);
|
|
479
|
+
} else if (block.text) parts.push(block.text);
|
|
480
|
+
return parts.join("\n\n");
|
|
481
|
+
},
|
|
482
|
+
tokenUsage: (responseJson, _promptText) => getNovaTokenUsage(responseJson)
|
|
483
|
+
},
|
|
484
|
+
CLAUDE_COMPLETION: {
|
|
485
|
+
params: async (config, prompt, stop, _modelName) => {
|
|
486
|
+
const params = {
|
|
487
|
+
prompt: `${Anthropic.HUMAN_PROMPT} ${prompt} ${Anthropic.AI_PROMPT}`,
|
|
488
|
+
stop_sequences: stop
|
|
489
|
+
};
|
|
490
|
+
addConfigParam(params, "max_tokens_to_sample", config?.max_tokens_to_sample, getEnvInt("AWS_BEDROCK_MAX_TOKENS"), 1024);
|
|
491
|
+
addConfigParam(params, "temperature", config?.temperature, getEnvFloat("AWS_BEDROCK_TEMPERATURE"), 0);
|
|
492
|
+
return params;
|
|
493
|
+
},
|
|
494
|
+
output: (_config, responseJson) => responseJson?.completion,
|
|
495
|
+
tokenUsage: (responseJson, _promptText) => {
|
|
496
|
+
if (!responseJson?.usage) return missingBedrockTokenUsage();
|
|
497
|
+
const usage = responseJson.usage;
|
|
498
|
+
const inputTokens = usage.input_tokens || usage.prompt_tokens;
|
|
499
|
+
const inputTokensNum = coerceStrToNum(inputTokens);
|
|
500
|
+
const outputTokens = usage.output_tokens || usage.completion_tokens;
|
|
501
|
+
const outputTokensNum = coerceStrToNum(outputTokens);
|
|
502
|
+
let totalTokens = usage.totalTokens || usage.total_tokens;
|
|
503
|
+
if (totalTokens == null && inputTokensNum !== void 0 && outputTokensNum !== void 0) totalTokens = inputTokensNum + outputTokensNum;
|
|
504
|
+
return {
|
|
505
|
+
prompt: inputTokensNum,
|
|
506
|
+
completion: outputTokensNum,
|
|
507
|
+
total: coerceStrToNum(totalTokens),
|
|
508
|
+
numRequests: 1
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
CLAUDE_MESSAGES: {
|
|
513
|
+
params: async (config, prompt, _stop, modelName, vars) => {
|
|
514
|
+
let messages;
|
|
515
|
+
let systemPrompt;
|
|
516
|
+
try {
|
|
517
|
+
const parsed = JSON.parse(prompt);
|
|
518
|
+
if (Array.isArray(parsed)) {
|
|
519
|
+
const systemMessages = parsed.filter((msg) => msg.role === "system");
|
|
520
|
+
const nonSystemMessages = parsed.filter((msg) => msg.role !== "system");
|
|
521
|
+
if (systemMessages.length === 1 && nonSystemMessages.length === 0) {
|
|
522
|
+
messages = [{
|
|
523
|
+
role: "user",
|
|
524
|
+
content: Array.isArray(systemMessages[0].content) ? systemMessages[0].content : [{
|
|
525
|
+
type: "text",
|
|
526
|
+
text: systemMessages[0].content
|
|
527
|
+
}]
|
|
528
|
+
}];
|
|
529
|
+
systemPrompt = void 0;
|
|
530
|
+
} else {
|
|
531
|
+
messages = nonSystemMessages.map((msg) => ({
|
|
532
|
+
role: msg.role,
|
|
533
|
+
content: Array.isArray(msg.content) ? msg.content : [{
|
|
534
|
+
type: "text",
|
|
535
|
+
text: msg.content
|
|
536
|
+
}]
|
|
537
|
+
}));
|
|
538
|
+
systemPrompt = systemMessages[0]?.content;
|
|
539
|
+
}
|
|
540
|
+
} else {
|
|
541
|
+
const { system, extractedMessages } = parseMessages(prompt);
|
|
542
|
+
messages = extractedMessages;
|
|
543
|
+
systemPrompt = system;
|
|
544
|
+
}
|
|
545
|
+
} catch {
|
|
546
|
+
const { system, extractedMessages } = parseMessages(prompt);
|
|
547
|
+
messages = extractedMessages;
|
|
548
|
+
systemPrompt = system;
|
|
549
|
+
}
|
|
550
|
+
const params = { messages };
|
|
551
|
+
addConfigParam(params, "anthropic_version", config?.anthropic_version, void 0, "bedrock-2023-05-31");
|
|
552
|
+
const alwaysOnAdaptiveThinking = !!modelName && isAlwaysOnAdaptiveThinkingClaudeModel(modelName);
|
|
553
|
+
const thinksByDefault = alwaysOnAdaptiveThinking || !!modelName && isThinkingOnByDefaultClaudeModel(modelName) && config?.thinking?.type !== "disabled" && config?.thinking?.type !== "between_tools";
|
|
554
|
+
addConfigParam(params, "max_tokens", config?.max_tokens, getEnvInt("AWS_BEDROCK_MAX_TOKENS"), thinksByDefault ? 2048 : 1024);
|
|
555
|
+
const thinking = modelName ? normalizeClaudeThinkingConfig(modelName, config?.thinking, void 0) : config?.thinking;
|
|
556
|
+
const { sampling, warnings: samplingWarnings } = resolveClaudeSamplingParams({ temperature: config?.temperature }, {
|
|
557
|
+
thinkingEnabled: alwaysOnAdaptiveThinking || isClaudeThinkingEnabled(thinking),
|
|
558
|
+
samplingParamsDeprecated: modelName ? isSamplingParamsDeprecatedClaudeModel(modelName) : false,
|
|
559
|
+
defaultTemperature: 0
|
|
560
|
+
});
|
|
561
|
+
for (const warning of samplingWarnings) logger.warn(warning);
|
|
562
|
+
addConfigParam(params, "temperature", sampling.temperature, void 0, void 0);
|
|
563
|
+
addConfigParam(params, "tools", await maybeLoadToolsFromExternalFile(config?.tools, vars), void 0, void 0);
|
|
564
|
+
addConfigParam(params, "tool_choice", (alwaysOnAdaptiveThinking || !!modelName && isForcedToolChoiceUnsupportedClaudeModel(modelName)) && (config?.tool_choice?.type === "any" || config?.tool_choice?.type === "tool") ? void 0 : config?.tool_choice, void 0, void 0);
|
|
565
|
+
addConfigParam(params, "thinking", thinking, void 0, void 0);
|
|
566
|
+
if (typeof params.max_tokens === "number") params.max_tokens = clampMaxTokensForThinkingBudget(params.max_tokens, thinking);
|
|
567
|
+
if (systemPrompt) addConfigParam(params, "system", systemPrompt, void 0, void 0);
|
|
568
|
+
return params;
|
|
569
|
+
},
|
|
570
|
+
output: (config, responseJson) => {
|
|
571
|
+
return outputFromMessage(responseJson, config?.showThinking ?? true);
|
|
572
|
+
},
|
|
573
|
+
tokenUsage: (responseJson, _promptText) => {
|
|
574
|
+
if (!responseJson?.usage) return missingBedrockTokenUsage();
|
|
575
|
+
const usage = responseJson.usage;
|
|
576
|
+
const normalizedUsage = {
|
|
577
|
+
...usage,
|
|
578
|
+
input_tokens: usage.input_tokens ?? usage.prompt_tokens,
|
|
579
|
+
output_tokens: usage.output_tokens ?? usage.completion_tokens
|
|
580
|
+
};
|
|
581
|
+
return {
|
|
582
|
+
...getTokenUsage({ usage: normalizedUsage }, false),
|
|
583
|
+
numRequests: 1
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
TITAN_TEXT: {
|
|
588
|
+
params: async (config, prompt, stop, _modelName) => {
|
|
589
|
+
const textGenerationConfig = {};
|
|
590
|
+
addConfigParam(textGenerationConfig, "maxTokenCount", config?.textGenerationConfig?.maxTokenCount, getEnvInt("AWS_BEDROCK_MAX_TOKENS"), 1024);
|
|
591
|
+
addConfigParam(textGenerationConfig, "temperature", config?.textGenerationConfig?.temperature, getEnvFloat("AWS_BEDROCK_TEMPERATURE"), 0);
|
|
592
|
+
addConfigParam(textGenerationConfig, "topP", config?.textGenerationConfig?.topP, getEnvFloat("AWS_BEDROCK_TOP_P"), 1);
|
|
593
|
+
addConfigParam(textGenerationConfig, "stopSequences", config?.textGenerationConfig?.stopSequences, void 0, stop);
|
|
594
|
+
return {
|
|
595
|
+
inputText: prompt,
|
|
596
|
+
textGenerationConfig
|
|
597
|
+
};
|
|
598
|
+
},
|
|
599
|
+
output: (_config, responseJson) => responseJson?.results?.[0]?.outputText,
|
|
600
|
+
tokenUsage: getOpenAiCompatibleTokenUsage
|
|
601
|
+
},
|
|
602
|
+
LLAMA2: getLlamaModelHandler(LlamaVersion.V2),
|
|
603
|
+
LLAMA3: getLlamaModelHandler(LlamaVersion.V3),
|
|
604
|
+
LLAMA3_1: getLlamaModelHandler(LlamaVersion.V3_1),
|
|
605
|
+
LLAMA3_2: getLlamaModelHandler(LlamaVersion.V3_2),
|
|
606
|
+
LLAMA3_3: getLlamaModelHandler(LlamaVersion.V3_3),
|
|
607
|
+
LLAMA4: getLlamaModelHandler(LlamaVersion.V4),
|
|
608
|
+
COHERE_COMMAND: {
|
|
609
|
+
params: async (config, prompt, stop, _modelName) => {
|
|
610
|
+
const params = { prompt };
|
|
611
|
+
addConfigParam(params, "temperature", config?.temperature, getEnvFloat("COHERE_TEMPERATURE"), 0);
|
|
612
|
+
addConfigParam(params, "p", config?.p, getEnvFloat("COHERE_P"), 1);
|
|
613
|
+
addConfigParam(params, "k", config?.k, getEnvInt("COHERE_K"), 0);
|
|
614
|
+
addConfigParam(params, "max_tokens", config?.max_tokens, getEnvInt("COHERE_MAX_TOKENS"), 1024);
|
|
615
|
+
addConfigParam(params, "return_likelihoods", config?.return_likelihoods, void 0, "NONE");
|
|
616
|
+
addConfigParam(params, "stream", config?.stream, void 0, false);
|
|
617
|
+
addConfigParam(params, "num_generations", config?.num_generations, void 0, 1);
|
|
618
|
+
addConfigParam(params, "logit_bias", config?.logit_bias, void 0, {});
|
|
619
|
+
addConfigParam(params, "truncate", config?.truncate, void 0, "NONE");
|
|
620
|
+
addConfigParam(params, "stop_sequences", stop, void 0, void 0);
|
|
621
|
+
return params;
|
|
622
|
+
},
|
|
623
|
+
output: (_config, responseJson) => responseJson?.generations?.[0]?.text,
|
|
624
|
+
tokenUsage: (responseJson, _promptText) => getCohereTokenUsage(responseJson)
|
|
625
|
+
},
|
|
626
|
+
COHERE_COMMAND_R: {
|
|
627
|
+
params: async (config, prompt, stop, _modelName, vars) => {
|
|
628
|
+
const messages = parseChatPrompt(prompt, [{
|
|
629
|
+
role: "user",
|
|
630
|
+
content: prompt
|
|
631
|
+
}]);
|
|
632
|
+
const lastMessage = messages[messages.length - 1].content;
|
|
633
|
+
if (!messages.every((m) => typeof m.content === "string")) throw new Error(`Message content must be a string, but got: ${JSON.stringify(messages)}`);
|
|
634
|
+
const params = {
|
|
635
|
+
message: lastMessage,
|
|
636
|
+
chat_history: messages.slice(0, messages.length - 1).map((m) => ({
|
|
637
|
+
role: m.role === "assistant" ? "CHATBOT" : "USER",
|
|
638
|
+
message: m.content
|
|
639
|
+
}))
|
|
640
|
+
};
|
|
641
|
+
addConfigParam(params, "documents", config?.documents);
|
|
642
|
+
addConfigParam(params, "search_queries_only", config?.search_queries_only);
|
|
643
|
+
addConfigParam(params, "preamble", config?.preamble);
|
|
644
|
+
addConfigParam(params, "max_tokens", config?.max_tokens);
|
|
645
|
+
addConfigParam(params, "temperature", config?.temperature);
|
|
646
|
+
addConfigParam(params, "p", config?.p);
|
|
647
|
+
addConfigParam(params, "k", config?.k);
|
|
648
|
+
addConfigParam(params, "prompt_truncation", config?.prompt_truncation);
|
|
649
|
+
addConfigParam(params, "frequency_penalty", config?.frequency_penalty);
|
|
650
|
+
addConfigParam(params, "presence_penalty", config?.presence_penalty);
|
|
651
|
+
addConfigParam(params, "seed", config?.seed);
|
|
652
|
+
addConfigParam(params, "return_prompt", config?.return_prompt);
|
|
653
|
+
addConfigParam(params, "tools", await maybeLoadToolsFromExternalFile(config?.tools, vars));
|
|
654
|
+
addConfigParam(params, "tool_results", config?.tool_results);
|
|
655
|
+
addConfigParam(params, "stop_sequences", stop);
|
|
656
|
+
addConfigParam(params, "raw_prompting", config?.raw_prompting);
|
|
657
|
+
return params;
|
|
658
|
+
},
|
|
659
|
+
output: (_config, responseJson) => responseJson?.text,
|
|
660
|
+
tokenUsage: (responseJson, _promptText) => getCohereTokenUsage(responseJson)
|
|
661
|
+
},
|
|
662
|
+
DEEPSEEK: {
|
|
663
|
+
params: async (config, prompt, _stop, _modelName) => {
|
|
664
|
+
const params = { prompt: `
|
|
665
|
+
${prompt}
|
|
666
|
+
<think>\n` };
|
|
667
|
+
addConfigParam(params, "max_tokens", config?.max_tokens, getEnvInt("AWS_BEDROCK_MAX_TOKENS"), void 0);
|
|
668
|
+
addConfigParam(params, "temperature", config?.temperature, getEnvFloat("AWS_BEDROCK_TEMPERATURE"), 0);
|
|
669
|
+
addConfigParam(params, "top_p", config?.top_p, getEnvFloat("AWS_BEDROCK_TOP_P"), 1);
|
|
670
|
+
return params;
|
|
671
|
+
},
|
|
672
|
+
output: (config, responseJson) => {
|
|
673
|
+
if (responseJson.error) throw new Error(`DeepSeek API error: ${responseJson.error}`);
|
|
674
|
+
if (responseJson.choices && Array.isArray(responseJson.choices)) {
|
|
675
|
+
const choice = responseJson.choices[0];
|
|
676
|
+
if (choice && choice.text) {
|
|
677
|
+
const fullResponse = choice.text;
|
|
678
|
+
const [thinking, finalResponse] = fullResponse.split("</think>");
|
|
679
|
+
if (!thinking || !finalResponse) return fullResponse;
|
|
680
|
+
if (config.showThinking !== false) return fullResponse;
|
|
681
|
+
return finalResponse.trim();
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
tokenUsage: getOpenAiCompatibleTokenUsage
|
|
686
|
+
},
|
|
687
|
+
MISTRAL: {
|
|
688
|
+
params: async (config, prompt, stop, _modelName) => {
|
|
689
|
+
const params = {
|
|
690
|
+
prompt,
|
|
691
|
+
stop
|
|
692
|
+
};
|
|
693
|
+
addConfigParam(params, "max_tokens", config?.max_tokens, getEnvInt("MISTRAL_MAX_TOKENS"), 1024);
|
|
694
|
+
addConfigParam(params, "temperature", config?.temperature, getEnvFloat("MISTRAL_TEMPERATURE"), 0);
|
|
695
|
+
addConfigParam(params, "top_p", config?.top_p, getEnvFloat("MISTRAL_TOP_P"), 1);
|
|
696
|
+
addConfigParam(params, "top_k", config?.top_k, getEnvFloat("MISTRAL_TOP_K"));
|
|
697
|
+
return params;
|
|
698
|
+
},
|
|
699
|
+
output: (_config, responseJson) => {
|
|
700
|
+
if (!responseJson?.outputs || !Array.isArray(responseJson.outputs)) return;
|
|
701
|
+
return responseJson.outputs[0]?.text;
|
|
702
|
+
},
|
|
703
|
+
tokenUsage: (responseJson, _promptText) => {
|
|
704
|
+
if (responseJson?.usage) return {
|
|
705
|
+
prompt: coerceStrToNum(responseJson.usage.prompt_tokens),
|
|
706
|
+
completion: coerceStrToNum(responseJson.usage.completion_tokens),
|
|
707
|
+
total: coerceStrToNum(responseJson.usage.total_tokens),
|
|
708
|
+
numRequests: 1
|
|
709
|
+
};
|
|
710
|
+
if (responseJson?.prompt_tokens !== void 0 && responseJson?.completion_tokens !== void 0) {
|
|
711
|
+
const promptTokens = coerceStrToNum(responseJson.prompt_tokens);
|
|
712
|
+
const completionTokens = coerceStrToNum(responseJson.completion_tokens);
|
|
713
|
+
return {
|
|
714
|
+
prompt: promptTokens,
|
|
715
|
+
completion: completionTokens,
|
|
716
|
+
total: coerceStrToNum(responseJson.total_tokens) ?? (promptTokens !== void 0 && completionTokens !== void 0 ? promptTokens + completionTokens : void 0),
|
|
717
|
+
numRequests: 1
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
return missingBedrockTokenUsage();
|
|
721
|
+
}
|
|
722
|
+
},
|
|
723
|
+
MISTRAL_CHAT: BEDROCK_MISTRAL_CHAT_MODEL,
|
|
724
|
+
MISTRAL_LARGE_2407: BEDROCK_MISTRAL_CHAT_MODEL,
|
|
725
|
+
DEEPSEEK_CHAT: BEDROCK_DEEPSEEK_CHAT_MODEL,
|
|
726
|
+
OPENAI: {
|
|
727
|
+
params: async (config, prompt, stop, _modelName) => {
|
|
728
|
+
const params = { messages: parseChatPrompt(prompt, [{
|
|
729
|
+
role: "user",
|
|
730
|
+
content: prompt
|
|
731
|
+
}]) };
|
|
732
|
+
addConfigParam(params, "max_completion_tokens", config?.max_completion_tokens, getEnvInt("AWS_BEDROCK_MAX_TOKENS"), void 0);
|
|
733
|
+
addConfigParam(params, "temperature", config?.temperature, getEnvFloat("AWS_BEDROCK_TEMPERATURE"), .1);
|
|
734
|
+
addConfigParam(params, "top_p", config?.top_p, getEnvFloat("AWS_BEDROCK_TOP_P"), 1);
|
|
735
|
+
addConfigParam(params, "reasoning_effort", config?.reasoning_effort);
|
|
736
|
+
if (stop && stop.length > 0 || config?.stop) addConfigParam(params, "stop", stop || config?.stop, getEnvString("AWS_BEDROCK_STOP"));
|
|
737
|
+
addConfigParam(params, "frequency_penalty", config?.frequency_penalty, getEnvFloat("AWS_BEDROCK_FREQUENCY_PENALTY"));
|
|
738
|
+
addConfigParam(params, "presence_penalty", config?.presence_penalty, getEnvFloat("AWS_BEDROCK_PRESENCE_PENALTY"));
|
|
739
|
+
return params;
|
|
740
|
+
},
|
|
741
|
+
output: (config, responseJson) => {
|
|
742
|
+
if (responseJson.error) throw new Error(`OpenAI API error: ${responseJson.error}`);
|
|
743
|
+
const content = responseJson.choices?.[0]?.message?.content;
|
|
744
|
+
const showThinking = config?.showThinking;
|
|
745
|
+
if (typeof content !== "string" || showThinking === void 0) return content;
|
|
746
|
+
const reasoningMatch = content.match(/^\s*<reasoning>([\s\S]*?)<\/reasoning>\s*([\s\S]*)$/);
|
|
747
|
+
if (!reasoningMatch) return content;
|
|
748
|
+
const [, reasoning, answer] = reasoningMatch;
|
|
749
|
+
if (showThinking) return `Thinking: ${reasoning.trim()}\n\n${answer}`;
|
|
750
|
+
return answer.trim() === "" ? content : answer;
|
|
751
|
+
},
|
|
752
|
+
tokenUsage: (responseJson, _promptText) => {
|
|
753
|
+
if (responseJson?.usage) {
|
|
754
|
+
const usage = responseJson.usage;
|
|
755
|
+
const reasoningTokens = coerceStrToNum(usage.completion_tokens_details?.reasoning_tokens);
|
|
756
|
+
const cachedInputTokens = coerceStrToNum(usage.prompt_tokens_details?.cached_tokens);
|
|
757
|
+
const completionDetails = {};
|
|
758
|
+
if (reasoningTokens !== void 0) completionDetails.reasoning = reasoningTokens;
|
|
759
|
+
if ((cachedInputTokens ?? 0) > 0) completionDetails.cacheReadInputTokens = cachedInputTokens;
|
|
760
|
+
return {
|
|
761
|
+
prompt: coerceStrToNum(usage.prompt_tokens),
|
|
762
|
+
completion: coerceStrToNum(usage.completion_tokens),
|
|
763
|
+
total: coerceStrToNum(usage.total_tokens),
|
|
764
|
+
numRequests: 1,
|
|
765
|
+
...Object.keys(completionDetails).length > 0 ? { completionDetails } : {}
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
return missingBedrockTokenUsage();
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
QWEN: {
|
|
772
|
+
params: async (config, prompt, stop, _modelName, vars) => {
|
|
773
|
+
const params = { messages: parseChatPrompt(prompt, [{
|
|
774
|
+
role: "user",
|
|
775
|
+
content: prompt
|
|
776
|
+
}]) };
|
|
777
|
+
addConfigParam(params, "max_tokens", config?.max_tokens, getEnvInt("AWS_BEDROCK_MAX_TOKENS"), void 0);
|
|
778
|
+
addConfigParam(params, "temperature", config?.temperature, getEnvFloat("AWS_BEDROCK_TEMPERATURE"), .7);
|
|
779
|
+
addConfigParam(params, "top_p", config?.top_p, getEnvFloat("AWS_BEDROCK_TOP_P"), 1);
|
|
780
|
+
if (stop && stop.length > 0 || config?.stop) addConfigParam(params, "stop", stop || config?.stop, getEnvString("AWS_BEDROCK_STOP"));
|
|
781
|
+
addConfigParam(params, "frequency_penalty", config?.frequency_penalty, getEnvFloat("AWS_BEDROCK_FREQUENCY_PENALTY"));
|
|
782
|
+
addConfigParam(params, "presence_penalty", config?.presence_penalty, getEnvFloat("AWS_BEDROCK_PRESENCE_PENALTY"));
|
|
783
|
+
addConfigParam(params, "tools", await maybeLoadToolsFromExternalFile(config?.tools, vars), void 0, void 0);
|
|
784
|
+
addConfigParam(params, "tool_choice", config?.tool_choice, void 0, void 0);
|
|
785
|
+
return params;
|
|
786
|
+
},
|
|
787
|
+
output: (config, responseJson) => {
|
|
788
|
+
if (responseJson.error) throw new Error(`Qwen API error: ${responseJson.error}`);
|
|
789
|
+
if (responseJson.choices && Array.isArray(responseJson.choices)) {
|
|
790
|
+
const choice = responseJson.choices[0];
|
|
791
|
+
if (choice?.message?.tool_calls && Array.isArray(choice.message.tool_calls)) {
|
|
792
|
+
const toolCalls = choice.message.tool_calls.map((toolCall) => {
|
|
793
|
+
return `Called function ${toolCall.function.name} with arguments: ${toolCall.function.arguments}`;
|
|
794
|
+
}).join("\n");
|
|
795
|
+
if (choice.message.content) return `${choice.message.content}\n\n${toolCalls}`;
|
|
796
|
+
return toolCalls;
|
|
797
|
+
}
|
|
798
|
+
if (choice?.message?.content) {
|
|
799
|
+
const content = choice.message.content;
|
|
800
|
+
if (content.includes("<think>") && content.includes("</think>")) {
|
|
801
|
+
if (config.showThinking === false) {
|
|
802
|
+
const parts = content.split("</think>");
|
|
803
|
+
return parts.length > 1 ? parts[1].trim() : content;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
return content;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
return responseJson.choices?.[0]?.message?.content;
|
|
810
|
+
},
|
|
811
|
+
tokenUsage: getOpenAiCompatibleTokenUsage
|
|
812
|
+
},
|
|
813
|
+
/**
|
|
814
|
+
* Shared handler for newer Bedrock model families that speak the OpenAI Chat Completions
|
|
815
|
+
* wire format over InvokeModel: Z.AI (GLM), MiniMax, Moonshot (Kimi), NVIDIA (Nemotron),
|
|
816
|
+
* Google (Gemma), and Writer (Palmyra). Request body is `{ messages, max_tokens, ... }`
|
|
817
|
+
* and the response is `{ choices: [{ message: { content } }], usage }`.
|
|
818
|
+
*
|
|
819
|
+
* Differs from the gpt-oss `OPENAI` handler by sending `max_tokens` (not
|
|
820
|
+
* `max_completion_tokens`, which Writer Palmyra rejects) and by not forcing a
|
|
821
|
+
* `temperature`/`top_p` default, so each model uses its provider-recommended sampling
|
|
822
|
+
* defaults unless the user overrides them.
|
|
823
|
+
*/
|
|
824
|
+
OPENAI_COMPAT: {
|
|
825
|
+
params: async (config, prompt, stop, _modelName, vars) => {
|
|
826
|
+
const params = { messages: parseChatPrompt(prompt, [{
|
|
827
|
+
role: "user",
|
|
828
|
+
content: prompt
|
|
829
|
+
}]) };
|
|
830
|
+
addConfigParam(params, "max_tokens", config?.max_tokens, getEnvInt("AWS_BEDROCK_MAX_TOKENS"));
|
|
831
|
+
addConfigParam(params, "temperature", config?.temperature, getEnvFloat("AWS_BEDROCK_TEMPERATURE"));
|
|
832
|
+
addConfigParam(params, "top_p", config?.top_p, getEnvFloat("AWS_BEDROCK_TOP_P"));
|
|
833
|
+
const effectiveStop = config?.stop && config.stop.length > 0 ? config.stop : stop && stop.length > 0 ? stop : void 0;
|
|
834
|
+
if (effectiveStop) addConfigParam(params, "stop", effectiveStop);
|
|
835
|
+
addConfigParam(params, "frequency_penalty", config?.frequency_penalty, getEnvFloat("AWS_BEDROCK_FREQUENCY_PENALTY"));
|
|
836
|
+
addConfigParam(params, "presence_penalty", config?.presence_penalty, getEnvFloat("AWS_BEDROCK_PRESENCE_PENALTY"));
|
|
837
|
+
addConfigParam(params, "reasoning_effort", config?.reasoning_effort);
|
|
838
|
+
addConfigParam(params, "tools", await maybeLoadToolsFromExternalFile(config?.tools, vars));
|
|
839
|
+
addConfigParam(params, "tool_choice", config?.tool_choice);
|
|
840
|
+
return params;
|
|
841
|
+
},
|
|
842
|
+
output: (config, responseJson) => {
|
|
843
|
+
if (responseJson.error) throw new Error(`Bedrock API error: ${responseJson.error}`);
|
|
844
|
+
const choice = responseJson.choices?.[0];
|
|
845
|
+
if (Array.isArray(choice?.message?.tool_calls) && choice.message.tool_calls.length > 0) {
|
|
846
|
+
const content = typeof choice.message.content === "string" && config?.showThinking === false ? choice.message.content.replace(/^\s*<(think|reasoning)>[\s\S]*?<\/\1>\s*/i, "") : choice.message.content;
|
|
847
|
+
const toolCalls = choice.message.tool_calls.map((toolCall) => `Called function ${toolCall.function?.name} with arguments: ${toolCall.function?.arguments}`).join("\n");
|
|
848
|
+
return content ? `${content}\n\n${toolCalls}` : toolCalls;
|
|
849
|
+
}
|
|
850
|
+
const content = choice?.message?.content;
|
|
851
|
+
if (typeof content !== "string") return content;
|
|
852
|
+
if (config.showThinking === false) {
|
|
853
|
+
const leadingBlock = content.match(/^\s*<(think|reasoning)>[\s\S]*?<\/\1>/);
|
|
854
|
+
if (leadingBlock) {
|
|
855
|
+
const stripped = content.slice(leadingBlock[0].length).trim();
|
|
856
|
+
return stripped === "" ? content : stripped;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
return content;
|
|
860
|
+
},
|
|
861
|
+
tokenUsage: getOpenAiCompatibleTokenUsage
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
const AWS_BEDROCK_MODELS = {
|
|
865
|
+
"ai21.jamba-1-5-large-v1:0": BEDROCK_MODEL.AI21,
|
|
866
|
+
"ai21.jamba-1-5-mini-v1:0": BEDROCK_MODEL.AI21,
|
|
867
|
+
"amazon.nova-lite-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
868
|
+
"amazon.nova-micro-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
869
|
+
"amazon.nova-pro-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
870
|
+
"amazon.nova-premier-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
871
|
+
"amazon.nova-2-lite-v1:0": BEDROCK_MODEL.AMAZON_NOVA_2,
|
|
872
|
+
"anthropic.claude-3-5-sonnet-20240620-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
873
|
+
"anthropic.claude-3-5-sonnet-20241022-v2:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
874
|
+
"anthropic.claude-3-7-sonnet-20250219-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
875
|
+
"anthropic.claude-3-haiku-20240307-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
876
|
+
"anthropic.claude-fable-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
877
|
+
"anthropic.claude-fable-5-1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
878
|
+
"anthropic.claude-mythos-5-1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
879
|
+
"anthropic.claude-opus-4-1-20250805-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
880
|
+
"anthropic.claude-opus-4-6-v1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
881
|
+
"anthropic.claude-opus-4-7": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
882
|
+
"anthropic.claude-opus-4-8": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
883
|
+
"anthropic.claude-opus-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
884
|
+
"anthropic.claude-opus-5-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
885
|
+
"anthropic.claude-opus-4-5-20251101-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
886
|
+
"anthropic.claude-sonnet-5-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
887
|
+
"anthropic.claude-sonnet-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
888
|
+
"anthropic.claude-sonnet-4-6": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
889
|
+
"anthropic.claude-sonnet-4-5-20250929-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
890
|
+
"anthropic.claude-haiku-4-5-20251001-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
891
|
+
"anthropic.claude-sonnet-4-20250514-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
892
|
+
"cohere.command-r-plus-v1:0": BEDROCK_MODEL.COHERE_COMMAND_R,
|
|
893
|
+
"cohere.command-r-v1:0": BEDROCK_MODEL.COHERE_COMMAND_R,
|
|
894
|
+
"deepseek.r1-v1:0": BEDROCK_MODEL.DEEPSEEK,
|
|
895
|
+
"deepseek.v3-v1:0": BEDROCK_MODEL.DEEPSEEK_CHAT,
|
|
896
|
+
"deepseek.v3.2": BEDROCK_MODEL.DEEPSEEK_CHAT,
|
|
897
|
+
"meta.llama3-1-405b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_1,
|
|
898
|
+
"meta.llama3-1-70b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_1,
|
|
899
|
+
"meta.llama3-1-8b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_1,
|
|
900
|
+
"meta.llama3-2-3b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_2,
|
|
901
|
+
"meta.llama3-3-70b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_3,
|
|
902
|
+
"meta.llama3-70b-instruct-v1:0": BEDROCK_MODEL.LLAMA3,
|
|
903
|
+
"meta.llama3-8b-instruct-v1:0": BEDROCK_MODEL.LLAMA3,
|
|
904
|
+
"meta.llama4-scout-17b-instruct-v1:0": BEDROCK_MODEL.LLAMA4,
|
|
905
|
+
"meta.llama4-maverick-17b-instruct-v1:0": BEDROCK_MODEL.LLAMA4,
|
|
906
|
+
"mistral.mistral-7b-instruct-v0:2": BEDROCK_MODEL.MISTRAL,
|
|
907
|
+
"mistral.devstral-2-123b": BEDROCK_MODEL.MISTRAL_CHAT,
|
|
908
|
+
"mistral.magistral-small-2509": BEDROCK_MODEL.MISTRAL_CHAT,
|
|
909
|
+
"mistral.ministral-3-14b-instruct": BEDROCK_MODEL.MISTRAL_CHAT,
|
|
910
|
+
"mistral.ministral-3-8b-instruct": BEDROCK_MODEL.MISTRAL_CHAT,
|
|
911
|
+
"mistral.ministral-3-3b-instruct": BEDROCK_MODEL.MISTRAL_CHAT,
|
|
912
|
+
"mistral.mistral-large-2402-v1:0": BEDROCK_MODEL.MISTRAL,
|
|
913
|
+
"mistral.mistral-large-2407-v1:0": BEDROCK_MODEL.MISTRAL_LARGE_2407,
|
|
914
|
+
"mistral.mistral-large-3-675b-instruct": BEDROCK_MODEL.MISTRAL_CHAT,
|
|
915
|
+
"mistral.mistral-small-2402-v1:0": BEDROCK_MODEL.MISTRAL,
|
|
916
|
+
"mistral.mixtral-8x7b-instruct-v0:1": BEDROCK_MODEL.MISTRAL,
|
|
917
|
+
"mistral.pixtral-large-2502-v1:0": BEDROCK_MODEL.MISTRAL_CHAT,
|
|
918
|
+
"mistral.voxtral-mini-3b-2507": BEDROCK_MODEL.MISTRAL_CHAT,
|
|
919
|
+
"mistral.voxtral-small-24b-2507": BEDROCK_MODEL.MISTRAL_CHAT,
|
|
920
|
+
"apac.amazon.nova-lite-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
921
|
+
"apac.amazon.nova-micro-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
922
|
+
"apac.amazon.nova-pro-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
923
|
+
"apac.amazon.nova-premier-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
924
|
+
"apac.amazon.nova-2-lite-v1:0": BEDROCK_MODEL.AMAZON_NOVA_2,
|
|
925
|
+
"apac.anthropic.claude-3-5-sonnet-20240620-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
926
|
+
"apac.anthropic.claude-3-haiku-20240307-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
927
|
+
"apac.anthropic.claude-opus-4-1-20250805-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
928
|
+
"apac.anthropic.claude-opus-4-6-v1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
929
|
+
"apac.anthropic.claude-opus-4-5-20251101-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
930
|
+
"apac.anthropic.claude-sonnet-4-6": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
931
|
+
"apac.anthropic.claude-sonnet-4-5-20250929-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
932
|
+
"apac.anthropic.claude-haiku-4-5-20251001-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
933
|
+
"apac.anthropic.claude-sonnet-4-20250514-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
934
|
+
"apac.meta.llama4-scout-17b-instruct-v1:0": BEDROCK_MODEL.LLAMA4,
|
|
935
|
+
"apac.meta.llama4-maverick-17b-instruct-v1:0": BEDROCK_MODEL.LLAMA4,
|
|
936
|
+
"au.anthropic.claude-opus-4-7": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
937
|
+
"au.anthropic.claude-opus-4-8": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
938
|
+
"au.anthropic.claude-opus-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
939
|
+
"au.anthropic.claude-sonnet-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
940
|
+
"eu.amazon.nova-lite-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
941
|
+
"eu.amazon.nova-micro-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
942
|
+
"eu.amazon.nova-pro-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
943
|
+
"eu.amazon.nova-premier-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
944
|
+
"eu.amazon.nova-2-lite-v1:0": BEDROCK_MODEL.AMAZON_NOVA_2,
|
|
945
|
+
"eu.anthropic.claude-3-5-sonnet-20240620-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
946
|
+
"eu.anthropic.claude-3-7-sonnet-20250219-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
947
|
+
"eu.anthropic.claude-3-haiku-20240307-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
948
|
+
"eu.anthropic.claude-opus-4-1-20250805-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
949
|
+
"eu.anthropic.claude-opus-4-6-v1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
950
|
+
"eu.anthropic.claude-opus-4-7": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
951
|
+
"eu.anthropic.claude-opus-4-8": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
952
|
+
"eu.anthropic.claude-opus-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
953
|
+
"eu.anthropic.claude-opus-5-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
954
|
+
"eu.anthropic.claude-opus-4-5-20251101-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
955
|
+
"eu.anthropic.claude-sonnet-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
956
|
+
"eu.anthropic.claude-sonnet-4-6": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
957
|
+
"eu.anthropic.claude-sonnet-4-5-20250929-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
958
|
+
"eu.anthropic.claude-haiku-4-5-20251001-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
959
|
+
"eu.anthropic.claude-sonnet-4-20250514-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
960
|
+
"eu.meta.llama3-2-1b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_2,
|
|
961
|
+
"eu.meta.llama3-2-3b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_2,
|
|
962
|
+
"eu.meta.llama4-scout-17b-instruct-v1:0": BEDROCK_MODEL.LLAMA4,
|
|
963
|
+
"eu.meta.llama4-maverick-17b-instruct-v1:0": BEDROCK_MODEL.LLAMA4,
|
|
964
|
+
"eu.mistral.pixtral-large-2502-v1:0": BEDROCK_MODEL.MISTRAL_CHAT,
|
|
965
|
+
"us-gov.anthropic.claude-3-5-sonnet-20240620-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
966
|
+
"us-gov.anthropic.claude-3-haiku-20240307-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
967
|
+
"us.amazon.nova-lite-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
968
|
+
"us.amazon.nova-micro-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
969
|
+
"us.amazon.nova-pro-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
970
|
+
"us.amazon.nova-premier-v1:0": BEDROCK_MODEL.AMAZON_NOVA,
|
|
971
|
+
"us.amazon.nova-2-lite-v1:0": BEDROCK_MODEL.AMAZON_NOVA_2,
|
|
972
|
+
"us.anthropic.claude-3-5-sonnet-20240620-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
973
|
+
"us.anthropic.claude-3-5-sonnet-20241022-v2:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
974
|
+
"us.anthropic.claude-3-7-sonnet-20250219-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
975
|
+
"us.anthropic.claude-3-haiku-20240307-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
976
|
+
"us.anthropic.claude-fable-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
977
|
+
"us.anthropic.claude-fable-5-1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
978
|
+
"us.anthropic.claude-mythos-5-1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
979
|
+
"us.anthropic.claude-opus-4-1-20250805-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
980
|
+
"us.anthropic.claude-opus-4-6-v1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
981
|
+
"us.anthropic.claude-opus-4-7": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
982
|
+
"us.anthropic.claude-opus-4-8": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
983
|
+
"us.anthropic.claude-opus-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
984
|
+
"us.anthropic.claude-opus-5-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
985
|
+
"us.anthropic.claude-opus-4-5-20251101-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
986
|
+
"us.anthropic.claude-sonnet-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
987
|
+
"us.anthropic.claude-sonnet-4-6": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
988
|
+
"us.anthropic.claude-sonnet-4-5-20250929-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
989
|
+
"us.anthropic.claude-haiku-4-5-20251001-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
990
|
+
"us.anthropic.claude-sonnet-4-20250514-v1:0": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
991
|
+
"us.deepseek.r1-v1:0": BEDROCK_MODEL.DEEPSEEK,
|
|
992
|
+
"us.meta.llama3-1-405b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_1,
|
|
993
|
+
"us.meta.llama3-1-70b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_1,
|
|
994
|
+
"us.meta.llama3-1-8b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_1,
|
|
995
|
+
"us.meta.llama3-2-11b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_2,
|
|
996
|
+
"us.meta.llama3-2-1b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_2,
|
|
997
|
+
"us.meta.llama3-2-3b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_2,
|
|
998
|
+
"us.meta.llama3-2-90b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_2,
|
|
999
|
+
"us.meta.llama3-3-70b-instruct-v1:0": BEDROCK_MODEL.LLAMA3_3,
|
|
1000
|
+
"us.meta.llama4-scout-17b-instruct-v1:0": BEDROCK_MODEL.LLAMA4,
|
|
1001
|
+
"us.meta.llama4-maverick-17b-instruct-v1:0": BEDROCK_MODEL.LLAMA4,
|
|
1002
|
+
"us.mistral.pixtral-large-2502-v1:0": BEDROCK_MODEL.MISTRAL_CHAT,
|
|
1003
|
+
"openai.gpt-oss-120b-1:0": BEDROCK_MODEL.OPENAI,
|
|
1004
|
+
"openai.gpt-oss-20b-1:0": BEDROCK_MODEL.OPENAI,
|
|
1005
|
+
"openai.gpt-oss-safeguard-120b": BEDROCK_MODEL.OPENAI,
|
|
1006
|
+
"openai.gpt-oss-safeguard-20b": BEDROCK_MODEL.OPENAI,
|
|
1007
|
+
"us.xai.grok-4.6": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1008
|
+
"global.xai.grok-4.6": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1009
|
+
"qwen.qwen3-coder-next": BEDROCK_MODEL.QWEN,
|
|
1010
|
+
"qwen.qwen3-coder-480b-a35b-v1:0": BEDROCK_MODEL.QWEN,
|
|
1011
|
+
"qwen.qwen3-coder-30b-a3b-v1:0": BEDROCK_MODEL.QWEN,
|
|
1012
|
+
"qwen.qwen3-next-80b-a3b": BEDROCK_MODEL.QWEN,
|
|
1013
|
+
"qwen.qwen3-vl-235b-a22b": BEDROCK_MODEL.QWEN,
|
|
1014
|
+
"qwen.qwen3-235b-a22b-2507-v1:0": BEDROCK_MODEL.QWEN,
|
|
1015
|
+
"qwen.qwen3-32b-v1:0": BEDROCK_MODEL.QWEN,
|
|
1016
|
+
"zai.glm-5": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1017
|
+
"zai.glm-4.7": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1018
|
+
"zai.glm-4.7-flash": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1019
|
+
"minimax.minimax-m2": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1020
|
+
"minimax.minimax-m2.1": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1021
|
+
"minimax.minimax-m2.5": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1022
|
+
"moonshotai.kimi-k2.5": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1023
|
+
"moonshot.kimi-k2-thinking": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1024
|
+
"nvidia.nemotron-nano-9b-v2": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1025
|
+
"nvidia.nemotron-nano-12b-v2": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1026
|
+
"nvidia.nemotron-nano-3-30b": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1027
|
+
"nvidia.nemotron-super-3-120b": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1028
|
+
"us-gov.nvidia.nemotron-nano-9b-v2": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1029
|
+
"us-gov.nvidia.nemotron-nano-12b-v2": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1030
|
+
"us-gov.nvidia.nemotron-nano-3-30b": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1031
|
+
"us-gov.nvidia.nemotron-super-3-120b": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1032
|
+
"google.gemma-3-4b-it": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1033
|
+
"google.gemma-3-12b-it": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1034
|
+
"google.gemma-3-27b-it": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1035
|
+
"us.writer.palmyra-x5-v1:0": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1036
|
+
"us.writer.palmyra-x4-v1:0": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1037
|
+
"writer.palmyra-vision-7b": BEDROCK_MODEL.OPENAI_COMPAT,
|
|
1038
|
+
"global.amazon.nova-2-lite-v1:0": BEDROCK_MODEL.AMAZON_NOVA_2,
|
|
1039
|
+
"global.anthropic.claude-opus-4-7": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
1040
|
+
"jp.anthropic.claude-opus-4-7": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
1041
|
+
"global.anthropic.claude-opus-4-8": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
1042
|
+
"jp.anthropic.claude-opus-4-8": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
1043
|
+
"global.anthropic.claude-opus-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
1044
|
+
"global.anthropic.claude-opus-5-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
1045
|
+
"jp.anthropic.claude-opus-5-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
1046
|
+
"au.anthropic.claude-opus-5-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
1047
|
+
"global.anthropic.claude-fable-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
1048
|
+
"global.anthropic.claude-fable-5-1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
1049
|
+
"global.anthropic.claude-mythos-5-1": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
1050
|
+
"global.anthropic.claude-sonnet-5": BEDROCK_MODEL.CLAUDE_MESSAGES,
|
|
1051
|
+
"global.anthropic.claude-sonnet-5-5": BEDROCK_MODEL.CLAUDE_MESSAGES
|
|
1052
|
+
};
|
|
1053
|
+
function getCanonicalMessagesOnlyModel(modelName) {
|
|
1054
|
+
const mythosMatch = /^(?:[^.]+\.)?(anthropic\.claude-mythos-(?:5|preview))$/.exec(modelName);
|
|
1055
|
+
if (mythosMatch) return mythosMatch[1];
|
|
1056
|
+
if (requiresBedrockAnthropicMessagesModel(modelName)) return modelName;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Model IDs AWS no longer serves. Kept so a config pinned to one fails with a clear local
|
|
1060
|
+
* error instead of reaching the `anthropic.claude` catch-all below (or, on the Converse
|
|
1061
|
+
* route, the remote API) and failing with something less obvious.
|
|
1062
|
+
*
|
|
1063
|
+
* The Claude entries were verified absent from `list-foundation-models` in all 17 commercial
|
|
1064
|
+
* regions on 2026-09-04. Note this is Bedrock's lifecycle, not Anthropic's: several models
|
|
1065
|
+
* retired on the Anthropic API are still served here and must NOT be listed.
|
|
1066
|
+
*
|
|
1067
|
+
* Use bare IDs; the availability check removes inference-profile prefixes.
|
|
1068
|
+
*/
|
|
1069
|
+
const RETIRED_BEDROCK_MODELS = /* @__PURE__ */ new Set([
|
|
1070
|
+
"anthropic.claude-3-opus-20240229-v1:0",
|
|
1071
|
+
"anthropic.claude-opus-4-20250514-v1:0",
|
|
1072
|
+
"anthropic.claude-3-5-haiku-20241022-v1:0",
|
|
1073
|
+
"anthropic.claude-instant-v1",
|
|
1074
|
+
"anthropic.claude-v1",
|
|
1075
|
+
"anthropic.claude-v2",
|
|
1076
|
+
"anthropic.claude-v2:1",
|
|
1077
|
+
"cohere.command-text-v14",
|
|
1078
|
+
"cohere.command-light-text-v14",
|
|
1079
|
+
"meta.llama2-13b-chat-v1",
|
|
1080
|
+
"meta.llama2-70b-chat-v1"
|
|
1081
|
+
]);
|
|
1082
|
+
/** Reject withdrawn models before InvokeModel, Converse, or Knowledge Base requests. */
|
|
1083
|
+
function assertBedrockModelIsAvailable(modelName) {
|
|
1084
|
+
const modelId = modelName.startsWith("arn:") ? /:(?:inference-profile|foundation-model)\/([^/]+)$/.exec(modelName)?.[1] ?? modelName : modelName;
|
|
1085
|
+
if (RETIRED_BEDROCK_MODELS.has(modelId.replace(INFERENCE_PROFILE_PREFIX, ""))) throw new Error(`Unknown Amazon Bedrock model: ${modelName}`);
|
|
1086
|
+
}
|
|
1087
|
+
function getHandlerForModel(modelName, config) {
|
|
1088
|
+
assertBedrockModelIsAvailable(modelName);
|
|
1089
|
+
const messagesOnlyModel = getCanonicalMessagesOnlyModel(modelName);
|
|
1090
|
+
if (messagesOnlyModel) throw new Error(`Amazon Bedrock model "${modelName}" uses Bedrock's Anthropic Messages API, not InvokeModel. Load it as "bedrock:${messagesOnlyModel}" instead.`);
|
|
1091
|
+
if (modelName.includes("arn:") && modelName.includes("inference-profile")) {
|
|
1092
|
+
const inferenceModelType = config?.inferenceModelType;
|
|
1093
|
+
if (!inferenceModelType) throw new Error("Inference profile requires inferenceModelType to be specified in config. Options: claude, nova, nova2, llama (defaults to v4), llama2, llama3, llama3.1, llama3.2, llama3.3, llama4, mistral, cohere, ai21, titan, deepseek, openai, qwen, zai, minimax, moonshot, nvidia, writer, gemma");
|
|
1094
|
+
switch (inferenceModelType) {
|
|
1095
|
+
case "claude": return BEDROCK_MODEL.CLAUDE_MESSAGES;
|
|
1096
|
+
case "nova": return BEDROCK_MODEL.AMAZON_NOVA;
|
|
1097
|
+
case "llama": return BEDROCK_MODEL.LLAMA4;
|
|
1098
|
+
case "llama2": return BEDROCK_MODEL.LLAMA2;
|
|
1099
|
+
case "llama3": return BEDROCK_MODEL.LLAMA3;
|
|
1100
|
+
case "llama3.1":
|
|
1101
|
+
case "llama3_1": return BEDROCK_MODEL.LLAMA3_1;
|
|
1102
|
+
case "llama3.2":
|
|
1103
|
+
case "llama3_2": return BEDROCK_MODEL.LLAMA3_2;
|
|
1104
|
+
case "llama3.3":
|
|
1105
|
+
case "llama3_3": return BEDROCK_MODEL.LLAMA3_3;
|
|
1106
|
+
case "llama4": return BEDROCK_MODEL.LLAMA4;
|
|
1107
|
+
case "mistral": return BEDROCK_MODEL.MISTRAL;
|
|
1108
|
+
case "cohere": return BEDROCK_MODEL.COHERE_COMMAND_R;
|
|
1109
|
+
case "ai21": return BEDROCK_MODEL.AI21;
|
|
1110
|
+
case "titan": return BEDROCK_MODEL.TITAN_TEXT;
|
|
1111
|
+
case "deepseek": return BEDROCK_MODEL.DEEPSEEK;
|
|
1112
|
+
case "openai": return BEDROCK_MODEL.OPENAI;
|
|
1113
|
+
case "qwen": return BEDROCK_MODEL.QWEN;
|
|
1114
|
+
case "nova2": return BEDROCK_MODEL.AMAZON_NOVA_2;
|
|
1115
|
+
case "zai":
|
|
1116
|
+
case "minimax":
|
|
1117
|
+
case "moonshot":
|
|
1118
|
+
case "nvidia":
|
|
1119
|
+
case "writer":
|
|
1120
|
+
case "gemma": return BEDROCK_MODEL.OPENAI_COMPAT;
|
|
1121
|
+
default: throw new Error(`Unknown inference model type: ${inferenceModelType}`);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
const ret = AWS_BEDROCK_MODELS[modelName];
|
|
1125
|
+
if (ret) return ret;
|
|
1126
|
+
if (modelName.startsWith("ai21.")) return BEDROCK_MODEL.AI21;
|
|
1127
|
+
if (modelName.includes("amazon.nova-2")) return BEDROCK_MODEL.AMAZON_NOVA_2;
|
|
1128
|
+
if (modelName.includes("amazon.nova")) return BEDROCK_MODEL.AMAZON_NOVA;
|
|
1129
|
+
if (modelName.includes("anthropic.claude")) return BEDROCK_MODEL.CLAUDE_MESSAGES;
|
|
1130
|
+
if (modelName.startsWith("meta.llama2")) return BEDROCK_MODEL.LLAMA2;
|
|
1131
|
+
if (modelName.includes("meta.llama3-1")) return BEDROCK_MODEL.LLAMA3_1;
|
|
1132
|
+
if (modelName.includes("meta.llama3-2")) return BEDROCK_MODEL.LLAMA3_2;
|
|
1133
|
+
if (modelName.includes("meta.llama3-3")) return BEDROCK_MODEL.LLAMA3_3;
|
|
1134
|
+
if (modelName.includes("meta.llama4")) return BEDROCK_MODEL.LLAMA4;
|
|
1135
|
+
if (modelName.includes("meta.llama3")) return BEDROCK_MODEL.LLAMA3;
|
|
1136
|
+
if (modelName.startsWith("cohere.command-r")) return BEDROCK_MODEL.COHERE_COMMAND_R;
|
|
1137
|
+
if (modelName.startsWith("cohere.command")) return BEDROCK_MODEL.COHERE_COMMAND;
|
|
1138
|
+
if (modelName.startsWith("mistral.")) return BEDROCK_MODEL.MISTRAL;
|
|
1139
|
+
if (modelName.startsWith("deepseek.")) return BEDROCK_MODEL.DEEPSEEK;
|
|
1140
|
+
if (modelName.startsWith("qwen.")) return BEDROCK_MODEL.QWEN;
|
|
1141
|
+
if (modelName.includes("openai.gpt-oss")) {
|
|
1142
|
+
if (/-\d+:\d+$/.test(modelName)) return BEDROCK_MODEL.OPENAI;
|
|
1143
|
+
throw new Error(`Amazon Bedrock model "${modelName}" looks like the Bedrock Mantle id for an open-weight gpt-oss model. promptfoo's bedrock: provider calls the InvokeModel (bedrock-runtime) API, which uses the versioned runtime id — e.g. "bedrock:openai.gpt-oss-120b-1:0". See https://www.promptfoo.dev/docs/providers/aws-bedrock/#openai-models`);
|
|
1144
|
+
}
|
|
1145
|
+
if (modelName.includes("openai.")) {
|
|
1146
|
+
const bareFrontierId = modelName.replace(/^[a-z]+\.(?=openai\.)/, "");
|
|
1147
|
+
if (/^[a-z]+\.openai\.gpt-5\.6-(?:sol|terra|luna)$/.test(modelName)) throw new Error(`OpenAI model "${modelName}" is not served by Bedrock's InvokeModel API. For a supported Runtime inference profile, use "bedrock:converse:${modelName}" with AWS credentials, or "bedrock:${bareFrontierId}" with AWS_BEARER_TOKEN_BEDROCK for Mantle Responses.`);
|
|
1148
|
+
throw new Error(`OpenAI model "${modelName}" is not served by Bedrock's InvokeModel API. Frontier models (gpt-5.x) use the OpenAI-compatible Responses API — use "bedrock:${bareFrontierId}" and set AWS_BEARER_TOKEN_BEDROCK. See https://www.promptfoo.dev/docs/providers/aws-bedrock/#openai-models`);
|
|
1149
|
+
}
|
|
1150
|
+
if (modelName.includes("xai.") || modelName.includes("grok")) throw new Error(`xAI model "${modelName}" is not served by Bedrock's InvokeModel API under that id. Grok 4.6 supports Runtime Converse through an inference profile — use "bedrock:converse:us.xai.grok-4.6" or "bedrock:converse:global.xai.grok-4.6" with ordinary AWS credentials. Other Grok models run on the OpenAI-compatible Responses API (mantle endpoint) — use the bare id such as "bedrock:xai.grok-4.3" and set AWS_BEARER_TOKEN_BEDROCK. See https://www.promptfoo.dev/docs/providers/aws-bedrock/#xai-grok-models`);
|
|
1151
|
+
throw new Error(`Unknown Amazon Bedrock model: ${modelName}`);
|
|
1152
|
+
}
|
|
1153
|
+
var AwsBedrockCompletionProvider = class extends AwsBedrockGenericProvider {
|
|
1154
|
+
static AWS_BEDROCK_COMPLETION_MODELS = Object.keys(AWS_BEDROCK_MODELS);
|
|
1155
|
+
async callApi(prompt, context) {
|
|
1156
|
+
let stop;
|
|
1157
|
+
try {
|
|
1158
|
+
stop = getEnvString("AWS_BEDROCK_STOP") ? JSON.parse(getEnvString("AWS_BEDROCK_STOP")) : [];
|
|
1159
|
+
} catch (err) {
|
|
1160
|
+
throw new Error(`BEDROCK_STOP is not a valid JSON string: ${err}`);
|
|
1161
|
+
}
|
|
1162
|
+
const mergedConfig = {
|
|
1163
|
+
...this.config,
|
|
1164
|
+
...context?.prompt.config
|
|
1165
|
+
};
|
|
1166
|
+
let model = getHandlerForModel(this.modelName, mergedConfig);
|
|
1167
|
+
if (!model) {
|
|
1168
|
+
logger.warn(`Unknown Amazon Bedrock model: ${this.modelName}. Assuming its API is Claude-like.`);
|
|
1169
|
+
model = BEDROCK_MODEL.CLAUDE_MESSAGES;
|
|
1170
|
+
}
|
|
1171
|
+
const params = await model.params(mergedConfig, prompt, stop, this.modelName, context?.vars);
|
|
1172
|
+
logger.debug("Calling Amazon Bedrock API", { params });
|
|
1173
|
+
const cache = await getCache();
|
|
1174
|
+
const region = this.getRegion();
|
|
1175
|
+
const cacheKey = `bedrock:${this.modelName}:${region}:${createBedrockCacheKeyHash({
|
|
1176
|
+
config: this.config,
|
|
1177
|
+
params,
|
|
1178
|
+
region
|
|
1179
|
+
})}`;
|
|
1180
|
+
if (isCacheEnabled()) {
|
|
1181
|
+
const cachedResponse = await cache.get(cacheKey);
|
|
1182
|
+
if (cachedResponse) {
|
|
1183
|
+
logger.debug(`Returning cached response for ${prompt}: ${cachedResponse}`);
|
|
1184
|
+
return {
|
|
1185
|
+
output: model.output(mergedConfig, JSON.parse(cachedResponse)),
|
|
1186
|
+
tokenUsage: createEmptyTokenUsage(),
|
|
1187
|
+
cached: true
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
let response;
|
|
1192
|
+
try {
|
|
1193
|
+
const bedrockInstance = await this.getBedrockInstance();
|
|
1194
|
+
try {
|
|
1195
|
+
const testCredentials = await bedrockInstance.config.credentials?.();
|
|
1196
|
+
logger.debug(`Actual credentials being used: ${testCredentials?.accessKeyId ? `accessKeyId starts with: ${testCredentials.accessKeyId.substring(0, 4)}...` : "no explicit credentials (using instance metadata)"}`);
|
|
1197
|
+
} catch (credErr) {
|
|
1198
|
+
logger.debug(`Error getting credentials: ${credErr}`);
|
|
1199
|
+
}
|
|
1200
|
+
response = await bedrockInstance.invokeModel({
|
|
1201
|
+
modelId: this.modelName,
|
|
1202
|
+
...this.config.guardrailIdentifier ? { guardrailIdentifier: String(this.config.guardrailIdentifier) } : {},
|
|
1203
|
+
...this.config.guardrailVersion ? { guardrailVersion: String(this.config.guardrailVersion) } : {},
|
|
1204
|
+
...this.config.trace ? { trace: this.config.trace } : {},
|
|
1205
|
+
accept: "application/json",
|
|
1206
|
+
contentType: "application/json",
|
|
1207
|
+
body: JSON.stringify(params)
|
|
1208
|
+
});
|
|
1209
|
+
} catch (err) {
|
|
1210
|
+
return { error: `Bedrock API invoke model error: ${String(err)}` };
|
|
1211
|
+
}
|
|
1212
|
+
logger.debug(`Amazon Bedrock API response: ${response.body.transformToString()}`);
|
|
1213
|
+
if (isCacheEnabled()) try {
|
|
1214
|
+
await cache.set(cacheKey, new TextDecoder().decode(response.body));
|
|
1215
|
+
} catch (err) {
|
|
1216
|
+
logger.error(`Failed to cache response: ${String(err)}`);
|
|
1217
|
+
}
|
|
1218
|
+
try {
|
|
1219
|
+
const output = JSON.parse(new TextDecoder().decode(response.body));
|
|
1220
|
+
let tokenUsage = {};
|
|
1221
|
+
if (model.tokenUsage) {
|
|
1222
|
+
tokenUsage = model.tokenUsage(output, prompt);
|
|
1223
|
+
logger.debug(`Token usage from model handler: ${JSON.stringify(tokenUsage)}`);
|
|
1224
|
+
} else {
|
|
1225
|
+
const promptTokens = output.usage?.inputTokens ?? output.usage?.input_tokens ?? output.usage?.prompt_tokens ?? output.prompt_tokens ?? output.prompt_token_count;
|
|
1226
|
+
const completionTokens = output.usage?.outputTokens ?? output.usage?.output_tokens ?? output.usage?.completion_tokens ?? output.completion_tokens ?? output.generation_token_count;
|
|
1227
|
+
const promptTokensNum = coerceStrToNum(promptTokens);
|
|
1228
|
+
const completionTokensNum = coerceStrToNum(completionTokens);
|
|
1229
|
+
tokenUsage = {
|
|
1230
|
+
prompt: promptTokensNum,
|
|
1231
|
+
completion: completionTokensNum,
|
|
1232
|
+
total: coerceStrToNum(output.usage?.totalTokens ?? output.usage?.total_tokens ?? output.total_tokens) ?? (promptTokensNum !== void 0 && completionTokensNum !== void 0 ? promptTokensNum + completionTokensNum : void 0),
|
|
1233
|
+
numRequests: 1
|
|
1234
|
+
};
|
|
1235
|
+
if (tokenUsage.prompt === void 0 && tokenUsage.completion === void 0 && tokenUsage.total === void 0 && output) logger.debug(`No explicit token counts found for ${this.modelName}, tracking request count only`);
|
|
1236
|
+
else logger.debug(`Extracted token usage: ${JSON.stringify(tokenUsage)}`);
|
|
1237
|
+
}
|
|
1238
|
+
if (!tokenUsage.numRequests) tokenUsage.numRequests = 1;
|
|
1239
|
+
const cacheReadInputTokens = tokenUsage.completionDetails?.cacheReadInputTokens ?? (isBedrockGrok46Profile(this.modelName) ? coerceStrToNum(output.usage?.prompt_tokens_details?.cached_tokens) : coerceStrToNum(output.usage?.cache_read_input_tokens));
|
|
1240
|
+
const billablePromptTokens = model === BEDROCK_MODEL.CLAUDE_MESSAGES ? coerceStrToNum(output.usage?.input_tokens ?? output.usage?.prompt_tokens) : isBedrockGrok46Profile(this.modelName) && tokenUsage.prompt !== void 0 ? Math.max(tokenUsage.prompt - (cacheReadInputTokens ?? 0), 0) : tokenUsage.prompt;
|
|
1241
|
+
const cost = calculateBedrockInvokeModelCost(this.modelName, billablePromptTokens, tokenUsage.completion, cacheReadInputTokens, tokenUsage.completionDetails?.cacheCreationInputTokens ?? coerceStrToNum(output.usage?.cache_creation_input_tokens), region, coerceStrToNum(output.usage?.cache_creation?.ephemeral_1h_input_tokens));
|
|
1242
|
+
return {
|
|
1243
|
+
output: model.output(mergedConfig, output),
|
|
1244
|
+
tokenUsage,
|
|
1245
|
+
cost,
|
|
1246
|
+
...output["amazon-bedrock-guardrailAction"] ? { guardrails: { flagged: output["amazon-bedrock-guardrailAction"] === "INTERVENED" } } : {}
|
|
1247
|
+
};
|
|
1248
|
+
} catch (err) {
|
|
1249
|
+
logger.error("Bedrock API response error", {
|
|
1250
|
+
error: String(err),
|
|
1251
|
+
response
|
|
1252
|
+
});
|
|
1253
|
+
return { error: `API response error: ${String(err)}: ${JSON.stringify(response)}` };
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
};
|
|
1257
|
+
var AwsBedrockEmbeddingProvider = class extends AwsBedrockGenericProvider {
|
|
1258
|
+
supportsEmbeddingCancellation = true;
|
|
1259
|
+
constructor(modelName, options = {}) {
|
|
1260
|
+
super(modelName, options);
|
|
1261
|
+
}
|
|
1262
|
+
async callApi() {
|
|
1263
|
+
throw new Error("callApi is not implemented for embedding provider");
|
|
1264
|
+
}
|
|
1265
|
+
async callEmbeddingApi(text, _context, options) {
|
|
1266
|
+
const params = this.modelName.includes("cohere.embed") ? {
|
|
1267
|
+
texts: [text],
|
|
1268
|
+
input_type: this.config.input_type ?? "search_document"
|
|
1269
|
+
} : { inputText: text };
|
|
1270
|
+
logger.debug("Calling AWS Bedrock API for embeddings", { params });
|
|
1271
|
+
let response;
|
|
1272
|
+
try {
|
|
1273
|
+
const bedrockInstance = await this.getBedrockInstance();
|
|
1274
|
+
const command = {
|
|
1275
|
+
modelId: this.modelName,
|
|
1276
|
+
accept: "application/json",
|
|
1277
|
+
contentType: "application/json",
|
|
1278
|
+
body: JSON.stringify(params)
|
|
1279
|
+
};
|
|
1280
|
+
response = options?.abortSignal ? await bedrockInstance.invokeModel(command, { abortSignal: options.abortSignal }) : await bedrockInstance.invokeModel(command);
|
|
1281
|
+
} catch (err) {
|
|
1282
|
+
options?.abortSignal?.throwIfAborted();
|
|
1283
|
+
return { error: `API call error: ${String(err)}` };
|
|
1284
|
+
}
|
|
1285
|
+
logger.debug(`AWS Bedrock API response (embeddings): ${JSON.stringify(response.body.transformToString())}`);
|
|
1286
|
+
try {
|
|
1287
|
+
const data = JSON.parse(response.body.transformToString());
|
|
1288
|
+
const embeddings = data?.embeddings?.float ?? data?.embeddings;
|
|
1289
|
+
const embedding = data?.embedding ?? (Array.isArray(embeddings) && embeddings.length === 1 ? embeddings[0] : void 0);
|
|
1290
|
+
if (!Array.isArray(embedding) || embedding.length === 0 || !embedding.every((value) => typeof value === "number" && Number.isFinite(value))) throw new Error("No valid embedding found in AWS Bedrock API response");
|
|
1291
|
+
return { embedding };
|
|
1292
|
+
} catch (err) {
|
|
1293
|
+
return { error: `API response error: ${String(err)}: ${JSON.stringify(response.body.transformToString())}` };
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
};
|
|
1297
|
+
//#endregion
|
|
1298
|
+
export { getLlamaModelHandler as _, LlamaVersion as a, assertBedrockModelIsAvailable as c, extractTextContent as d, formatPromptLlama2Chat as f, getHandlerForModel as g, formatPromptLlama4 as h, BEDROCK_MODEL as i, coerceStrToNum as l, formatPromptLlama3Instruct as m, AwsBedrockCompletionProvider as n, RETIRED_BEDROCK_MODELS as o, formatPromptLlama32Vision as p, AwsBedrockEmbeddingProvider as r, addConfigParam as s, AWS_BEDROCK_MODELS as t, extractTextAndImages as u, parseValue as v };
|
|
1299
|
+
|
|
1300
|
+
//# sourceMappingURL=bedrock-CsjM1dOt.js.map
|