@mcp-use/inspector 0.22.1 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/inspector.css +1 -1
- package/dist/cdn/inspector.js +26547 -26379
- package/dist/cli.js +6 -2
- package/dist/client/components/ChatTab.d.ts.map +1 -1
- package/dist/client/components/MCPAppsRenderer.d.ts.map +1 -1
- package/dist/client/components/OpenAIComponentRenderer.d.ts.map +1 -1
- package/dist/client/components/chat/ChatInput.d.ts +5 -1
- package/dist/client/components/chat/ChatInput.d.ts.map +1 -1
- package/dist/client/components/chat/ChatInputArea.d.ts +5 -1
- package/dist/client/components/chat/ChatInputArea.d.ts.map +1 -1
- package/dist/client/components/chat/ChatLandingForm.d.ts +5 -1
- package/dist/client/components/chat/ChatLandingForm.d.ts.map +1 -1
- package/dist/client/components/chat/ToolSelector.d.ts +13 -0
- package/dist/client/components/chat/ToolSelector.d.ts.map +1 -0
- package/dist/client/components/chat/useChatMessagesClientSide.d.ts +2 -1
- package/dist/client/components/chat/useChatMessagesClientSide.d.ts.map +1 -1
- package/dist/client/index.js +591 -402
- package/dist/server/{chunk-HOSWJXPT.js → chunk-IZPEEN7F.js} +6 -2
- package/dist/server/{chunk-CE5BNX35.js → chunk-JNAYXSVD.js} +1 -1
- package/dist/server/{chunk-N6DUXBZK.js → chunk-YF6BUSE7.js} +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/middleware.js +3 -3
- package/dist/server/server.js +2 -2
- package/dist/server/shared-routes.js +2 -2
- package/dist/server/shared-utils.d.ts.map +1 -1
- package/dist/server/shared-utils.js +1 -1
- package/dist/web/assets/{1c-CuB6KJny.js → 1c-DdyTu-k_.js} +1 -1
- package/dist/web/assets/{abnf-331NRzq6.js → abnf-C2DLuWsJ.js} +1 -1
- package/dist/web/assets/{accesslog-DPZ1SVBF.js → accesslog-BcPmBnek.js} +1 -1
- package/dist/web/assets/{actionscript-CuGZR-oV.js → actionscript-BX-T-H0r.js} +1 -1
- package/dist/web/assets/{ada-DRqvTj3B.js → ada-bFUa8rWB.js} +1 -1
- package/dist/web/assets/{angelscript-CP2_ypHm.js → angelscript--QyowWyi.js} +1 -1
- package/dist/web/assets/{apache-DP5S1Xwo.js → apache-CSPxjWTM.js} +1 -1
- package/dist/web/assets/{applescript-CLh7Bl5g.js → applescript-Beh8nYPj.js} +1 -1
- package/dist/web/assets/{arcade-L7ZIK7Vg.js → arcade-7vaiax_h.js} +1 -1
- package/dist/web/assets/{arduino-D38C-BRe.js → arduino-D67F76RP.js} +1 -1
- package/dist/web/assets/{armasm-BL0z-zkV.js → armasm-DWQZh6t7.js} +1 -1
- package/dist/web/assets/{asciidoc-BwOqzYyI.js → asciidoc-DCLwNk1M.js} +1 -1
- package/dist/web/assets/{aspectj-CsfF5uHW.js → aspectj-C7zkyhZG.js} +1 -1
- package/dist/web/assets/{autohotkey-BnfF2slP.js → autohotkey-D67jHa54.js} +1 -1
- package/dist/web/assets/{autoit-BUNufrnh.js → autoit-YshTFaZR.js} +1 -1
- package/dist/web/assets/{avrasm-BUwC6GGa.js → avrasm-QFQOAcRR.js} +1 -1
- package/dist/web/assets/{awk-BAn6DoRI.js → awk-h3G4tOxj.js} +1 -1
- package/dist/web/assets/{axapta-C5EQhsWz.js → axapta-Ck2tuXpL.js} +1 -1
- package/dist/web/assets/{bash-CXJ0QYm_.js → bash-SNro2FI9.js} +1 -1
- package/dist/web/assets/{basic-8InlTbNb.js → basic-CdFIzr_S.js} +1 -1
- package/dist/web/assets/{bnf-zpEK5Wju.js → bnf-CoDF7W_1.js} +1 -1
- package/dist/web/assets/{brainfuck-BhgAAx-v.js → brainfuck-Bt-q8Sif.js} +1 -1
- package/dist/web/assets/{c-CDPkc2Ya.js → c-CSy1LJEc.js} +1 -1
- package/dist/web/assets/{c-like-Ds21bDLY.js → c-like-CgJH8TzM.js} +1 -1
- package/dist/web/assets/{cal-DWpElLgG.js → cal-BN4ZaGC3.js} +1 -1
- package/dist/web/assets/{capnproto-96me6T8-.js → capnproto-DtQwy4ia.js} +1 -1
- package/dist/web/assets/{ceylon-Eu9VMqL5.js → ceylon-rt4387UK.js} +1 -1
- package/dist/web/assets/{clean-Bw3NaeUf.js → clean-Cyb94-bm.js} +1 -1
- package/dist/web/assets/{client-Dqtz8Ili.js → client-hyRgVCty.js} +3 -3
- package/dist/web/assets/{clojure-CcB35oPu.js → clojure-CLewI5lA.js} +1 -1
- package/dist/web/assets/{clojure-repl-UmCtFENG.js → clojure-repl-BtzgAt1p.js} +1 -1
- package/dist/web/assets/{cmake-BNsFX7mM.js → cmake-DWrK9r_0.js} +1 -1
- package/dist/web/assets/{coffeescript-BO-bY-7g.js → coffeescript-dC8dxgju.js} +1 -1
- package/dist/web/assets/{coq-DxEbCmAp.js → coq-Dx-VjjMG.js} +1 -1
- package/dist/web/assets/{core-Ca6TmLdX.js → core-l5FbiT9y.js} +1 -1
- package/dist/web/assets/{cos-D7p4YQ1F.js → cos-8hM_upPC.js} +1 -1
- package/dist/web/assets/{cpp-BfXjKrw-.js → cpp-C9q7oMVc.js} +1 -1
- package/dist/web/assets/{crmsh-Cu_wHzWI.js → crmsh-CM-iDW78.js} +1 -1
- package/dist/web/assets/{crystal-B4ffFRgA.js → crystal-B89CGmJl.js} +1 -1
- package/dist/web/assets/{csharp-F3YLadH3.js → csharp-BML5bF5U.js} +1 -1
- package/dist/web/assets/{csp-BLkoFjJ1.js → csp-BFgIYW7p.js} +1 -1
- package/dist/web/assets/{css-CBlOEu5y.js → css-Bmr2MmHJ.js} +1 -1
- package/dist/web/assets/{d-B8LLg7Ap.js → d-Bl1waUG7.js} +1 -1
- package/dist/web/assets/{dart-Bg7_Weak.js → dart-7WM1pTL7.js} +1 -1
- package/dist/web/assets/{delphi-CUFJtF08.js → delphi-BATb_6La.js} +1 -1
- package/dist/web/assets/{diff-D6IyExXS.js → diff-DQixhTxV.js} +1 -1
- package/dist/web/assets/{display-A5IEINAP-CalMK9h7.js → display-A5IEINAP-CIPa27wl.js} +2 -2
- package/dist/web/assets/{django-B-UTY01C.js → django-BaiMyL7a.js} +1 -1
- package/dist/web/assets/{dns-DfGDf7is.js → dns-B9LMXwq0.js} +1 -1
- package/dist/web/assets/{dockerfile-BYeQ3jyi.js → dockerfile-CgRRyc7d.js} +1 -1
- package/dist/web/assets/{dos-B_5-_6xr.js → dos-CUi0wmYe.js} +1 -1
- package/dist/web/assets/{dsconfig-uyDAQQAU.js → dsconfig-CtHPMV_z.js} +1 -1
- package/dist/web/assets/{dts-D75DwEM4.js → dts-Da6KiRGb.js} +1 -1
- package/dist/web/assets/{dust-JsNLCukW.js → dust-CtSB5RuR.js} +1 -1
- package/dist/web/assets/{ebnf-BP6c5l4a.js → ebnf-Civ7z3Sl.js} +1 -1
- package/dist/web/assets/{elixir-CUhtoXbR.js → elixir-BRz9w0Jz.js} +1 -1
- package/dist/web/assets/{elm-CKMhE8ah.js → elm-BLvIF2ZJ.js} +1 -1
- package/dist/web/assets/{embeddings-LX6aYruq.js → embeddings-DgQZkbYX.js} +1 -1
- package/dist/web/assets/{erb-CIx8MUO5.js → erb-yf3e-otT.js} +1 -1
- package/dist/web/assets/{erlang-repl-k7jT--Ou.js → erlang-repl-ygAXsKis.js} +1 -1
- package/dist/web/assets/{erlang-CkXPsz4M.js → erlang-u1gFvkzN.js} +1 -1
- package/dist/web/assets/{excel-C5SkgBGz.js → excel-Dr1VKgu5.js} +1 -1
- package/dist/web/assets/{fix-_4ZjoSTH.js → fix-CQ9USTvQ.js} +1 -1
- package/dist/web/assets/{flix-DnrR-dRx.js → flix-CK8VWwdt.js} +1 -1
- package/dist/web/assets/{fortran-CD6uDQX4.js → fortran-ChxBIVaA.js} +1 -1
- package/dist/web/assets/{fsharp-DTtzfUsx.js → fsharp-C2VB7uZ8.js} +1 -1
- package/dist/web/assets/{gams-CQk2cq7o.js → gams-cNOVPE3r.js} +1 -1
- package/dist/web/assets/{gauss-CtDmpxAf.js → gauss-Bqbzwh3H.js} +1 -1
- package/dist/web/assets/{gcode-B_EYK0Vg.js → gcode-CCf3GJpC.js} +1 -1
- package/dist/web/assets/{gherkin-DVcj5Cvn.js → gherkin-zMG7sQxB.js} +1 -1
- package/dist/web/assets/{glsl-BoRlfwJN.js → glsl-ChXPtZtn.js} +1 -1
- package/dist/web/assets/{gml-DwXf4s-K.js → gml-Dkbq2p7u.js} +1 -1
- package/dist/web/assets/{go-jKSz3kk6.js → go-C_rm61mN.js} +1 -1
- package/dist/web/assets/{golo-Dz5XOjjS.js → golo-BHw2HzNW.js} +1 -1
- package/dist/web/assets/{gradle-CG3C4PH5.js → gradle-dmNWlxt5.js} +1 -1
- package/dist/web/assets/{groovy-SRcDLXTF.js → groovy-BYRQ-Iq8.js} +1 -1
- package/dist/web/assets/{haml-CJsy3-F-.js → haml-CUGq_1r0.js} +1 -1
- package/dist/web/assets/{handlebars-LN8E0NSL.js → handlebars-ClqAsR9Y.js} +1 -1
- package/dist/web/assets/{haskell-ZP5N77Rb.js → haskell-D1EUHyyy.js} +1 -1
- package/dist/web/assets/{haxe-S_8gGOoI.js → haxe-D5_584-N.js} +1 -1
- package/dist/web/assets/{hsp-KqF2E7-o.js → hsp-CxOObZJt.js} +1 -1
- package/dist/web/assets/{htmlbars-Bw_UyB1p.js → htmlbars-BcxYs9JO.js} +1 -1
- package/dist/web/assets/{http-BI5U1FE3.js → http-IoGXsslz.js} +1 -1
- package/dist/web/assets/{hy-BAOLWsZC.js → hy-DOezFVYJ.js} +1 -1
- package/dist/web/assets/{index-ChIi2Veb.js → index-58vKJ_rW.js} +1 -1
- package/dist/web/assets/{index-BJOEo8tI.js → index-BQMLPync.js} +1 -1
- package/dist/web/assets/{index-DtyH_PEF.js → index-BWHJKdRK.js} +1 -1
- package/dist/web/assets/index-Br5Lp-nB.css +1 -0
- package/dist/web/assets/{index-Bmd2u1yJ.js → index-Brj1Oahm.js} +1 -1
- package/dist/web/assets/{index-Cz7z8sOR.js → index-BzCXH-MY.js} +1 -1
- package/dist/web/assets/{index-YcAOTRMN.js → index-CeFusmJF.js} +155 -155
- package/dist/web/assets/{index-DUSfaXA6.js → index-Df6PS_lJ.js} +1 -1
- package/dist/web/assets/{inform7-DgEbiTHe.js → inform7-4DkSrciU.js} +1 -1
- package/dist/web/assets/{ini-VsC63Yhp.js → ini-BAOejxzX.js} +1 -1
- package/dist/web/assets/{irpf90-BPXrE0Br.js → irpf90-CPhvVsrR.js} +1 -1
- package/dist/web/assets/{isbl-Dz4HkKrY.js → isbl-B9cEpNQ2.js} +1 -1
- package/dist/web/assets/{java-C5QDkp3s.js → java-B4D9vUuB.js} +1 -1
- package/dist/web/assets/{javascript-Qw1A7HIi.js → javascript-BUcy5JSl.js} +1 -1
- package/dist/web/assets/{jboss-cli-DjxxWoe7.js → jboss-cli-rk3boy7C.js} +1 -1
- package/dist/web/assets/{json-DwXmVB99.js → json-DMjBKfEa.js} +1 -1
- package/dist/web/assets/{julia-_UEF-d-n.js → julia-ByXC6uTj.js} +1 -1
- package/dist/web/assets/{julia-repl-BmGjKqDN.js → julia-repl-BRG6tLsN.js} +1 -1
- package/dist/web/assets/{kotlin-BGX09JNe.js → kotlin-LVfLRQA6.js} +1 -1
- package/dist/web/assets/{langfuse-U2OEF7K7-oUFfuCA2.js → langfuse-U2OEF7K7-BHNkft2N.js} +28 -28
- package/dist/web/assets/{lasso-CMKn1wD1.js → lasso-BcDeHYYs.js} +1 -1
- package/dist/web/assets/{latex-CSuZLxub.js → latex-BQLu7e0M.js} +1 -1
- package/dist/web/assets/{ldif-DtYZcb6_.js → ldif-MoWOvygf.js} +1 -1
- package/dist/web/assets/{leaf-Dm7kHn1u.js → leaf-Dc_ryT_U.js} +1 -1
- package/dist/web/assets/{less-BduOo7w1.js → less-xL-2sUOW.js} +1 -1
- package/dist/web/assets/{lisp-CTN_y443.js → lisp-CQgkxiVN.js} +1 -1
- package/dist/web/assets/{livecodeserver-Bt_3a5Le.js → livecodeserver-CnHs8DDk.js} +1 -1
- package/dist/web/assets/{livescript-fany4WHq.js → livescript-Bq3GcA8X.js} +1 -1
- package/dist/web/assets/{llms-CaZsx5qn.js → llms-DJAqua6W.js} +1 -1
- package/dist/web/assets/{llvm-BPeNPow9.js → llvm-g2SZAh5n.js} +1 -1
- package/dist/web/assets/{lsl-CUkRosfV.js → lsl-duYC8WGZ.js} +1 -1
- package/dist/web/assets/{lua-BYvWg4jg.js → lua-BKi5mh_G.js} +1 -1
- package/dist/web/assets/{makefile-oS53Vg0z.js → makefile-BqeicODu.js} +1 -1
- package/dist/web/assets/{markdown-D_B0fAXx.js → markdown-BG4LCYiF.js} +1 -1
- package/dist/web/assets/{mathematica-DKe-IuUK.js → mathematica-abL0r-fQ.js} +1 -1
- package/dist/web/assets/{matlab-D_21Tl-L.js → matlab-UvEnHOa4.js} +1 -1
- package/dist/web/assets/{maxima-DUtL1egA.js → maxima-WaftEzY-.js} +1 -1
- package/dist/web/assets/{mel-LAIz87bj.js → mel-B2MSGRGp.js} +1 -1
- package/dist/web/assets/{mercury-zYnf0BJA.js → mercury-D-B5OKnw.js} +1 -1
- package/dist/web/assets/{mipsasm-By1nFx6c.js → mipsasm-BN0bNdeJ.js} +1 -1
- package/dist/web/assets/{mizar-Bzhf-tV1.js → mizar-B9qd-OhV.js} +1 -1
- package/dist/web/assets/{mojolicious-B8QJxbI8.js → mojolicious-DojZjej7.js} +1 -1
- package/dist/web/assets/{monkey-Z_CyDrLh.js → monkey-DTUG_uUK.js} +1 -1
- package/dist/web/assets/{moonscript-CoDseIDC.js → moonscript-BxxoAw0w.js} +1 -1
- package/dist/web/assets/{n1ql-BEBUEhhE.js → n1ql-DoMSEnVI.js} +1 -1
- package/dist/web/assets/{nginx-BGCHEvnU.js → nginx-Ce5-hgf7.js} +1 -1
- package/dist/web/assets/{nim-Ctrpw--E.js → nim--cUhot81.js} +1 -1
- package/dist/web/assets/{nix-Caa5UC27.js → nix-CFzICQwT.js} +1 -1
- package/dist/web/assets/{node-repl-sr3s7jQZ.js → node-repl-8uW0BP3C.js} +1 -1
- package/dist/web/assets/{nsis-CzkCLfi2.js → nsis-D85QEHck.js} +1 -1
- package/dist/web/assets/{objectivec-jvD65_0I.js → objectivec-CO4ZKM1N.js} +1 -1
- package/dist/web/assets/{ocaml-DhDYdcp2.js → ocaml-MdZmIFP9.js} +1 -1
- package/dist/web/assets/{openscad-BqnRwGZd.js → openscad-Dd_k-u5o.js} +1 -1
- package/dist/web/assets/{oxygene-Cd0jRim3.js → oxygene-C9_JJ-Tz.js} +1 -1
- package/dist/web/assets/{parser3-BETxqEki.js → parser3--hakx1TP.js} +1 -1
- package/dist/web/assets/{perl-knvs0MzJ.js → perl-Bryi0MIt.js} +1 -1
- package/dist/web/assets/{pf-DiXaovgm.js → pf-ZaeD0XU8.js} +1 -1
- package/dist/web/assets/{pgsql-BWEvOXP5.js → pgsql-9scnk6gR.js} +1 -1
- package/dist/web/assets/{php-fyvUpIS6.js → php-Fdiy0MkS.js} +1 -1
- package/dist/web/assets/{php-template-Bvb-N_hu.js → php-template-BYeCSEy4.js} +1 -1
- package/dist/web/assets/{plaintext-Dwt8jzyJ.js → plaintext-FbFisAWv.js} +1 -1
- package/dist/web/assets/{pony-Cfelzwqf.js → pony-B0HARvcw.js} +1 -1
- package/dist/web/assets/{powershell-2b2YR7rM.js → powershell-DUssROtG.js} +1 -1
- package/dist/web/assets/{processing-CgyyQkLr.js → processing-BQZO45D3.js} +1 -1
- package/dist/web/assets/{profile-CHSonwOR.js → profile-CcGplmcc.js} +1 -1
- package/dist/web/assets/{prolog-CArpL4nb.js → prolog-B0NhCbAQ.js} +1 -1
- package/dist/web/assets/{properties-B7x5j4f3.js → properties-CWjoVJ5W.js} +1 -1
- package/dist/web/assets/{protobuf-DbZMyS9y.js → protobuf-D58gQeRM.js} +1 -1
- package/dist/web/assets/{puppet-CyK4RmCj.js → puppet-Ba9doIt2.js} +1 -1
- package/dist/web/assets/{purebasic-Bu9BNLQf.js → purebasic-BrH-D46w.js} +1 -1
- package/dist/web/assets/{python-DpcgEz0v.js → python-CjvAeSv8.js} +1 -1
- package/dist/web/assets/{python-repl-BAoj7DrU.js → python-repl-Jgv_SkQ0.js} +1 -1
- package/dist/web/assets/{q-aLpDzBqb.js → q-DgYB_ewM.js} +1 -1
- package/dist/web/assets/{qml-CF8YT9EP.js → qml-C7I-vh-W.js} +1 -1
- package/dist/web/assets/{r-DJifPsK_.js → r-DUpFDXxH.js} +1 -1
- package/dist/web/assets/{reasonml-DYlZCQtf.js → reasonml-Dxs-bF-2.js} +1 -1
- package/dist/web/assets/{rib-BWlooZzU.js → rib-CQL270qQ.js} +1 -1
- package/dist/web/assets/{roboconf-B3mKPOxb.js → roboconf-krxtbKe1.js} +1 -1
- package/dist/web/assets/{routeros-Ri82AIpo.js → routeros-BGBHdfxg.js} +1 -1
- package/dist/web/assets/{rsl-YFzXeAfb.js → rsl-CxAtY_02.js} +1 -1
- package/dist/web/assets/{ruby-CjV_PTlL.js → ruby-DJm1xcVx.js} +1 -1
- package/dist/web/assets/{ruleslanguage-DJCtPhmJ.js → ruleslanguage-BnhvTD6g.js} +1 -1
- package/dist/web/assets/{rust-T_ZZbr83.js → rust-DQe5T9WQ.js} +1 -1
- package/dist/web/assets/{sas-DnThN-QA.js → sas-6xbHPzOh.js} +1 -1
- package/dist/web/assets/{scala-CiCGCGBM.js → scala-DZlwYVr9.js} +1 -1
- package/dist/web/assets/{scheme-C81ecRNU.js → scheme-DXL_Buip.js} +1 -1
- package/dist/web/assets/{scilab-yIe92bs8.js → scilab-CKRl_kfB.js} +1 -1
- package/dist/web/assets/{scss-BGCT6i58.js → scss-jr09pBlW.js} +1 -1
- package/dist/web/assets/{shell-CtJaW7qj.js → shell-CxU4VQpG.js} +1 -1
- package/dist/web/assets/{smali-D9JxR6Ok.js → smali-BsXFpLll.js} +1 -1
- package/dist/web/assets/{smalltalk-Cc681-eJ.js → smalltalk-D2nr_49h.js} +1 -1
- package/dist/web/assets/{sml-CTRWATz0.js → sml-B16pEEUV.js} +1 -1
- package/dist/web/assets/{sqf-DSWEsa4V.js → sqf-BRaN4nE_.js} +1 -1
- package/dist/web/assets/{sql-CDB6g9ay.js → sql-CeIac2_e.js} +1 -1
- package/dist/web/assets/{sql_more-CpMC6pU4.js → sql_more-ZIMlJNGg.js} +1 -1
- package/dist/web/assets/{stan-BHnXBW_m.js → stan-DmpIhD_z.js} +1 -1
- package/dist/web/assets/{stata-84iUAWPp.js → stata-0ytqR1Ib.js} +1 -1
- package/dist/web/assets/{stdio-ZJFIZK2F-DAa98oll.js → stdio-PVTCK7WZ-C_E3pv0k.js} +1 -1
- package/dist/web/assets/{step21-DDfRrzcc.js → step21-C5gS7qwT.js} +1 -1
- package/dist/web/assets/{stylus-6UGB2DbU.js → stylus-DUzDJYfR.js} +1 -1
- package/dist/web/assets/{subunit-CI6BjWYM.js → subunit-BgugsJpP.js} +1 -1
- package/dist/web/assets/{swift-gZKjqZzX.js → swift-Cq31xV9A.js} +1 -1
- package/dist/web/assets/{taggerscript-4a4rpAZe.js → taggerscript-D6rUQ5Ju.js} +1 -1
- package/dist/web/assets/{tap-1yGDzo5T.js → tap-DkraFPBQ.js} +1 -1
- package/dist/web/assets/{tcl-Blqm3M6H.js → tcl-87kkAxdg.js} +1 -1
- package/dist/web/assets/{thrift-SCSYAnoo.js → thrift-CHkbhRQC.js} +1 -1
- package/dist/web/assets/{tp-CJiYvF2Z.js → tp-D5drOrfs.js} +1 -1
- package/dist/web/assets/{twig-CwKcbSAY.js → twig-JUSSxmsN.js} +1 -1
- package/dist/web/assets/{typescript-Dfq7Dw6S.js → typescript-DxY7tpO6.js} +1 -1
- package/dist/web/assets/{vala-CwjTTkCe.js → vala-BKhreswN.js} +1 -1
- package/dist/web/assets/{vbnet-DkyZUDFs.js → vbnet-BHYN5PHo.js} +1 -1
- package/dist/web/assets/{vbscript-D7mSa0kc.js → vbscript-eErGIKc5.js} +1 -1
- package/dist/web/assets/{vbscript-html-4muOpfOP.js → vbscript-html-BVPWl6WP.js} +1 -1
- package/dist/web/assets/{verilog-CTx73zAb.js → verilog-DbaUNZdo.js} +1 -1
- package/dist/web/assets/{vhdl-bNkZElSZ.js → vhdl-UR-HSHjG.js} +1 -1
- package/dist/web/assets/{vim-BEHLt-ak.js → vim-Dk1XUiA7.js} +1 -1
- package/dist/web/assets/{x86asm-LPghO6jq.js → x86asm-B9c_N4c6.js} +1 -1
- package/dist/web/assets/{xl-C1a1l7dp.js → xl-swOLfPCO.js} +1 -1
- package/dist/web/assets/{xml-DkVcEWrP.js → xml-BpZLXHyv.js} +1 -1
- package/dist/web/assets/{xquery-BC8Ygt24.js → xquery-RWTIln5p.js} +1 -1
- package/dist/web/assets/{yaml-dlNOCKmh.js → yaml-k20kwc4p.js} +1 -1
- package/dist/web/assets/{zephir-Bif85EPV.js → zephir-7ED-2Mm2.js} +1 -1
- package/dist/web/index.html +3 -3
- package/package.json +2 -2
- package/dist/web/assets/index-B53yBrEF.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{t as a,u as k}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BWHJKdRK.js","assets/index-CeFusmJF.js","assets/index-Br5Lp-nB.css","assets/core-lM8H9z0c.js","assets/1c-DOTL_Doy.js","assets/abnf-BjLV93yi.js","assets/accesslog-GJv3YBrF.js","assets/actionscript-DoqfywO9.js","assets/ada-RUsuGPJi.js","assets/angelscript-BdZ1b0rs.js","assets/apache-CsbpFlqC.js","assets/applescript-kY8OmlKB.js","assets/arcade-BmMgc7_g.js","assets/arduino-pNuu6z4_.js","assets/armasm-nKvy_iDO.js","assets/xml-BXh47oPk.js","assets/asciidoc-B_fy0kBa.js","assets/aspectj-DvN9ZbSj.js","assets/autohotkey-CZG2ssCb.js","assets/autoit-DXMOl7Fd.js","assets/avrasm-Ba2EQvoc.js","assets/awk-Cb-RiGP0.js","assets/axapta-J1eBZbig.js","assets/bash-CN_VnC_Q.js","assets/basic-Bug0UzDW.js","assets/bnf-DZMdTSN9.js","assets/brainfuck-BYywhCpy.js","assets/c-like-BLVencsc.js","assets/c-DkSi4Vcz.js","assets/cal-Bok_ig3y.js","assets/capnproto-uQZ1jOWw.js","assets/ceylon-CLrvJLwU.js","assets/clean-jkCpP5TC.js","assets/clojure--pYedOFI.js","assets/clojure-repl-Cp-cHE39.js","assets/cmake-CKl4Nywn.js","assets/coffeescript-B5dBcvVG.js","assets/coq-DJA4mjuN.js","assets/cos-DckhWT6g.js","assets/cpp-B87jAeCB.js","assets/crmsh-Dc9XdWBP.js","assets/crystal-AiyYbKLq.js","assets/csharp-GDFduacm.js","assets/csp-DK1-V7Db.js","assets/css-OjpDdnLT.js","assets/d-Cj7t0knZ.js","assets/markdown-Bnpjmjdr.js","assets/dart-vlk_R7L2.js","assets/delphi-oHShnxHc.js","assets/diff-CMHzeABH.js","assets/django-BJHTgcPT.js","assets/dns-B8Qm8HuY.js","assets/dockerfile-NjbpBWJ2.js","assets/dos-C6ygE4Ei.js","assets/dsconfig-BetjSZ3D.js","assets/dts-BOH5TDT-.js","assets/dust-DsfNS0hI.js","assets/ebnf-BGmXUujk.js","assets/elixir-CYXbd3jG.js","assets/elm-CJCwRLzK.js","assets/ruby-U0BYPmFB.js","assets/erb-CANFiuzW.js","assets/erlang-repl-C-WvLaul.js","assets/erlang-CYUnCrk0.js","assets/excel-DPetn2vF.js","assets/fix-D7T_oQ9O.js","assets/flix-DWvLG6E_.js","assets/fortran-Cbh4tV_m.js","assets/fsharp-BarQNxPT.js","assets/gams-BVueaFMy.js","assets/gauss-DMVDwWC_.js","assets/gcode-B80Z_LSc.js","assets/gherkin-DwdfqIxg.js","assets/glsl-DFuaITlO.js","assets/gml-sg8D2Hoc.js","assets/go-DOIHECmn.js","assets/golo-5y-cAlg7.js","assets/gradle-C5LRK4lY.js","assets/groovy-CqO0xXbN.js","assets/haml-Du0d9Qpu.js","assets/handlebars-BqpMwd25.js","assets/haskell-BSgKG0fA.js","assets/haxe-Bbxdab9d.js","assets/hsp-BfO253pz.js","assets/htmlbars-BdupgdwA.js","assets/http-FG-1bz0S.js","assets/hy-CljtLrIB.js","assets/inform7-CKh91FfW.js","assets/ini-CUN5Fz6a.js","assets/irpf90-BGwK5upn.js","assets/isbl-BW2-1xqY.js","assets/java-BopHZ59q.js","assets/javascript-Bcajz3YC.js","assets/jboss-cli-7Bb2wtKY.js","assets/json-_cGKMkqV.js","assets/julia-CflsGA1_.js","assets/julia-repl-DTkCRO_Z.js","assets/kotlin-DSmpQSGN.js","assets/lasso-BciudTQ1.js","assets/latex-CHdb8PhR.js","assets/ldif-jBEfafs_.js","assets/leaf-CQphRTnn.js","assets/less-D0Ccux41.js","assets/lisp-DfrNO5te.js","assets/livecodeserver-WU_wnUq8.js","assets/livescript-oQhn4lAX.js","assets/llvm-Ctq8Ea1M.js","assets/lsl-CZ-92Osz.js","assets/lua-CtuzIFQ2.js","assets/makefile-CUBjRDBz.js","assets/mathematica-DMjmGOFL.js","assets/matlab-bMP2hmJA.js","assets/maxima-CiGgQtRy.js","assets/mel-BKEdQ-Ac.js","assets/mercury-Cg7tRNfI.js","assets/mipsasm-CNyeTk3S.js","assets/mizar-BICf15Zj.js","assets/perl-CG48H2Tk.js","assets/mojolicious-DiD_1YV0.js","assets/monkey-D6kono4g.js","assets/moonscript-Ba-Tqbk8.js","assets/n1ql-AxtiJSd2.js","assets/nginx-DwELR1Kc.js","assets/nim-WLvfBExD.js","assets/nix-CYCtYL9u.js","assets/node-repl-DFkgLtXM.js","assets/nsis-DuGBnzB5.js","assets/objectivec-DaSEGJ40.js","assets/ocaml-Lke8W5fZ.js","assets/openscad-BUF8N3i5.js","assets/oxygene-CNTFR9M0.js","assets/parser3-DkkG33l8.js","assets/pf-B8CGBekM.js","assets/pgsql-C72BsFGV.js","assets/php-BnOcpMux.js","assets/php-template-BQLZ6iCT.js","assets/plaintext-TgN34U_P.js","assets/pony-D2s0nSMG.js","assets/powershell-CwBe08EC.js","assets/processing-83OAnlCi.js","assets/profile-Co0NG88S.js","assets/prolog-2Rxvo3d_.js","assets/properties-BZrOFGmF.js","assets/protobuf-Cc7EZO5Y.js","assets/puppet-CJr7B09H.js","assets/purebasic-lmx8MMfp.js","assets/python-BctvjIbZ.js","assets/python-repl-f_19wJYw.js","assets/q-ClVUhk4N.js","assets/qml-WV58KNua.js","assets/r-CnigUbQl.js","assets/reasonml-D-8_Lf63.js","assets/rib-DhxZj9fV.js","assets/roboconf-C9_f8BAb.js","assets/routeros-0VVpPsA4.js","assets/rsl-B-_wRvQZ.js","assets/ruleslanguage-C6IDQ_id.js","assets/rust-ByoeQ5jb.js","assets/sas-DzgwSrpf.js","assets/scala-Dzt-MscJ.js","assets/scheme-D7X8lENz.js","assets/scilab-BDRgLrmm.js","assets/scss-hD3K75LU.js","assets/shell-DtjSgbG3.js","assets/smali-Dz834AtK.js","assets/smalltalk-bRqiTIeV.js","assets/sml-BZgrt2qR.js","assets/sqf-BhMgSC-9.js","assets/sql_more-CiUnQFCB.js","assets/sql-D9a3dnuY.js","assets/stan-M2mdTSOp.js","assets/stata-CBjVxKhA.js","assets/step21-PEp2FbgJ.js","assets/stylus-KpBYw7lY.js","assets/subunit-CIiHPJOz.js","assets/swift-l8Sedkw9.js","assets/taggerscript-B2nhDpZI.js","assets/yaml-BKYJIuvD.js","assets/tap-Cz77FvlH.js","assets/tcl-Cw1k2FtN.js","assets/thrift-CAwZw_2g.js","assets/tp-BoGwmalK.js","assets/twig-1xgj4vMV.js","assets/typescript-C925WkhK.js","assets/vala-8Htn2qvX.js","assets/vbnet-CsYNC8ZV.js","assets/vbscript-C6WdSq9e.js","assets/vbscript-html-CBkOqIaC.js","assets/verilog-DSo68DT-.js","assets/vhdl-C1F4x3vF.js","assets/vim-CNd_h5kc.js","assets/x86asm-BXgEvW-J.js","assets/xl-sMilxJ95.js","assets/xquery-GsrDavrd.js","assets/zephir-DZzC3J8X.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as a,u as k}from"./index-CeFusmJF.js";var y=null,L=null,O=null,J=!1,V=typeof process<"u"&&process.versions?.node;(async()=>{if(V)try{O=(await k(()=>import("./util-QmrWvrtn.js"),[])).stripVTControlCharacters}catch{}try{y=(await k(()=>import("./index-JiKw9JSs.js"),[])).default}catch{}try{L=(await k(()=>import("./index-BWHJKdRK.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194]))).highlight}catch{}V&&(!y||!L)&&(J||(J=!0,console.warn(`
|
|
3
3
|
✨ For enhanced console output with colors and syntax highlighting, install:
|
|
4
4
|
|
|
5
5
|
npm install chalk cli-highlight
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as g}from"./django-BJHTgcPT.js";function i(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=g();const c=s(f),d=i({__proto__:null,default:c},[f]);export{d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as i}from"./dns-B8Qm8HuY.js";function c(t,s){for(var o=0;o<s.length;o++){const e=s[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=i();const p=f(a),l=c({__proto__:null,default:p},[a]);export{l as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n}from"./index-
|
|
1
|
+
import{r as n}from"./index-CeFusmJF.js";import{r as a}from"./dockerfile-NjbpBWJ2.js";function s(t,i){for(var o=0;o<i.length;o++){const e=i[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const f=Object.getOwnPropertyDescriptor(e,r);f&&Object.defineProperty(t,r,f.get?f:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var c=a();const l=n(c),d=s({__proto__:null,default:l},[c]);export{d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as i}from"./dos-C6ygE4Ei.js";function c(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=i();const p=f(a),l=c({__proto__:null,default:p},[a]);export{l as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i}from"./index-
|
|
1
|
+
import{r as i}from"./index-CeFusmJF.js";import{r as c}from"./dsconfig-BetjSZ3D.js";function a(t,f){for(var o=0;o<f.length;o++){const e=f[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var s=c();const g=i(s),d=a({__proto__:null,default:g},[s]);export{d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as i}from"./dts-BOH5TDT-.js";function c(r,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const t in e)if(t!=="default"&&!(t in r)){const s=Object.getOwnPropertyDescriptor(e,t);s&&Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var a=i();const p=f(a),l=c({__proto__:null,default:p},[a]);export{l as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as u}from"./dust-DsfNS0hI.js";function i(r,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const t in e)if(t!=="default"&&!(t in r)){const s=Object.getOwnPropertyDescriptor(e,t);s&&Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var a=u();const c=f(a),l=i({__proto__:null,default:c},[a]);export{l as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as i}from"./ebnf-BGmXUujk.js";function c(t,f){for(var o=0;o<f.length;o++){const e=f[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=i();const p=s(a),l=c({__proto__:null,default:p},[a]);export{l as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as s}from"./elixir-CYXbd3jG.js";function l(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const i=Object.getOwnPropertyDescriptor(e,r);i&&Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=s();const c=f(a),g=l({__proto__:null,default:c},[a]);export{g as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as l}from"./elm-CJCwRLzK.js";function i(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=l();const c=s(f),u=i({__proto__:null,default:c},[f]);export{u as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as s,w as d}from"./index-
|
|
1
|
+
import{n as s,w as d}from"./index-CeFusmJF.js";var l={};s(l,{chunkArray:()=>u});const u=(r,c)=>r.reduce((a,n,o)=>{const e=Math.floor(o/c),t=a[e]||[];return a[e]=t.concat([n]),a},[]);var h={};s(h,{Embeddings:()=>i});var i=class{caller;constructor(r){this.caller=new d(r??{})}};export{i as E,l as a,u as c,h as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as i}from"./erb-CANFiuzW.js";function c(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=i();const p=s(f),l=c({__proto__:null,default:p},[f]);export{l as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p}from"./index-
|
|
1
|
+
import{r as p}from"./index-CeFusmJF.js";import{r as f}from"./erlang-repl-C-WvLaul.js";function s(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var l=f();const g=p(l),u=s({__proto__:null,default:g},[l]);export{u as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as l}from"./erlang-CYUnCrk0.js";function g(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=l();const i=s(f),u=g({__proto__:null,default:i},[f]);export{u as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as s}from"./excel-DPetn2vF.js";function l(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const c=Object.getOwnPropertyDescriptor(e,r);c&&Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=s();const i=f(a),g=l({__proto__:null,default:i},[a]);export{g as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./index-
|
|
1
|
+
import{r as a}from"./index-CeFusmJF.js";import{r as s}from"./fix-D7T_oQ9O.js";function c(t,i){for(var o=0;o<i.length;o++){const e=i[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const f=Object.getOwnPropertyDescriptor(e,r);f&&Object.defineProperty(t,r,f.get?f:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=s();const p=a(n),g=c({__proto__:null,default:p},[n]);export{g as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./index-
|
|
1
|
+
import{r as a}from"./index-CeFusmJF.js";import{r as s}from"./flix-DWvLG6E_.js";function l(t,i){for(var o=0;o<i.length;o++){const e=i[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const f=Object.getOwnPropertyDescriptor(e,r);f&&Object.defineProperty(t,r,f.get?f:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=s();const c=a(n),g=l({__proto__:null,default:c},[n]);export{g as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as i}from"./fortran-Cbh4tV_m.js";function c(t,a){for(var o=0;o<a.length;o++){const r=a[o];if(typeof r!="string"&&!Array.isArray(r)){for(const e in r)if(e!=="default"&&!(e in t)){const n=Object.getOwnPropertyDescriptor(r,e);n&&Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=i();const p=s(f),g=c({__proto__:null,default:p},[f]);export{g as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n}from"./index-
|
|
1
|
+
import{r as n}from"./index-CeFusmJF.js";import{r as p}from"./fsharp-BarQNxPT.js";function i(t,f){for(var o=0;o<f.length;o++){const r=f[o];if(typeof r!="string"&&!Array.isArray(r)){for(const e in r)if(e!=="default"&&!(e in t)){const a=Object.getOwnPropertyDescriptor(r,e);a&&Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var s=p();const c=n(s),g=i({__proto__:null,default:c},[s]);export{g as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as g}from"./gams-BVueaFMy.js";function i(t,s){for(var o=0;o<s.length;o++){const e=s[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=g();const c=f(n),u=i({__proto__:null,default:c},[n]);export{u as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as u}from"./gauss-DMVDwWC_.js";function g(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=u();const i=f(n),l=g({__proto__:null,default:i},[n]);export{l as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as s}from"./gcode-B80Z_LSc.js";function g(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const c=Object.getOwnPropertyDescriptor(e,r);c&&Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=s();const i=f(a),d=g({__proto__:null,default:i},[a]);export{d as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as s}from"./gherkin-DwdfqIxg.js";function g(t,i){for(var o=0;o<i.length;o++){const e=i[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=s();const c=f(a),l=g({__proto__:null,default:c},[a]);export{l as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./index-
|
|
1
|
+
import{r as a}from"./index-CeFusmJF.js";import{r as f}from"./glsl-DFuaITlO.js";function g(t,l){for(var o=0;o<l.length;o++){const e=l[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=f();const i=a(n),u=g({__proto__:null,default:i},[n]);export{u as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as l}from"./gml-sg8D2Hoc.js";function g(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=l();const i=s(f),p=g({__proto__:null,default:i},[f]);export{p as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as g}from"./go-DOIHECmn.js";function i(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=g();const c=s(f),l=i({__proto__:null,default:c},[f]);export{l as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as l}from"./golo-5y-cAlg7.js";function g(o,a){for(var t=0;t<a.length;t++){const e=a[t];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in o)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var f=l();const i=s(f),u=g({__proto__:null,default:i},[f]);export{u as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as l}from"./gradle-C5LRK4lY.js";function g(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=l();const i=s(f),u=g({__proto__:null,default:i},[f]);export{u as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as g}from"./groovy-CqO0xXbN.js";function i(o,a){for(var t=0;t<a.length;t++){const r=a[t];if(typeof r!="string"&&!Array.isArray(r)){for(const e in r)if(e!=="default"&&!(e in o)){const n=Object.getOwnPropertyDescriptor(r,e);n&&Object.defineProperty(o,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var f=g();const c=s(f),y=i({__proto__:null,default:c},[f]);export{y as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as l}from"./haml-Du0d9Qpu.js";function i(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=l();const c=s(f),u=i({__proto__:null,default:c},[f]);export{u as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as l}from"./handlebars-BqpMwd25.js";function i(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var s=l();const c=f(s),b=i({__proto__:null,default:c},[s]);export{b as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n}from"./index-
|
|
1
|
+
import{r as n}from"./index-CeFusmJF.js";import{r as f}from"./haskell-BSgKG0fA.js";function i(t,s){for(var o=0;o<s.length;o++){const e=s[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var l=f();const c=n(l),g=i({__proto__:null,default:c},[l]);export{g as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as i}from"./haxe-Bbxdab9d.js";function c(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=i();const p=s(f),g=c({__proto__:null,default:p},[f]);export{g as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./index-
|
|
1
|
+
import{r as a}from"./index-CeFusmJF.js";import{r as f}from"./hsp-BfO253pz.js";function i(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var p=f();const c=a(p),g=i({__proto__:null,default:c},[p]);export{g as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as l}from"./htmlbars-BdupgdwA.js";function i(t,s){for(var o=0;o<s.length;o++){const r=s[o];if(typeof r!="string"&&!Array.isArray(r)){for(const e in r)if(e!=="default"&&!(e in t)){const a=Object.getOwnPropertyDescriptor(r,e);a&&Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=l();const c=f(n),u=i({__proto__:null,default:c},[n]);export{u as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CeFusmJF.js";import{r as s}from"./http-FG-1bz0S.js";function i(r,p){for(var o=0;o<p.length;o++){const t=p[o];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in r)){const n=Object.getOwnPropertyDescriptor(t,e);n&&Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var a=s();const c=f(a),g=i({__proto__:null,default:c},[a]);export{g as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CeFusmJF.js";import{r as i}from"./hy-CljtLrIB.js";function c(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=i();const p=s(f),l=c({__proto__:null,default:p},[f]);export{l as h};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ss,O as jt,h as ks,c as qt,f as Ts,J as Ms,S as vs,R as Dt}from"./index-DUSfaXA6.js";import{x as Os,b2 as y,b3 as Wt,b4 as Is,b5 as As,b6 as Ft,a0 as kn,U as ve,aA as Ht,Z as Rs,$ as Cs,W as N,a1 as Ps,b as ot,Q as ie,V as Es,a2 as Ns,b7 as Us,b8 as tt,b9 as b,ba as w,bb as E,bc as Bs,bd as At}from"./index-YcAOTRMN.js";import{t as Ie}from"./index-Cz7z8sOR.js";var Jt=class extends Ss{static lc_name(){return"AnthropicToolsOutputParser"}lc_namespace=["langchain","anthropic","output_parsers"];returnId=!1;keyName;returnSingle=!1;zodSchema;constructor(t){super(t),this.keyName=t.keyName,this.returnSingle=t.returnSingle??this.returnSingle,this.zodSchema=t.zodSchema}async _validateResult(t){let e=t;if(typeof t=="string")try{e=JSON.parse(t)}catch(r){throw new jt(`Failed to parse. Text: "${JSON.stringify(t,null,2)}". Error: ${JSON.stringify(r.message)}`,t)}else e=t;if(this.zodSchema===void 0)return e;const n=await Os(this.zodSchema,e);if(n.success)return n.data;throw new jt(`Failed to parse. Text: "${JSON.stringify(t,null,2)}". Error: ${JSON.stringify(n.error.issues)}`,JSON.stringify(e,null,2))}async parseResult(t){const e=t.flatMap(s=>{const{message:a}=s;return Array.isArray(a.content)?Tn(a.content)[0]:[]});if(e[0]===void 0)throw new Error("No parseable tool calls provided to AnthropicToolsOutputParser.");const[n]=e;return await this._validateResult(n.args)}};function Tn(t){const e=[];for(const n of t)n.type==="tool_use"&&e.push({name:n.name,args:n.input,id:n.id,type:"tool_call"});return e}function $s(t){if(t)return t==="any"?{type:"any"}:t==="auto"?{type:"auto"}:t==="none"?{type:"none"}:typeof t=="string"?{type:"tool",name:t}:t}const Ls=y({cache_control:As().optional().nullable(),defer_loading:Is().optional(),input_examples:Wt(Ft()).optional(),allowed_callers:Wt(Ft()).optional()}),Kt={tool_search_tool_regex_20251119:"advanced-tool-use-2025-11-20",tool_search_tool_bm25_20251119:"advanced-tool-use-2025-11-20",memory_20250818:"context-management-2025-06-27",web_fetch_20250910:"web-fetch-2025-09-10",code_execution_20250825:"code-execution-2025-08-25",computer_20251124:"computer-use-2025-11-24",computer_20250124:"computer-use-2025-01-24",mcp_toolset:"mcp-client-2025-11-20"};function js(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="thinking"}function qs(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="redacted_thinking"}function Ds(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="search_result"}function Ws(t){return typeof t!="object"||t==null||!("type"in t)||t.type!=="image"||!("source"in t)||typeof t.source!="object"||t.source==null||!("type"in t.source)?!1:t.source.type==="base64"?!(!("media_type"in t.source)||typeof t.source.media_type!="string"||!("data"in t.source)||typeof t.source.data!="string"):t.source.type==="url"?!(!("url"in t.source)||typeof t.source.url!="string"):!1}const Fs={providerName:"anthropic",fromStandardTextBlock(t){return{type:"text",text:t.text,..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{}}},fromStandardImageBlock(t){if(t.source_type==="url"){const e=kn({dataUrl:t.url,asTypedArray:!1});return e?{type:"image",source:{type:"base64",data:e.data,media_type:e.mime_type},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{}}:{type:"image",source:{type:"url",url:t.url},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{}}}else{if(t.source_type==="base64")return{type:"image",source:{type:"base64",data:t.data,media_type:t.mime_type??""},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{}};throw new Error(`Unsupported image source type: ${t.source_type}`)}},fromStandardFileBlock(t){const e=(t.mime_type??"").split(";")[0];if(t.source_type==="url"){if(e==="application/pdf"||e==="")return{type:"document",source:{type:"url",url:t.url},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{},..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."context"in(t.metadata??{})?{context:t.metadata.context}:{},..."title"in(t.metadata??{})?{title:t.metadata.title}:{}};throw new Error(`Unsupported file mime type for file url source: ${t.mime_type}`)}else if(t.source_type==="text"){if(e==="text/plain"||e==="")return{type:"document",source:{type:"text",data:t.text,media_type:t.mime_type??""},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{},..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."context"in(t.metadata??{})?{context:t.metadata.context}:{},..."title"in(t.metadata??{})?{title:t.metadata.title}:{}};throw new Error(`Unsupported file mime type for file text source: ${t.mime_type}`)}else if(t.source_type==="base64"){if(e==="application/pdf"||e==="")return{type:"document",source:{type:"base64",data:t.data,media_type:"application/pdf"},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{},..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."context"in(t.metadata??{})?{context:t.metadata.context}:{},..."title"in(t.metadata??{})?{title:t.metadata.title}:{}};if(["image/jpeg","image/png","image/gif","image/webp"].includes(e))return{type:"document",source:{type:"content",content:[{type:"image",source:{type:"base64",data:t.data,media_type:e}}]},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{},..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."context"in(t.metadata??{})?{context:t.metadata.context}:{},..."title"in(t.metadata??{})?{title:t.metadata.title}:{}};throw new Error(`Unsupported file mime type for file base64 source: ${t.mime_type}`)}else throw new Error(`Unsupported file source type: ${t.source_type}`)}},Hs=t=>t();function Js(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="citation"}function Ks(t){function*e(){for(const n of t)Js(n)&&(n.source==="char"?yield{type:"char_location",file_id:n.url??"",start_char_index:n.startIndex??0,end_char_index:n.endIndex??0,document_title:n.title??null,document_index:0,cited_text:n.citedText??""}:n.source==="page"?yield{type:"page_location",file_id:n.url??"",start_page_number:n.startIndex??0,end_page_number:n.endIndex??0,document_title:n.title??null,document_index:0,cited_text:n.citedText??""}:n.source==="block"?yield{type:"content_block_location",file_id:n.url??"",start_block_index:n.startIndex??0,end_block_index:n.endIndex??0,document_title:n.title??null,document_index:0,cited_text:n.citedText??""}:n.source==="url"?yield{type:"web_search_result_location",url:n.url??"",title:n.title??null,encrypted_index:String(n.startIndex??0),cited_text:n.citedText??""}:n.source==="search"&&(yield{type:"search_result_location",title:n.title??null,start_block_index:n.startIndex??0,end_block_index:n.endIndex??0,search_result_index:0,source:n.source??"",cited_text:n.citedText??""}))}return Array.from(e())}function oe(t){return typeof t=="string"?t:Xs(t)}function Xs(t){const e=[];for(let n=0,{length:r}=t;n<r;n++)e.push(String.fromCharCode(t[n]));return btoa(e.join(""))}function ct(t){return(t??"").split(";")[0].toLowerCase()}function ke(t,e){if(t!=null&&typeof t=="object"&&e in t)return t[e]}function Z(t,e){const n=ke(e,"cache_control");n!==void 0&&(t.cache_control=n);const r=ke(e,"citations");r!==void 0&&(t.citations=r);const s=ke(e,"context");s!==void 0&&(t.context=s);const a=ke(e,"title");return a!==void 0&&(t.title=a),t}function ut(t,e){const n=ke(e,"cache_control");return n!==void 0&&(t.cache_control=n),t}function Xt(t){return new Set(["image/jpeg","image/png","image/gif","image/webp"]).has(t)}function zs(t){const e=[],n=t.response_metadata,r="model_provider"in n&&n?.model_provider==="anthropic";for(const s of t.contentBlocks)if(s.type==="text")s.annotations?e.push({type:"text",text:s.text,citations:Ks(s.annotations)}):e.push({type:"text",text:s.text});else if(s.type==="tool_call")e.push({type:"tool_use",id:s.id??"",name:s.name,input:s.args});else if(s.type==="tool_call_chunk"){const a=Hs(()=>{if(typeof s.args!="string")return s.args;try{return JSON.parse(s.args)}catch{return{}}});e.push({type:"tool_use",id:s.id??"",name:s.name??"",input:a})}else if(s.type==="reasoning"&&r)e.push({type:"thinking",thinking:s.reasoning,signature:String(s.signature)});else if(s.type==="server_tool_call"&&r)s.name==="web_search"?e.push({type:"server_tool_use",name:s.name,id:s.id??"",input:s.args}):s.name==="code_execution"&&e.push({type:"server_tool_use",name:s.name,id:s.id??"",input:s.args});else if(s.type==="server_tool_call_result"&&r)if(s.name==="web_search"&&Array.isArray(s.output.urls)){const a=s.output.urls.map(i=>({type:"web_search_result",title:"",encrypted_content:"",url:i}));e.push({type:"web_search_tool_result",tool_use_id:s.toolCallId??"",content:a})}else s.name==="code_execution"?e.push({type:"code_execution_tool_result",tool_use_id:s.toolCallId??"",content:s.output}):s.name==="mcp_tool_result"&&e.push({type:"mcp_tool_result",tool_use_id:s.toolCallId??"",content:s.output});else{if(s.type==="audio")throw new Error("Anthropic does not support audio content blocks.");if(s.type==="file"){const a=s.metadata;if(s.fileId){e.push(Z({type:"document",source:{type:"file",file_id:s.fileId}},a));continue}if(s.url){const i=ct(s.mimeType);if(i==="application/pdf"||i===""){e.push(Z({type:"document",source:{type:"url",url:s.url}},a));continue}}if(s.data){const i=ct(s.mimeType);if(i===""||i==="application/pdf")e.push(Z({type:"document",source:{type:"base64",data:oe(s.data),media_type:"application/pdf"}},a));else if(i==="text/plain")e.push(Z({type:"document",source:{type:"text",data:oe(s.data),media_type:"text/plain"}},a));else if(Xt(i))e.push(Z({type:"document",source:{type:"content",content:[{type:"image",source:{type:"base64",data:oe(s.data),media_type:i}}]}},a));else throw new Error(`Unsupported file mime type for Anthropic base64 source: ${i}`);continue}throw new Error("File content block must include a fileId, url, or data property.")}else if(s.type==="image"){const a=s.metadata;if(s.fileId){e.push(ut({type:"image",source:{type:"file",file_id:s.fileId}},a));continue}if(s.url){e.push(ut({type:"image",source:{type:"url",url:s.url}},a));continue}if(s.data){const i=ct(s.mimeType)||"image/png";Xt(i)&&e.push(ut({type:"image",source:{type:"base64",data:oe(s.data),media_type:i}},a));continue}throw new Error("Image content block must include a fileId, url, or data property.")}else s.type==="video"||(s.type==="text-plain"?s.data&&e.push(Z({type:"document",source:{type:"text",data:oe(s.data),media_type:"text/plain"}},s.metadata)):s.type==="non_standard"&&r&&e.push(s.value))}return e}function lt(t){const e=kn({dataUrl:t});if(e)return{type:"base64",media_type:e.mime_type,data:e.data};let n;try{n=new URL(t)}catch{throw new Error([`Malformed image URL: ${JSON.stringify(t)}. Content blocks of type 'image_url' must be a valid http, https, or base64-encoded data URL.`,"Example: data:image/png;base64,/9j/4AAQSk...","Example: https://example.com/image.jpg"].join(`
|
|
1
|
+
import{g as Ss,O as jt,h as ks,c as qt,f as Ts,J as Ms,S as vs,R as Dt}from"./index-Df6PS_lJ.js";import{x as Os,b2 as y,b3 as Wt,b4 as Is,b5 as As,b6 as Ft,a0 as kn,U as ve,aA as Ht,Z as Rs,$ as Cs,W as N,a1 as Ps,b as ot,Q as ie,V as Es,a2 as Ns,b7 as Us,b8 as tt,b9 as b,ba as w,bb as E,bc as Bs,bd as At}from"./index-CeFusmJF.js";import{t as Ie}from"./index-BzCXH-MY.js";var Jt=class extends Ss{static lc_name(){return"AnthropicToolsOutputParser"}lc_namespace=["langchain","anthropic","output_parsers"];returnId=!1;keyName;returnSingle=!1;zodSchema;constructor(t){super(t),this.keyName=t.keyName,this.returnSingle=t.returnSingle??this.returnSingle,this.zodSchema=t.zodSchema}async _validateResult(t){let e=t;if(typeof t=="string")try{e=JSON.parse(t)}catch(r){throw new jt(`Failed to parse. Text: "${JSON.stringify(t,null,2)}". Error: ${JSON.stringify(r.message)}`,t)}else e=t;if(this.zodSchema===void 0)return e;const n=await Os(this.zodSchema,e);if(n.success)return n.data;throw new jt(`Failed to parse. Text: "${JSON.stringify(t,null,2)}". Error: ${JSON.stringify(n.error.issues)}`,JSON.stringify(e,null,2))}async parseResult(t){const e=t.flatMap(s=>{const{message:a}=s;return Array.isArray(a.content)?Tn(a.content)[0]:[]});if(e[0]===void 0)throw new Error("No parseable tool calls provided to AnthropicToolsOutputParser.");const[n]=e;return await this._validateResult(n.args)}};function Tn(t){const e=[];for(const n of t)n.type==="tool_use"&&e.push({name:n.name,args:n.input,id:n.id,type:"tool_call"});return e}function $s(t){if(t)return t==="any"?{type:"any"}:t==="auto"?{type:"auto"}:t==="none"?{type:"none"}:typeof t=="string"?{type:"tool",name:t}:t}const Ls=y({cache_control:As().optional().nullable(),defer_loading:Is().optional(),input_examples:Wt(Ft()).optional(),allowed_callers:Wt(Ft()).optional()}),Kt={tool_search_tool_regex_20251119:"advanced-tool-use-2025-11-20",tool_search_tool_bm25_20251119:"advanced-tool-use-2025-11-20",memory_20250818:"context-management-2025-06-27",web_fetch_20250910:"web-fetch-2025-09-10",code_execution_20250825:"code-execution-2025-08-25",computer_20251124:"computer-use-2025-11-24",computer_20250124:"computer-use-2025-01-24",mcp_toolset:"mcp-client-2025-11-20"};function js(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="thinking"}function qs(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="redacted_thinking"}function Ds(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="search_result"}function Ws(t){return typeof t!="object"||t==null||!("type"in t)||t.type!=="image"||!("source"in t)||typeof t.source!="object"||t.source==null||!("type"in t.source)?!1:t.source.type==="base64"?!(!("media_type"in t.source)||typeof t.source.media_type!="string"||!("data"in t.source)||typeof t.source.data!="string"):t.source.type==="url"?!(!("url"in t.source)||typeof t.source.url!="string"):!1}const Fs={providerName:"anthropic",fromStandardTextBlock(t){return{type:"text",text:t.text,..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{}}},fromStandardImageBlock(t){if(t.source_type==="url"){const e=kn({dataUrl:t.url,asTypedArray:!1});return e?{type:"image",source:{type:"base64",data:e.data,media_type:e.mime_type},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{}}:{type:"image",source:{type:"url",url:t.url},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{}}}else{if(t.source_type==="base64")return{type:"image",source:{type:"base64",data:t.data,media_type:t.mime_type??""},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{}};throw new Error(`Unsupported image source type: ${t.source_type}`)}},fromStandardFileBlock(t){const e=(t.mime_type??"").split(";")[0];if(t.source_type==="url"){if(e==="application/pdf"||e==="")return{type:"document",source:{type:"url",url:t.url},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{},..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."context"in(t.metadata??{})?{context:t.metadata.context}:{},..."title"in(t.metadata??{})?{title:t.metadata.title}:{}};throw new Error(`Unsupported file mime type for file url source: ${t.mime_type}`)}else if(t.source_type==="text"){if(e==="text/plain"||e==="")return{type:"document",source:{type:"text",data:t.text,media_type:t.mime_type??""},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{},..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."context"in(t.metadata??{})?{context:t.metadata.context}:{},..."title"in(t.metadata??{})?{title:t.metadata.title}:{}};throw new Error(`Unsupported file mime type for file text source: ${t.mime_type}`)}else if(t.source_type==="base64"){if(e==="application/pdf"||e==="")return{type:"document",source:{type:"base64",data:t.data,media_type:"application/pdf"},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{},..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."context"in(t.metadata??{})?{context:t.metadata.context}:{},..."title"in(t.metadata??{})?{title:t.metadata.title}:{}};if(["image/jpeg","image/png","image/gif","image/webp"].includes(e))return{type:"document",source:{type:"content",content:[{type:"image",source:{type:"base64",data:t.data,media_type:e}}]},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{},..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."context"in(t.metadata??{})?{context:t.metadata.context}:{},..."title"in(t.metadata??{})?{title:t.metadata.title}:{}};throw new Error(`Unsupported file mime type for file base64 source: ${t.mime_type}`)}else throw new Error(`Unsupported file source type: ${t.source_type}`)}},Hs=t=>t();function Js(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="citation"}function Ks(t){function*e(){for(const n of t)Js(n)&&(n.source==="char"?yield{type:"char_location",file_id:n.url??"",start_char_index:n.startIndex??0,end_char_index:n.endIndex??0,document_title:n.title??null,document_index:0,cited_text:n.citedText??""}:n.source==="page"?yield{type:"page_location",file_id:n.url??"",start_page_number:n.startIndex??0,end_page_number:n.endIndex??0,document_title:n.title??null,document_index:0,cited_text:n.citedText??""}:n.source==="block"?yield{type:"content_block_location",file_id:n.url??"",start_block_index:n.startIndex??0,end_block_index:n.endIndex??0,document_title:n.title??null,document_index:0,cited_text:n.citedText??""}:n.source==="url"?yield{type:"web_search_result_location",url:n.url??"",title:n.title??null,encrypted_index:String(n.startIndex??0),cited_text:n.citedText??""}:n.source==="search"&&(yield{type:"search_result_location",title:n.title??null,start_block_index:n.startIndex??0,end_block_index:n.endIndex??0,search_result_index:0,source:n.source??"",cited_text:n.citedText??""}))}return Array.from(e())}function oe(t){return typeof t=="string"?t:Xs(t)}function Xs(t){const e=[];for(let n=0,{length:r}=t;n<r;n++)e.push(String.fromCharCode(t[n]));return btoa(e.join(""))}function ct(t){return(t??"").split(";")[0].toLowerCase()}function ke(t,e){if(t!=null&&typeof t=="object"&&e in t)return t[e]}function Z(t,e){const n=ke(e,"cache_control");n!==void 0&&(t.cache_control=n);const r=ke(e,"citations");r!==void 0&&(t.citations=r);const s=ke(e,"context");s!==void 0&&(t.context=s);const a=ke(e,"title");return a!==void 0&&(t.title=a),t}function ut(t,e){const n=ke(e,"cache_control");return n!==void 0&&(t.cache_control=n),t}function Xt(t){return new Set(["image/jpeg","image/png","image/gif","image/webp"]).has(t)}function zs(t){const e=[],n=t.response_metadata,r="model_provider"in n&&n?.model_provider==="anthropic";for(const s of t.contentBlocks)if(s.type==="text")s.annotations?e.push({type:"text",text:s.text,citations:Ks(s.annotations)}):e.push({type:"text",text:s.text});else if(s.type==="tool_call")e.push({type:"tool_use",id:s.id??"",name:s.name,input:s.args});else if(s.type==="tool_call_chunk"){const a=Hs(()=>{if(typeof s.args!="string")return s.args;try{return JSON.parse(s.args)}catch{return{}}});e.push({type:"tool_use",id:s.id??"",name:s.name??"",input:a})}else if(s.type==="reasoning"&&r)e.push({type:"thinking",thinking:s.reasoning,signature:String(s.signature)});else if(s.type==="server_tool_call"&&r)s.name==="web_search"?e.push({type:"server_tool_use",name:s.name,id:s.id??"",input:s.args}):s.name==="code_execution"&&e.push({type:"server_tool_use",name:s.name,id:s.id??"",input:s.args});else if(s.type==="server_tool_call_result"&&r)if(s.name==="web_search"&&Array.isArray(s.output.urls)){const a=s.output.urls.map(i=>({type:"web_search_result",title:"",encrypted_content:"",url:i}));e.push({type:"web_search_tool_result",tool_use_id:s.toolCallId??"",content:a})}else s.name==="code_execution"?e.push({type:"code_execution_tool_result",tool_use_id:s.toolCallId??"",content:s.output}):s.name==="mcp_tool_result"&&e.push({type:"mcp_tool_result",tool_use_id:s.toolCallId??"",content:s.output});else{if(s.type==="audio")throw new Error("Anthropic does not support audio content blocks.");if(s.type==="file"){const a=s.metadata;if(s.fileId){e.push(Z({type:"document",source:{type:"file",file_id:s.fileId}},a));continue}if(s.url){const i=ct(s.mimeType);if(i==="application/pdf"||i===""){e.push(Z({type:"document",source:{type:"url",url:s.url}},a));continue}}if(s.data){const i=ct(s.mimeType);if(i===""||i==="application/pdf")e.push(Z({type:"document",source:{type:"base64",data:oe(s.data),media_type:"application/pdf"}},a));else if(i==="text/plain")e.push(Z({type:"document",source:{type:"text",data:oe(s.data),media_type:"text/plain"}},a));else if(Xt(i))e.push(Z({type:"document",source:{type:"content",content:[{type:"image",source:{type:"base64",data:oe(s.data),media_type:i}}]}},a));else throw new Error(`Unsupported file mime type for Anthropic base64 source: ${i}`);continue}throw new Error("File content block must include a fileId, url, or data property.")}else if(s.type==="image"){const a=s.metadata;if(s.fileId){e.push(ut({type:"image",source:{type:"file",file_id:s.fileId}},a));continue}if(s.url){e.push(ut({type:"image",source:{type:"url",url:s.url}},a));continue}if(s.data){const i=ct(s.mimeType)||"image/png";Xt(i)&&e.push(ut({type:"image",source:{type:"base64",data:oe(s.data),media_type:i}},a));continue}throw new Error("Image content block must include a fileId, url, or data property.")}else s.type==="video"||(s.type==="text-plain"?s.data&&e.push(Z({type:"document",source:{type:"text",data:oe(s.data),media_type:"text/plain"}},s.metadata)):s.type==="non_standard"&&r&&e.push(s.value))}return e}function lt(t){const e=kn({dataUrl:t});if(e)return{type:"base64",media_type:e.mime_type,data:e.data};let n;try{n=new URL(t)}catch{throw new Error([`Malformed image URL: ${JSON.stringify(t)}. Content blocks of type 'image_url' must be a valid http, https, or base64-encoded data URL.`,"Example: data:image/png;base64,/9j/4AAQSk...","Example: https://example.com/image.jpg"].join(`
|
|
2
2
|
|
|
3
3
|
`))}if(n.protocol==="http:"||n.protocol==="https:")return{type:"url",url:t};throw new Error([`Invalid image URL protocol: ${JSON.stringify(n.protocol)}. Anthropic only supports images as http, https, or base64-encoded data URLs on 'image_url' content blocks.`,"Example: data:image/png;base64,/9j/4AAQSk...","Example: https://example.com/image.jpg"].join(`
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as at,f as rt,g as Ct,O as Ot,h as yt,J as It,R as U}from"./index-DUSfaXA6.js";import{b as ut,Q as vt,S as _t,U as Et,V as Tt,W as wt,X as St,Y as At,y as lt,Z as Rt,$ as xt,a0 as k,x as kt,a1 as ct,a2 as bt}from"./index-YcAOTRMN.js";import{E as Nt,c as Mt}from"./embeddings-LX6aYruq.js";function I(t){if(typeof t=="object"&&t!==null){const e={...t};"additionalProperties"in e&&delete e.additionalProperties,"$schema"in e&&delete e.$schema,"strict"in e&&delete e.strict;for(const n in e)n in e&&(Array.isArray(e[n])?e[n]=e[n].map(I):typeof e[n]=="object"&&e[n]!==null&&(e[n]=I(e[n])));return e}return t}function N(t){const{$schema:e,...n}=I(ut(t)?vt(t):t);return n}function Dt(t){const{$schema:e,...n}=I(t);return n}function E(t,e,n=[]){if(t==null||typeof t!="object")return;const s=t;if(Array.isArray(s.enum)&&s.enum.some(i=>i==="")){const i=n.length?` at path "${n.join(".")}"`:"",o=e?` in tool "${e}"`:"";throw new Error(`Invalid enum: empty string not allowed${o}${i}. Gemini API rejects empty strings in enums.`)}if(s.type==="object"&&s.properties&&typeof s.properties=="object")for(const[i,o]of Object.entries(s.properties))E(o,e,[...n,i]);s.items&&E(s.items,e,[...n,"[]"]);for(const i of["anyOf","oneOf","allOf"]){const o=s[i];Array.isArray(o)&&o.forEach((a,u)=>E(a,e,[...n,`${i}[${u}]`]))}s.additionalProperties&&typeof s.additionalProperties=="object"&&E(s.additionalProperties,e,[...n,"additionalProperties"])}const h=[];for(let t=0;t<256;++t)h.push((t+256).toString(16).slice(1));function Gt(t,e=0){return(h[t[e+0]]+h[t[e+1]]+h[t[e+2]]+h[t[e+3]]+"-"+h[t[e+4]]+h[t[e+5]]+"-"+h[t[e+6]]+h[t[e+7]]+"-"+h[t[e+8]]+h[t[e+9]]+"-"+h[t[e+10]]+h[t[e+11]]+h[t[e+12]]+h[t[e+13]]+h[t[e+14]]+h[t[e+15]]).toLowerCase()}let b;const Ut=new Uint8Array(16);function Lt(){if(!b){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");b=crypto.getRandomValues.bind(crypto)}return b(Ut)}const Pt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),L={randomUUID:Pt};function dt(t,e,n){if(L.randomUUID&&!t)return L.randomUUID();t=t||{};const s=t.random??t.rng?.()??Lt();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Gt(s)}const D="__gemini_function_call_thought_signatures__",jt="ErYCCrMCAdHtim9kOoOkrPiCNVsmlpMIKd7ZMxgiFbVQOkgp7nlLcDMzVsZwIzvuT7nQROivoXA72ccC2lSDvR0Gh7dkWaGuj7ctv6t7ZceHnecx0QYa+ix8tYpRfjhyWozQ49lWiws6+YGjCt10KRTyWsZ2h6O7iHTYJwKIRwGUHRKy/qK/6kFxJm5ML00gLq4D8s5Z6DBpp2ZlR+uF4G8jJgeWQgyHWVdx2wGYElaceVAc66tZdPQRdOHpWtgYSI1YdaXgVI8KHY3/EfNc2YqqMIulvkDBAnuMhkAjV9xmBa54Tq+ih3Im4+r3DzqhGqYdsSkhS0kZMwte4Hjs65dZzCw9lANxIqYi1DJ639WNPYihp/DCJCos7o+/EeSPJaio5sgWDyUnMGkY1atsJZ+m7pj7DD5tvQ==",Kt=t=>t();function Ft(t){return St.isInstance(t)?t.role:t.type}function Ht(t){switch(t){case"supervisor":case"ai":case"model":return"model";case"system":return"system";case"human":return"user";case"tool":case"function":return"function";default:throw new Error(`Unknown / unsupported author: ${t}`)}}function $t(t){if("mimeType"in t&&"data"in t)return{inlineData:{mimeType:t.mimeType,data:t.data}};if("mimeType"in t&&"fileUri"in t)return{fileData:{mimeType:t.mimeType,fileUri:t.fileUri}};throw new Error("Invalid media content")}function Yt(t,e){return e.map(n=>lt(n)?n.tool_calls??[]:[]).flat().find(n=>n.id===t.tool_call_id)?.name}function Bt(t){return{providerName:"Google Gemini",fromStandardTextBlock(e){return{text:e.text}},fromStandardImageBlock(e){if(!t)throw new Error("This model does not support images");if(e.source_type==="url"){const n=k({dataUrl:e.url});return n?{inlineData:{mimeType:n.mime_type,data:n.data}}:{fileData:{mimeType:e.mime_type??"",fileUri:e.url}}}if(e.source_type==="base64")return{inlineData:{mimeType:e.mime_type??"",data:e.data}};throw new Error(`Unsupported source type: ${e.source_type}`)},fromStandardAudioBlock(e){if(!t)throw new Error("This model does not support audio");if(e.source_type==="url"){const n=k({dataUrl:e.url});return n?{inlineData:{mimeType:n.mime_type,data:n.data}}:{fileData:{mimeType:e.mime_type??"",fileUri:e.url}}}if(e.source_type==="base64")return{inlineData:{mimeType:e.mime_type??"",data:e.data}};throw new Error(`Unsupported source type: ${e.source_type}`)},fromStandardFileBlock(e){if(!t)throw new Error("This model does not support files");if(e.source_type==="text")return{text:e.text};if(e.source_type==="url"){const n=k({dataUrl:e.url});return n?{inlineData:{mimeType:n.mime_type,data:n.data}}:{fileData:{mimeType:e.mime_type??"",fileUri:e.url}}}if(e.source_type==="base64")return{inlineData:{mimeType:e.mime_type??"",data:e.data}};throw new Error(`Unsupported source type: ${e.source_type}`)}}}function P(t,e){if(Rt(t))return xt(t,Bt(e));if(t.type==="text")return{text:t.text};if(t.type==="executableCode")return{executableCode:t.executableCode};if(t.type==="codeExecutionResult")return{codeExecutionResult:t.codeExecutionResult};if(t.type==="image_url"){if(!e)throw new Error("This model does not support images");let n;if(typeof t.image_url=="string")n=t.image_url;else if(typeof t.image_url=="object"&&"url"in t.image_url)n=t.image_url.url;else throw new Error("Please provide image as base64 encoded data URL");const[s,i]=n.split(",");if(!s.startsWith("data:"))throw new Error("Please provide image as base64 encoded data URL");const[o,a]=s.replace(/^data:/,"").split(";");if(a!=="base64")throw new Error("Please provide image as base64 encoded data URL");return{inlineData:{data:i,mimeType:o}}}else{if(t.type==="media")return $t(t);if(t.type==="tool_use")return{functionCall:{name:t.name,args:t.input}};if(t.type==="tool_call")return{functionCall:{name:t.name,args:t.args}};if(t.type?.includes("/")&&t.type.split("/").length===2&&"data"in t&&typeof t.data=="string")return{inlineData:{mimeType:t.type,data:t.data}};if("functionCall"in t)return;throw"type"in t?new Error(`Unknown content type ${t.type}`):new Error(`Unknown content ${JSON.stringify(t)}`)}}function qt(t,e,n,s){if(At(t)){const u=t.name??Yt(t,n);if(u===void 0)throw new Error(`Google requires a tool name for each tool call response, and we could not infer a called tool name for ToolMessage "${t.id}" from your passed messages. Please populate a "name" field on that ToolMessage explicitly.`);const d=Array.isArray(t.content)?t.content.map(p=>P(p,e)).filter(p=>p!==void 0):t.content;return t.status==="error"?[{functionResponse:{name:u,response:{error:{details:d}}}}]:[{functionResponse:{name:u,response:{result:d}}}]}let i=[];const o=[];typeof t.content=="string"&&t.content&&o.push({text:t.content}),Array.isArray(t.content)&&o.push(...t.content.map(u=>P(u,e)).filter(u=>u!==void 0));const a=t.additional_kwargs?.[D];return lt(t)&&t.tool_calls?.length&&(i=t.tool_calls.map(u=>{const d=Kt(()=>{if(u.id){const p=a?.[u.id];if(p)return p}return s?.includes("gemini-3")?jt:""});return{functionCall:{name:u.name,args:u.args},...d?{thoughtSignature:d}:{}}})),[...o,...i]}function j(t,e,n=!1,s){return t.reduce((i,o,a)=>{if(!_t(o))throw new Error("Unsupported message input");const u=Ft(o);if(u==="system"&&a!==0)throw new Error("System message should be the first one");const d=Ht(u),p=i.content[i.content.length];if(!i.mergeWithPreviousContent&&p&&p.role===d)throw new Error("Google Generative AI requires alternate messages between authors");const l=qt(o,e,t.slice(0,a),s);if(i.mergeWithPreviousContent){const f=i.content[i.content.length-1];if(!f)throw new Error("There was a problem parsing your system message. Please try a prompt without one.");return f.parts.push(...l),{mergeWithPreviousContent:!1,content:i.content}}let r=d;(r==="function"||r==="system"&&!n)&&(r="user");const c={role:r,parts:l};return{mergeWithPreviousContent:u==="system"&&!n,content:[...i.content,c]}},{content:[],mergeWithPreviousContent:!1}).content}function Vt(t,e){if(!t.candidates||t.candidates.length===0||!t.candidates[0])return{generations:[],llmOutput:{filters:t.promptFeedback}};const[n]=t.candidates,{content:s,...i}=n,o=s.parts?.reduce((l,r)=>("functionCall"in r&&r.functionCall&&l.push({...r,id:"id"in r.functionCall&&typeof r.functionCall.id=="string"?r.functionCall.id:dt()}),l),[]);let a;const u=s?.parts;Array.isArray(u)&&u.length===1&&"text"in u[0]&&u[0].text&&!u[0].thought?a=u[0].text:Array.isArray(u)&&u.length>0?a=u.map(l=>l.thought&&"text"in l&&l.text?{type:"thinking",thinking:l.text,...l.thoughtSignature?{signature:l.thoughtSignature}:{}}:"text"in l?{type:"text",text:l.text}:"inlineData"in l?{type:"inlineData",inlineData:l.inlineData}:"functionCall"in l?{type:"functionCall",functionCall:l.functionCall}:"functionResponse"in l?{type:"functionResponse",functionResponse:l.functionResponse}:"fileData"in l?{type:"fileData",fileData:l.fileData}:"executableCode"in l?{type:"executableCode",executableCode:l.executableCode}:"codeExecutionResult"in l?{type:"codeExecutionResult",codeExecutionResult:l.codeExecutionResult}:l):a=[];const d=o?.reduce((l,r)=>("thoughtSignature"in r&&typeof r.thoughtSignature=="string"&&(l[r.id]=r.thoughtSignature),l),{});let p="";return typeof a=="string"?p=a:Array.isArray(a)&&a.length>0&&(p=a.find(l=>"text"in l)?.text??p),{generations:[{text:p,message:new Et({content:a??"",tool_calls:o?.map(l=>({type:"tool_call",id:l.id,name:l.functionCall.name,args:l.functionCall.args})),additional_kwargs:{...i,[D]:d},usage_metadata:e?.usageMetadata}),generationInfo:i}],llmOutput:{tokenUsage:{promptTokens:e?.usageMetadata?.input_tokens,completionTokens:e?.usageMetadata?.output_tokens,totalTokens:e?.usageMetadata?.total_tokens}}}}function Wt(t,e){if(!t.candidates||t.candidates.length===0)return null;const[n]=t.candidates,{content:s,...i}=n,o=s.parts?.reduce((r,c)=>("functionCall"in c&&c.functionCall&&r.push({...c,id:"id"in c.functionCall&&typeof c.functionCall.id=="string"?c.functionCall.id:dt()}),r),[]);let a;const u=s?.parts;Array.isArray(u)&&u.every(r=>"text"in r&&!r.thought)?a=u.map(r=>r.text).join(""):Array.isArray(u)?a=u.map(r=>r.thought&&"text"in r&&r.text?{type:"thinking",thinking:r.text,...r.thoughtSignature?{signature:r.thoughtSignature}:{}}:"text"in r?{type:"text",text:r.text}:"inlineData"in r?{type:"inlineData",inlineData:r.inlineData}:"functionCall"in r?{type:"functionCall",functionCall:r.functionCall}:"functionResponse"in r?{type:"functionResponse",functionResponse:r.functionResponse}:"fileData"in r?{type:"fileData",fileData:r.fileData}:"executableCode"in r?{type:"executableCode",executableCode:r.executableCode}:"codeExecutionResult"in r?{type:"codeExecutionResult",codeExecutionResult:r.codeExecutionResult}:r):a=[];let d="";a&&typeof a=="string"?d=a:Array.isArray(a)&&(d=a.find(r=>"text"in r)?.text??"");const p=[];o&&p.push(...o.map(r=>({type:"tool_call_chunk",id:r.id,name:r.functionCall.name,args:JSON.stringify(r.functionCall.args)})));const l=o?.reduce((r,c)=>("thoughtSignature"in c&&typeof c.thoughtSignature=="string"&&(r[c.id]=c.thoughtSignature),r),{});return new Tt({text:d,message:new wt({content:a||"",name:s?s.role:void 0,tool_call_chunks:p,additional_kwargs:{[D]:l},response_metadata:{model_provider:"google-genai"},usage_metadata:e.usageMetadata}),generationInfo:i})}function Jt(t){return t.every(e=>"functionDeclarations"in e&&Array.isArray(e.functionDeclarations))?t:[{functionDeclarations:t.map(e=>{if(at(e)){const n=N(e.schema);return n.type==="object"&&"properties"in n&&Object.keys(n.properties).length===0?{name:e.name,description:e.description}:(E(n,e.name),{name:e.name,description:e.description,parameters:n})}if(rt(e)){const n=Dt(e.function.parameters);return E(n,e.function.name),{name:e.function.name,description:e.function.description??"A function available to call.",parameters:n}}return e})}]}function K(t,e){const n={input_tokens:t?.promptTokenCount??0,output_tokens:t?.candidatesTokenCount??0,total_tokens:t?.totalTokenCount??0};if(t?.cachedContentTokenCount&&(n.input_token_details??={},n.input_token_details.cache_read=t.cachedContentTokenCount),e==="gemini-3-pro-preview"){const s=Math.max(0,t?.promptTokenCount??-2e5),i=Math.max(0,t?.cachedContentTokenCount??-2e5);s&&(n.input_token_details={...n.input_token_details,over_200k:s}),i&&(n.input_token_details={...n.input_token_details,cache_read_over_200k:i})}return n}var F=class extends Ct{static lc_name(){return"GoogleGenerativeAIToolsOutputParser"}lc_namespace=["langchain","google_genai","output_parsers"];returnId=!1;keyName;returnSingle=!1;zodSchema;constructor(t){super(t),this.keyName=t.keyName,this.returnSingle=t.returnSingle??this.returnSingle,this.zodSchema=t.zodSchema}async _validateResult(t){if(this.zodSchema===void 0)return t;const e=await kt(this.zodSchema,t);if(e.success)return e.data;throw new Ot(`Failed to parse. Text: "${JSON.stringify(t,null,2)}". Error: ${JSON.stringify(e.error.issues)}`,JSON.stringify(t,null,2))}async parseResult(t){const e=t.flatMap(s=>{const{message:i}=s;return!("tool_calls"in i)||!Array.isArray(i.tool_calls)?[]:i.tool_calls});if(e[0]===void 0)throw new Error("No parseable tool calls provided to GoogleGenerativeAIToolsOutputParser.");const[n]=e;return await this._validateResult(n.args)}},H;(function(t){t.STRING="string",t.NUMBER="number",t.INTEGER="integer",t.BOOLEAN="boolean",t.ARRAY="array",t.OBJECT="object"})(H||(H={}));var $;(function(t){t.LANGUAGE_UNSPECIFIED="language_unspecified",t.PYTHON="python"})($||($={}));var Y;(function(t){t.OUTCOME_UNSPECIFIED="outcome_unspecified",t.OUTCOME_OK="outcome_ok",t.OUTCOME_FAILED="outcome_failed",t.OUTCOME_DEADLINE_EXCEEDED="outcome_deadline_exceeded"})(Y||(Y={}));const B=["user","model","function","system"];var q;(function(t){t.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",t.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",t.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",t.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",t.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY"})(q||(q={}));var V;(function(t){t.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE"})(V||(V={}));var W;(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(W||(W={}));var J;(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER"})(J||(J={}));var w;(function(t){t.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.LANGUAGE="LANGUAGE",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.OTHER="OTHER"})(w||(w={}));var z;(function(t){t.TASK_TYPE_UNSPECIFIED="TASK_TYPE_UNSPECIFIED",t.RETRIEVAL_QUERY="RETRIEVAL_QUERY",t.RETRIEVAL_DOCUMENT="RETRIEVAL_DOCUMENT",t.SEMANTIC_SIMILARITY="SEMANTIC_SIMILARITY",t.CLASSIFICATION="CLASSIFICATION",t.CLUSTERING="CLUSTERING"})(z||(z={}));var T;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE"})(T||(T={}));var Q;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(Q||(Q={}));class m extends Error{constructor(e){super(`[GoogleGenerativeAI Error]: ${e}`)}}class _ extends m{constructor(e,n){super(e),this.response=n}}class ft extends m{constructor(e,n,s,i){super(e),this.status=n,this.statusText=s,this.errorDetails=i}}class y extends m{}class pt extends m{}const zt="https://generativelanguage.googleapis.com",Qt="v1beta",Zt="0.24.1",Xt="genai-js";var v;(function(t){t.GENERATE_CONTENT="generateContent",t.STREAM_GENERATE_CONTENT="streamGenerateContent",t.COUNT_TOKENS="countTokens",t.EMBED_CONTENT="embedContent",t.BATCH_EMBED_CONTENTS="batchEmbedContents"})(v||(v={}));class te{constructor(e,n,s,i,o){this.model=e,this.task=n,this.apiKey=s,this.stream=i,this.requestOptions=o}toString(){var e,n;const s=((e=this.requestOptions)===null||e===void 0?void 0:e.apiVersion)||Qt;let o=`${((n=this.requestOptions)===null||n===void 0?void 0:n.baseUrl)||zt}/${s}/${this.model}:${this.task}`;return this.stream&&(o+="?alt=sse"),o}}function ee(t){const e=[];return t?.apiClient&&e.push(t.apiClient),e.push(`${Xt}/${Zt}`),e.join(" ")}async function ne(t){var e;const n=new Headers;n.append("Content-Type","application/json"),n.append("x-goog-api-client",ee(t.requestOptions)),n.append("x-goog-api-key",t.apiKey);let s=(e=t.requestOptions)===null||e===void 0?void 0:e.customHeaders;if(s){if(!(s instanceof Headers))try{s=new Headers(s)}catch(i){throw new y(`unable to convert customHeaders value ${JSON.stringify(s)} to Headers: ${i.message}`)}for(const[i,o]of s.entries()){if(i==="x-goog-api-key")throw new y(`Cannot set reserved header name ${i}`);if(i==="x-goog-api-client")throw new y(`Header name ${i} can only be set using the apiClient field`);n.append(i,o)}}return n}async function se(t,e,n,s,i,o){const a=new te(t,e,n,s,o);return{url:a.toString(),fetchOptions:Object.assign(Object.assign({},re(o)),{method:"POST",headers:await ne(a),body:i})}}async function R(t,e,n,s,i,o={},a=fetch){const{url:u,fetchOptions:d}=await se(t,e,n,s,i,o);return ie(u,d,a)}async function ie(t,e,n=fetch){let s;try{s=await n(t,e)}catch(i){oe(i,t)}return s.ok||await ae(s,t),s}function oe(t,e){let n=t;throw n.name==="AbortError"?(n=new pt(`Request aborted when fetching ${e.toString()}: ${t.message}`),n.stack=t.stack):t instanceof ft||t instanceof y||(n=new m(`Error fetching from ${e.toString()}: ${t.message}`),n.stack=t.stack),n}async function ae(t,e){let n="",s;try{const i=await t.json();n=i.error.message,i.error.details&&(n+=` ${JSON.stringify(i.error.details)}`,s=i.error.details)}catch{}throw new ft(`Error fetching from ${e.toString()}: [${t.status} ${t.statusText}] ${n}`,t.status,t.statusText,s)}function re(t){const e={};if(t?.signal!==void 0||t?.timeout>=0){const n=new AbortController;t?.timeout>=0&&setTimeout(()=>n.abort(),t.timeout),t?.signal&&t.signal.addEventListener("abort",()=>{n.abort()}),e.signal=n.signal}return e}function G(t){return t.text=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`),x(t.candidates[0]))throw new _(`${O(t)}`,t);return ue(t)}else if(t.promptFeedback)throw new _(`Text not available. ${O(t)}`,t);return""},t.functionCall=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),x(t.candidates[0]))throw new _(`${O(t)}`,t);return console.warn("response.functionCall() is deprecated. Use response.functionCalls() instead."),Z(t)[0]}else if(t.promptFeedback)throw new _(`Function call not available. ${O(t)}`,t)},t.functionCalls=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),x(t.candidates[0]))throw new _(`${O(t)}`,t);return Z(t)}else if(t.promptFeedback)throw new _(`Function call not available. ${O(t)}`,t)},t}function ue(t){var e,n,s,i;const o=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(const a of(i=(s=t.candidates)===null||s===void 0?void 0:s[0].content)===null||i===void 0?void 0:i.parts)a.text&&o.push(a.text),a.executableCode&&o.push("\n```"+a.executableCode.language+`
|
|
1
|
+
import{c as at,f as rt,g as Ct,O as Ot,h as yt,J as It,R as U}from"./index-Df6PS_lJ.js";import{b as ut,Q as vt,S as _t,U as Et,V as Tt,W as wt,X as St,Y as At,y as lt,Z as Rt,$ as xt,a0 as k,x as kt,a1 as ct,a2 as bt}from"./index-CeFusmJF.js";import{E as Nt,c as Mt}from"./embeddings-DgQZkbYX.js";function I(t){if(typeof t=="object"&&t!==null){const e={...t};"additionalProperties"in e&&delete e.additionalProperties,"$schema"in e&&delete e.$schema,"strict"in e&&delete e.strict;for(const n in e)n in e&&(Array.isArray(e[n])?e[n]=e[n].map(I):typeof e[n]=="object"&&e[n]!==null&&(e[n]=I(e[n])));return e}return t}function N(t){const{$schema:e,...n}=I(ut(t)?vt(t):t);return n}function Dt(t){const{$schema:e,...n}=I(t);return n}function E(t,e,n=[]){if(t==null||typeof t!="object")return;const s=t;if(Array.isArray(s.enum)&&s.enum.some(i=>i==="")){const i=n.length?` at path "${n.join(".")}"`:"",o=e?` in tool "${e}"`:"";throw new Error(`Invalid enum: empty string not allowed${o}${i}. Gemini API rejects empty strings in enums.`)}if(s.type==="object"&&s.properties&&typeof s.properties=="object")for(const[i,o]of Object.entries(s.properties))E(o,e,[...n,i]);s.items&&E(s.items,e,[...n,"[]"]);for(const i of["anyOf","oneOf","allOf"]){const o=s[i];Array.isArray(o)&&o.forEach((a,u)=>E(a,e,[...n,`${i}[${u}]`]))}s.additionalProperties&&typeof s.additionalProperties=="object"&&E(s.additionalProperties,e,[...n,"additionalProperties"])}const h=[];for(let t=0;t<256;++t)h.push((t+256).toString(16).slice(1));function Gt(t,e=0){return(h[t[e+0]]+h[t[e+1]]+h[t[e+2]]+h[t[e+3]]+"-"+h[t[e+4]]+h[t[e+5]]+"-"+h[t[e+6]]+h[t[e+7]]+"-"+h[t[e+8]]+h[t[e+9]]+"-"+h[t[e+10]]+h[t[e+11]]+h[t[e+12]]+h[t[e+13]]+h[t[e+14]]+h[t[e+15]]).toLowerCase()}let b;const Ut=new Uint8Array(16);function Lt(){if(!b){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");b=crypto.getRandomValues.bind(crypto)}return b(Ut)}const Pt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),L={randomUUID:Pt};function dt(t,e,n){if(L.randomUUID&&!t)return L.randomUUID();t=t||{};const s=t.random??t.rng?.()??Lt();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Gt(s)}const D="__gemini_function_call_thought_signatures__",jt="ErYCCrMCAdHtim9kOoOkrPiCNVsmlpMIKd7ZMxgiFbVQOkgp7nlLcDMzVsZwIzvuT7nQROivoXA72ccC2lSDvR0Gh7dkWaGuj7ctv6t7ZceHnecx0QYa+ix8tYpRfjhyWozQ49lWiws6+YGjCt10KRTyWsZ2h6O7iHTYJwKIRwGUHRKy/qK/6kFxJm5ML00gLq4D8s5Z6DBpp2ZlR+uF4G8jJgeWQgyHWVdx2wGYElaceVAc66tZdPQRdOHpWtgYSI1YdaXgVI8KHY3/EfNc2YqqMIulvkDBAnuMhkAjV9xmBa54Tq+ih3Im4+r3DzqhGqYdsSkhS0kZMwte4Hjs65dZzCw9lANxIqYi1DJ639WNPYihp/DCJCos7o+/EeSPJaio5sgWDyUnMGkY1atsJZ+m7pj7DD5tvQ==",Kt=t=>t();function Ft(t){return St.isInstance(t)?t.role:t.type}function Ht(t){switch(t){case"supervisor":case"ai":case"model":return"model";case"system":return"system";case"human":return"user";case"tool":case"function":return"function";default:throw new Error(`Unknown / unsupported author: ${t}`)}}function $t(t){if("mimeType"in t&&"data"in t)return{inlineData:{mimeType:t.mimeType,data:t.data}};if("mimeType"in t&&"fileUri"in t)return{fileData:{mimeType:t.mimeType,fileUri:t.fileUri}};throw new Error("Invalid media content")}function Yt(t,e){return e.map(n=>lt(n)?n.tool_calls??[]:[]).flat().find(n=>n.id===t.tool_call_id)?.name}function Bt(t){return{providerName:"Google Gemini",fromStandardTextBlock(e){return{text:e.text}},fromStandardImageBlock(e){if(!t)throw new Error("This model does not support images");if(e.source_type==="url"){const n=k({dataUrl:e.url});return n?{inlineData:{mimeType:n.mime_type,data:n.data}}:{fileData:{mimeType:e.mime_type??"",fileUri:e.url}}}if(e.source_type==="base64")return{inlineData:{mimeType:e.mime_type??"",data:e.data}};throw new Error(`Unsupported source type: ${e.source_type}`)},fromStandardAudioBlock(e){if(!t)throw new Error("This model does not support audio");if(e.source_type==="url"){const n=k({dataUrl:e.url});return n?{inlineData:{mimeType:n.mime_type,data:n.data}}:{fileData:{mimeType:e.mime_type??"",fileUri:e.url}}}if(e.source_type==="base64")return{inlineData:{mimeType:e.mime_type??"",data:e.data}};throw new Error(`Unsupported source type: ${e.source_type}`)},fromStandardFileBlock(e){if(!t)throw new Error("This model does not support files");if(e.source_type==="text")return{text:e.text};if(e.source_type==="url"){const n=k({dataUrl:e.url});return n?{inlineData:{mimeType:n.mime_type,data:n.data}}:{fileData:{mimeType:e.mime_type??"",fileUri:e.url}}}if(e.source_type==="base64")return{inlineData:{mimeType:e.mime_type??"",data:e.data}};throw new Error(`Unsupported source type: ${e.source_type}`)}}}function P(t,e){if(Rt(t))return xt(t,Bt(e));if(t.type==="text")return{text:t.text};if(t.type==="executableCode")return{executableCode:t.executableCode};if(t.type==="codeExecutionResult")return{codeExecutionResult:t.codeExecutionResult};if(t.type==="image_url"){if(!e)throw new Error("This model does not support images");let n;if(typeof t.image_url=="string")n=t.image_url;else if(typeof t.image_url=="object"&&"url"in t.image_url)n=t.image_url.url;else throw new Error("Please provide image as base64 encoded data URL");const[s,i]=n.split(",");if(!s.startsWith("data:"))throw new Error("Please provide image as base64 encoded data URL");const[o,a]=s.replace(/^data:/,"").split(";");if(a!=="base64")throw new Error("Please provide image as base64 encoded data URL");return{inlineData:{data:i,mimeType:o}}}else{if(t.type==="media")return $t(t);if(t.type==="tool_use")return{functionCall:{name:t.name,args:t.input}};if(t.type==="tool_call")return{functionCall:{name:t.name,args:t.args}};if(t.type?.includes("/")&&t.type.split("/").length===2&&"data"in t&&typeof t.data=="string")return{inlineData:{mimeType:t.type,data:t.data}};if("functionCall"in t)return;throw"type"in t?new Error(`Unknown content type ${t.type}`):new Error(`Unknown content ${JSON.stringify(t)}`)}}function qt(t,e,n,s){if(At(t)){const u=t.name??Yt(t,n);if(u===void 0)throw new Error(`Google requires a tool name for each tool call response, and we could not infer a called tool name for ToolMessage "${t.id}" from your passed messages. Please populate a "name" field on that ToolMessage explicitly.`);const d=Array.isArray(t.content)?t.content.map(p=>P(p,e)).filter(p=>p!==void 0):t.content;return t.status==="error"?[{functionResponse:{name:u,response:{error:{details:d}}}}]:[{functionResponse:{name:u,response:{result:d}}}]}let i=[];const o=[];typeof t.content=="string"&&t.content&&o.push({text:t.content}),Array.isArray(t.content)&&o.push(...t.content.map(u=>P(u,e)).filter(u=>u!==void 0));const a=t.additional_kwargs?.[D];return lt(t)&&t.tool_calls?.length&&(i=t.tool_calls.map(u=>{const d=Kt(()=>{if(u.id){const p=a?.[u.id];if(p)return p}return s?.includes("gemini-3")?jt:""});return{functionCall:{name:u.name,args:u.args},...d?{thoughtSignature:d}:{}}})),[...o,...i]}function j(t,e,n=!1,s){return t.reduce((i,o,a)=>{if(!_t(o))throw new Error("Unsupported message input");const u=Ft(o);if(u==="system"&&a!==0)throw new Error("System message should be the first one");const d=Ht(u),p=i.content[i.content.length];if(!i.mergeWithPreviousContent&&p&&p.role===d)throw new Error("Google Generative AI requires alternate messages between authors");const l=qt(o,e,t.slice(0,a),s);if(i.mergeWithPreviousContent){const f=i.content[i.content.length-1];if(!f)throw new Error("There was a problem parsing your system message. Please try a prompt without one.");return f.parts.push(...l),{mergeWithPreviousContent:!1,content:i.content}}let r=d;(r==="function"||r==="system"&&!n)&&(r="user");const c={role:r,parts:l};return{mergeWithPreviousContent:u==="system"&&!n,content:[...i.content,c]}},{content:[],mergeWithPreviousContent:!1}).content}function Vt(t,e){if(!t.candidates||t.candidates.length===0||!t.candidates[0])return{generations:[],llmOutput:{filters:t.promptFeedback}};const[n]=t.candidates,{content:s,...i}=n,o=s.parts?.reduce((l,r)=>("functionCall"in r&&r.functionCall&&l.push({...r,id:"id"in r.functionCall&&typeof r.functionCall.id=="string"?r.functionCall.id:dt()}),l),[]);let a;const u=s?.parts;Array.isArray(u)&&u.length===1&&"text"in u[0]&&u[0].text&&!u[0].thought?a=u[0].text:Array.isArray(u)&&u.length>0?a=u.map(l=>l.thought&&"text"in l&&l.text?{type:"thinking",thinking:l.text,...l.thoughtSignature?{signature:l.thoughtSignature}:{}}:"text"in l?{type:"text",text:l.text}:"inlineData"in l?{type:"inlineData",inlineData:l.inlineData}:"functionCall"in l?{type:"functionCall",functionCall:l.functionCall}:"functionResponse"in l?{type:"functionResponse",functionResponse:l.functionResponse}:"fileData"in l?{type:"fileData",fileData:l.fileData}:"executableCode"in l?{type:"executableCode",executableCode:l.executableCode}:"codeExecutionResult"in l?{type:"codeExecutionResult",codeExecutionResult:l.codeExecutionResult}:l):a=[];const d=o?.reduce((l,r)=>("thoughtSignature"in r&&typeof r.thoughtSignature=="string"&&(l[r.id]=r.thoughtSignature),l),{});let p="";return typeof a=="string"?p=a:Array.isArray(a)&&a.length>0&&(p=a.find(l=>"text"in l)?.text??p),{generations:[{text:p,message:new Et({content:a??"",tool_calls:o?.map(l=>({type:"tool_call",id:l.id,name:l.functionCall.name,args:l.functionCall.args})),additional_kwargs:{...i,[D]:d},usage_metadata:e?.usageMetadata}),generationInfo:i}],llmOutput:{tokenUsage:{promptTokens:e?.usageMetadata?.input_tokens,completionTokens:e?.usageMetadata?.output_tokens,totalTokens:e?.usageMetadata?.total_tokens}}}}function Wt(t,e){if(!t.candidates||t.candidates.length===0)return null;const[n]=t.candidates,{content:s,...i}=n,o=s.parts?.reduce((r,c)=>("functionCall"in c&&c.functionCall&&r.push({...c,id:"id"in c.functionCall&&typeof c.functionCall.id=="string"?c.functionCall.id:dt()}),r),[]);let a;const u=s?.parts;Array.isArray(u)&&u.every(r=>"text"in r&&!r.thought)?a=u.map(r=>r.text).join(""):Array.isArray(u)?a=u.map(r=>r.thought&&"text"in r&&r.text?{type:"thinking",thinking:r.text,...r.thoughtSignature?{signature:r.thoughtSignature}:{}}:"text"in r?{type:"text",text:r.text}:"inlineData"in r?{type:"inlineData",inlineData:r.inlineData}:"functionCall"in r?{type:"functionCall",functionCall:r.functionCall}:"functionResponse"in r?{type:"functionResponse",functionResponse:r.functionResponse}:"fileData"in r?{type:"fileData",fileData:r.fileData}:"executableCode"in r?{type:"executableCode",executableCode:r.executableCode}:"codeExecutionResult"in r?{type:"codeExecutionResult",codeExecutionResult:r.codeExecutionResult}:r):a=[];let d="";a&&typeof a=="string"?d=a:Array.isArray(a)&&(d=a.find(r=>"text"in r)?.text??"");const p=[];o&&p.push(...o.map(r=>({type:"tool_call_chunk",id:r.id,name:r.functionCall.name,args:JSON.stringify(r.functionCall.args)})));const l=o?.reduce((r,c)=>("thoughtSignature"in c&&typeof c.thoughtSignature=="string"&&(r[c.id]=c.thoughtSignature),r),{});return new Tt({text:d,message:new wt({content:a||"",name:s?s.role:void 0,tool_call_chunks:p,additional_kwargs:{[D]:l},response_metadata:{model_provider:"google-genai"},usage_metadata:e.usageMetadata}),generationInfo:i})}function Jt(t){return t.every(e=>"functionDeclarations"in e&&Array.isArray(e.functionDeclarations))?t:[{functionDeclarations:t.map(e=>{if(at(e)){const n=N(e.schema);return n.type==="object"&&"properties"in n&&Object.keys(n.properties).length===0?{name:e.name,description:e.description}:(E(n,e.name),{name:e.name,description:e.description,parameters:n})}if(rt(e)){const n=Dt(e.function.parameters);return E(n,e.function.name),{name:e.function.name,description:e.function.description??"A function available to call.",parameters:n}}return e})}]}function K(t,e){const n={input_tokens:t?.promptTokenCount??0,output_tokens:t?.candidatesTokenCount??0,total_tokens:t?.totalTokenCount??0};if(t?.cachedContentTokenCount&&(n.input_token_details??={},n.input_token_details.cache_read=t.cachedContentTokenCount),e==="gemini-3-pro-preview"){const s=Math.max(0,t?.promptTokenCount??-2e5),i=Math.max(0,t?.cachedContentTokenCount??-2e5);s&&(n.input_token_details={...n.input_token_details,over_200k:s}),i&&(n.input_token_details={...n.input_token_details,cache_read_over_200k:i})}return n}var F=class extends Ct{static lc_name(){return"GoogleGenerativeAIToolsOutputParser"}lc_namespace=["langchain","google_genai","output_parsers"];returnId=!1;keyName;returnSingle=!1;zodSchema;constructor(t){super(t),this.keyName=t.keyName,this.returnSingle=t.returnSingle??this.returnSingle,this.zodSchema=t.zodSchema}async _validateResult(t){if(this.zodSchema===void 0)return t;const e=await kt(this.zodSchema,t);if(e.success)return e.data;throw new Ot(`Failed to parse. Text: "${JSON.stringify(t,null,2)}". Error: ${JSON.stringify(e.error.issues)}`,JSON.stringify(t,null,2))}async parseResult(t){const e=t.flatMap(s=>{const{message:i}=s;return!("tool_calls"in i)||!Array.isArray(i.tool_calls)?[]:i.tool_calls});if(e[0]===void 0)throw new Error("No parseable tool calls provided to GoogleGenerativeAIToolsOutputParser.");const[n]=e;return await this._validateResult(n.args)}},H;(function(t){t.STRING="string",t.NUMBER="number",t.INTEGER="integer",t.BOOLEAN="boolean",t.ARRAY="array",t.OBJECT="object"})(H||(H={}));var $;(function(t){t.LANGUAGE_UNSPECIFIED="language_unspecified",t.PYTHON="python"})($||($={}));var Y;(function(t){t.OUTCOME_UNSPECIFIED="outcome_unspecified",t.OUTCOME_OK="outcome_ok",t.OUTCOME_FAILED="outcome_failed",t.OUTCOME_DEADLINE_EXCEEDED="outcome_deadline_exceeded"})(Y||(Y={}));const B=["user","model","function","system"];var q;(function(t){t.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",t.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",t.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",t.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",t.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY"})(q||(q={}));var V;(function(t){t.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE"})(V||(V={}));var W;(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(W||(W={}));var J;(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER"})(J||(J={}));var w;(function(t){t.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.LANGUAGE="LANGUAGE",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.OTHER="OTHER"})(w||(w={}));var z;(function(t){t.TASK_TYPE_UNSPECIFIED="TASK_TYPE_UNSPECIFIED",t.RETRIEVAL_QUERY="RETRIEVAL_QUERY",t.RETRIEVAL_DOCUMENT="RETRIEVAL_DOCUMENT",t.SEMANTIC_SIMILARITY="SEMANTIC_SIMILARITY",t.CLASSIFICATION="CLASSIFICATION",t.CLUSTERING="CLUSTERING"})(z||(z={}));var T;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE"})(T||(T={}));var Q;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(Q||(Q={}));class m extends Error{constructor(e){super(`[GoogleGenerativeAI Error]: ${e}`)}}class _ extends m{constructor(e,n){super(e),this.response=n}}class ft extends m{constructor(e,n,s,i){super(e),this.status=n,this.statusText=s,this.errorDetails=i}}class y extends m{}class pt extends m{}const zt="https://generativelanguage.googleapis.com",Qt="v1beta",Zt="0.24.1",Xt="genai-js";var v;(function(t){t.GENERATE_CONTENT="generateContent",t.STREAM_GENERATE_CONTENT="streamGenerateContent",t.COUNT_TOKENS="countTokens",t.EMBED_CONTENT="embedContent",t.BATCH_EMBED_CONTENTS="batchEmbedContents"})(v||(v={}));class te{constructor(e,n,s,i,o){this.model=e,this.task=n,this.apiKey=s,this.stream=i,this.requestOptions=o}toString(){var e,n;const s=((e=this.requestOptions)===null||e===void 0?void 0:e.apiVersion)||Qt;let o=`${((n=this.requestOptions)===null||n===void 0?void 0:n.baseUrl)||zt}/${s}/${this.model}:${this.task}`;return this.stream&&(o+="?alt=sse"),o}}function ee(t){const e=[];return t?.apiClient&&e.push(t.apiClient),e.push(`${Xt}/${Zt}`),e.join(" ")}async function ne(t){var e;const n=new Headers;n.append("Content-Type","application/json"),n.append("x-goog-api-client",ee(t.requestOptions)),n.append("x-goog-api-key",t.apiKey);let s=(e=t.requestOptions)===null||e===void 0?void 0:e.customHeaders;if(s){if(!(s instanceof Headers))try{s=new Headers(s)}catch(i){throw new y(`unable to convert customHeaders value ${JSON.stringify(s)} to Headers: ${i.message}`)}for(const[i,o]of s.entries()){if(i==="x-goog-api-key")throw new y(`Cannot set reserved header name ${i}`);if(i==="x-goog-api-client")throw new y(`Header name ${i} can only be set using the apiClient field`);n.append(i,o)}}return n}async function se(t,e,n,s,i,o){const a=new te(t,e,n,s,o);return{url:a.toString(),fetchOptions:Object.assign(Object.assign({},re(o)),{method:"POST",headers:await ne(a),body:i})}}async function R(t,e,n,s,i,o={},a=fetch){const{url:u,fetchOptions:d}=await se(t,e,n,s,i,o);return ie(u,d,a)}async function ie(t,e,n=fetch){let s;try{s=await n(t,e)}catch(i){oe(i,t)}return s.ok||await ae(s,t),s}function oe(t,e){let n=t;throw n.name==="AbortError"?(n=new pt(`Request aborted when fetching ${e.toString()}: ${t.message}`),n.stack=t.stack):t instanceof ft||t instanceof y||(n=new m(`Error fetching from ${e.toString()}: ${t.message}`),n.stack=t.stack),n}async function ae(t,e){let n="",s;try{const i=await t.json();n=i.error.message,i.error.details&&(n+=` ${JSON.stringify(i.error.details)}`,s=i.error.details)}catch{}throw new ft(`Error fetching from ${e.toString()}: [${t.status} ${t.statusText}] ${n}`,t.status,t.statusText,s)}function re(t){const e={};if(t?.signal!==void 0||t?.timeout>=0){const n=new AbortController;t?.timeout>=0&&setTimeout(()=>n.abort(),t.timeout),t?.signal&&t.signal.addEventListener("abort",()=>{n.abort()}),e.signal=n.signal}return e}function G(t){return t.text=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`),x(t.candidates[0]))throw new _(`${O(t)}`,t);return ue(t)}else if(t.promptFeedback)throw new _(`Text not available. ${O(t)}`,t);return""},t.functionCall=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),x(t.candidates[0]))throw new _(`${O(t)}`,t);return console.warn("response.functionCall() is deprecated. Use response.functionCalls() instead."),Z(t)[0]}else if(t.promptFeedback)throw new _(`Function call not available. ${O(t)}`,t)},t.functionCalls=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),x(t.candidates[0]))throw new _(`${O(t)}`,t);return Z(t)}else if(t.promptFeedback)throw new _(`Function call not available. ${O(t)}`,t)},t}function ue(t){var e,n,s,i;const o=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(const a of(i=(s=t.candidates)===null||s===void 0?void 0:s[0].content)===null||i===void 0?void 0:i.parts)a.text&&o.push(a.text),a.executableCode&&o.push("\n```"+a.executableCode.language+`
|
|
2
2
|
`+a.executableCode.code+"\n```\n"),a.codeExecutionResult&&o.push("\n```\n"+a.codeExecutionResult.output+"\n```\n");return o.length>0?o.join(""):""}function Z(t){var e,n,s,i;const o=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(const a of(i=(s=t.candidates)===null||s===void 0?void 0:s[0].content)===null||i===void 0?void 0:i.parts)a.functionCall&&o.push(a.functionCall);if(o.length>0)return o}const le=[w.RECITATION,w.SAFETY,w.LANGUAGE];function x(t){return!!t.finishReason&&le.includes(t.finishReason)}function O(t){var e,n,s;let i="";if((!t.candidates||t.candidates.length===0)&&t.promptFeedback)i+="Response was blocked",!((e=t.promptFeedback)===null||e===void 0)&&e.blockReason&&(i+=` due to ${t.promptFeedback.blockReason}`),!((n=t.promptFeedback)===null||n===void 0)&&n.blockReasonMessage&&(i+=`: ${t.promptFeedback.blockReasonMessage}`);else if(!((s=t.candidates)===null||s===void 0)&&s[0]){const o=t.candidates[0];x(o)&&(i+=`Candidate was blocked due to ${o.finishReason}`,o.finishMessage&&(i+=`: ${o.finishMessage}`))}return i}function S(t){return this instanceof S?(this.v=t,this):new S(t)}function ce(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=n.apply(t,e||[]),i,o=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(c){s[c]&&(i[c]=function(f){return new Promise(function(g,C){o.push([c,f,g,C])>1||u(c,f)})})}function u(c,f){try{d(s[c](f))}catch(g){r(o[0][3],g)}}function d(c){c.value instanceof S?Promise.resolve(c.value.v).then(p,l):r(o[0][2],c)}function p(c){u("next",c)}function l(c){u("throw",c)}function r(c,f){c(f),o.shift(),o.length&&u(o[0][0],o[0][1])}}const X=/^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/;function de(t){const e=t.body.pipeThrough(new TextDecoderStream("utf8",{fatal:!0})),n=ge(e),[s,i]=n.tee();return{stream:pe(s),response:fe(i)}}async function fe(t){const e=[],n=t.getReader();for(;;){const{done:s,value:i}=await n.read();if(s)return G(he(e));e.push(i)}}function pe(t){return ce(this,arguments,function*(){const n=t.getReader();for(;;){const{value:s,done:i}=yield S(n.read());if(i)break;yield yield S(G(s))}})}function ge(t){const e=t.getReader();return new ReadableStream({start(s){let i="";return o();function o(){return e.read().then(({value:a,done:u})=>{if(u){if(i.trim()){s.error(new m("Failed to parse stream"));return}s.close();return}i+=a;let d=i.match(X),p;for(;d;){try{p=JSON.parse(d[1])}catch{s.error(new m(`Error parsing JSON response: "${d[1]}"`));return}s.enqueue(p),i=i.substring(d[0].length),d=i.match(X)}return o()}).catch(a=>{let u=a;throw u.stack=a.stack,u.name==="AbortError"?u=new pt("Request aborted when reading from the stream"):u=new m("Error reading from the stream"),u})}}})}function he(t){const e=t[t.length-1],n={promptFeedback:e?.promptFeedback};for(const s of t){if(s.candidates){let i=0;for(const o of s.candidates)if(n.candidates||(n.candidates=[]),n.candidates[i]||(n.candidates[i]={index:i}),n.candidates[i].citationMetadata=o.citationMetadata,n.candidates[i].groundingMetadata=o.groundingMetadata,n.candidates[i].finishReason=o.finishReason,n.candidates[i].finishMessage=o.finishMessage,n.candidates[i].safetyRatings=o.safetyRatings,o.content&&o.content.parts){n.candidates[i].content||(n.candidates[i].content={role:o.content.role||"user",parts:[]});const a={};for(const u of o.content.parts)u.text&&(a.text=u.text),u.functionCall&&(a.functionCall=u.functionCall),u.executableCode&&(a.executableCode=u.executableCode),u.codeExecutionResult&&(a.codeExecutionResult=u.codeExecutionResult),Object.keys(a).length===0&&(a.text=""),n.candidates[i].content.parts.push(a)}i++}s.usageMetadata&&(n.usageMetadata=s.usageMetadata)}return n}async function gt(t,e,n,s){const i=await R(e,v.STREAM_GENERATE_CONTENT,t,!0,JSON.stringify(n),s);return de(i)}async function ht(t,e,n,s){const o=await(await R(e,v.GENERATE_CONTENT,t,!1,JSON.stringify(n),s)).json();return{response:G(o)}}function mt(t){if(t!=null){if(typeof t=="string")return{role:"system",parts:[{text:t}]};if(t.text)return{role:"system",parts:[t]};if(t.parts)return t.role?t:{role:"system",parts:t.parts}}}function A(t){let e=[];if(typeof t=="string")e=[{text:t}];else for(const n of t)typeof n=="string"?e.push({text:n}):e.push(n);return me(e)}function me(t){const e={role:"user",parts:[]},n={role:"function",parts:[]};let s=!1,i=!1;for(const o of t)"functionResponse"in o?(n.parts.push(o),i=!0):(e.parts.push(o),s=!0);if(s&&i)throw new m("Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message.");if(!s&&!i)throw new m("No content is provided for sending chat message.");return s?e:n}function Ce(t,e){var n;let s={model:e?.model,generationConfig:e?.generationConfig,safetySettings:e?.safetySettings,tools:e?.tools,toolConfig:e?.toolConfig,systemInstruction:e?.systemInstruction,cachedContent:(n=e?.cachedContent)===null||n===void 0?void 0:n.name,contents:[]};const i=t.generateContentRequest!=null;if(t.contents){if(i)throw new y("CountTokensRequest must have one of contents or generateContentRequest, not both.");s.contents=t.contents}else if(i)s=Object.assign(Object.assign({},s),t.generateContentRequest);else{const o=A(t);s.contents=[o]}return{generateContentRequest:s}}function tt(t){let e;return t.contents?e=t:e={contents:[A(t)]},t.systemInstruction&&(e.systemInstruction=mt(t.systemInstruction)),e}function Oe(t){return typeof t=="string"||Array.isArray(t)?{content:A(t)}:t}const et=["text","inlineData","functionCall","functionResponse","executableCode","codeExecutionResult"],ye={user:["text","inlineData"],function:["functionResponse"],model:["text","functionCall","executableCode","codeExecutionResult"],system:["text"]};function Ie(t){let e=!1;for(const n of t){const{role:s,parts:i}=n;if(!e&&s!=="user")throw new m(`First content should be with role 'user', got ${s}`);if(!B.includes(s))throw new m(`Each item should include role field. Got ${s} but valid roles are: ${JSON.stringify(B)}`);if(!Array.isArray(i))throw new m("Content should have 'parts' property with an array of Parts");if(i.length===0)throw new m("Each Content should have at least one part");const o={text:0,inlineData:0,functionCall:0,functionResponse:0,fileData:0,executableCode:0,codeExecutionResult:0};for(const u of i)for(const d of et)d in u&&(o[d]+=1);const a=ye[s];for(const u of et)if(!a.includes(u)&&o[u]>0)throw new m(`Content with role '${s}' can't contain '${u}' part`);e=!0}}function nt(t){var e;if(t.candidates===void 0||t.candidates.length===0)return!1;const n=(e=t.candidates[0])===null||e===void 0?void 0:e.content;if(n===void 0||n.parts===void 0||n.parts.length===0)return!1;for(const s of n.parts)if(s===void 0||Object.keys(s).length===0||s.text!==void 0&&s.text==="")return!1;return!0}const st="SILENT_ERROR";class ve{constructor(e,n,s,i={}){this.model=n,this.params=s,this._requestOptions=i,this._history=[],this._sendPromise=Promise.resolve(),this._apiKey=e,s?.history&&(Ie(s.history),this._history=s.history)}async getHistory(){return await this._sendPromise,this._history}async sendMessage(e,n={}){var s,i,o,a,u,d;await this._sendPromise;const p=A(e),l={safetySettings:(s=this.params)===null||s===void 0?void 0:s.safetySettings,generationConfig:(i=this.params)===null||i===void 0?void 0:i.generationConfig,tools:(o=this.params)===null||o===void 0?void 0:o.tools,toolConfig:(a=this.params)===null||a===void 0?void 0:a.toolConfig,systemInstruction:(u=this.params)===null||u===void 0?void 0:u.systemInstruction,cachedContent:(d=this.params)===null||d===void 0?void 0:d.cachedContent,contents:[...this._history,p]},r=Object.assign(Object.assign({},this._requestOptions),n);let c;return this._sendPromise=this._sendPromise.then(()=>ht(this._apiKey,this.model,l,r)).then(f=>{var g;if(nt(f.response)){this._history.push(p);const C=Object.assign({parts:[],role:"model"},(g=f.response.candidates)===null||g===void 0?void 0:g[0].content);this._history.push(C)}else{const C=O(f.response);C&&console.warn(`sendMessage() was unsuccessful. ${C}. Inspect response object for details.`)}c=f}).catch(f=>{throw this._sendPromise=Promise.resolve(),f}),await this._sendPromise,c}async sendMessageStream(e,n={}){var s,i,o,a,u,d;await this._sendPromise;const p=A(e),l={safetySettings:(s=this.params)===null||s===void 0?void 0:s.safetySettings,generationConfig:(i=this.params)===null||i===void 0?void 0:i.generationConfig,tools:(o=this.params)===null||o===void 0?void 0:o.tools,toolConfig:(a=this.params)===null||a===void 0?void 0:a.toolConfig,systemInstruction:(u=this.params)===null||u===void 0?void 0:u.systemInstruction,cachedContent:(d=this.params)===null||d===void 0?void 0:d.cachedContent,contents:[...this._history,p]},r=Object.assign(Object.assign({},this._requestOptions),n),c=gt(this._apiKey,this.model,l,r);return this._sendPromise=this._sendPromise.then(()=>c).catch(f=>{throw new Error(st)}).then(f=>f.response).then(f=>{if(nt(f)){this._history.push(p);const g=Object.assign({},f.candidates[0].content);g.role||(g.role="model"),this._history.push(g)}else{const g=O(f);g&&console.warn(`sendMessageStream() was unsuccessful. ${g}. Inspect response object for details.`)}}).catch(f=>{f.message!==st&&console.error(f)}),c}}async function _e(t,e,n,s){return(await R(e,v.COUNT_TOKENS,t,!1,JSON.stringify(n),s)).json()}async function Ee(t,e,n,s){return(await R(e,v.EMBED_CONTENT,t,!1,JSON.stringify(n),s)).json()}async function Te(t,e,n,s){const i=n.requests.map(a=>Object.assign(Object.assign({},a),{model:e}));return(await R(e,v.BATCH_EMBED_CONTENTS,t,!1,JSON.stringify({requests:i}),s)).json()}class it{constructor(e,n,s={}){this.apiKey=e,this._requestOptions=s,n.model.includes("/")?this.model=n.model:this.model=`models/${n.model}`,this.generationConfig=n.generationConfig||{},this.safetySettings=n.safetySettings||[],this.tools=n.tools,this.toolConfig=n.toolConfig,this.systemInstruction=mt(n.systemInstruction),this.cachedContent=n.cachedContent}async generateContent(e,n={}){var s;const i=tt(e),o=Object.assign(Object.assign({},this._requestOptions),n);return ht(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(s=this.cachedContent)===null||s===void 0?void 0:s.name},i),o)}async generateContentStream(e,n={}){var s;const i=tt(e),o=Object.assign(Object.assign({},this._requestOptions),n);return gt(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(s=this.cachedContent)===null||s===void 0?void 0:s.name},i),o)}startChat(e){var n;return new ve(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(n=this.cachedContent)===null||n===void 0?void 0:n.name},e),this._requestOptions)}async countTokens(e,n={}){const s=Ce(e,{model:this.model,generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent}),i=Object.assign(Object.assign({},this._requestOptions),n);return _e(this.apiKey,this.model,s,i)}async embedContent(e,n={}){const s=Oe(e),i=Object.assign(Object.assign({},this._requestOptions),n);return Ee(this.apiKey,this.model,s,i)}async batchEmbedContents(e,n={}){const s=Object.assign(Object.assign({},this._requestOptions),n);return Te(this.apiKey,this.model,e,s)}}class M{constructor(e){this.apiKey=e}getGenerativeModel(e,n){if(!e.model)throw new m("Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })");return new it(this.apiKey,e,n)}getGenerativeModelFromCachedContent(e,n,s){if(!e.name)throw new y("Cached content must contain a `name` field.");if(!e.model)throw new y("Cached content must contain a `model` field.");const i=["model","systemInstruction"];for(const a of i)if(n?.[a]&&e[a]&&n?.[a]!==e[a]){if(a==="model"){const u=n.model.startsWith("models/")?n.model.replace("models/",""):n.model,d=e.model.startsWith("models/")?e.model.replace("models/",""):e.model;if(u===d)continue}throw new y(`Different value for "${a}" specified in modelParams (${n[a]}) and cachedContent (${e[a]})`)}const o=Object.assign(Object.assign({},n),{model:e.model,tools:e.tools,toolConfig:e.toolConfig,systemInstruction:e.systemInstruction,cachedContent:e});return new it(this.apiKey,o,s)}}function ot(t,e){const n=we(t);return{tools:n,toolConfig:Ae(n,e)}}function we(t){let e=[];const n=[];return t.forEach(s=>{if(at(s)){const[i]=Jt([s]);i.functionDeclarations&&e.push(...i.functionDeclarations)}else if(rt(s)){const{functionDeclarations:i}=Se(s);if(i)e.push(...i);else throw new Error("Failed to convert OpenAI structured tool to GenerativeAI tool")}else n.push(s)}),n.find(s=>"functionDeclarations"in s)?n.map(s=>{if(e?.length>0&&"functionDeclarations"in s){const i={functionDeclarations:[...s.functionDeclarations||[],...e]};return e=[],i}return s}):[...n,...e.length>0?[{functionDeclarations:e}]:[]]}function Se(t){return{functionDeclarations:[{name:t.function.name,description:t.function.description,parameters:I(t.function.parameters)}]}}function Ae(t,e){if(!t.length||!e)return;const{toolChoice:n,allowedFunctionNames:s}=e,i={any:T.ANY,auto:T.AUTO,none:T.NONE};if(n&&["any","auto","none"].includes(n))return{functionCallingConfig:{mode:i[n]??"MODE_UNSPECIFIED",allowedFunctionNames:s}};if(typeof n=="string"||s)return{functionCallingConfig:{mode:T.ANY,allowedFunctionNames:[...s??[],...n&&typeof n=="string"?[n]:[]]}}}const Re={"gemini-embedding-001":{maxInputTokens:2048,imageInputs:!1,audioInputs:!1,pdfInputs:!1,videoInputs:!1,maxOutputTokens:3072,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!1},"gemini-2.5-flash-lite-preview-09-2025":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-2.5-pro-preview-06-05":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-2.5-flash-preview-04-17":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!1},"gemini-2.5-flash-preview-09-2025":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-2.5-pro-preview-05-06":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-2.5-flash-preview-05-20":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-2.5-flash":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-live-2.5-flash":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!0,pdfInputs:!1,videoInputs:!0,maxOutputTokens:8e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!0,videoOutputs:!1,toolCalling:!0,structuredOutput:!1},"gemini-3-flash-preview":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-live-2.5-flash-preview-native-audio":{maxInputTokens:131072,imageInputs:!1,audioInputs:!0,pdfInputs:!1,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!0,videoOutputs:!1,toolCalling:!0,structuredOutput:!1},"gemini-2.5-flash-lite":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-2.5-flash-preview-tts":{maxInputTokens:8e3,imageInputs:!1,audioInputs:!1,pdfInputs:!1,videoInputs:!1,maxOutputTokens:16e3,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!0,videoOutputs:!1,toolCalling:!1,structuredOutput:!1},"gemini-flash-latest":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-2.5-flash-lite-preview-06-17":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!1},"gemini-2.5-flash-image":{maxInputTokens:32768,imageInputs:!0,audioInputs:!1,pdfInputs:!1,videoInputs:!1,maxOutputTokens:32768,reasoningOutput:!0,imageOutputs:!0,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!1},"gemini-2.5-pro-preview-tts":{maxInputTokens:8e3,imageInputs:!1,audioInputs:!1,pdfInputs:!1,videoInputs:!1,maxOutputTokens:16e3,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!0,videoOutputs:!1,toolCalling:!1,structuredOutput:!1},"gemini-2.5-flash-image-preview":{maxInputTokens:32768,imageInputs:!0,audioInputs:!1,pdfInputs:!1,videoInputs:!1,maxOutputTokens:32768,reasoningOutput:!0,imageOutputs:!0,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!1},"gemini-1.5-flash-8b":{maxInputTokens:1e6,imageInputs:!0,audioInputs:!0,pdfInputs:!1,videoInputs:!0,maxOutputTokens:8192,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!1},"gemini-3-pro-preview":{maxInputTokens:1e6,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:64e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-2.0-flash-lite":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:8192,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-1.5-flash":{maxInputTokens:1e6,imageInputs:!0,audioInputs:!0,pdfInputs:!1,videoInputs:!0,maxOutputTokens:8192,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!1},"gemini-flash-lite-latest":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-2.5-pro":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-2.0-flash":{maxInputTokens:1048576,imageInputs:!0,audioInputs:!0,pdfInputs:!0,videoInputs:!0,maxOutputTokens:8192,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0},"gemini-1.5-pro":{maxInputTokens:1e6,imageInputs:!0,audioInputs:!0,pdfInputs:!1,videoInputs:!0,maxOutputTokens:8192,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!1}};var Ne=class extends yt{static lc_name(){return"ChatGoogleGenerativeAI"}lc_serializable=!0;get lc_secrets(){return{apiKey:"GOOGLE_API_KEY"}}lc_namespace=["langchain","chat_models","google_genai"];get lc_aliases(){return{apiKey:"google_api_key"}}model;temperature;maxOutputTokens;topP;topK;stopSequences=[];safetySettings;apiKey;streaming=!1;json;streamUsage=!0;convertSystemMessageToHumanContent;thinkingConfig;client;get _isMultimodalModel(){return this.model.includes("vision")||this.model.startsWith("gemini-1.5")||this.model.startsWith("gemini-2")||this.model.startsWith("gemma-3-")&&!this.model.startsWith("gemma-3-1b")||this.model.startsWith("gemini-3")}constructor(t){if(super(t),this.model=t.model.replace(/^models\//,""),this.maxOutputTokens=t.maxOutputTokens??this.maxOutputTokens,this.maxOutputTokens&&this.maxOutputTokens<0)throw new Error("`maxOutputTokens` must be a positive integer");if(this.temperature=t.temperature??this.temperature,this.temperature&&(this.temperature<0||this.temperature>2))throw new Error("`temperature` must be in the range of [0.0,2.0]");if(this.topP=t.topP??this.topP,this.topP&&this.topP<0)throw new Error("`topP` must be a positive integer");if(this.topP&&this.topP>1)throw new Error("`topP` must be below 1.");if(this.topK=t.topK??this.topK,this.topK&&this.topK<0)throw new Error("`topK` must be a positive integer");if(this.stopSequences=t.stopSequences??this.stopSequences,this.apiKey=t.apiKey??ct("GOOGLE_API_KEY"),!this.apiKey)throw new Error("Please set an API key for Google GenerativeAI in the environment variable GOOGLE_API_KEY or in the `apiKey` field of the ChatGoogleGenerativeAI constructor");if(this.safetySettings=t.safetySettings??this.safetySettings,this.safetySettings&&this.safetySettings.length>0&&new Set(this.safetySettings.map(e=>e.category)).size!==this.safetySettings.length)throw new Error("The categories in `safetySettings` array must be unique");this.streaming=t.streaming??this.streaming,this.json=t.json,this.thinkingConfig=t.thinkingConfig??this.thinkingConfig,this.client=new M(this.apiKey).getGenerativeModel({model:this.model,safetySettings:this.safetySettings,generationConfig:{stopSequences:this.stopSequences,maxOutputTokens:this.maxOutputTokens,temperature:this.temperature,topP:this.topP,topK:this.topK,...this.json?{responseMimeType:"application/json"}:{},...this.thinkingConfig?{thinkingConfig:this.thinkingConfig}:{}}},{apiVersion:t.apiVersion,baseUrl:t.baseUrl,customHeaders:t.customHeaders}),this.streamUsage=t.streamUsage??this.streamUsage}useCachedContent(t,e,n){this.apiKey&&(this.client=new M(this.apiKey).getGenerativeModelFromCachedContent(t,e,n))}get useSystemInstruction(){return typeof this.convertSystemMessageToHumanContent=="boolean"?!this.convertSystemMessageToHumanContent:this.computeUseSystemInstruction}get computeUseSystemInstruction(){return this.model==="gemini-1.0-pro-001"||this.model.startsWith("gemini-pro-vision")||this.model.startsWith("gemini-1.0-pro-vision")?!1:this.model!=="gemini-pro"}getLsParams(t){return{ls_provider:"google_genai",ls_model_name:this.model,ls_model_type:"chat",ls_temperature:this.client.generationConfig.temperature,ls_max_tokens:this.client.generationConfig.maxOutputTokens,ls_stop:t.stop}}_combineLLMOutput(){return[]}_llmType(){return"googlegenerativeai"}bindTools(t,e){return this.withConfig({tools:ot(t)?.tools,...e})}invocationParams(t){const e=t?.tools?.length?ot(t.tools,{toolChoice:t.tool_choice,allowedFunctionNames:t.allowedFunctionNames}):void 0;return t?.responseSchema?(this.client.generationConfig.responseSchema=t.responseSchema,this.client.generationConfig.responseMimeType="application/json"):(this.client.generationConfig.responseSchema=void 0,this.client.generationConfig.responseMimeType=this.json?"application/json":void 0),{...e?.tools?{tools:e.tools}:{},...e?.toolConfig?{toolConfig:e.toolConfig}:{}}}async _generate(t,e,n){e.signal?.throwIfAborted();const s=j(t,this._isMultimodalModel,this.useSystemInstruction,this.model);let i=s;if(s[0].role==="system"){const[p]=s;this.client.systemInstruction=p,i=s.slice(1)}const o=this.invocationParams(e);if(this.streaming){const p={},l=this._streamResponseChunks(t,e,n),r=[];for await(const c of l){const f=c.generationInfo?.completion??0;r[f]===void 0?r[f]=c:r[f]=r[f].concat(c)}return{generations:r.filter(c=>c!==void 0),llmOutput:{estimatedTokenUsage:p}}}const a=await this.completionWithRetry({...o,contents:i});let u;"usageMetadata"in a.response&&(u=K(a.response.usageMetadata,this.model));const d=Vt(a.response,{usageMetadata:u});return d.generations?.length>0&&await n?.handleLLMNewToken(d.generations[0]?.text??""),d}async*_streamResponseChunks(t,e,n){const s=j(t,this._isMultimodalModel,this.useSystemInstruction,this.model);let i=s;if(s[0].role==="system"){const[r]=s;this.client.systemInstruction=r,i=s.slice(1)}const o={...this.invocationParams(e),contents:i},a=await this.caller.callWithOptions({signal:e?.signal},async()=>{const{stream:r}=await this.client.generateContentStream(o,{signal:e?.signal});return r});let u,d=0,p=0,l=0;for await(const r of a){if(e.signal?.aborted)return;if("usageMetadata"in r&&r.usageMetadata!==void 0&&this.streamUsage!==!1&&e.streamUsage!==!1){u=K(r.usageMetadata,this.model);const f=r.usageMetadata.promptTokenCount??0;u.input_tokens=Math.max(0,f-d),d=f;const g=r.usageMetadata.candidatesTokenCount??0;u.output_tokens=Math.max(0,g-p),p=g;const C=r.usageMetadata.totalTokenCount??0;u.total_tokens=Math.max(0,C-l),l=C}const c=Wt(r,{usageMetadata:u});c&&(yield c,await n?.handleLLMNewToken(c.text??""))}}async completionWithRetry(t,e){return this.caller.callWithOptions({signal:e?.signal},async()=>{try{return await this.client.generateContent(t,{signal:e?.signal})}catch(n){throw n.message?.includes("400 Bad Request")&&(n.status=400),n}})}get profile(){return Re[this.model]??{}}withStructuredOutput(t,e){const n=t,s=e?.name,i=e?.method,o=e?.includeRaw;if(i==="jsonMode")throw new Error('ChatGoogleGenerativeAI only supports "jsonSchema" or "functionCalling" as a method.');let a,u;if(i==="functionCalling"){let r=s??"extract",c;if(ut(n)){const f=N(n);c=[{functionDeclarations:[{name:r,description:f.description??"A function available to call.",parameters:f}]}],u=new F({returnSingle:!0,keyName:r,zodSchema:n})}else{let f;typeof n.name=="string"&&typeof n.parameters=="object"&&n.parameters!=null?(f=n,f.parameters=I(n.parameters),r=n.name):f={name:r,description:n.description??"",parameters:I(n)},c=[{functionDeclarations:[f]}],u=new F({returnSingle:!0,keyName:r})}a=this.bindTools(c).withConfig({allowedFunctionNames:[r]})}else{const r=N(n);a=this.withConfig({responseSchema:r}),u=new It}if(!o)return a.pipe(u).withConfig({runName:"ChatGoogleGenerativeAIStructuredOutput"});const d=U.assign({parsed:(r,c)=>u.invoke(r.raw,c)}),p=U.assign({parsed:()=>null}),l=d.withFallbacks({fallbacks:[p]});return bt.from([{raw:a},l]).withConfig({runName:"StructuredOutputRunnable"})}},Me=class extends Nt{apiKey;modelName="embedding-001";model="embedding-001";taskType;title;stripNewLines=!0;maxBatchSize=100;client;constructor(t){if(super(t??{}),this.modelName=t?.model?.replace(/^models\//,"")??t?.modelName?.replace(/^models\//,"")??this.modelName,this.model=this.modelName,this.taskType=t?.taskType??this.taskType,this.title=t?.title??this.title,this.title&&this.taskType!=="RETRIEVAL_DOCUMENT")throw new Error("title can only be sepcified with TaskType.RETRIEVAL_DOCUMENT");if(this.apiKey=t?.apiKey??ct("GOOGLE_API_KEY"),!this.apiKey)throw new Error("Please set an API key for Google GenerativeAI in the environmentb variable GOOGLE_API_KEY or in the `apiKey` field of the GoogleGenerativeAIEmbeddings constructor");this.client=new M(this.apiKey).getGenerativeModel({model:this.model},{baseUrl:t?.baseUrl})}_convertToContent(t){return{content:{role:"user",parts:[{text:this.stripNewLines?t.replace(/\n/g," "):t}]},taskType:this.taskType,title:this.title}}async _embedQueryContent(t){const e=this._convertToContent(t);return(await this.client.embedContent(e)).embedding.values??[]}async _embedDocumentsContent(t){const e=Mt(t,this.maxBatchSize),n=e.map(s=>({requests:s.map(i=>this._convertToContent(i))}));return(await Promise.allSettled(n.map(s=>this.client.batchEmbedContents(s)))).flatMap((s,i)=>s.status==="fulfilled"?s.value.embeddings.map(o=>o.values||[]):Array(e[i].length).fill([]))}embedQuery(t){return this.caller.call(this._embedQueryContent.bind(this),t)}embedDocuments(t){return this.caller.call(this._embedDocumentsContent.bind(this),t)}};export{Ne as ChatGoogleGenerativeAI,Me as GoogleGenerativeAIEmbeddings};
|