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,850 @@
|
|
|
1
|
+
const require_logger = require("./logger-DXUHJBHJ.cjs");
|
|
2
|
+
const require_fetch = require("./fetch-BKlgUg08.cjs");
|
|
3
|
+
const require_shared = require("./shared-D9Bf3UgD.cjs");
|
|
4
|
+
const require_time = require("./time-CY7bOv6D.cjs");
|
|
5
|
+
const require_render = require("./render-j-UNQw7s.cjs");
|
|
6
|
+
const require_env = require("./env-PwgLIVUT.cjs");
|
|
7
|
+
const require_credentials = require("./credentials-CFfK32uY.cjs");
|
|
8
|
+
const require_cache = require("./cache-iG87oYan.cjs");
|
|
9
|
+
const require_blobs = require("./blobs-CwaJ7l1g.cjs");
|
|
10
|
+
const require_util = require("./util-Df7rfMGb.cjs");
|
|
11
|
+
//#region src/providers/google/interactions.ts
|
|
12
|
+
function normalizeAudioMimeType(format) {
|
|
13
|
+
if (format?.startsWith("audio/")) return format;
|
|
14
|
+
if (format === "mp3") return "audio/mpeg";
|
|
15
|
+
if (format === "pcm16") return "audio/pcm";
|
|
16
|
+
return `audio/${format || "mpeg"}`;
|
|
17
|
+
}
|
|
18
|
+
function getInteractionText(value) {
|
|
19
|
+
if (typeof value === "string") return [value];
|
|
20
|
+
if (Array.isArray(value)) return value.flatMap(getInteractionText);
|
|
21
|
+
if (!value || typeof value !== "object") return [];
|
|
22
|
+
const record = value;
|
|
23
|
+
if (typeof record.text === "string") return [record.text];
|
|
24
|
+
return getInteractionText(record.content ?? record.parts);
|
|
25
|
+
}
|
|
26
|
+
function parseInteractionInput(prompt, extractSystemInstructions) {
|
|
27
|
+
try {
|
|
28
|
+
const parsedPrompt = JSON.parse(prompt);
|
|
29
|
+
const promptEnvelope = parsedPrompt && typeof parsedPrompt === "object" && !Array.isArray(parsedPrompt) ? parsedPrompt : void 0;
|
|
30
|
+
const envelopeSystemInstruction = getInteractionText(promptEnvelope?.system_instruction ?? promptEnvelope?.systemInstruction);
|
|
31
|
+
const parsed = parsedPrompt && typeof parsedPrompt === "object" && !Array.isArray(parsedPrompt) && Array.isArray(parsedPrompt.contents) ? parsedPrompt.contents : parsedPrompt;
|
|
32
|
+
if (Array.isArray(parsed)) {
|
|
33
|
+
const systemInstructions = [...envelopeSystemInstruction];
|
|
34
|
+
const input = parsed.flatMap((content) => {
|
|
35
|
+
if (!content || typeof content !== "object") return [content];
|
|
36
|
+
const normalizePart = (part) => {
|
|
37
|
+
if (!part || typeof part !== "object") return part;
|
|
38
|
+
if (!("type" in part)) {
|
|
39
|
+
const geminiPart = part;
|
|
40
|
+
if (typeof geminiPart.text === "string") return {
|
|
41
|
+
type: "text",
|
|
42
|
+
text: geminiPart.text
|
|
43
|
+
};
|
|
44
|
+
const inlineData = geminiPart.inlineData || geminiPart.inline_data;
|
|
45
|
+
const mimeType = geminiPart.inlineData?.mimeType || geminiPart.inline_data?.mime_type || geminiPart.fileData?.mimeType || geminiPart.file_data?.mime_type;
|
|
46
|
+
if (mimeType) {
|
|
47
|
+
const type = mimeType.startsWith("video/") ? "video" : mimeType.startsWith("audio/") ? "audio" : "image";
|
|
48
|
+
return inlineData ? {
|
|
49
|
+
type,
|
|
50
|
+
mime_type: mimeType,
|
|
51
|
+
data: inlineData.data
|
|
52
|
+
} : {
|
|
53
|
+
type,
|
|
54
|
+
mime_type: mimeType,
|
|
55
|
+
uri: geminiPart.fileData?.fileUri || geminiPart.file_data?.file_uri
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return part;
|
|
59
|
+
}
|
|
60
|
+
const imagePart = part;
|
|
61
|
+
if (imagePart.type === "input_text") return {
|
|
62
|
+
...imagePart,
|
|
63
|
+
type: "text"
|
|
64
|
+
};
|
|
65
|
+
if (imagePart.type === "input_audio") {
|
|
66
|
+
const inputAudio = part.input_audio;
|
|
67
|
+
if (inputAudio?.data) return {
|
|
68
|
+
type: "audio",
|
|
69
|
+
mime_type: normalizeAudioMimeType(inputAudio.format?.toLowerCase()),
|
|
70
|
+
data: inputAudio.data
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (imagePart.type !== "image_url" && imagePart.type !== "input_image") return part;
|
|
74
|
+
const imageUrl = typeof imagePart.image_url === "string" ? imagePart.image_url : imagePart.image_url?.url;
|
|
75
|
+
if (!imageUrl) return part;
|
|
76
|
+
const inlineImage = /^data:([^;,]+);base64,(.*)$/is.exec(imageUrl);
|
|
77
|
+
return inlineImage ? {
|
|
78
|
+
type: "image",
|
|
79
|
+
mime_type: inlineImage[1],
|
|
80
|
+
data: inlineImage[2]
|
|
81
|
+
} : {
|
|
82
|
+
type: "image",
|
|
83
|
+
uri: imageUrl
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
if (!("role" in content)) return [normalizePart(content)];
|
|
87
|
+
const { role, content: messageContent, parts, ...message } = content;
|
|
88
|
+
const interactionContent = messageContent ?? parts;
|
|
89
|
+
if (role === "system" && extractSystemInstructions) {
|
|
90
|
+
systemInstructions.push(...getInteractionText(interactionContent));
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
const normalizedContent = Array.isArray(interactionContent) ? interactionContent.map((part) => normalizePart(part)) : typeof interactionContent === "string" ? [{
|
|
94
|
+
type: "text",
|
|
95
|
+
text: interactionContent
|
|
96
|
+
}] : interactionContent && typeof interactionContent === "object" ? [normalizePart(interactionContent)] : [];
|
|
97
|
+
return [{
|
|
98
|
+
...message,
|
|
99
|
+
type: role === "assistant" || role === "model" ? "model_output" : "user_input",
|
|
100
|
+
content: normalizedContent
|
|
101
|
+
}];
|
|
102
|
+
});
|
|
103
|
+
if (input.length === 0 && systemInstructions.length > 0) return {
|
|
104
|
+
input: [{
|
|
105
|
+
type: "user_input",
|
|
106
|
+
content: systemInstructions.map((text) => ({
|
|
107
|
+
type: "text",
|
|
108
|
+
text
|
|
109
|
+
}))
|
|
110
|
+
}],
|
|
111
|
+
hasSystemInstruction: true
|
|
112
|
+
};
|
|
113
|
+
return {
|
|
114
|
+
input,
|
|
115
|
+
...systemInstructions.length > 0 ? {
|
|
116
|
+
systemInstruction: systemInstructions.join("\n"),
|
|
117
|
+
hasSystemInstruction: true
|
|
118
|
+
} : {}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
input: parsed && typeof parsed === "object" ? parsed : prompt,
|
|
123
|
+
...envelopeSystemInstruction.length > 0 ? {
|
|
124
|
+
systemInstruction: envelopeSystemInstruction.join("\n"),
|
|
125
|
+
hasSystemInstruction: true
|
|
126
|
+
} : {}
|
|
127
|
+
};
|
|
128
|
+
} catch {
|
|
129
|
+
return { input: prompt };
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
const INTERACTION_INPUT_METADATA_FIELDS = /* @__PURE__ */ new Set([
|
|
133
|
+
"mime_type",
|
|
134
|
+
"mimeType",
|
|
135
|
+
"role",
|
|
136
|
+
"type"
|
|
137
|
+
]);
|
|
138
|
+
function hasSemanticInteractionInput(value) {
|
|
139
|
+
if (typeof value === "string") return value.trim().length > 0;
|
|
140
|
+
if (Array.isArray(value)) return value.some(hasSemanticInteractionInput);
|
|
141
|
+
if (value && typeof value === "object") return Object.entries(value).some(([field, nestedValue]) => !INTERACTION_INPUT_METADATA_FIELDS.has(field) && hasSemanticInteractionInput(nestedValue));
|
|
142
|
+
return value !== null && value !== void 0;
|
|
143
|
+
}
|
|
144
|
+
function getLiveOnlyModelRouteError(modelName) {
|
|
145
|
+
if (modelName === "gemini-3.5-live-translate-preview" || modelName.startsWith("gemini-robotics-er-2-streaming-")) return `Model "${modelName}" requires the Gemini Live API. Use google:live:${modelName}.`;
|
|
146
|
+
}
|
|
147
|
+
const INTERACTION_GENERATION_FIELDS = /* @__PURE__ */ new Set([
|
|
148
|
+
"max_output_tokens",
|
|
149
|
+
"seed",
|
|
150
|
+
"stop_sequences",
|
|
151
|
+
"thinking_level",
|
|
152
|
+
"thinking_summaries",
|
|
153
|
+
"tool_choice",
|
|
154
|
+
"transcription_config",
|
|
155
|
+
"video_config"
|
|
156
|
+
]);
|
|
157
|
+
const INTERACTION_GENERATION_ALIASES = {
|
|
158
|
+
maxOutputTokens: "max_output_tokens",
|
|
159
|
+
stopSequences: "stop_sequences",
|
|
160
|
+
thinkingLevel: "thinking_level",
|
|
161
|
+
thinkingSummaries: "thinking_summaries",
|
|
162
|
+
topP: "top_p",
|
|
163
|
+
toolChoice: "tool_choice",
|
|
164
|
+
transcriptionConfig: "transcription_config",
|
|
165
|
+
videoConfig: "video_config"
|
|
166
|
+
};
|
|
167
|
+
const INTERACTION_SAMPLING_FIELDS = /* @__PURE__ */ new Set(["temperature", "top_p"]);
|
|
168
|
+
const INTERACTION_TOP_LEVEL_GENERATION_FIELDS = /* @__PURE__ */ new Set([
|
|
169
|
+
...INTERACTION_GENERATION_FIELDS,
|
|
170
|
+
...Object.keys(INTERACTION_GENERATION_ALIASES),
|
|
171
|
+
"temperature",
|
|
172
|
+
"top_p",
|
|
173
|
+
"topP",
|
|
174
|
+
"top_k",
|
|
175
|
+
"topK",
|
|
176
|
+
"thinkingConfig",
|
|
177
|
+
"thinking_config",
|
|
178
|
+
"thinkingBudget",
|
|
179
|
+
"thinking_budget",
|
|
180
|
+
"negative_prompt",
|
|
181
|
+
"negativePrompt",
|
|
182
|
+
"responseMimeType",
|
|
183
|
+
"response_mime_type",
|
|
184
|
+
"responseSchema",
|
|
185
|
+
"response_schema"
|
|
186
|
+
]);
|
|
187
|
+
function normalizeInteractionThinkingLevel(value) {
|
|
188
|
+
return typeof value === "string" ? value.toLowerCase() : value;
|
|
189
|
+
}
|
|
190
|
+
function hasInteractionThinkingLevel(value) {
|
|
191
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
192
|
+
const config = value;
|
|
193
|
+
return [config.thinkingConfig, config.thinking_config].some((thinkingConfig) => {
|
|
194
|
+
if (!thinkingConfig || typeof thinkingConfig !== "object" || Array.isArray(thinkingConfig)) return false;
|
|
195
|
+
const nestedConfig = thinkingConfig;
|
|
196
|
+
return nestedConfig.thinkingLevel !== void 0 || nestedConfig.thinking_level !== void 0;
|
|
197
|
+
}) || config.thinkingLevel !== void 0 || config.thinking_level !== void 0;
|
|
198
|
+
}
|
|
199
|
+
function shouldRejectInteractionThinkingBudget(value, ignoreNumericThinkingBudget) {
|
|
200
|
+
return typeof value === "number" && !ignoreNumericThinkingBudget;
|
|
201
|
+
}
|
|
202
|
+
function isSupportedInteractionGenerationField(field, allowSamplingControls) {
|
|
203
|
+
return INTERACTION_GENERATION_FIELDS.has(field) || allowSamplingControls && INTERACTION_SAMPLING_FIELDS.has(field);
|
|
204
|
+
}
|
|
205
|
+
function normalizeInteractionGenerationConfig(value, allowSamplingControls = false, ignoreNumericThinkingBudget = false) {
|
|
206
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return { config: {} };
|
|
207
|
+
const config = {};
|
|
208
|
+
for (const [field, fieldValue] of Object.entries(value)) {
|
|
209
|
+
if (field === "thinkingConfig" || field === "thinking_config") {
|
|
210
|
+
if (!fieldValue || typeof fieldValue !== "object" || Array.isArray(fieldValue)) continue;
|
|
211
|
+
const thinkingConfig = fieldValue;
|
|
212
|
+
if (shouldRejectInteractionThinkingBudget(thinkingConfig.thinkingBudget ?? thinkingConfig.thinking_budget, ignoreNumericThinkingBudget)) return {
|
|
213
|
+
config: {},
|
|
214
|
+
error: "Gemini Interactions generation_config does not support numeric thinkingBudget; use thinkingConfig.thinkingLevel instead."
|
|
215
|
+
};
|
|
216
|
+
const thinkingLevel = thinkingConfig.thinkingLevel ?? thinkingConfig.thinking_level;
|
|
217
|
+
if (thinkingLevel !== void 0) config.thinking_level = normalizeInteractionThinkingLevel(thinkingLevel);
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
if (field === "thinkingBudget" || field === "thinking_budget") {
|
|
221
|
+
if (shouldRejectInteractionThinkingBudget(fieldValue, ignoreNumericThinkingBudget)) return {
|
|
222
|
+
config: {},
|
|
223
|
+
error: "Gemini Interactions generation_config does not support numeric thinkingBudget; use thinking_level instead."
|
|
224
|
+
};
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
const normalizedField = INTERACTION_GENERATION_ALIASES[field] || field;
|
|
228
|
+
if (!isSupportedInteractionGenerationField(normalizedField, allowSamplingControls) || fieldValue === void 0) continue;
|
|
229
|
+
config[normalizedField] = normalizedField === "thinking_level" ? normalizeInteractionThinkingLevel(fieldValue) : fieldValue;
|
|
230
|
+
}
|
|
231
|
+
return { config };
|
|
232
|
+
}
|
|
233
|
+
function normalizeInteractionGenerationLayers(layers, allowSamplingControls = false) {
|
|
234
|
+
const hasLaterThinkingLevel = new Array(layers.length);
|
|
235
|
+
let laterThinkingLevelFound = false;
|
|
236
|
+
for (let index = layers.length - 1; index >= 0; index--) {
|
|
237
|
+
hasLaterThinkingLevel[index] = laterThinkingLevelFound;
|
|
238
|
+
laterThinkingLevelFound ||= hasInteractionThinkingLevel(layers[index]);
|
|
239
|
+
}
|
|
240
|
+
const config = {};
|
|
241
|
+
for (const [index, layer] of layers.entries()) {
|
|
242
|
+
const normalizedLayer = normalizeInteractionGenerationConfig(layer, allowSamplingControls, hasLaterThinkingLevel[index] ?? false);
|
|
243
|
+
if (normalizedLayer.error) return normalizedLayer;
|
|
244
|
+
Object.assign(config, normalizedLayer.config);
|
|
245
|
+
}
|
|
246
|
+
return { config };
|
|
247
|
+
}
|
|
248
|
+
function normalizeInteractionServiceTier(value) {
|
|
249
|
+
return value === "flex" || value === "standard" || value === "priority" ? value : void 0;
|
|
250
|
+
}
|
|
251
|
+
function resolveInteractionStructuredOutput(layers) {
|
|
252
|
+
let legacyMimeType;
|
|
253
|
+
let legacyResponseSchema;
|
|
254
|
+
for (const layer of layers) {
|
|
255
|
+
let layerMimeType;
|
|
256
|
+
let layerResponseSchema;
|
|
257
|
+
for (const generationConfig of layer.generationConfigs) {
|
|
258
|
+
if (!generationConfig || typeof generationConfig !== "object" || Array.isArray(generationConfig)) continue;
|
|
259
|
+
const config = generationConfig;
|
|
260
|
+
const responseMimeType = config.response_mime_type ?? config.responseMimeType;
|
|
261
|
+
const responseSchemaValue = config.response_schema ?? config.responseSchema;
|
|
262
|
+
if (responseMimeType !== void 0) layerMimeType = responseMimeType;
|
|
263
|
+
if (responseSchemaValue !== void 0) layerResponseSchema = responseSchemaValue;
|
|
264
|
+
}
|
|
265
|
+
if (layer.responseSchema !== void 0 && layerResponseSchema !== void 0) throw new Error("`responseSchema` provided but `generationConfig.response_schema` already set.");
|
|
266
|
+
if (layerMimeType !== void 0) legacyMimeType = layerMimeType;
|
|
267
|
+
const resolvedLayerSchema = layer.responseSchema ?? layerResponseSchema;
|
|
268
|
+
if (resolvedLayerSchema !== void 0) legacyResponseSchema = resolvedLayerSchema;
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
...typeof legacyMimeType === "string" ? { mimeType: legacyMimeType } : {},
|
|
272
|
+
...legacyResponseSchema === void 0 ? {} : { responseSchema: legacyResponseSchema }
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function normalizeInteractionSafetySettings(safetySettings) {
|
|
276
|
+
return safetySettings.map(({ category, threshold, probability }) => ({
|
|
277
|
+
type: category.replace(/^HARM_CATEGORY_/i, "").toLowerCase(),
|
|
278
|
+
...threshold || probability ? { threshold: (threshold || probability)?.toLowerCase() } : {}
|
|
279
|
+
}));
|
|
280
|
+
}
|
|
281
|
+
function calculateExplicitInteractionCost(config, promptTokens, completionTokens, audioPromptTokens, audioCompletionTokens, videoCompletionTokens, imagePromptTokens) {
|
|
282
|
+
const inputCost = config.inputCost ?? config.cost;
|
|
283
|
+
const outputCost = config.outputCost ?? config.cost;
|
|
284
|
+
const audioInput = Math.max(0, Math.min(audioPromptTokens, promptTokens));
|
|
285
|
+
const imageInput = Math.max(0, Math.min(imagePromptTokens, promptTokens - audioInput));
|
|
286
|
+
const audioOutput = Math.max(0, Math.min(audioCompletionTokens, completionTokens));
|
|
287
|
+
const videoOutput = Math.max(0, Math.min(videoCompletionTokens, completionTokens - audioOutput));
|
|
288
|
+
const charges = [
|
|
289
|
+
[promptTokens - audioInput - imageInput, inputCost],
|
|
290
|
+
[audioInput, config.audioInputCost ?? config.audioCost ?? inputCost],
|
|
291
|
+
[imageInput, config.imageInputCost ?? inputCost],
|
|
292
|
+
[completionTokens - audioOutput - videoOutput, outputCost],
|
|
293
|
+
[audioOutput, config.audioOutputCost ?? config.audioCost ?? outputCost],
|
|
294
|
+
[videoOutput, config.videoOutputCost ?? outputCost]
|
|
295
|
+
];
|
|
296
|
+
if (!charges.some(([, rate]) => rate !== void 0) || charges.some(([tokens, rate]) => !Number.isFinite(tokens) || tokens < 0 || tokens > 0 && (rate === void 0 || !Number.isFinite(rate)))) return;
|
|
297
|
+
return charges.reduce((total, [tokens, rate]) => total + tokens * (rate ?? 0), 0);
|
|
298
|
+
}
|
|
299
|
+
function getInteractionModalityTokenCount(details, modalities) {
|
|
300
|
+
return (details || []).filter((detail) => modalities.includes(detail.modality?.toLowerCase() || "")).reduce((total, detail) => total + Math.max(detail.tokens ?? 0, 0), 0);
|
|
301
|
+
}
|
|
302
|
+
function getModelOutputContent(data) {
|
|
303
|
+
const steps = data.steps || [];
|
|
304
|
+
const latestUserInput = steps.map((step) => step.type).lastIndexOf("user_input");
|
|
305
|
+
const latestToolStep = steps.map((step) => step.type?.endsWith("_call") || step.type?.endsWith("_result")).lastIndexOf(true);
|
|
306
|
+
return steps.slice(Math.max(latestUserInput, latestToolStep) + 1).filter((step) => step.type === "model_output").flatMap((step) => step.content || []);
|
|
307
|
+
}
|
|
308
|
+
function getInteractionAnnotationExcerpt(text, startIndex, endIndex) {
|
|
309
|
+
if (typeof text !== "string" || !Number.isInteger(startIndex) || !Number.isInteger(endIndex) || startIndex < 0 || endIndex < startIndex) return "";
|
|
310
|
+
const bytes = Buffer.from(text, "utf8");
|
|
311
|
+
if (endIndex > bytes.length) return "";
|
|
312
|
+
return bytes.subarray(startIndex, endIndex).toString("utf8").trim();
|
|
313
|
+
}
|
|
314
|
+
function getTrimmedString(value) {
|
|
315
|
+
return typeof value === "string" ? value.trim() : "";
|
|
316
|
+
}
|
|
317
|
+
function normalizeInteractionCitation(annotation, text) {
|
|
318
|
+
if (!annotation || typeof annotation !== "object") return [];
|
|
319
|
+
const record = annotation;
|
|
320
|
+
const excerpt = getInteractionAnnotationExcerpt(text, record.start_index ?? record.startIndex, record.end_index ?? record.endIndex);
|
|
321
|
+
if (record.type === "url_citation") {
|
|
322
|
+
const url = getTrimmedString(record.url);
|
|
323
|
+
if (!/^https?:\/\//i.test(url)) return [];
|
|
324
|
+
return [{
|
|
325
|
+
url,
|
|
326
|
+
content: [getTrimmedString(record.title), excerpt].filter(Boolean).join(": ") || url
|
|
327
|
+
}];
|
|
328
|
+
}
|
|
329
|
+
if (record.type === "file_citation") {
|
|
330
|
+
const source = [
|
|
331
|
+
record.document_uri,
|
|
332
|
+
record.source,
|
|
333
|
+
record.file_name,
|
|
334
|
+
record.media_id
|
|
335
|
+
].map(getTrimmedString).find(Boolean);
|
|
336
|
+
if (!source) return [];
|
|
337
|
+
const fileName = getTrimmedString(record.file_name);
|
|
338
|
+
const page = Number.isInteger(record.page_number) ? ` (page ${record.page_number})` : "";
|
|
339
|
+
return [{
|
|
340
|
+
source,
|
|
341
|
+
content: [`${fileName || source}${page}`, excerpt].filter(Boolean).join(": ") || source
|
|
342
|
+
}];
|
|
343
|
+
}
|
|
344
|
+
if (record.type === "place_citation") {
|
|
345
|
+
const url = getTrimmedString(record.url);
|
|
346
|
+
const name = getTrimmedString(record.name);
|
|
347
|
+
const placeId = getTrimmedString(record.place_id);
|
|
348
|
+
const source = url || placeId || name;
|
|
349
|
+
if (!source) return [];
|
|
350
|
+
return [{
|
|
351
|
+
...url ? { url } : { source },
|
|
352
|
+
content: [name, excerpt].filter(Boolean).join(": ") || source
|
|
353
|
+
}];
|
|
354
|
+
}
|
|
355
|
+
return [];
|
|
356
|
+
}
|
|
357
|
+
function getInteractionGroundingMetadata(data, outputContent) {
|
|
358
|
+
const annotations = outputContent.flatMap((part) => Array.isArray(part.annotations) ? part.annotations : []);
|
|
359
|
+
const citations = outputContent.flatMap((part) => {
|
|
360
|
+
if (!Array.isArray(part.annotations)) return [];
|
|
361
|
+
return part.annotations.flatMap((annotation) => normalizeInteractionCitation(annotation, part.text));
|
|
362
|
+
});
|
|
363
|
+
const steps = data.steps || [];
|
|
364
|
+
const latestUserInput = steps.map((step) => step.type).lastIndexOf("user_input");
|
|
365
|
+
const latestSteps = steps.slice(latestUserInput + 1);
|
|
366
|
+
const interactionToolCalls = latestSteps.filter((step) => step.type?.endsWith("_call"));
|
|
367
|
+
const interactionToolResults = latestSteps.filter((step) => step.type?.endsWith("_result"));
|
|
368
|
+
return {
|
|
369
|
+
...annotations.length > 0 ? { annotations } : {},
|
|
370
|
+
...citations.length > 0 ? { citations } : {},
|
|
371
|
+
...interactionToolCalls.length > 0 ? { interactionToolCalls } : {},
|
|
372
|
+
...interactionToolResults.length > 0 ? { interactionToolResults } : {}
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
function getInteractionsEndpoint(config, env) {
|
|
376
|
+
const endpointFromHost = (apiHost) => {
|
|
377
|
+
return `${(/^https?:\/\//i.test(apiHost) ? apiHost : `https://${apiHost}`).replace(/\/$/, "")}/v1beta/interactions`;
|
|
378
|
+
};
|
|
379
|
+
if (config.apiHost) return endpointFromHost(config.apiHost);
|
|
380
|
+
if (config.apiBaseUrl) return `${config.apiBaseUrl.replace(/\/$/, "")}/v1beta/interactions`;
|
|
381
|
+
const endpoint = require_env.resolveProviderEnv(env, [
|
|
382
|
+
"GOOGLE_API_HOST",
|
|
383
|
+
"PALM_API_HOST",
|
|
384
|
+
"GOOGLE_API_BASE_URL"
|
|
385
|
+
]);
|
|
386
|
+
if (endpoint?.name === "GOOGLE_API_BASE_URL") return `${endpoint.value.replace(/\/$/, "")}/v1beta/interactions`;
|
|
387
|
+
if (endpoint) return endpointFromHost(endpoint.value);
|
|
388
|
+
return "https://generativelanguage.googleapis.com/v1beta/interactions";
|
|
389
|
+
}
|
|
390
|
+
function getVertexInteractionsRegion(config, env) {
|
|
391
|
+
return config.region || require_env.resolveProviderEnv(env, ["VERTEX_REGION", "GOOGLE_CLOUD_LOCATION"])?.value || "global";
|
|
392
|
+
}
|
|
393
|
+
function getVertexInteractionsEndpoint(config, projectId, env) {
|
|
394
|
+
const region = getVertexInteractionsRegion(config, env);
|
|
395
|
+
const configuredHost = config.apiBaseUrl || config.apiHost || require_env.resolveProviderEnv(env, ["VERTEX_API_HOST"])?.value || (region === "global" ? "aiplatform.googleapis.com" : `${region}-aiplatform.googleapis.com`);
|
|
396
|
+
return `${(/^https?:\/\//i.test(configuredHost) ? configuredHost : `https://${configuredHost}`).replace(/\/$/, "")}/v1beta1/projects/${encodeURIComponent(projectId)}/locations/${encodeURIComponent(region)}/interactions`;
|
|
397
|
+
}
|
|
398
|
+
function getVertexExpressInteractionsEndpoint(config, env) {
|
|
399
|
+
const configuredHost = config.apiBaseUrl || config.apiHost || require_env.resolveProviderEnv(env, ["VERTEX_API_HOST"])?.value || "aiplatform.googleapis.com";
|
|
400
|
+
return `${(/^https?:\/\//i.test(configuredHost) ? configuredHost : `https://${configuredHost}`).replace(/\/$/, "")}/v1beta1/interactions`;
|
|
401
|
+
}
|
|
402
|
+
function getVertexInteractionsApiKey(config, env) {
|
|
403
|
+
return require_util.GoogleAuthManager.getApiKey(config, env, true).apiKey;
|
|
404
|
+
}
|
|
405
|
+
function usesVertexExpressInteractions(config, env, apiKey) {
|
|
406
|
+
const hasOAuthConfig = Boolean(config.credentials || config.keyFilename || config.googleAuthOptions?.keyFilename || config.googleAuthOptions?.keyFile || config.googleAuthOptions?.authClient || config.googleAuthOptions?.credentials);
|
|
407
|
+
const providerScopedRegion = config.region || env?.VERTEX_REGION || env?.GOOGLE_CLOUD_LOCATION;
|
|
408
|
+
const hasProviderScopedOAuthConfig = Boolean(config.projectId || config.googleAuthOptions?.projectId || env?.VERTEX_PROJECT_ID || env?.GOOGLE_PROJECT_ID || env?.GOOGLE_CLOUD_PROJECT || providerScopedRegion && providerScopedRegion !== "global");
|
|
409
|
+
const explicitlyRequestedExpress = config.expressMode === true || Boolean(config.apiKey) || Boolean(env?.VERTEX_API_KEY) && !hasProviderScopedOAuthConfig;
|
|
410
|
+
const effectiveRegion = config.region || require_env.resolveProviderEnv(env, ["VERTEX_REGION", "GOOGLE_CLOUD_LOCATION"])?.value;
|
|
411
|
+
const hasProjectScopedOAuthConfig = Boolean(config.projectId || config.googleAuthOptions?.projectId || require_env.resolveProviderEnv(env, [
|
|
412
|
+
"VERTEX_PROJECT_ID",
|
|
413
|
+
"GOOGLE_PROJECT_ID",
|
|
414
|
+
"GOOGLE_CLOUD_PROJECT"
|
|
415
|
+
])?.value || effectiveRegion && effectiveRegion !== "global");
|
|
416
|
+
return Boolean(apiKey) && config.expressMode !== false && !hasOAuthConfig && (explicitlyRequestedExpress || !hasProjectScopedOAuthConfig);
|
|
417
|
+
}
|
|
418
|
+
function mergeGoogleInteractionsRequestConfig(providerConfig, promptConfig) {
|
|
419
|
+
return {
|
|
420
|
+
...require_util.mergeGoogleCompletionOptions(providerConfig, promptConfig),
|
|
421
|
+
apiKey: providerConfig.apiKey,
|
|
422
|
+
apiHost: providerConfig.apiHost,
|
|
423
|
+
apiBaseUrl: providerConfig.apiBaseUrl,
|
|
424
|
+
headers: providerConfig.headers,
|
|
425
|
+
projectId: providerConfig.projectId,
|
|
426
|
+
region: providerConfig.region,
|
|
427
|
+
publisher: providerConfig.publisher,
|
|
428
|
+
apiVersion: providerConfig.apiVersion,
|
|
429
|
+
credentials: providerConfig.credentials,
|
|
430
|
+
expressMode: providerConfig.expressMode,
|
|
431
|
+
googleAuthOptions: providerConfig.googleAuthOptions,
|
|
432
|
+
keyFilename: providerConfig.keyFilename,
|
|
433
|
+
scopes: providerConfig.scopes,
|
|
434
|
+
vertexai: providerConfig.vertexai,
|
|
435
|
+
strictMutualExclusivity: providerConfig.strictMutualExclusivity
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
var GoogleInteractionsProvider = class {
|
|
439
|
+
modelName;
|
|
440
|
+
config;
|
|
441
|
+
env;
|
|
442
|
+
providerId;
|
|
443
|
+
constructor(modelName, options = {}) {
|
|
444
|
+
this.modelName = modelName;
|
|
445
|
+
this.config = options.config || {};
|
|
446
|
+
this.env = options.env;
|
|
447
|
+
this.providerId = options.id;
|
|
448
|
+
require_util.GoogleAuthManager.validateAndWarn(this.config, this.env);
|
|
449
|
+
}
|
|
450
|
+
id() {
|
|
451
|
+
return this.providerId || `google:${this.modelName}`;
|
|
452
|
+
}
|
|
453
|
+
toString() {
|
|
454
|
+
return `[Google Interactions Provider ${this.modelName}]`;
|
|
455
|
+
}
|
|
456
|
+
async callApi(prompt, context) {
|
|
457
|
+
const promptConfig = context?.prompt?.config;
|
|
458
|
+
const config = mergeGoogleInteractionsRequestConfig(this.config, promptConfig);
|
|
459
|
+
if (this.modelName === "gemini-omni-1.1-flash") config.vertexai = false;
|
|
460
|
+
const { toolsDisabled } = require_util.resolveGoogleToolConfig(config);
|
|
461
|
+
const promptBasePath = promptConfig?.basePath ?? this.config.basePath;
|
|
462
|
+
const providerPassthrough = this.config.passthrough || {};
|
|
463
|
+
const promptPassthrough = promptConfig?.passthrough || {};
|
|
464
|
+
const mergedPassthrough = {
|
|
465
|
+
...providerPassthrough,
|
|
466
|
+
...promptPassthrough
|
|
467
|
+
};
|
|
468
|
+
const passthroughModel = promptPassthrough.model ?? providerPassthrough.model;
|
|
469
|
+
const effectiveModel = typeof passthroughModel === "string" ? passthroughModel : this.modelName;
|
|
470
|
+
const routeError = getLiveOnlyModelRouteError(effectiveModel);
|
|
471
|
+
if (routeError) return { error: routeError };
|
|
472
|
+
const hasCatalogModel = require_util.GOOGLE_MODELS.some((model) => model.id === effectiveModel);
|
|
473
|
+
const capabilityModel = hasCatalogModel ? effectiveModel : this.modelName;
|
|
474
|
+
const isVideoModel = [
|
|
475
|
+
"gemini-omni-flash-preview",
|
|
476
|
+
"gemini-omni-1.1-flash",
|
|
477
|
+
"gemini-omni-1.1-flash-preview"
|
|
478
|
+
].includes(capabilityModel);
|
|
479
|
+
const allowSamplingControls = config.vertexai && isVideoModel;
|
|
480
|
+
const { input: interactionInput, systemInstruction: promptSystemInstruction, hasSystemInstruction: hasPromptSystemInstruction } = parseInteractionInput(prompt, !isVideoModel);
|
|
481
|
+
const requestInput = promptPassthrough.input ?? providerPassthrough.input ?? (config.vertexai && typeof interactionInput === "string" ? [{
|
|
482
|
+
type: "text",
|
|
483
|
+
text: interactionInput
|
|
484
|
+
}] : interactionInput);
|
|
485
|
+
if (!hasSemanticInteractionInput(requestInput)) return { error: "Gemini Interactions prompt must contain at least one input item." };
|
|
486
|
+
const previousInteractionId = promptPassthrough.previous_interaction_id ?? promptPassthrough.previousInteractionId ?? promptConfig?.previousInteractionId ?? providerPassthrough.previous_interaction_id ?? providerPassthrough.previousInteractionId ?? this.config.previousInteractionId;
|
|
487
|
+
const providerPassthroughResponseFormat = providerPassthrough.response_format ?? providerPassthrough.responseFormat;
|
|
488
|
+
const promptPassthroughResponseFormat = promptPassthrough.response_format ?? promptPassthrough.responseFormat;
|
|
489
|
+
const providerPassthroughSystemInstruction = providerPassthrough.system_instruction ?? providerPassthrough.systemInstruction;
|
|
490
|
+
const passthroughSystemInstruction = promptPassthrough.system_instruction ?? promptPassthrough.systemInstruction ?? (promptConfig?.systemInstruction === void 0 && !hasPromptSystemInstruction ? providerPassthroughSystemInstruction : void 0);
|
|
491
|
+
const interactionConfigTools = toolsDisabled ? void 0 : config.tools;
|
|
492
|
+
const hasConfigTools = Array.isArray(interactionConfigTools) ? interactionConfigTools.length > 0 : Boolean(interactionConfigTools);
|
|
493
|
+
const interactionTools = toolsDisabled ? void 0 : mergedPassthrough.tools;
|
|
494
|
+
const hasPassthroughTools = Array.isArray(interactionTools) ? interactionTools.length > 0 : Boolean(interactionTools);
|
|
495
|
+
const hasClientExecutedTools = Array.isArray(interactionTools) ? interactionTools.some((tool) => tool !== null && typeof tool === "object" && !Array.isArray(tool) && ["function", "computer_use"].includes(String(tool.type))) : false;
|
|
496
|
+
const hasMcpTools = !toolsDisabled && config.mcp?.enabled === true;
|
|
497
|
+
if (config.vertexai && isVideoModel && previousInteractionId) return { error: "Gemini Omni on Vertex AI does not support previousInteractionId. Use the Google AI Studio route for conversational video editing." };
|
|
498
|
+
if (isVideoModel && (hasConfigTools || hasPassthroughTools || hasMcpTools)) return { error: "Gemini Omni Flash does not support tools, including grounding, code execution, or function calling." };
|
|
499
|
+
if (!isVideoModel && (hasConfigTools || hasMcpTools)) return { error: "Gemini Interactions models require Interactions-native tool declarations in config.passthrough.tools; generateContent-style config.tools and MCP tools are not supported on this route." };
|
|
500
|
+
if (!isVideoModel && hasClientExecutedTools) return { error: "Gemini Interactions custom function and computer-use tools are not supported because Promptfoo does not yet handle requires_action responses. Use managed built-in tools in config.passthrough.tools." };
|
|
501
|
+
let apiKey;
|
|
502
|
+
let endpoint;
|
|
503
|
+
let headers;
|
|
504
|
+
const rawVertexApiKey = config.vertexai ? getVertexInteractionsApiKey(config, this.env) : void 0;
|
|
505
|
+
const vertexApiKey = rawVertexApiKey ? require_render.getNunjucksEngine().renderString(rawVertexApiKey, {}) : void 0;
|
|
506
|
+
if (config.vertexai && vertexApiKey && usesVertexExpressInteractions(config, this.env, vertexApiKey)) {
|
|
507
|
+
const region = getVertexInteractionsRegion(config, this.env);
|
|
508
|
+
if (region !== "global") return { error: `Vertex Express Interactions supports only the global endpoint, but region ${region} was configured. Set expressMode: false and use OAuth or Application Default Credentials for a regional endpoint.` };
|
|
509
|
+
apiKey = vertexApiKey;
|
|
510
|
+
endpoint = getVertexExpressInteractionsEndpoint(config, this.env);
|
|
511
|
+
headers = {
|
|
512
|
+
"Content-Type": "application/json",
|
|
513
|
+
"Api-Revision": "2026-05-20",
|
|
514
|
+
"x-goog-api-key": vertexApiKey,
|
|
515
|
+
...config.headers
|
|
516
|
+
};
|
|
517
|
+
} else if (config.vertexai) try {
|
|
518
|
+
const { client, projectId: authProjectId } = await require_util.GoogleAuthManager.getOAuthClient({
|
|
519
|
+
credentials: config.credentials,
|
|
520
|
+
googleAuthOptions: config.googleAuthOptions,
|
|
521
|
+
keyFilename: config.keyFilename,
|
|
522
|
+
scopes: config.scopes
|
|
523
|
+
});
|
|
524
|
+
const projectId = config.projectId || require_env.resolveProviderEnv(this.env, [
|
|
525
|
+
"VERTEX_PROJECT_ID",
|
|
526
|
+
"GOOGLE_PROJECT_ID",
|
|
527
|
+
"GOOGLE_CLOUD_PROJECT"
|
|
528
|
+
])?.value || authProjectId;
|
|
529
|
+
if (!projectId) return { error: "Gemini Interactions on Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT or add projectId to the provider config." };
|
|
530
|
+
const accessToken = await client.getAccessToken();
|
|
531
|
+
const token = typeof accessToken === "string" ? accessToken : accessToken?.token;
|
|
532
|
+
if (!token) return { error: "Gemini Interactions on Vertex AI could not obtain an OAuth access token." };
|
|
533
|
+
endpoint = getVertexInteractionsEndpoint(config, projectId, this.env);
|
|
534
|
+
const { authorization, ...authHeaders } = typeof client.getRequestHeaders === "function" ? Object.fromEntries((await client.getRequestHeaders(endpoint)).entries()) : {};
|
|
535
|
+
headers = {
|
|
536
|
+
"Content-Type": "application/json",
|
|
537
|
+
"Api-Revision": "2026-05-20",
|
|
538
|
+
Authorization: authorization || `Bearer ${token}`,
|
|
539
|
+
...authHeaders,
|
|
540
|
+
...config.headers
|
|
541
|
+
};
|
|
542
|
+
} catch (err) {
|
|
543
|
+
return { error: `Gemini Interactions on Vertex AI authentication error: ${String(err)}` };
|
|
544
|
+
}
|
|
545
|
+
else {
|
|
546
|
+
const rawApiKey = require_credentials.resolveProviderApiKey({ apiKey: config.apiKey }, this.env, [
|
|
547
|
+
"GOOGLE_API_KEY",
|
|
548
|
+
"GEMINI_API_KEY",
|
|
549
|
+
"PALM_API_KEY",
|
|
550
|
+
"GOOGLE_GENERATIVE_AI_API_KEY"
|
|
551
|
+
]);
|
|
552
|
+
apiKey = rawApiKey ? require_render.getNunjucksEngine().renderString(rawApiKey, {}) : void 0;
|
|
553
|
+
if (!apiKey) return { error: "Gemini Interactions API requires an API key. Set GOOGLE_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY, GEMINI_API_KEY, or PALM_API_KEY, or add apiKey to the provider config." };
|
|
554
|
+
endpoint = getInteractionsEndpoint(config, this.env);
|
|
555
|
+
headers = {
|
|
556
|
+
"Content-Type": "application/json",
|
|
557
|
+
"Api-Revision": "2026-05-20",
|
|
558
|
+
"x-goog-api-key": apiKey,
|
|
559
|
+
...config.headers
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
const providerGenerationConfigValue = {
|
|
563
|
+
...this.config.maxOutputTokens === void 0 ? {} : { max_output_tokens: this.config.maxOutputTokens },
|
|
564
|
+
...allowSamplingControls && this.config.temperature !== void 0 ? { temperature: this.config.temperature } : {},
|
|
565
|
+
...allowSamplingControls && this.config.topP !== void 0 ? { top_p: this.config.topP } : {},
|
|
566
|
+
...this.config.stopSequences === void 0 ? {} : { stop_sequences: this.config.stopSequences },
|
|
567
|
+
...this.config.seed === void 0 ? {} : { seed: this.config.seed },
|
|
568
|
+
...this.config.generationConfig || {}
|
|
569
|
+
};
|
|
570
|
+
const promptToolMode = require_util.resolveGoogleToolConfig(promptConfig || {}).toolConfig?.functionCallingConfig?.mode;
|
|
571
|
+
const promptGenerationConfigValue = {
|
|
572
|
+
...promptConfig?.maxOutputTokens === void 0 ? {} : { max_output_tokens: promptConfig.maxOutputTokens },
|
|
573
|
+
...allowSamplingControls && promptConfig?.temperature !== void 0 ? { temperature: promptConfig.temperature } : {},
|
|
574
|
+
...allowSamplingControls && promptConfig?.topP !== void 0 ? { top_p: promptConfig.topP } : {},
|
|
575
|
+
...promptConfig?.stopSequences === void 0 ? {} : { stop_sequences: promptConfig.stopSequences },
|
|
576
|
+
...promptConfig?.seed === void 0 ? {} : { seed: promptConfig.seed },
|
|
577
|
+
...!isVideoModel && promptToolMode === "AUTO" ? { tool_choice: "auto" } : {},
|
|
578
|
+
...promptConfig?.generationConfig || {}
|
|
579
|
+
};
|
|
580
|
+
const normalizedGenerationConfig = normalizeInteractionGenerationLayers([
|
|
581
|
+
providerGenerationConfigValue,
|
|
582
|
+
providerPassthrough.generationConfig,
|
|
583
|
+
providerPassthrough.generation_config,
|
|
584
|
+
promptGenerationConfigValue,
|
|
585
|
+
promptPassthrough.generationConfig,
|
|
586
|
+
promptPassthrough.generation_config
|
|
587
|
+
], allowSamplingControls);
|
|
588
|
+
if (normalizedGenerationConfig.error) return { error: normalizedGenerationConfig.error };
|
|
589
|
+
if (isVideoModel) delete normalizedGenerationConfig.config.stop_sequences;
|
|
590
|
+
const generationConfig = {
|
|
591
|
+
...normalizedGenerationConfig.config,
|
|
592
|
+
...!isVideoModel && toolsDisabled ? { tool_choice: "none" } : {}
|
|
593
|
+
};
|
|
594
|
+
const providerServiceTier = providerPassthrough.service_tier ?? providerPassthrough.serviceTier ?? this.config.service_tier;
|
|
595
|
+
const rawServiceTier = promptPassthrough.service_tier ?? promptPassthrough.serviceTier ?? promptConfig?.service_tier ?? providerServiceTier;
|
|
596
|
+
const serviceTier = normalizeInteractionServiceTier(rawServiceTier);
|
|
597
|
+
if (rawServiceTier !== void 0 && serviceTier === void 0) return { error: "Gemini Interactions service_tier must be one of flex, standard, or priority." };
|
|
598
|
+
const billingConfig = {
|
|
599
|
+
...config,
|
|
600
|
+
service_tier: serviceTier,
|
|
601
|
+
passthrough: {
|
|
602
|
+
...config.passthrough || {},
|
|
603
|
+
service_tier: serviceTier,
|
|
604
|
+
serviceTier
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
const passthrough = {
|
|
608
|
+
...Object.fromEntries(Object.entries(mergedPassthrough).filter(([field]) => field !== "generation_config" && field !== "generationConfig" && field !== "model" && field !== "service_tier" && field !== "serviceTier" && field !== "previous_interaction_id" && field !== "previousInteractionId" && field !== "response_format" && field !== "responseFormat" && field !== "system_instruction" && field !== "systemInstruction" && field !== "input" && field !== "store" && field !== "safety_settings" && (!toolsDisabled || field !== "tools") && !INTERACTION_TOP_LEVEL_GENERATION_FIELDS.has(field))),
|
|
609
|
+
...!isVideoModel && passthroughSystemInstruction !== void 0 ? { system_instruction: passthroughSystemInstruction } : {}
|
|
610
|
+
};
|
|
611
|
+
const systemInstructionContent = !isVideoModel && passthroughSystemInstruction === void 0 ? require_util.parseConfigSystemInstruction(config.systemInstruction, context?.vars, promptConfig?.systemInstruction === void 0 ? this.config.basePath : promptBasePath) : void 0;
|
|
612
|
+
const systemInstruction = !isVideoModel && passthroughSystemInstruction === void 0 ? [...systemInstructionContent?.parts.map((part) => part.text).filter((text) => typeof text === "string") ?? [], ...promptSystemInstruction ? [promptSystemInstruction] : []].join("\n") : void 0;
|
|
613
|
+
const promptStructuredOutput = !isVideoModel && promptPassthroughResponseFormat === void 0 ? resolveInteractionStructuredOutput([{
|
|
614
|
+
generationConfigs: [promptConfig?.generationConfig],
|
|
615
|
+
responseSchema: promptConfig?.responseSchema
|
|
616
|
+
}, { generationConfigs: [promptPassthrough.generationConfig, promptPassthrough.generation_config] }]) : void 0;
|
|
617
|
+
const hasPromptStructuredOutput = promptStructuredOutput?.mimeType !== void 0 || promptStructuredOutput?.responseSchema !== void 0;
|
|
618
|
+
const passthroughResponseFormat = promptPassthroughResponseFormat ?? (hasPromptStructuredOutput ? void 0 : providerPassthroughResponseFormat);
|
|
619
|
+
const providerStructuredOutput = !isVideoModel && passthroughResponseFormat === void 0 && providerPassthroughResponseFormat === void 0 ? resolveInteractionStructuredOutput([{
|
|
620
|
+
generationConfigs: [this.config.generationConfig],
|
|
621
|
+
responseSchema: this.config.responseSchema
|
|
622
|
+
}, { generationConfigs: [providerPassthrough.generationConfig, providerPassthrough.generation_config] }]) : void 0;
|
|
623
|
+
const promptOwnsResponseSchema = promptStructuredOutput?.responseSchema !== void 0;
|
|
624
|
+
const rawResponseSchema = promptOwnsResponseSchema ? promptStructuredOutput.responseSchema : providerStructuredOutput?.responseSchema;
|
|
625
|
+
const responseMimeType = promptStructuredOutput?.mimeType ?? (promptOwnsResponseSchema ? void 0 : providerStructuredOutput?.mimeType) ?? (rawResponseSchema === void 0 ? void 0 : "application/json");
|
|
626
|
+
const structuredOutput = {
|
|
627
|
+
mimeType: responseMimeType,
|
|
628
|
+
schema: rawResponseSchema === void 0 || responseMimeType !== "application/json" ? void 0 : require_util.parseConfigResponseSchema(rawResponseSchema, context?.vars, promptOwnsResponseSchema ? promptBasePath : this.config.basePath)
|
|
629
|
+
};
|
|
630
|
+
const generatedVideoResponseFormat = config.vertexai ? [{
|
|
631
|
+
type: "video",
|
|
632
|
+
...config.aspectRatio ? { aspect_ratio: config.aspectRatio } : {}
|
|
633
|
+
}] : {
|
|
634
|
+
type: "video",
|
|
635
|
+
...config.aspectRatio ? { aspect_ratio: config.aspectRatio } : {}
|
|
636
|
+
};
|
|
637
|
+
const videoResponseFormat = promptPassthroughResponseFormat ?? (promptConfig?.aspectRatio === void 0 ? providerPassthroughResponseFormat ?? generatedVideoResponseFormat : generatedVideoResponseFormat);
|
|
638
|
+
const store = promptPassthrough.store ?? promptConfig?.store ?? providerPassthrough.store ?? this.config.store;
|
|
639
|
+
const providerSafetySettings = providerPassthrough.safety_settings ?? (this.config.safetySettings ? normalizeInteractionSafetySettings(this.config.safetySettings) : void 0);
|
|
640
|
+
const safetySettings = promptPassthrough.safety_settings ?? (promptConfig?.safetySettings ? normalizeInteractionSafetySettings(promptConfig.safetySettings) : void 0) ?? providerSafetySettings;
|
|
641
|
+
const body = {
|
|
642
|
+
model: effectiveModel,
|
|
643
|
+
input: requestInput,
|
|
644
|
+
...isVideoModel ? { response_format: videoResponseFormat } : passthroughResponseFormat === void 0 ? structuredOutput?.mimeType || structuredOutput?.schema !== void 0 ? { response_format: [{
|
|
645
|
+
type: "text",
|
|
646
|
+
...structuredOutput.mimeType ? { mime_type: structuredOutput.mimeType } : {},
|
|
647
|
+
...structuredOutput.schema === void 0 ? {} : { schema: structuredOutput.schema }
|
|
648
|
+
}] } : {} : { response_format: passthroughResponseFormat },
|
|
649
|
+
...previousInteractionId === void 0 ? {} : { previous_interaction_id: previousInteractionId },
|
|
650
|
+
...store === void 0 ? {} : { store },
|
|
651
|
+
...safetySettings === void 0 ? {} : { safety_settings: safetySettings },
|
|
652
|
+
...systemInstruction ? { system_instruction: systemInstruction } : {},
|
|
653
|
+
...Object.keys(generationConfig).length > 0 ? { generation_config: generationConfig } : {},
|
|
654
|
+
...serviceTier ? { service_tier: serviceTier } : {},
|
|
655
|
+
...passthrough,
|
|
656
|
+
background: false,
|
|
657
|
+
stream: false
|
|
658
|
+
};
|
|
659
|
+
let data;
|
|
660
|
+
let cached;
|
|
661
|
+
let httpStatus;
|
|
662
|
+
let httpStatusText;
|
|
663
|
+
try {
|
|
664
|
+
({data, cached, status: httpStatus, statusText: httpStatusText} = await require_cache.fetchWithCache(endpoint, {
|
|
665
|
+
method: "POST",
|
|
666
|
+
headers,
|
|
667
|
+
body: JSON.stringify(body)
|
|
668
|
+
}, require_shared.getRequestTimeoutMs(), "json", true));
|
|
669
|
+
} catch (err) {
|
|
670
|
+
return { error: `Gemini Interactions API error: ${String(err)}` };
|
|
671
|
+
}
|
|
672
|
+
if (data.error?.message) return { error: `Gemini Interactions API error: ${data.error.message}` };
|
|
673
|
+
if (httpStatus && (httpStatus < 200 || httpStatus >= 300)) return {
|
|
674
|
+
error: `Gemini Interactions API error: HTTP ${httpStatus} ${httpStatusText}`.trim(),
|
|
675
|
+
raw: data
|
|
676
|
+
};
|
|
677
|
+
const pollTimeoutMs = config.timeoutMs ?? require_shared.getRequestTimeoutMs();
|
|
678
|
+
const pollStartedAt = Date.now();
|
|
679
|
+
let pollCount = 0;
|
|
680
|
+
while (data.status === "in_progress" && data.id) {
|
|
681
|
+
const elapsed = Date.now() - pollStartedAt;
|
|
682
|
+
if (elapsed >= pollTimeoutMs) return {
|
|
683
|
+
error: `Gemini interaction timed out after ${pollTimeoutMs}ms (status: ${data.status})`,
|
|
684
|
+
raw: data
|
|
685
|
+
};
|
|
686
|
+
if (pollCount > 0) await require_time.sleep(Math.min(1e3, pollTimeoutMs - elapsed));
|
|
687
|
+
try {
|
|
688
|
+
({data, status: httpStatus, statusText: httpStatusText} = await require_cache.fetchWithCache(`${endpoint}/${encodeURIComponent(data.id)}`, {
|
|
689
|
+
method: "GET",
|
|
690
|
+
headers
|
|
691
|
+
}, Math.max(pollTimeoutMs - (Date.now() - pollStartedAt), 1), "json", true));
|
|
692
|
+
} catch (err) {
|
|
693
|
+
return { error: `Gemini Interactions API polling error: ${String(err)}` };
|
|
694
|
+
}
|
|
695
|
+
pollCount++;
|
|
696
|
+
if (data.error?.message) return {
|
|
697
|
+
error: `Gemini Interactions API error: ${data.error.message}`,
|
|
698
|
+
raw: data
|
|
699
|
+
};
|
|
700
|
+
if (httpStatus && (httpStatus < 200 || httpStatus >= 300)) return {
|
|
701
|
+
error: `Gemini Interactions API polling error: HTTP ${httpStatus} ${httpStatusText}`.trim(),
|
|
702
|
+
raw: data
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
if (data.status && data.status !== "completed") return {
|
|
706
|
+
error: `Gemini interaction did not complete (status: ${data.status})`,
|
|
707
|
+
raw: data
|
|
708
|
+
};
|
|
709
|
+
const latestUserInput = (data.steps || []).map((step) => step.type).lastIndexOf("user_input");
|
|
710
|
+
const latestOutputError = (data.steps || []).slice(latestUserInput + 1).filter((step) => step.type === "model_output").find((step) => step.error?.message)?.error?.message;
|
|
711
|
+
if (latestOutputError) return {
|
|
712
|
+
error: `Gemini Interactions API error: ${latestOutputError}`,
|
|
713
|
+
raw: data
|
|
714
|
+
};
|
|
715
|
+
const outputContent = getModelOutputContent(data);
|
|
716
|
+
const groundingMetadata = getInteractionGroundingMetadata(data, outputContent);
|
|
717
|
+
const lastTextIndex = outputContent.map((part) => part.type === "text").lastIndexOf(true);
|
|
718
|
+
const lastNonTextIndex = outputContent.slice(0, lastTextIndex).map((part) => part.type !== "text").lastIndexOf(true);
|
|
719
|
+
const text = outputContent.slice(lastNonTextIndex + 1, lastTextIndex + 1).filter((part) => part.type === "text" && part.text).map((part) => part.text).join("");
|
|
720
|
+
const usage = data.usage;
|
|
721
|
+
const promptTokens = (usage?.total_input_tokens ?? 0) + (usage?.total_tool_use_tokens ?? 0);
|
|
722
|
+
const outputTokens = usage?.total_output_tokens ?? 0;
|
|
723
|
+
const thoughtTokens = usage?.total_reasoning_tokens ?? usage?.total_thought_tokens ?? 0;
|
|
724
|
+
const audioInputTokens = getInteractionModalityTokenCount(usage?.input_tokens_by_modality, ["audio"]) + getInteractionModalityTokenCount(usage?.tool_use_tokens_by_modality, ["audio"]);
|
|
725
|
+
const imageInputTokens = getInteractionModalityTokenCount(usage?.input_tokens_by_modality, [
|
|
726
|
+
"image",
|
|
727
|
+
"document",
|
|
728
|
+
"video"
|
|
729
|
+
]) + getInteractionModalityTokenCount(usage?.tool_use_tokens_by_modality, [
|
|
730
|
+
"image",
|
|
731
|
+
"document",
|
|
732
|
+
"video"
|
|
733
|
+
]);
|
|
734
|
+
const cachedAudioTokens = getInteractionModalityTokenCount(usage?.cached_tokens_by_modality, ["audio"]);
|
|
735
|
+
const cachedImageTokens = getInteractionModalityTokenCount(usage?.cached_tokens_by_modality, [
|
|
736
|
+
"image",
|
|
737
|
+
"document",
|
|
738
|
+
"video"
|
|
739
|
+
]);
|
|
740
|
+
const audioOutputTokens = getInteractionModalityTokenCount(usage?.output_tokens_by_modality, ["audio"]);
|
|
741
|
+
const videoTokens = getInteractionModalityTokenCount(usage?.output_tokens_by_modality, ["video"]);
|
|
742
|
+
const tokenUsage = {
|
|
743
|
+
prompt: promptTokens,
|
|
744
|
+
completion: outputTokens,
|
|
745
|
+
total: usage?.total_tokens ?? promptTokens + outputTokens + thoughtTokens,
|
|
746
|
+
cached: usage?.total_cached_tokens ?? 0,
|
|
747
|
+
numRequests: 1,
|
|
748
|
+
...thoughtTokens > 0 ? { completionDetails: { reasoning: thoughtTokens } } : {}
|
|
749
|
+
};
|
|
750
|
+
const cost = cached ? void 0 : hasCatalogModel ? require_util.calculateGoogleCost(effectiveModel, billingConfig, promptTokens, outputTokens + thoughtTokens, config.vertexai, audioInputTokens, audioOutputTokens, videoTokens, imageInputTokens, usage?.total_cached_tokens, cachedAudioTokens, cachedImageTokens, void 0, config.vertexai ? getVertexInteractionsRegion(config, this.env) : void 0) : calculateExplicitInteractionCost(billingConfig, promptTokens, outputTokens + thoughtTokens, audioInputTokens, audioOutputTokens, videoTokens, imageInputTokens);
|
|
751
|
+
if (!isVideoModel) {
|
|
752
|
+
if (!text) return {
|
|
753
|
+
error: "Gemini interaction did not return text output",
|
|
754
|
+
raw: data
|
|
755
|
+
};
|
|
756
|
+
return {
|
|
757
|
+
output: text,
|
|
758
|
+
cached,
|
|
759
|
+
tokenUsage,
|
|
760
|
+
cost,
|
|
761
|
+
metadata: {
|
|
762
|
+
interactionId: data.id,
|
|
763
|
+
status: data.status,
|
|
764
|
+
...groundingMetadata
|
|
765
|
+
}
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
const video = [...outputContent].reverse().find((part) => part.type === "video");
|
|
769
|
+
if (!video?.data && !video?.uri) return {
|
|
770
|
+
error: "Gemini interaction did not return video output",
|
|
771
|
+
raw: data
|
|
772
|
+
};
|
|
773
|
+
let blobRef;
|
|
774
|
+
let videoBuffer = video.data ? Buffer.from(video.data, "base64") : void 0;
|
|
775
|
+
if (!videoBuffer && video.uri) try {
|
|
776
|
+
let downloadUrl = new URL(video.uri, endpoint);
|
|
777
|
+
if (config.vertexai && downloadUrl.protocol === "gs:") {
|
|
778
|
+
const bucket = encodeURIComponent(downloadUrl.hostname);
|
|
779
|
+
const object = encodeURIComponent(decodeURIComponent(downloadUrl.pathname.slice(1)));
|
|
780
|
+
downloadUrl = new URL(`https://storage.googleapis.com/download/storage/v1/b/${bucket}/o/${object}?alt=media`);
|
|
781
|
+
}
|
|
782
|
+
const endpointOrigin = new URL(endpoint).origin;
|
|
783
|
+
const isVertexStorageDownload = config.vertexai && downloadUrl.origin === "https://storage.googleapis.com";
|
|
784
|
+
if (downloadUrl.origin === endpointOrigin || isVertexStorageDownload || downloadUrl.protocol === "https:" && downloadUrl.hostname === "generativelanguage.googleapis.com") {
|
|
785
|
+
let downloadHeaders = {};
|
|
786
|
+
if (downloadUrl.origin === endpointOrigin) downloadHeaders = headers;
|
|
787
|
+
else if (isVertexStorageDownload) downloadHeaders = Object.fromEntries(Object.entries(headers).filter(([header]) => ["authorization", "x-goog-user-project"].includes(header.toLowerCase())));
|
|
788
|
+
else if (apiKey) downloadHeaders = { "x-goog-api-key": apiKey };
|
|
789
|
+
let response = await require_fetch.fetchWithTimeout(downloadUrl.toString(), {
|
|
790
|
+
method: "GET",
|
|
791
|
+
headers: downloadHeaders,
|
|
792
|
+
redirect: "manual"
|
|
793
|
+
}, require_shared.getRequestTimeoutMs());
|
|
794
|
+
const redirectLocation = response.headers.get("location");
|
|
795
|
+
if (response.status >= 300 && response.status < 400 && redirectLocation) {
|
|
796
|
+
const redirectUrl = new URL(redirectLocation, downloadUrl);
|
|
797
|
+
if (!(redirectUrl.origin === downloadUrl.origin || redirectUrl.protocol === "https:" && (redirectUrl.hostname === "storage.googleapis.com" || redirectUrl.hostname.endsWith(".storage.googleapis.com") || redirectUrl.hostname.endsWith(".googleusercontent.com")))) return { error: `Refusing untrusted Gemini interaction video redirect: ${redirectUrl.origin}` };
|
|
798
|
+
response = await require_fetch.fetchWithTimeout(redirectUrl.toString(), {
|
|
799
|
+
method: "GET",
|
|
800
|
+
...redirectUrl.origin === downloadUrl.origin ? { headers: downloadHeaders } : {},
|
|
801
|
+
redirect: "manual"
|
|
802
|
+
}, require_shared.getRequestTimeoutMs());
|
|
803
|
+
}
|
|
804
|
+
if (!response.ok) return { error: `Failed to download Gemini interaction video: HTTP ${response.status} ${response.statusText}`.trim() };
|
|
805
|
+
videoBuffer = Buffer.from(await response.arrayBuffer());
|
|
806
|
+
} else require_logger.logger.warn("[Google Interactions] Skipping video download from untrusted origin; returning the raw URI", {
|
|
807
|
+
origin: downloadUrl.origin,
|
|
808
|
+
protocol: downloadUrl.protocol
|
|
809
|
+
});
|
|
810
|
+
} catch (err) {
|
|
811
|
+
return { error: `Failed to download Gemini interaction video: ${String(err)}` };
|
|
812
|
+
}
|
|
813
|
+
if (videoBuffer) try {
|
|
814
|
+
({ref: blobRef} = await require_blobs.storeBlob(videoBuffer, video.mime_type || "video/mp4", {
|
|
815
|
+
evalId: context?.evaluationId,
|
|
816
|
+
kind: "video",
|
|
817
|
+
location: "response.video",
|
|
818
|
+
promptIdx: context?.promptIdx,
|
|
819
|
+
testIdx: context?.testIdx
|
|
820
|
+
}));
|
|
821
|
+
} catch (err) {
|
|
822
|
+
return { error: `Failed to store Gemini interaction video: ${String(err)}` };
|
|
823
|
+
}
|
|
824
|
+
const videoUrl = blobRef?.uri ?? video.uri;
|
|
825
|
+
const sanitizedPrompt = prompt.replace(/\r?\n|\r/g, " ").replace(/\[/g, "(").replace(/\]/g, ")").slice(0, 50);
|
|
826
|
+
return {
|
|
827
|
+
output: text || `[Video: ${sanitizedPrompt}](${videoUrl})`,
|
|
828
|
+
cached,
|
|
829
|
+
tokenUsage,
|
|
830
|
+
cost,
|
|
831
|
+
video: {
|
|
832
|
+
id: data.id,
|
|
833
|
+
blobRef,
|
|
834
|
+
url: videoUrl,
|
|
835
|
+
format: video.mime_type?.split("/")[1] || "mp4",
|
|
836
|
+
model: effectiveModel,
|
|
837
|
+
aspectRatio: config.aspectRatio
|
|
838
|
+
},
|
|
839
|
+
metadata: {
|
|
840
|
+
interactionId: data.id,
|
|
841
|
+
status: data.status,
|
|
842
|
+
...groundingMetadata
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
//#endregion
|
|
848
|
+
exports.GoogleInteractionsProvider = GoogleInteractionsProvider;
|
|
849
|
+
|
|
850
|
+
//# sourceMappingURL=interactions-CND010Lh.cjs.map
|