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,934 @@
|
|
|
1
|
+
import { J as getEnvInt, X as getEnvString, o as logger, q as getEnvFloat } from "./logger-Gff7RMNF.js";
|
|
2
|
+
import "./dataUrl-DBMifX6C.js";
|
|
3
|
+
import { O as formatRateLimitErrorMessage, S as DEFINITIVE_BILLING_ERROR_CODES, w as HttpRateLimitError } from "./fetch-B5KxZuKu.js";
|
|
4
|
+
import { S as isCallerAbortError, _ as transformToolChoice, a as getRequestTimeoutMs, f as parseChatPrompt, h as throwIfAborted, y as waitForPromiseWithAbort } from "./shared-BBI-NXjW.js";
|
|
5
|
+
import { c as extractProviderResponseAttributes, h as withGenAISpan } from "./genaiTracer-CuSjHi4t.js";
|
|
6
|
+
import { i as fetchWithCache } from "./cache-DSm6t1MZ.js";
|
|
7
|
+
import { n as renderVarsInObject } from "./render-DuOHcYot.js";
|
|
8
|
+
import { a as isGpt6Model, n as getGpt6ChatReasoningEffort, o as resolveGpt6ChatOutputCap, t as applyGpt6RequestRules } from "./gpt6-CA0S8lOm.js";
|
|
9
|
+
import { C as getOpenAiEffectiveServiceTier, D as getOpenAiPolicyRefusal, E as getOpenAiPartialOutput, F as isCustomOpenAiEndpoint, G as prepareOpenAiFunctions, I as isOpenAiErrorOnlyResponse, J as prepareOpenAiTools, K as prepareOpenAiReasoning, R as normalizeOpenAiBillingModelName, S as getOpenAiChatChoiceError, T as getOpenAiGatewayProviderCode, U as validateFunctionCall, W as isOpenAiJsonSchemaFormat, d as appendOpenAiApiPath, f as assertOpenAiApiModel, i as OPENAI_CHAT_MODELS, k as getTokenUsage, q as prepareOpenAiResponseFormat, v as formatOpenAiError, w as getOpenAiGatewayErrorType, z as normalizeOpenAiServiceTierForWire } from "./util-CsTD_ROg.js";
|
|
10
|
+
import { r as calculateOpenAIUsageCost } from "./billing-Gg_jbkR9.js";
|
|
11
|
+
import "./tracing-CfUes1dH.js";
|
|
12
|
+
import { n as normalizeFinishReason, t as FINISH_REASON_MAP } from "./finishReason-BixMIdSI.js";
|
|
13
|
+
import { c as normalizeMcpToolContent, i as getMcpErrorMessage, o as isMcpErrorResult } from "./util-DMNFhk47.js";
|
|
14
|
+
import { t as MCPClient } from "./client-mRs2UvH9.js";
|
|
15
|
+
import { i as transformMCPToolsToOpenAi } from "./transform-DIOIQDmM.js";
|
|
16
|
+
import { n as executeProviderFunctionCallback, r as loadProviderCallbackFromFileUrl } from "./functionCallbackUtils-BfXnPo0o.js";
|
|
17
|
+
import { n as getOpenRouterBillingMetadata, r as isOpenRouterEndpoint, t as calculateOpenRouterResponseCost } from "./openrouterBilling--wdhQt3U.js";
|
|
18
|
+
import { n as OpenAiGenericProvider } from "./openai-TU3iAci7.js";
|
|
19
|
+
//#region src/util/fetch/responseHeadersObserver.ts
|
|
20
|
+
const CALLER_ERROR_RESPONSE = Symbol("responseHeadersCallerErrorResponse");
|
|
21
|
+
function markResponseHeadersObserverErrorResponse(response) {
|
|
22
|
+
Object.defineProperty(response, CALLER_ERROR_RESPONSE, { value: true });
|
|
23
|
+
return response;
|
|
24
|
+
}
|
|
25
|
+
function isResponseHeadersObserverErrorResponse(response) {
|
|
26
|
+
return typeof response === "object" && response !== null && response[CALLER_ERROR_RESPONSE] === true;
|
|
27
|
+
}
|
|
28
|
+
/** Copy private caller-exception provenance when the same error response is projected. */
|
|
29
|
+
function preserveResponseHeadersObserverErrorResponse(source, response) {
|
|
30
|
+
if (isResponseHeadersObserverErrorResponse(source)) markResponseHeadersObserverErrorResponse(response);
|
|
31
|
+
return response;
|
|
32
|
+
}
|
|
33
|
+
const OWNER = Symbol("rateLimitResponseHeadersObserver");
|
|
34
|
+
const CALLER_ERRORS = Symbol("responseHeadersCallerErrors");
|
|
35
|
+
function ownedObserver(record) {
|
|
36
|
+
const observer = (...args) => {
|
|
37
|
+
let observed = record.observe(args, false);
|
|
38
|
+
let caller = record.caller;
|
|
39
|
+
const owners = [record];
|
|
40
|
+
while (caller) {
|
|
41
|
+
const inherited = caller[OWNER];
|
|
42
|
+
if (!inherited) {
|
|
43
|
+
try {
|
|
44
|
+
caller(...args);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
for (const owner of owners) owner.errors.add(error);
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
if (inherited.owner === record.owner) observed = inherited.observe(args, observed);
|
|
52
|
+
owners.push(inherited);
|
|
53
|
+
caller = inherited.caller;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
observer[OWNER] = record;
|
|
57
|
+
observer[CALLER_ERRORS] = record.errors;
|
|
58
|
+
return observer;
|
|
59
|
+
}
|
|
60
|
+
function createResponseHeadersObserver(owner, observe) {
|
|
61
|
+
return ownedObserver({
|
|
62
|
+
owner,
|
|
63
|
+
observe,
|
|
64
|
+
errors: /* @__PURE__ */ new Set()
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function composeResponseHeadersObservers(observer, caller) {
|
|
68
|
+
if (!caller) return observer;
|
|
69
|
+
const record = observer[OWNER];
|
|
70
|
+
if (record) return ownedObserver({
|
|
71
|
+
...record,
|
|
72
|
+
caller
|
|
73
|
+
});
|
|
74
|
+
const errors = /* @__PURE__ */ new Set();
|
|
75
|
+
const combined = (...args) => {
|
|
76
|
+
observer(...args);
|
|
77
|
+
try {
|
|
78
|
+
caller(...args);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
errors.add(error);
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
combined[CALLER_ERRORS] = errors;
|
|
85
|
+
return combined;
|
|
86
|
+
}
|
|
87
|
+
function isResponseHeadersObserverError(observer, error) {
|
|
88
|
+
return observer?.[CALLER_ERRORS]?.has(error) ?? false;
|
|
89
|
+
}
|
|
90
|
+
/** Retain the provider's existing diagnostic when it converts a caller exception. */
|
|
91
|
+
function preserveResponseHeadersObserverError(observer, error, response) {
|
|
92
|
+
if (isResponseHeadersObserverError(observer, error)) markResponseHeadersObserverErrorResponse(response);
|
|
93
|
+
return response;
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/providers/openai/chat.ts
|
|
97
|
+
function getOpenAiGatewayRateLimitKind(data) {
|
|
98
|
+
const providerCode = getOpenAiGatewayProviderCode(data);
|
|
99
|
+
if (providerCode && DEFINITIVE_BILLING_ERROR_CODES.has(providerCode.toLowerCase())) return "quota";
|
|
100
|
+
return getOpenAiGatewayErrorType(data) === "rate_limit_exceeded" ? "rate_limit" : void 0;
|
|
101
|
+
}
|
|
102
|
+
function getOpenAiRateLimitResponse(error, responseHeaders) {
|
|
103
|
+
if (!(error instanceof HttpRateLimitError)) return;
|
|
104
|
+
return {
|
|
105
|
+
error: formatRateLimitErrorMessage(error),
|
|
106
|
+
metadata: {
|
|
107
|
+
rateLimitKind: error.kind,
|
|
108
|
+
http: {
|
|
109
|
+
status: error.status,
|
|
110
|
+
statusText: error.statusText,
|
|
111
|
+
headers: error.headers ?? responseHeaders ?? {}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function getChatSearchCitations(annotations, output) {
|
|
117
|
+
if (!Array.isArray(annotations)) return [];
|
|
118
|
+
return annotations.flatMap((annotation) => {
|
|
119
|
+
const citation = annotation?.type === "url_citation" ? annotation.url_citation : void 0;
|
|
120
|
+
if (typeof citation?.url !== "string" || !/^https?:\/\//i.test(citation.url)) return [];
|
|
121
|
+
const excerpt = typeof output === "string" && Number.isInteger(citation.start_index) && Number.isInteger(citation.end_index) ? output.slice(citation.start_index, citation.end_index + 1).trim() : "";
|
|
122
|
+
const title = typeof citation.title === "string" ? citation.title.trim() : "";
|
|
123
|
+
return [{
|
|
124
|
+
url: citation.url,
|
|
125
|
+
content: [title, excerpt].filter(Boolean).join(": ") || citation.url
|
|
126
|
+
}];
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function getChatSearchSurcharge(modelName) {
|
|
130
|
+
const billingModelName = normalizeOpenAiBillingModelName(modelName);
|
|
131
|
+
if (billingModelName.includes("/")) return 0;
|
|
132
|
+
if (/^gpt-5-search-api(?:-|$)/.test(billingModelName)) return .01;
|
|
133
|
+
if (/^gpt-4o(?:-mini)?-search-preview(?:-|$)/.test(billingModelName)) return .025;
|
|
134
|
+
return 0;
|
|
135
|
+
}
|
|
136
|
+
function getOpenRouterPassthrough(config) {
|
|
137
|
+
const passthrough = config?.passthrough;
|
|
138
|
+
return passthrough && typeof passthrough === "object" && !Array.isArray(passthrough) ? passthrough : {};
|
|
139
|
+
}
|
|
140
|
+
function getOpenRouterReasoningControl(config, vars = {}) {
|
|
141
|
+
const passthrough = getOpenRouterPassthrough(config);
|
|
142
|
+
const efforts = [
|
|
143
|
+
["flat", config?.reasoning_effort],
|
|
144
|
+
["flat", passthrough.reasoning_effort],
|
|
145
|
+
["nested", passthrough.reasoning === null ? null : passthrough.reasoning?.effort]
|
|
146
|
+
];
|
|
147
|
+
for (const [kind, configured] of efforts) {
|
|
148
|
+
if (configured === void 0) continue;
|
|
149
|
+
const value = renderVarsInObject(configured, vars);
|
|
150
|
+
if (value === null || value === "") return { kind: "reset" };
|
|
151
|
+
if (value !== void 0) return {
|
|
152
|
+
kind,
|
|
153
|
+
value
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
const budget = renderVarsInObject(passthrough.reasoning?.max_tokens, vars);
|
|
157
|
+
if (budget === null) return { kind: "reset" };
|
|
158
|
+
if (budget !== void 0) return {
|
|
159
|
+
kind: "budget",
|
|
160
|
+
value: budget
|
|
161
|
+
};
|
|
162
|
+
const enabled = renderVarsInObject(passthrough.reasoning?.enabled, vars);
|
|
163
|
+
if (typeof enabled === "boolean") return {
|
|
164
|
+
kind: "enabled",
|
|
165
|
+
value: enabled
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function reconcileOpenRouterReasoning(body, providerConfig, promptConfig, vars) {
|
|
169
|
+
const providerReasoning = getOpenRouterPassthrough(providerConfig).reasoning;
|
|
170
|
+
const promptReasoning = getOpenRouterPassthrough(promptConfig).reasoning;
|
|
171
|
+
const reasoning = promptReasoning !== null && (providerReasoning != null || promptReasoning != null) ? {
|
|
172
|
+
...providerReasoning,
|
|
173
|
+
...promptReasoning
|
|
174
|
+
} : void 0;
|
|
175
|
+
const control = getOpenRouterReasoningControl(promptConfig, vars) ?? getOpenRouterReasoningControl(providerConfig, vars);
|
|
176
|
+
if (!control) {
|
|
177
|
+
if (typeof body.reasoning_effort === "function") delete body.reasoning_effort;
|
|
178
|
+
if (reasoning) {
|
|
179
|
+
if (typeof reasoning.effort === "function") delete reasoning.effort;
|
|
180
|
+
if (typeof reasoning.max_tokens === "function") delete reasoning.max_tokens;
|
|
181
|
+
body.reasoning = reasoning;
|
|
182
|
+
}
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (control.kind === "reset") {
|
|
186
|
+
delete body.reasoning_effort;
|
|
187
|
+
if (reasoning) {
|
|
188
|
+
delete reasoning.effort;
|
|
189
|
+
delete reasoning.enabled;
|
|
190
|
+
delete reasoning.max_tokens;
|
|
191
|
+
}
|
|
192
|
+
if (reasoning && Object.keys(reasoning).length) body.reasoning = reasoning;
|
|
193
|
+
else delete body.reasoning;
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (control.kind === "enabled") {
|
|
197
|
+
const normalizedReasoning = {
|
|
198
|
+
...reasoning,
|
|
199
|
+
enabled: control.value
|
|
200
|
+
};
|
|
201
|
+
delete normalizedReasoning.effort;
|
|
202
|
+
delete normalizedReasoning.max_tokens;
|
|
203
|
+
body.reasoning = normalizedReasoning;
|
|
204
|
+
delete body.reasoning_effort;
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (control.kind === "budget") {
|
|
208
|
+
const normalizedReasoning = {
|
|
209
|
+
...reasoning,
|
|
210
|
+
max_tokens: control.value
|
|
211
|
+
};
|
|
212
|
+
delete normalizedReasoning.effort;
|
|
213
|
+
if (normalizedReasoning.enabled === false) delete normalizedReasoning.enabled;
|
|
214
|
+
body.reasoning = normalizedReasoning;
|
|
215
|
+
delete body.reasoning_effort;
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const effort = control.value;
|
|
219
|
+
delete reasoning?.max_tokens;
|
|
220
|
+
if (reasoning && typeof reasoning.enabled === "boolean" && reasoning.enabled === (effort === "none")) delete reasoning.enabled;
|
|
221
|
+
if (reasoning && (control.kind === "nested" || Object.prototype.hasOwnProperty.call(reasoning, "effort"))) {
|
|
222
|
+
body.reasoning = {
|
|
223
|
+
...reasoning,
|
|
224
|
+
effort
|
|
225
|
+
};
|
|
226
|
+
delete body.reasoning_effort;
|
|
227
|
+
} else {
|
|
228
|
+
body.reasoning_effort = effort;
|
|
229
|
+
if (reasoning && Object.keys(reasoning).length) body.reasoning = reasoning;
|
|
230
|
+
else if (reasoning || promptReasoning === null) delete body.reasoning;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
var OpenAiChatCompletionProvider = class OpenAiChatCompletionProvider extends OpenAiGenericProvider {
|
|
234
|
+
usesOpenRouter() {
|
|
235
|
+
const system = this.getGenAISystem();
|
|
236
|
+
return system === "openrouter" || system === "openai" && isOpenRouterEndpoint(this.getApiUrl());
|
|
237
|
+
}
|
|
238
|
+
usesGatewayErrorFormat() {
|
|
239
|
+
const system = this.getGenAISystem();
|
|
240
|
+
return system === "openrouter" || system === "openai" && isCustomOpenAiEndpoint(this.getApiUrl());
|
|
241
|
+
}
|
|
242
|
+
getAudioInputFormat() {
|
|
243
|
+
const model = this.config.passthrough?.model ?? this.modelName;
|
|
244
|
+
return typeof model === "string" && /^gpt-(?:audio|4o(?:-mini)?-audio)(?:-|$)/.test(model) ? "openai" : void 0;
|
|
245
|
+
}
|
|
246
|
+
static OPENAI_CHAT_MODELS = OPENAI_CHAT_MODELS;
|
|
247
|
+
static OPENAI_CHAT_MODEL_NAMES = OPENAI_CHAT_MODELS.map((model) => model.id);
|
|
248
|
+
config;
|
|
249
|
+
mcpClient = null;
|
|
250
|
+
initializationPromise = null;
|
|
251
|
+
initializationPending = false;
|
|
252
|
+
initializationWaiters = 0;
|
|
253
|
+
lastInitializationWaitCancelled = false;
|
|
254
|
+
loadedFunctionCallbacks = {};
|
|
255
|
+
constructor(modelName, options = {}) {
|
|
256
|
+
if (!OpenAiChatCompletionProvider.OPENAI_CHAT_MODEL_NAMES.includes(modelName)) logger.debug(`Using unknown chat model: ${modelName}`);
|
|
257
|
+
super(modelName, options);
|
|
258
|
+
this.config = options.config ? { ...options.config } : {};
|
|
259
|
+
if (this.config.mcp?.enabled) this.startMCPInitialization();
|
|
260
|
+
}
|
|
261
|
+
validateFunctionToolCall(output, vars) {
|
|
262
|
+
validateFunctionCall(output, this.config.functions, vars);
|
|
263
|
+
}
|
|
264
|
+
startMCPInitialization() {
|
|
265
|
+
this.initializationPending = true;
|
|
266
|
+
this.lastInitializationWaitCancelled = false;
|
|
267
|
+
const initialization = this.initializeMCP().finally(() => {
|
|
268
|
+
if (this.initializationPromise === initialization) this.initializationPending = false;
|
|
269
|
+
});
|
|
270
|
+
this.initializationPromise = initialization;
|
|
271
|
+
initialization.catch(() => void 0);
|
|
272
|
+
}
|
|
273
|
+
async initializeMCP() {
|
|
274
|
+
this.mcpClient = new MCPClient(this.config.mcp);
|
|
275
|
+
await this.mcpClient.initialize();
|
|
276
|
+
}
|
|
277
|
+
async cleanup() {
|
|
278
|
+
if (this.mcpClient) {
|
|
279
|
+
const mcpClient = this.mcpClient;
|
|
280
|
+
const initialization = this.initializationPromise;
|
|
281
|
+
const cleanup = (async () => {
|
|
282
|
+
try {
|
|
283
|
+
await initialization;
|
|
284
|
+
} finally {
|
|
285
|
+
try {
|
|
286
|
+
await mcpClient.cleanup();
|
|
287
|
+
} finally {
|
|
288
|
+
if (this.mcpClient === mcpClient) {
|
|
289
|
+
this.mcpClient = null;
|
|
290
|
+
this.initializationPromise = null;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
})();
|
|
295
|
+
if (this.initializationPending && this.lastInitializationWaitCancelled && this.initializationWaiters === 0) {
|
|
296
|
+
this.mcpClient = null;
|
|
297
|
+
this.initializationPromise = null;
|
|
298
|
+
cleanup.catch((error) => {
|
|
299
|
+
logger.debug("MCP cleanup after cancelled initialization failed", { error });
|
|
300
|
+
});
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
await cleanup;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
isReasoningCapabilityModel(modelName) {
|
|
307
|
+
return super.isReasoningModel(modelName);
|
|
308
|
+
}
|
|
309
|
+
supportsTemperatureForCapabilityModel(modelName) {
|
|
310
|
+
return !this.isReasoningCapabilityModel(modelName);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Loads a function from an external file
|
|
314
|
+
* @param fileRef The file reference in the format 'file://path/to/file:functionName'
|
|
315
|
+
* @returns The loaded function
|
|
316
|
+
*/
|
|
317
|
+
async loadExternalFunction(fileRef) {
|
|
318
|
+
return loadProviderCallbackFromFileUrl(fileRef);
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Executes a function callback with proper error handling
|
|
322
|
+
*/
|
|
323
|
+
async executeFunctionCallback(functionName, args, config, callId, abortSignal) {
|
|
324
|
+
return executeProviderFunctionCallback({
|
|
325
|
+
functionName,
|
|
326
|
+
args,
|
|
327
|
+
callId,
|
|
328
|
+
abortSignal,
|
|
329
|
+
callbacks: config.functionToolCallbacks,
|
|
330
|
+
cache: this.loadedFunctionCallbacks
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
async getOpenAiBody(prompt, context, callApiOptions) {
|
|
334
|
+
const promptConfig = context?.prompt?.config;
|
|
335
|
+
const mergedConfig = {
|
|
336
|
+
...this.config,
|
|
337
|
+
...promptConfig
|
|
338
|
+
};
|
|
339
|
+
const passthrough = mergedConfig.passthrough ? { ...mergedConfig.passthrough } : void 0;
|
|
340
|
+
const config = {
|
|
341
|
+
...mergedConfig,
|
|
342
|
+
passthrough
|
|
343
|
+
};
|
|
344
|
+
const effectiveServiceTier = getOpenAiEffectiveServiceTier(this.config, promptConfig);
|
|
345
|
+
const messages = parseChatPrompt(prompt, [{
|
|
346
|
+
role: "user",
|
|
347
|
+
content: prompt
|
|
348
|
+
}]);
|
|
349
|
+
const passthroughModel = typeof config.passthrough?.model === "string" ? config.passthrough.model : void 0;
|
|
350
|
+
const capabilityModelName = this.normalizeCapabilityModelName(passthroughModel ?? this.getCapabilityModelName()).replace(/(^|\/)ft:/, "$1");
|
|
351
|
+
const usesConfiguredCapabilities = capabilityModelName === this.normalizeCapabilityModelName(this.getCapabilityModelName()).replace(/(^|\/)ft:/, "$1");
|
|
352
|
+
const isGPT5Model = this.isGPT5Model(capabilityModelName);
|
|
353
|
+
const isOSeriesModel = capabilityModelName.startsWith("o1") || capabilityModelName.startsWith("o3") || capabilityModelName.startsWith("o4") || capabilityModelName.includes("/o1") || capabilityModelName.includes("/o3") || capabilityModelName.includes("/o4");
|
|
354
|
+
const isGPT6Model = isGpt6Model(capabilityModelName);
|
|
355
|
+
const isOpenRouterGpt6 = isGPT6Model && this.usesOpenRouter();
|
|
356
|
+
const isReasoningModel = usesConfiguredCapabilities ? this.isReasoningModel() : this.isReasoningCapabilityModel(capabilityModelName);
|
|
357
|
+
const maxCompletionTokens = isReasoningModel ? config.max_completion_tokens ?? getEnvInt("OPENAI_MAX_COMPLETION_TOKENS") : void 0;
|
|
358
|
+
const maxTokensDefault = config.omitDefaults ? getEnvString("OPENAI_MAX_TOKENS") === void 0 ? void 0 : getEnvInt("OPENAI_MAX_TOKENS") : getEnvInt("OPENAI_MAX_TOKENS", 1024);
|
|
359
|
+
const maxTokens = isReasoningModel || isGPT5Model ? void 0 : config.max_tokens ?? maxTokensDefault;
|
|
360
|
+
const temperatureDefault = config.omitDefaults ? getEnvString("OPENAI_TEMPERATURE") === void 0 ? void 0 : getEnvFloat("OPENAI_TEMPERATURE") : getEnvFloat("OPENAI_TEMPERATURE", 0);
|
|
361
|
+
const temperature = isGPT6Model || (usesConfiguredCapabilities ? this.supportsTemperature() : this.supportsTemperatureForCapabilityModel(capabilityModelName)) ? config.temperature ?? temperatureDefault : void 0;
|
|
362
|
+
const reasoningEffort = isReasoningModel && !isGPT6Model ? renderVarsInObject(config.reasoning_effort, context?.vars ?? {}) : void 0;
|
|
363
|
+
const mcpTools = this.mcpClient ? transformMCPToolsToOpenAi(this.mcpClient.getAllTools()) : [];
|
|
364
|
+
const loadedTools = await prepareOpenAiTools(config.tools, context?.vars, callApiOptions?.abortSignal) ?? [];
|
|
365
|
+
const functions = prepareOpenAiFunctions(config.functions, context?.vars);
|
|
366
|
+
const responseFormat = prepareOpenAiResponseFormat(config.response_format, context?.vars);
|
|
367
|
+
const fileTools = loadedTools;
|
|
368
|
+
const allTools = [...mcpTools, ...fileTools];
|
|
369
|
+
const body = {
|
|
370
|
+
model: this.modelName,
|
|
371
|
+
messages,
|
|
372
|
+
seed: config.seed,
|
|
373
|
+
...maxTokens === void 0 ? {} : { max_tokens: maxTokens },
|
|
374
|
+
...maxCompletionTokens === void 0 ? {} : { max_completion_tokens: maxCompletionTokens },
|
|
375
|
+
...reasoningEffort ? { reasoning_effort: reasoningEffort } : {},
|
|
376
|
+
...temperature === void 0 ? {} : { temperature },
|
|
377
|
+
...config.top_p !== void 0 || getEnvString("OPENAI_TOP_P") ? { top_p: config.top_p ?? getEnvFloat("OPENAI_TOP_P", 1) } : {},
|
|
378
|
+
...config.presence_penalty !== void 0 || getEnvString("OPENAI_PRESENCE_PENALTY") ? { presence_penalty: config.presence_penalty ?? getEnvFloat("OPENAI_PRESENCE_PENALTY", 0) } : {},
|
|
379
|
+
...config.frequency_penalty !== void 0 || getEnvString("OPENAI_FREQUENCY_PENALTY") ? { frequency_penalty: config.frequency_penalty ?? getEnvFloat("OPENAI_FREQUENCY_PENALTY", 0) } : {},
|
|
380
|
+
...config.functions ? { functions } : {},
|
|
381
|
+
...config.function_call ? { function_call: config.function_call } : {},
|
|
382
|
+
...allTools.length > 0 ? { tools: allTools } : {},
|
|
383
|
+
...config.tool_choice ? { tool_choice: transformToolChoice(config.tool_choice, "openai") } : {},
|
|
384
|
+
...config.tool_resources ? { tool_resources: config.tool_resources } : {},
|
|
385
|
+
...config.response_format ? { response_format: responseFormat } : {},
|
|
386
|
+
...callApiOptions?.includeLogProbs ? { logprobs: callApiOptions.includeLogProbs } : {},
|
|
387
|
+
...config.stop ? { stop: config.stop } : {},
|
|
388
|
+
...config.safety_identifier === void 0 ? {} : { safety_identifier: config.safety_identifier },
|
|
389
|
+
...config.prompt_cache_key === void 0 ? {} : { prompt_cache_key: config.prompt_cache_key },
|
|
390
|
+
...config.prompt_cache_options === void 0 ? {} : { prompt_cache_options: config.prompt_cache_options },
|
|
391
|
+
...config.prompt_cache_retention === void 0 ? {} : { prompt_cache_retention: config.prompt_cache_retention },
|
|
392
|
+
...config.passthrough || {},
|
|
393
|
+
...effectiveServiceTier === void 0 ? {} : { service_tier: normalizeOpenAiServiceTierForWire(effectiveServiceTier, this.getApiUrl()) },
|
|
394
|
+
...capabilityModelName.includes("audio") ? {
|
|
395
|
+
modalities: config.modalities || ["text", "audio"],
|
|
396
|
+
audio: config.audio || {
|
|
397
|
+
voice: "alloy",
|
|
398
|
+
format: "wav"
|
|
399
|
+
}
|
|
400
|
+
} : {},
|
|
401
|
+
...(isGPT5Model || isGPT6Model) && config.verbosity ? { verbosity: config.verbosity } : {}
|
|
402
|
+
};
|
|
403
|
+
assertOpenAiApiModel(body.model, this.getApiUrl());
|
|
404
|
+
if (!isGPT6Model && config.reasoning_effort && (isReasoningModel || capabilityModelName.includes("gpt-oss"))) body.reasoning_effort = renderVarsInObject(config.reasoning_effort, context?.vars ?? {});
|
|
405
|
+
if (config.reasoning && isOSeriesModel) body.reasoning = prepareOpenAiReasoning(config.reasoning, context?.vars);
|
|
406
|
+
if (config.user) body.user = config.user;
|
|
407
|
+
if (config.metadata) body.metadata = config.metadata;
|
|
408
|
+
if (config.store !== void 0) body.store = config.store;
|
|
409
|
+
if ((isReasoningModel || isGPT5Model) && "max_tokens" in body) delete body.max_tokens;
|
|
410
|
+
const gpt6Effort = isGPT6Model && !isOpenRouterGpt6 ? getGpt6ChatReasoningEffort(this.config, context?.prompt?.config, (value) => renderVarsInObject(value, context?.vars ?? {})) : void 0;
|
|
411
|
+
if (isGPT6Model) {
|
|
412
|
+
const outputCap = resolveGpt6ChatOutputCap(this.config, context?.prompt?.config, isOpenRouterGpt6, {
|
|
413
|
+
maxCompletionTokens: getEnvInt("OPENAI_MAX_COMPLETION_TOKENS"),
|
|
414
|
+
maxTokens: isOpenRouterGpt6 || gpt6Effort === "none" ? getEnvInt("OPENAI_MAX_TOKENS") : void 0
|
|
415
|
+
});
|
|
416
|
+
if (outputCap === void 0) delete body.max_completion_tokens;
|
|
417
|
+
else body.max_completion_tokens = outputCap;
|
|
418
|
+
}
|
|
419
|
+
if (isOpenRouterGpt6) reconcileOpenRouterReasoning(body, this.config, context?.prompt?.config, context?.vars);
|
|
420
|
+
else if (isGPT6Model) {
|
|
421
|
+
if (config.reasoning != null) throw new Error("GPT-6 Chat Completions requests use reasoning_effort. Configure reasoning_effort, or use the Responses API for config.reasoning.");
|
|
422
|
+
if (gpt6Effort === void 0) delete body.reasoning_effort;
|
|
423
|
+
else body.reasoning_effort = gpt6Effort;
|
|
424
|
+
}
|
|
425
|
+
applyGpt6RequestRules(body, capabilityModelName, "chat", { isOpenRouter: isOpenRouterGpt6 });
|
|
426
|
+
return {
|
|
427
|
+
body,
|
|
428
|
+
config: {
|
|
429
|
+
...config,
|
|
430
|
+
functions,
|
|
431
|
+
response_format: responseFormat,
|
|
432
|
+
service_tier: effectiveServiceTier
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
getBillingModelName(config) {
|
|
437
|
+
const passthroughModel = config.passthrough?.model;
|
|
438
|
+
return typeof passthroughModel === "string" ? passthroughModel : super.getBillingModelName(config);
|
|
439
|
+
}
|
|
440
|
+
getBillingRegion() {}
|
|
441
|
+
/**
|
|
442
|
+
* Calculate the response cost from the provider's raw usage payload.
|
|
443
|
+
*
|
|
444
|
+
* OpenAI-compatible providers can override this hook when their API exposes
|
|
445
|
+
* authoritative billing data or uses provider-specific token accounting.
|
|
446
|
+
*/
|
|
447
|
+
calculateResponseCost(data, config, cached) {
|
|
448
|
+
if (this.usesOpenRouter()) return calculateOpenRouterResponseCost(data, config);
|
|
449
|
+
const modelName = this.getBillingModelName(config);
|
|
450
|
+
const billingModelName = normalizeOpenAiBillingModelName(modelName);
|
|
451
|
+
const tokenCost = calculateOpenAIUsageCost(billingModelName, config, data.usage, {
|
|
452
|
+
apiUrl: this.getApiUrl(),
|
|
453
|
+
cachedResponse: cached,
|
|
454
|
+
provider: this.getGenAISystem(),
|
|
455
|
+
region: this.getBillingRegion(),
|
|
456
|
+
serviceTier: data.service_tier ?? config.service_tier
|
|
457
|
+
});
|
|
458
|
+
const searchCost = cached ? 0 : getChatSearchSurcharge(modelName);
|
|
459
|
+
return tokenCost === void 0 ? searchCost || void 0 : tokenCost + searchCost;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Extract provider-specific fields while the raw OpenAI-compatible response is still available.
|
|
463
|
+
*/
|
|
464
|
+
getProviderResponseMetadata(data) {
|
|
465
|
+
return this.usesOpenRouter() && data && typeof data === "object" ? getOpenRouterBillingMetadata(data) ?? {} : {};
|
|
466
|
+
}
|
|
467
|
+
getChatTracingRequest(body) {
|
|
468
|
+
const asNumber = (value) => typeof value === "number" ? value : void 0;
|
|
469
|
+
return {
|
|
470
|
+
maxTokens: asNumber(body.max_completion_tokens) ?? asNumber(body.max_tokens),
|
|
471
|
+
temperature: asNumber(body.temperature),
|
|
472
|
+
topP: asNumber(body.top_p),
|
|
473
|
+
stopSequences: Array.isArray(body.stop) ? body.stop : typeof body.stop === "string" ? [body.stop] : void 0
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
async callApi(prompt, context, callApiOptions) {
|
|
477
|
+
if (this.config.mcp?.enabled && !this.mcpClient) {
|
|
478
|
+
throwIfAborted(callApiOptions?.abortSignal);
|
|
479
|
+
this.startMCPInitialization();
|
|
480
|
+
}
|
|
481
|
+
if (this.initializationPromise == null) throwIfAborted(callApiOptions?.abortSignal);
|
|
482
|
+
else {
|
|
483
|
+
this.initializationWaiters++;
|
|
484
|
+
let cancelled = false;
|
|
485
|
+
try {
|
|
486
|
+
await waitForPromiseWithAbort(this.initializationPromise, callApiOptions?.abortSignal);
|
|
487
|
+
} catch (error) {
|
|
488
|
+
cancelled = isCallerAbortError(error, callApiOptions?.abortSignal, { requireReasonMatch: true });
|
|
489
|
+
throw error;
|
|
490
|
+
} finally {
|
|
491
|
+
this.initializationWaiters--;
|
|
492
|
+
if (this.initializationWaiters === 0) this.lastInitializationWaitCancelled = cancelled;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
throwIfAborted(callApiOptions?.abortSignal);
|
|
496
|
+
const apiKey = this.getApiKey();
|
|
497
|
+
if (this.requiresApiKey() && !apiKey) throw new Error(this.getMissingApiKeyErrorMessage());
|
|
498
|
+
const spanContext = {
|
|
499
|
+
system: this.getGenAISystem(),
|
|
500
|
+
operationName: "chat",
|
|
501
|
+
openaiApiType: "chat_completions",
|
|
502
|
+
model: this.modelName,
|
|
503
|
+
providerId: this.id(),
|
|
504
|
+
evalId: context?.evaluationId || context?.test?.metadata?.evaluationId,
|
|
505
|
+
testIndex: context?.testIdx ?? context?.test?.vars?.__testIdx,
|
|
506
|
+
promptLabel: context?.prompt?.label,
|
|
507
|
+
traceparent: context?.traceparent,
|
|
508
|
+
requestBody: prompt
|
|
509
|
+
};
|
|
510
|
+
let prepared;
|
|
511
|
+
try {
|
|
512
|
+
prepared = await this.getOpenAiBody(prompt, context, callApiOptions);
|
|
513
|
+
} catch (error) {
|
|
514
|
+
return withGenAISpan(spanContext, async () => {
|
|
515
|
+
throw error;
|
|
516
|
+
}, extractProviderResponseAttributes);
|
|
517
|
+
}
|
|
518
|
+
return withGenAISpan({
|
|
519
|
+
...spanContext,
|
|
520
|
+
...this.getChatTracingRequest(prepared.body)
|
|
521
|
+
}, () => this.callApiInternal(prepared, context, callApiOptions, apiKey), extractProviderResponseAttributes);
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Internal implementation of callApi without tracing wrapper.
|
|
525
|
+
* This is called by callApi after setting up the tracing span.
|
|
526
|
+
*/
|
|
527
|
+
async callApiInternal(prepared, context, callApiOptions, apiKey) {
|
|
528
|
+
const { body, config } = prepared;
|
|
529
|
+
const getAuthHeaders = this.getRequestAuthentication();
|
|
530
|
+
throwIfAborted(callApiOptions?.abortSignal);
|
|
531
|
+
let data;
|
|
532
|
+
let status;
|
|
533
|
+
let statusText;
|
|
534
|
+
let cached = false;
|
|
535
|
+
let latencyMs;
|
|
536
|
+
let deleteFromCache;
|
|
537
|
+
let responseHeaders;
|
|
538
|
+
let completedRefusal;
|
|
539
|
+
const getRefusalResponse = ({ data, cached, status, statusText, headers, latencyMs }) => {
|
|
540
|
+
const choice = data?.choices?.[0];
|
|
541
|
+
const message = choice?.message;
|
|
542
|
+
const finishReason = normalizeFinishReason(choice?.finish_reason);
|
|
543
|
+
if (!message || !message.refusal && finishReason !== FINISH_REASON_MAP.content_filter) return;
|
|
544
|
+
const cost = this.calculateResponseCost(data, config, cached);
|
|
545
|
+
return {
|
|
546
|
+
output: message.refusal || message.content || "Content filtered by provider",
|
|
547
|
+
tokenUsage: getTokenUsage(data, cached),
|
|
548
|
+
cached,
|
|
549
|
+
latencyMs,
|
|
550
|
+
...cost === void 0 ? {} : { cost },
|
|
551
|
+
isRefusal: true,
|
|
552
|
+
...finishReason && { finishReason },
|
|
553
|
+
guardrails: { flagged: true },
|
|
554
|
+
metadata: {
|
|
555
|
+
...this.getProviderResponseMetadata(data),
|
|
556
|
+
http: {
|
|
557
|
+
status,
|
|
558
|
+
statusText,
|
|
559
|
+
headers: headers ?? {}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
try {
|
|
565
|
+
({data, cached, status, statusText, latencyMs, deleteFromCache, headers: responseHeaders} = await fetchWithCache(appendOpenAiApiPath(this.getApiUrl(), "chat/completions"), {
|
|
566
|
+
method: "POST",
|
|
567
|
+
headers: {
|
|
568
|
+
"Content-Type": "application/json",
|
|
569
|
+
...apiKey && !getAuthHeaders ? { Authorization: `Bearer ${apiKey}` } : {},
|
|
570
|
+
...this.getOpenAiRequestHeaders(config.headers)
|
|
571
|
+
},
|
|
572
|
+
body: JSON.stringify(body),
|
|
573
|
+
...getAuthHeaders ? { getAuthHeaders } : {},
|
|
574
|
+
...callApiOptions?.abortSignal ? { signal: callApiOptions.abortSignal } : {}
|
|
575
|
+
}, getRequestTimeoutMs(), "json", this.shouldBustCache(context), this.config.maxRetries, (response) => {
|
|
576
|
+
if (response.status >= 200 && response.status < 300) {
|
|
577
|
+
if (response.headers && getOpenAiGatewayRateLimitKind(response.data) !== "quota") callApiOptions?.onResponseHeaders?.(response.headers);
|
|
578
|
+
completedRefusal = getRefusalResponse(response);
|
|
579
|
+
}
|
|
580
|
+
}, callApiOptions?.onResponseHeaders ? (backoff) => callApiOptions.onResponseHeaders?.(backoff.headers, backoff) : void 0));
|
|
581
|
+
const gatewayErrorFormat = this.usesGatewayErrorFormat();
|
|
582
|
+
const policy = getOpenAiPolicyRefusal(data, gatewayErrorFormat);
|
|
583
|
+
if (policy) {
|
|
584
|
+
const cost = this.calculateResponseCost(data, config, cached);
|
|
585
|
+
return {
|
|
586
|
+
output: policy.partialOutput === void 0 ? policy.message : getOpenAiPartialOutput(policy.partialOutput, isOpenAiJsonSchemaFormat(body.response_format)),
|
|
587
|
+
tokenUsage: data?.usage ? getTokenUsage(data, cached) : void 0,
|
|
588
|
+
cached,
|
|
589
|
+
latencyMs,
|
|
590
|
+
...cost === void 0 ? {} : { cost },
|
|
591
|
+
isRefusal: true,
|
|
592
|
+
guardrails: {
|
|
593
|
+
flagged: true,
|
|
594
|
+
...policy.flaggedInput ? { flaggedInput: true } : {},
|
|
595
|
+
reason: policy.message
|
|
596
|
+
},
|
|
597
|
+
raw: data,
|
|
598
|
+
metadata: {
|
|
599
|
+
...this.getProviderResponseMetadata(data),
|
|
600
|
+
...policy.code ? { providerPolicy: { code: policy.code } } : {},
|
|
601
|
+
http: {
|
|
602
|
+
status,
|
|
603
|
+
statusText,
|
|
604
|
+
headers: responseHeaders ?? {}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
const choiceError = (this.usesOpenRouter() || gatewayErrorFormat && getOpenAiGatewayErrorType(data) !== void 0) && !data?.error ? getOpenAiChatChoiceError(data) : void 0;
|
|
610
|
+
if (choiceError) {
|
|
611
|
+
await deleteFromCache?.();
|
|
612
|
+
const cost = this.calculateResponseCost(data, config, cached);
|
|
613
|
+
const rateLimitKind = getOpenAiGatewayRateLimitKind(data);
|
|
614
|
+
return {
|
|
615
|
+
error: `API error: ${choiceError.error.message}`,
|
|
616
|
+
tokenUsage: data?.usage ? getTokenUsage(data, cached) : void 0,
|
|
617
|
+
cached,
|
|
618
|
+
latencyMs,
|
|
619
|
+
...cost === void 0 ? {} : { cost },
|
|
620
|
+
raw: data,
|
|
621
|
+
metadata: {
|
|
622
|
+
...this.getProviderResponseMetadata(data),
|
|
623
|
+
...rateLimitKind ? { rateLimitKind } : {},
|
|
624
|
+
http: {
|
|
625
|
+
status,
|
|
626
|
+
statusText,
|
|
627
|
+
headers: responseHeaders ?? {}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
if (status < 200 || status >= 300) {
|
|
633
|
+
const errorMessage = `API error: ${status} ${statusText}\n${typeof data === "string" ? data : JSON.stringify(data)}`;
|
|
634
|
+
const rateLimitKind = getOpenAiGatewayRateLimitKind(data);
|
|
635
|
+
if (typeof data === "object" && data?.error?.code === "invalid_prompt" && !this.usesOpenRouter() && (!gatewayErrorFormat || getOpenAiGatewayErrorType(data) === void 0)) {
|
|
636
|
+
const cost = this.calculateResponseCost(data, config, cached);
|
|
637
|
+
return {
|
|
638
|
+
output: errorMessage,
|
|
639
|
+
tokenUsage: data?.usage ? getTokenUsage(data, cached) : void 0,
|
|
640
|
+
cached,
|
|
641
|
+
latencyMs,
|
|
642
|
+
...cost === void 0 ? {} : { cost },
|
|
643
|
+
isRefusal: true,
|
|
644
|
+
guardrails: {
|
|
645
|
+
flagged: true,
|
|
646
|
+
flaggedInput: true
|
|
647
|
+
},
|
|
648
|
+
metadata: {
|
|
649
|
+
...this.getProviderResponseMetadata(data),
|
|
650
|
+
http: {
|
|
651
|
+
status,
|
|
652
|
+
statusText,
|
|
653
|
+
headers: responseHeaders ?? {}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
return {
|
|
659
|
+
error: errorMessage,
|
|
660
|
+
metadata: {
|
|
661
|
+
...rateLimitKind ? { rateLimitKind } : {},
|
|
662
|
+
http: {
|
|
663
|
+
status,
|
|
664
|
+
statusText,
|
|
665
|
+
headers: responseHeaders ?? {}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
} catch (err) {
|
|
671
|
+
const signal = callApiOptions?.abortSignal;
|
|
672
|
+
if (!isResponseHeadersObserverError(callApiOptions?.onResponseHeaders, err) && isCallerAbortError(err, signal)) {
|
|
673
|
+
if (completedRefusal) return completedRefusal;
|
|
674
|
+
throwIfAborted(signal);
|
|
675
|
+
}
|
|
676
|
+
logger.error(`API call error: ${String(err)}`);
|
|
677
|
+
await deleteFromCache?.();
|
|
678
|
+
const rateLimitResponse = getOpenAiRateLimitResponse(err, responseHeaders);
|
|
679
|
+
if (rateLimitResponse) return preserveResponseHeadersObserverError(callApiOptions?.onResponseHeaders, err, rateLimitResponse);
|
|
680
|
+
return preserveResponseHeadersObserverError(callApiOptions?.onResponseHeaders, err, {
|
|
681
|
+
error: `API call error: ${String(err)}`,
|
|
682
|
+
metadata: { http: {
|
|
683
|
+
status: 0,
|
|
684
|
+
statusText: "Error",
|
|
685
|
+
headers: responseHeaders ?? {}
|
|
686
|
+
} }
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
let errorOrigin;
|
|
690
|
+
let completedModelAccounting;
|
|
691
|
+
try {
|
|
692
|
+
const refusal = completedRefusal ?? getRefusalResponse({
|
|
693
|
+
data,
|
|
694
|
+
cached,
|
|
695
|
+
status,
|
|
696
|
+
statusText,
|
|
697
|
+
headers: responseHeaders,
|
|
698
|
+
latencyMs
|
|
699
|
+
});
|
|
700
|
+
if (refusal) return refusal;
|
|
701
|
+
if (isOpenAiErrorOnlyResponse(data)) return {
|
|
702
|
+
error: formatOpenAiError({
|
|
703
|
+
...data,
|
|
704
|
+
error: {
|
|
705
|
+
...data.error,
|
|
706
|
+
message: data.error.message
|
|
707
|
+
}
|
|
708
|
+
}),
|
|
709
|
+
metadata: { http: {
|
|
710
|
+
status,
|
|
711
|
+
statusText,
|
|
712
|
+
headers: responseHeaders ?? {}
|
|
713
|
+
} }
|
|
714
|
+
};
|
|
715
|
+
throwIfAborted(callApiOptions?.abortSignal);
|
|
716
|
+
const message = data.choices[0].message;
|
|
717
|
+
const finishReason = normalizeFinishReason(data.choices[0].finish_reason);
|
|
718
|
+
const cost = this.calculateResponseCost(data, config, cached);
|
|
719
|
+
const providerMetadata = this.getProviderResponseMetadata(data);
|
|
720
|
+
completedModelAccounting = {
|
|
721
|
+
tokenUsage: getTokenUsage(data, cached),
|
|
722
|
+
cost,
|
|
723
|
+
cached,
|
|
724
|
+
latencyMs
|
|
725
|
+
};
|
|
726
|
+
const contentFiltered = finishReason === FINISH_REASON_MAP.content_filter;
|
|
727
|
+
let reasoning = "";
|
|
728
|
+
let output = "";
|
|
729
|
+
if (message.reasoning) {
|
|
730
|
+
reasoning = message.reasoning;
|
|
731
|
+
output = message.content;
|
|
732
|
+
} else if (message.content && (message.function_call || message.tool_calls)) {
|
|
733
|
+
if (Array.isArray(message.tool_calls) && message.tool_calls.length === 0) output = message.content;
|
|
734
|
+
else output = message;
|
|
735
|
+
} else if (message.content === null || message.content === void 0 || message.content === "" && message.tool_calls) output = message.function_call || message.tool_calls;
|
|
736
|
+
else output = message.content;
|
|
737
|
+
const logProbs = data.choices[0].logprobs?.content?.map((logProbObj) => logProbObj.logprob);
|
|
738
|
+
if (isOpenAiJsonSchemaFormat(body.response_format) && typeof output === "string") try {
|
|
739
|
+
output = JSON.parse(output);
|
|
740
|
+
} catch (error) {
|
|
741
|
+
logger.error(`Failed to parse JSON output: ${error}`);
|
|
742
|
+
}
|
|
743
|
+
if (reasoning && typeof output === "string" && (this.config.showThinking ?? true)) output = `Thinking: ${reasoning}\n\n${output}`;
|
|
744
|
+
const mcpToolCalls = [];
|
|
745
|
+
const functionCalls = message.function_call ? [message.function_call] : message.tool_calls;
|
|
746
|
+
if (functionCalls && (config.functionToolCallbacks || this.mcpClient)) {
|
|
747
|
+
const results = [];
|
|
748
|
+
let hasSuccessfulCallback = false;
|
|
749
|
+
for (const functionCall of functionCalls) {
|
|
750
|
+
throwIfAborted(callApiOptions?.abortSignal);
|
|
751
|
+
const functionName = functionCall.name || functionCall.function?.name;
|
|
752
|
+
if (this.mcpClient) {
|
|
753
|
+
if (this.mcpClient.getAllTools().find((tool) => tool.name === functionName)) {
|
|
754
|
+
const rawArgs = functionCall.arguments || functionCall.function?.arguments || "{}";
|
|
755
|
+
const toolCallId = functionCall.id ?? functionCall.call_id;
|
|
756
|
+
let parsedArgs;
|
|
757
|
+
try {
|
|
758
|
+
parsedArgs = typeof rawArgs === "string" ? JSON.parse(rawArgs) : rawArgs;
|
|
759
|
+
throwIfAborted(callApiOptions?.abortSignal);
|
|
760
|
+
const mcpResult = await this.mcpClient.callTool(functionName, parsedArgs, callApiOptions?.abortSignal);
|
|
761
|
+
if (isMcpErrorResult(mcpResult)) {
|
|
762
|
+
const errorMessage = getMcpErrorMessage(mcpResult);
|
|
763
|
+
results.push(`MCP Tool Error (${functionName}): ${errorMessage}`);
|
|
764
|
+
mcpToolCalls.push({
|
|
765
|
+
id: toolCallId,
|
|
766
|
+
name: functionName,
|
|
767
|
+
input: parsedArgs,
|
|
768
|
+
output: errorMessage,
|
|
769
|
+
is_error: true
|
|
770
|
+
});
|
|
771
|
+
if (callApiOptions?.abortSignal?.aborted) return {
|
|
772
|
+
error: `MCP Tool Error (${functionName}): ${errorMessage}`,
|
|
773
|
+
tokenUsage: getTokenUsage(data, cached),
|
|
774
|
+
cached,
|
|
775
|
+
latencyMs,
|
|
776
|
+
logProbs,
|
|
777
|
+
...finishReason && { finishReason },
|
|
778
|
+
cost,
|
|
779
|
+
guardrails: { flagged: contentFiltered },
|
|
780
|
+
metadata: {
|
|
781
|
+
...providerMetadata,
|
|
782
|
+
errorOrigin: "tool",
|
|
783
|
+
http: {
|
|
784
|
+
status,
|
|
785
|
+
statusText,
|
|
786
|
+
headers: responseHeaders ?? {}
|
|
787
|
+
},
|
|
788
|
+
toolCalls: mcpToolCalls
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
} else {
|
|
792
|
+
throwIfAborted(callApiOptions?.abortSignal);
|
|
793
|
+
const content = normalizeMcpToolContent(mcpResult?.content);
|
|
794
|
+
results.push(`MCP Tool Result (${functionName}): ${content}`);
|
|
795
|
+
mcpToolCalls.push({
|
|
796
|
+
id: toolCallId,
|
|
797
|
+
name: functionName,
|
|
798
|
+
input: parsedArgs,
|
|
799
|
+
output: content,
|
|
800
|
+
is_error: false
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
hasSuccessfulCallback = true;
|
|
804
|
+
continue;
|
|
805
|
+
} catch (error) {
|
|
806
|
+
if (isCallerAbortError(error, callApiOptions?.abortSignal, { requireReasonMatch: true })) throwIfAborted(callApiOptions?.abortSignal);
|
|
807
|
+
if (callApiOptions?.abortSignal?.aborted) {
|
|
808
|
+
errorOrigin = "tool";
|
|
809
|
+
throw error;
|
|
810
|
+
}
|
|
811
|
+
logger.debug(`MCP tool execution failed for ${functionName}: ${error}`);
|
|
812
|
+
results.push(`MCP Tool Error (${functionName}): ${error}`);
|
|
813
|
+
mcpToolCalls.push({
|
|
814
|
+
id: toolCallId,
|
|
815
|
+
name: functionName,
|
|
816
|
+
input: parsedArgs ?? rawArgs,
|
|
817
|
+
output: String(error),
|
|
818
|
+
is_error: true
|
|
819
|
+
});
|
|
820
|
+
hasSuccessfulCallback = true;
|
|
821
|
+
continue;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
if (config.functionToolCallbacks && config.functionToolCallbacks[functionName]) try {
|
|
826
|
+
throwIfAborted(callApiOptions?.abortSignal);
|
|
827
|
+
const functionResult = await this.executeFunctionCallback(functionName, functionCall.arguments || functionCall.function?.arguments, config, functionCall.call_id ?? functionCall.id, callApiOptions?.abortSignal);
|
|
828
|
+
throwIfAborted(callApiOptions?.abortSignal);
|
|
829
|
+
results.push(functionResult);
|
|
830
|
+
hasSuccessfulCallback = true;
|
|
831
|
+
} catch (error) {
|
|
832
|
+
if (isCallerAbortError(error, callApiOptions?.abortSignal, { requireReasonMatch: true })) throwIfAborted(callApiOptions?.abortSignal);
|
|
833
|
+
if (callApiOptions?.abortSignal?.aborted) {
|
|
834
|
+
errorOrigin = "tool";
|
|
835
|
+
throw error;
|
|
836
|
+
}
|
|
837
|
+
logger.debug(`Function callback failed for ${functionName} with error ${error}, falling back to original output`);
|
|
838
|
+
hasSuccessfulCallback = false;
|
|
839
|
+
break;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
throwIfAborted(callApiOptions?.abortSignal);
|
|
843
|
+
if (hasSuccessfulCallback && results.length > 0) return {
|
|
844
|
+
output: results.join("\n"),
|
|
845
|
+
tokenUsage: getTokenUsage(data, cached),
|
|
846
|
+
cached,
|
|
847
|
+
latencyMs,
|
|
848
|
+
logProbs,
|
|
849
|
+
...finishReason && { finishReason },
|
|
850
|
+
cost,
|
|
851
|
+
guardrails: { flagged: contentFiltered },
|
|
852
|
+
metadata: {
|
|
853
|
+
...providerMetadata,
|
|
854
|
+
http: {
|
|
855
|
+
status,
|
|
856
|
+
statusText,
|
|
857
|
+
headers: responseHeaders ?? {}
|
|
858
|
+
},
|
|
859
|
+
...mcpToolCalls.length > 0 && { toolCalls: mcpToolCalls }
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
}
|
|
863
|
+
if (message.reasoning_content && typeof message.reasoning_content === "string" && typeof output === "string" && (this.config.showThinking ?? true)) output = `Thinking: ${message.reasoning_content}\n\n${output}`;
|
|
864
|
+
if (message.audio) return {
|
|
865
|
+
output: message.audio.transcript || "",
|
|
866
|
+
audio: {
|
|
867
|
+
id: message.audio.id,
|
|
868
|
+
expiresAt: message.audio.expires_at,
|
|
869
|
+
data: message.audio.data,
|
|
870
|
+
transcript: message.audio.transcript,
|
|
871
|
+
format: message.audio.format || body.audio?.format || "wav"
|
|
872
|
+
},
|
|
873
|
+
tokenUsage: getTokenUsage(data, cached),
|
|
874
|
+
cached,
|
|
875
|
+
latencyMs,
|
|
876
|
+
logProbs,
|
|
877
|
+
...finishReason && { finishReason },
|
|
878
|
+
cost,
|
|
879
|
+
guardrails: { flagged: contentFiltered },
|
|
880
|
+
metadata: {
|
|
881
|
+
...providerMetadata,
|
|
882
|
+
http: {
|
|
883
|
+
status,
|
|
884
|
+
statusText,
|
|
885
|
+
headers: responseHeaders ?? {}
|
|
886
|
+
},
|
|
887
|
+
...mcpToolCalls.length > 0 && { toolCalls: mcpToolCalls }
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
const citations = getChatSearchCitations(message.annotations, output);
|
|
891
|
+
return {
|
|
892
|
+
output,
|
|
893
|
+
tokenUsage: getTokenUsage(data, cached),
|
|
894
|
+
cached,
|
|
895
|
+
latencyMs,
|
|
896
|
+
logProbs,
|
|
897
|
+
...finishReason && { finishReason },
|
|
898
|
+
cost,
|
|
899
|
+
guardrails: { flagged: contentFiltered },
|
|
900
|
+
metadata: {
|
|
901
|
+
...providerMetadata,
|
|
902
|
+
http: {
|
|
903
|
+
status,
|
|
904
|
+
statusText,
|
|
905
|
+
headers: responseHeaders ?? {}
|
|
906
|
+
},
|
|
907
|
+
...data.choices.length > 1 && { choices: data.choices },
|
|
908
|
+
...Array.isArray(message.annotations) && message.annotations.length > 0 && { annotations: message.annotations },
|
|
909
|
+
...citations.length > 0 && { citations },
|
|
910
|
+
...mcpToolCalls.length > 0 && { toolCalls: mcpToolCalls }
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
} catch (err) {
|
|
914
|
+
if (isCallerAbortError(err, callApiOptions?.abortSignal, { requireReasonMatch: true })) throwIfAborted(callApiOptions?.abortSignal);
|
|
915
|
+
if (errorOrigin !== "tool") await deleteFromCache?.();
|
|
916
|
+
return {
|
|
917
|
+
error: `API error: ${String(err)}: ${JSON.stringify(data)}`,
|
|
918
|
+
...errorOrigin === "tool" && completedModelAccounting,
|
|
919
|
+
metadata: {
|
|
920
|
+
...errorOrigin && { errorOrigin },
|
|
921
|
+
http: {
|
|
922
|
+
status,
|
|
923
|
+
statusText,
|
|
924
|
+
headers: responseHeaders ?? {}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
};
|
|
931
|
+
//#endregion
|
|
932
|
+
export { createResponseHeadersObserver as a, preserveResponseHeadersObserverError as c, composeResponseHeadersObservers as i, preserveResponseHeadersObserverErrorResponse as l, getOpenAiGatewayRateLimitKind as n, isResponseHeadersObserverError as o, getOpenAiRateLimitResponse as r, isResponseHeadersObserverErrorResponse as s, OpenAiChatCompletionProvider as t };
|
|
933
|
+
|
|
934
|
+
//# sourceMappingURL=chat-ClTFM3qq.js.map
|