sliccy 6.248.13 → 6.248.15
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/ui/.vite/manifest.json +473 -473
- package/dist/ui/assets/{account-store-D4Humqb-.js → account-store-C8ku_32k.js} +2 -2
- package/dist/ui/assets/{account-store-AloIt5Ss.js → account-store-CLrcVXc0.js} +1 -1
- package/dist/ui/assets/{adobe-COzZgYMJ.js → adobe-Cpi2aE-H.js} +1 -1
- package/dist/ui/assets/{adobe-DzPNN5WH.js → adobe-ZF88lAqt.js} +2 -2
- package/dist/ui/assets/{agent-panels-C7WGWk6D.js → agent-panels-BeptN8xj.js} +1 -1
- package/dist/ui/assets/{almost-bash-shell-headless--HYnQClo.js → almost-bash-shell-headless-BVria6dz.js} +12 -12
- package/dist/ui/assets/{anthropic-messages-BPiITV7m.js → anthropic-messages-pITcoTin.js} +3 -3
- package/dist/ui/assets/{apply-layout-C4DLtjYf.js → apply-layout-mZoFZ7NI.js} +1 -1
- package/dist/ui/assets/{azure-openai-DCtV7Fk7.js → azure-openai-BuzUN1Zv.js} +1 -1
- package/dist/ui/assets/{azure-openai-qBC0T6wP.js → azure-openai-D8taz7yq.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-CYEKOLNU.js → azure-openai-responses-BzfTIQxM.js} +1 -1
- package/dist/ui/assets/{backend-hostfs-C_GQqMGj.js → backend-hostfs-BlwgXw0-.js} +1 -1
- package/dist/ui/assets/{bedrock-camp-BRe8SyVL.js → bedrock-camp-Drg4mDwe.js} +1 -1
- package/dist/ui/assets/{capability-ChjrBUX1.js → capability-COwjFLjM.js} +2 -2
- package/dist/ui/assets/{cdp-CCSeAKYa.js → cdp-BECQB1rP.js} +1 -1
- package/dist/ui/assets/{cerebras-D05pSaD3.js → cerebras-DZZFW27U.js} +1 -1
- package/dist/ui/assets/{cerebras-BlBAjiPm.js → cerebras-DfDfqh_L.js} +1 -1
- package/dist/ui/assets/{classifier-shared-2vXBXYjG.js → classifier-shared-1BfNmzbv.js} +1 -1
- package/dist/ui/assets/{cloudflare-workers-ai-system-one-gkmS2Nb_.js → cloudflare-workers-ai-system-one-CYstFSnj.js} +1 -1
- package/dist/ui/assets/{compat-d34y6SaJ.js → compat-TaBTsXFP.js} +2 -2
- package/dist/ui/assets/{composer-speech-ZEQzpxXl.js → composer-speech-B1kWFuju.js} +1 -1
- package/dist/ui/assets/{connect-surface-DVe7YnEx.js → connect-surface-CXFbDGll.js} +1 -1
- package/dist/ui/assets/{core-DfJhnyZb.js → core-kdG72Y8N.js} +1 -1
- package/dist/ui/assets/{directed-approval-DpSG1Fn9.js → directed-approval-LQT_TPqz.js} +1 -1
- package/dist/ui/assets/{discovery-preference-DZcZKow3.js → discovery-preference-C-pw_A76.js} +1 -1
- package/dist/ui/assets/{dist-BZDZf9iZ.js → dist-AEgtkPbB.js} +1 -1
- package/dist/ui/assets/{dist-sPwgAbDH.js → dist-BOzr2Ip-.js} +1 -1
- package/dist/ui/assets/{dist-C3U_YVHW.js → dist-CKtiDzqm.js} +1 -1
- package/dist/ui/assets/{dist-Dxh_321I.js → dist-Cr80TbAt.js} +1 -1
- package/dist/ui/assets/{dist-Bkks4gfH.js → dist-DMTrP4j6.js} +1 -1
- package/dist/ui/assets/{dist-CTibI9AZ.js → dist-EaD2nXS1.js} +1 -1
- package/dist/ui/assets/{emscripten-vfs-hook-rbqoLuA5.js → emscripten-vfs-hook-CnPmEK30.js} +1 -1
- package/dist/ui/assets/{env-api-keys-Ds64PXJ4.js → env-api-keys-Cfrk_k8Z.js} +1 -1
- package/dist/ui/assets/esp8266-mbfP83qK.js +1 -0
- package/dist/ui/assets/{esptool-operations-CndxwE1S.js → esptool-operations-CTZQdeQU.js} +2 -2
- package/dist/ui/assets/{float-topology-PI5i_WsZ.js → float-topology-DJxhvO9u.js} +1 -1
- package/dist/ui/assets/{follower-navigate-watcher-B3g-lkMJ.js → follower-navigate-watcher-BThbqvla.js} +1 -1
- package/dist/ui/assets/{frozen-archive-writer-D6ckorva.js → frozen-archive-writer-BTbtadrW.js} +1 -1
- package/dist/ui/assets/{frozen-archive-writer-ClcpBoUl.js → frozen-archive-writer-CUzf7C3s.js} +1 -1
- package/dist/ui/assets/{frozen-session-delete-_74oIhfQ.js → frozen-session-delete-CyRcONHk.js} +1 -1
- package/dist/ui/assets/{frozen-session-identity-DW7M6tap.js → frozen-session-identity-BCGVU2K1.js} +1 -1
- package/dist/ui/assets/{frozen-session-identity-DRez4L_k.js → frozen-session-identity-DVcpz2HB.js} +1 -1
- package/dist/ui/assets/{fs-CQpIxK2e.js → fs-DSnZb1DK.js} +2 -2
- package/dist/ui/assets/{gelatiere-unit-DY9kFx7W.js → gelatiere-unit-CLfqVD6U.js} +1 -1
- package/dist/ui/assets/{github-BAVQKGLM.js → github--CcFgkAY.js} +2 -2
- package/dist/ui/assets/{github-seYRLByd.js → github-ChxmjcJc.js} +1 -1
- package/dist/ui/assets/{github-copilot-NuiVJlRe.js → github-copilot-Bt2MljG0.js} +1 -1
- package/dist/ui/assets/{github-copilot-B2ui266i.js → github-copilot-DRF3abOV.js} +1 -1
- package/dist/ui/assets/{google-generative-ai-y59nuAoz.js → google-generative-ai-_4RGA5R9.js} +1 -1
- package/dist/ui/assets/{google-shared-BixQtMJk.js → google-shared-BmjkwexI.js} +1 -1
- package/dist/ui/assets/{google-vertex-BuV_pgMi.js → google-vertex-CCT-gmBZ.js} +1 -1
- package/dist/ui/assets/{hear-LEawuxbU.js → hear-BGGOzrLe.js} +1 -1
- package/dist/ui/assets/icons-CPOTRcvO.js +1 -0
- package/dist/ui/assets/{js-realm-worker-BQ2E7b6Z.js → js-realm-worker-Qikr6DIj.js} +2 -2
- package/dist/ui/assets/{jsh-executor-BA7Owezg.js → jsh-executor-Cduj8RKN.js} +3 -3
- package/dist/ui/assets/{kernel-worker-Bl7wfxQy.js → kernel-worker-DKhuL-SB.js} +8 -8
- package/dist/ui/assets/{kokoro-g58mp2Gg.js → kokoro-BZ2oL9at.js} +1 -1
- package/dist/ui/assets/{legacy-api-aliases-DZ7QKXPR.js → legacy-api-aliases-BqXqjuwj.js} +1 -1
- package/dist/ui/assets/{legacy-styles-CbYwED5J.js → legacy-styles-CGcVbQni.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-BIajXq6B.js → lick-ws-bridge-Bgd2UUqy.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-BEHNQbo5.js → lick-ws-bridge-Cy-M-w5Q.js} +1 -1
- package/dist/ui/assets/{live-session-curation-BJVU7yfS.js → live-session-curation-DKF46wEh.js} +1 -1
- package/dist/ui/assets/{live-session-curation-C8cnTFuk.js → live-session-curation-w6IDH4Wx.js} +1 -1
- package/dist/ui/assets/{live-session-snapshot-DB7ATVqO.js → live-session-snapshot-DCT_jWTD.js} +1 -1
- package/dist/ui/assets/{local-llm-Dxm6T0ph.js → local-llm-BzQlnS5L.js} +1 -1
- package/dist/ui/assets/{local-llm-B72jeBdJ.js → local-llm-DUc-GBj9.js} +1 -1
- package/dist/ui/assets/{main-pG2z7nDr.js → main-CWx8ZbOh.js} +3 -3
- package/dist/ui/assets/{main-cherry-Cndxk3tr.js → main-cherry-qefabkXK.js} +1 -1
- package/dist/ui/assets/{mcp-command-R_syvmA2.js → mcp-command-BMbHOLse.js} +10 -10
- package/dist/ui/assets/{memory-curation-seam-xAt4_ZGt.js → memory-curation-seam-DqgqK6CR.js} +1 -1
- package/dist/ui/assets/{memory-health-N-Qft3RQ.js → memory-health-CyDp9rny.js} +1 -1
- package/dist/ui/assets/{memory-write-execute-CcPwzxh2.js → memory-write-execute-mLtLK-OJ.js} +1 -1
- package/dist/ui/assets/{merge-folded-cost-into-frozen-D5QzQftk.js → merge-folded-cost-into-frozen-VpR7-OO_.js} +1 -1
- package/dist/ui/assets/{mistral-conversations-BbeDfELF.js → mistral-conversations-BTfu6zaw.js} +1 -1
- package/dist/ui/assets/{models-K_BYbYJy.js → models-DuCVW_cU.js} +1 -1
- package/dist/ui/assets/{mount-Cvx8MHrJ.js → mount-iiKbRe20.js} +1 -1
- package/dist/ui/assets/{new-session-CzmqZfEw.js → new-session-pyHdj7ky.js} +2 -2
- package/dist/ui/assets/{node.browser-D-KuY2NZ.js → node.browser-POTNsJTJ.js} +1 -1
- package/dist/ui/assets/{oauth-bootstrap-BgBpgpMH.js → oauth-bootstrap-4_xLQ_sb.js} +2 -2
- package/dist/ui/assets/{oauth-service-C9_em2OO.js → oauth-service-BTbFz00g.js} +1 -1
- package/dist/ui/assets/{onboarding-orchestrator-B0EOdDeN.js → onboarding-orchestrator-CjdNWdMC.js} +1 -1
- package/dist/ui/assets/{openai-codex-CBBCnX5G.js → openai-codex-4_vQIXxb.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-CsoNnMnP.js → openai-codex-responses-BQf_Un8s.js} +1 -1
- package/dist/ui/assets/{openai-codex-BuzdyFkb.js → openai-codex-uQMjU0_s.js} +1 -1
- package/dist/ui/assets/{openai-completions-CwpTiqkV.js → openai-completions-UyX4inUN.js} +1 -1
- package/dist/ui/assets/{openai-decisions-C2a995aZ.js → openai-decisions-6D6eupBk.js} +1 -1
- package/dist/ui/assets/{openai-responses-CXxDIIaJ.js → openai-responses-Bn1YXtN4.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-Df32ziOu.js → openai-responses-shared-CHC7SqmI.js} +1 -1
- package/dist/ui/assets/{openrouter-CajNnUyi.js → openrouter-DneJqayx.js} +1 -1
- package/dist/ui/assets/{openrouter-yrPyWZSZ.js → openrouter-TLjYxLOJ.js} +1 -1
- package/dist/ui/assets/{openrouter-free-CoKNk8Q9.js → openrouter-free-C9Ks_BoF.js} +1 -1
- package/dist/ui/assets/{openrouter-free-DvQSB466.js → openrouter-free-QijswzXp.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-Cwnv6aaR.js → openrouter-oauth-C3NFC0lq.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-Dm2bFG2r.js → openrouter-oauth-CWRFCzx3.js} +1 -1
- package/dist/ui/assets/{opfs-mount-DqwXxpJI.js → opfs-mount-DHQkCQyR.js} +1 -1
- package/dist/ui/assets/{page-approval-service-BV4pp4cE.js → page-approval-service-1D_bhphG.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-0Asc887-.js → panel-rpc-handlers-DJTIyg19.js} +2 -2
- package/dist/ui/assets/{panelize-shell-CYWV616_.js → panelize-shell-KnM6qBOd.js} +1 -1
- package/dist/ui/assets/{pi-edit-execution-DUHiH3Ek.js → pi-edit-execution-KjYZMQ1M.js} +1 -1
- package/dist/ui/assets/{pi-transcript-context-M0uAa_Rs.js → pi-transcript-context-BD-rasES.js} +1 -1
- package/dist/ui/assets/preload-helper-BLdHbfdN.js +1 -0
- package/dist/ui/assets/{provider-gVV-Tw2o.js → provider-BUOENNXd.js} +1 -1
- package/dist/ui/assets/{provider-DQEpec-V.js → provider-C6GKyGbH.js} +2 -2
- package/dist/ui/assets/{provider-settings-HdIWRUQi.js → provider-settings-DiWaVtMa.js} +1 -1
- package/dist/ui/assets/provider-store-access-BLah3TfA.js +1 -0
- package/dist/ui/assets/provider-store-access-DK9jcMFs.js +1 -0
- package/dist/ui/assets/{providers-BPtyhTCJ.js → providers-D98KfVHw.js} +2 -2
- package/dist/ui/assets/{providers-BqUoo02I.js → providers-DQDxShvT.js} +1 -1
- package/dist/ui/assets/{proxied-fetch-Co-YYDT9.js → proxied-fetch-Dcpb4ieV.js} +1 -1
- package/dist/ui/assets/{proxied-fetch-raw-C_Y--MLW.js → proxied-fetch-raw-DFOSVEWz.js} +1 -1
- package/dist/ui/assets/{quick-llm-DKIeT-Bm.js → quick-llm-BpqDA4jj.js} +1 -1
- package/dist/ui/assets/{realm-inprocess-I1Oa37_B.js → realm-inprocess-DB9T1J06.js} +2 -2
- package/dist/ui/assets/{realm-unhandled-rejections-5totJ0nZ.js → realm-unhandled-rejections--yhMR2JG.js} +1 -1
- package/dist/ui/assets/{realm-unhandled-rejections-Vf408gQs.js → realm-unhandled-rejections-C-dWyWFT.js} +1 -1
- package/dist/ui/assets/{recovery-screen-d6N9mctq.js → recovery-screen-DxmS11pP.js} +1 -1
- package/dist/ui/assets/{remote-terminal-view-B8EZ4je-.js → remote-terminal-view-CKT9I4xa.js} +3 -3
- package/dist/ui/assets/{rest-ops-Bu4Fgr3O.js → rest-ops-DUxY6dMv.js} +1 -1
- package/dist/ui/assets/{restore-YHJZnRoZ.js → restore-DBVHFRDn.js} +1 -1
- package/dist/ui/assets/{run-Ds5q8C_n.js → run-B2qNRdiQ.js} +2 -2
- package/dist/ui/assets/{run-qBD2W0pE.js → run-D6GtWFc7.js} +1 -1
- package/dist/ui/assets/{run-QN9mmLnD.js → run-DWu38u8c.js} +1 -1
- package/dist/ui/assets/{run-jEnj-WXZ.js → run-DxF2t6YH.js} +2 -2
- package/dist/ui/assets/{secret-env-Da2LI-Wl.js → secret-env-BDj2iVgu.js} +1 -1
- package/dist/ui/assets/secret-topology-CcM8VDVI.js +1 -0
- package/dist/ui/assets/{serve-command-ClUJJ3EB.js → serve-command-Cj91wHBd.js} +2 -2
- package/dist/ui/assets/{serve-runtime-WdVepvEi.js → serve-runtime-C6U19az5.js} +1 -1
- package/dist/ui/assets/{session-command-memory-CQnSNVmV.js → session-command-memory-DTJrpKQG.js} +2 -2
- package/dist/ui/assets/{session-jsonl-BGHEGuWx.js → session-jsonl-CUGtVDjz.js} +1 -1
- package/dist/ui/assets/{session-jsonl-BjBaj5ud.js → session-jsonl-PBSNVf5N.js} +1 -1
- package/dist/ui/assets/{session-search-index-DFWu63Zi.js → session-search-index-BmWzdxol.js} +1 -1
- package/dist/ui/assets/{setup-feature-flags-remote-CUbaBhWB.js → setup-feature-flags-remote-Dcyvcm1c.js} +1 -1
- package/dist/ui/assets/{setup-model-catalog-CykSe_Dx.js → setup-model-catalog-9sIjZkxM.js} +1 -1
- package/dist/ui/assets/{setup-sprinkle-exec-IU4qWikH.js → setup-sprinkle-exec-CdgElwNt.js} +1 -1
- package/dist/ui/assets/{silent-renew-backoff-BMr_pGCU.js → silent-renew-backoff-B9OHOzRe.js} +1 -1
- package/dist/ui/assets/{slicc-diff-D8v8ZLu9.js → slicc-diff-BfQJcIZe.js} +1 -1
- package/dist/ui/assets/{slicc-editor-CEzmoAZr.js → slicc-editor-CasndIRU.js} +3 -3
- package/dist/ui/assets/slicc-editor-tCvqLLxb.js +1 -0
- package/dist/ui/assets/slicc-version-QFUwKumj.js +1 -0
- package/dist/ui/assets/{soundscape-Blo80kkF.js → soundscape-BotaZrDR.js} +1 -1
- package/dist/ui/assets/{speak-DYYfW_FH.js → speak-DHpjynd6.js} +3 -3
- package/dist/ui/assets/{sprinkle-manager-6IcFnb1j.js → sprinkle-manager-8dcg9Iza.js} +1 -1
- package/dist/ui/assets/{sprinkle-renderer-BnGOcTUx.js → sprinkle-renderer-D0vfMqnl.js} +3 -3
- package/dist/ui/assets/{sudo-cs2WnTRn.js → sudo-CNQ60foM.js} +1 -1
- package/dist/ui/assets/{supervisor-BULFrqrk.js → supervisor-CPH3uat9.js} +1 -1
- package/dist/ui/assets/{sync-dialog-MmcHaZwh.js → sync-dialog-DcHJ8wDd.js} +1 -1
- package/dist/ui/assets/{system-one-shared-DLgt2600.js → system-one-shared-sVc-bQkc.js} +1 -1
- package/dist/ui/assets/{telemetry-BqfutULb.js → telemetry-kqkj0A7x.js} +1 -1
- package/dist/ui/assets/{transform-messages-Bx3wQh2R.js → transform-messages-HTSSP3zz.js} +1 -1
- package/dist/ui/assets/{transformers-env-Fm5j4giD.js → transformers-env-C4aTP2JX.js} +1 -1
- package/dist/ui/assets/{transformers.web-BR6ghS6P.js → transformers.web-C5VLk0m7.js} +1 -1
- package/dist/ui/assets/{tray-leader-CFIVvD5G.js → tray-leader-BO7RLnAz.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-BSxSDTw5.js → tray-leave-runtime-DrPHvVi6.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-DQqVkAjk.js → tray-sidecar-BF8y2nH9.js} +1 -1
- package/dist/ui/assets/{typesafe-system-one-CXEHNzQF.js → typesafe-system-one-BdxxnbQu.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-MAFg6kZz.js → upgrade-detection-DYeqLwkQ.js} +1 -1
- package/dist/ui/assets/{usb-operations-Ccb6x34d.js → usb-operations-DvSWlz_Y.js} +1 -1
- package/dist/ui/assets/{voice-reply-Bum2oQcA.js → voice-reply-DVgxPsp4.js} +1 -1
- package/dist/ui/assets/{warm-wterm-C7ml3_29.js → warm-wterm-snqvCS0-.js} +1 -1
- package/dist/ui/assets/{wc-attach-BJHnH6pd.js → wc-attach-DtB955Cg.js} +3 -3
- package/dist/ui/assets/{wc-browser-sNhsHdWm.js → wc-browser-5eX1yDaM.js} +1 -1
- package/dist/ui/assets/{wc-computers-CWg9NiMK.js → wc-computers-BQe7QGA5.js} +1 -1
- package/dist/ui/assets/{wc-detached-DZvftcPT.js → wc-detached-B448Oceh.js} +1 -1
- package/dist/ui/assets/{wc-extension-BaYtWo4q.js → wc-extension-DcxJvbXQ.js} +2 -2
- package/dist/ui/assets/{wc-follower-C3skKl26.js → wc-follower-C4HBJRkp.js} +3 -3
- package/dist/ui/assets/{wc-follower-oauth-iJKLKYov.js → wc-follower-oauth-DWB_1KrV.js} +1 -1
- package/dist/ui/assets/{wc-gelatiere-DaysrnKa.js → wc-gelatiere-DNuoJgyp.js} +1 -1
- package/dist/ui/assets/{wc-live-DEo-6NQK.js → wc-live-BMXg1cW0.js} +5 -5
- package/dist/ui/assets/{wc-nav-DqmL5N5I.js → wc-nav-C4cQdKiF.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-Dg7G2Ykz.js → wc-onboarding-CsrFGEQ2.js} +2 -2
- package/dist/ui/assets/{wc-permissions-wBb5q-ot.js → wc-permissions-DMVzE1os.js} +3 -3
- package/dist/ui/assets/{wc-permissions-providers-r97Cs0CM.js → wc-permissions-providers-CzfeTK0C.js} +1 -1
- package/dist/ui/assets/{wc-placeholder-Dcqr3sQ2.js → wc-placeholder-BSqm7GOK.js} +3 -3
- package/dist/ui/assets/{wc-secret-request-DLngmY78.js → wc-secret-request-BMp1_Dqa.js} +1 -1
- package/dist/ui/assets/{wc-settings-DhxNLvFd.js → wc-settings-D_rtZFP8.js} +3 -3
- package/dist/ui/assets/{wc-shell-RF_bfAGN.js → wc-shell-CbiYuC-u.js} +6 -6
- package/dist/ui/assets/{wc-shortcut-config-Cr8zuZad.js → wc-shortcut-config-Dit9NqHJ.js} +1 -1
- package/dist/ui/assets/{wc-sprinkles-DyMWm1jp.js → wc-sprinkles-CRU3Bd1x.js} +2 -2
- package/dist/ui/assets/{wc-transcript-export-DVyU4B6b.js → wc-transcript-export-CCBgVRIb.js} +2 -2
- package/dist/ui/assets/{wc-tray-BjkHiwAE.js → wc-tray-DMpwCD-i.js} +4 -4
- package/dist/ui/assets/welcome-detection-CMa9jsjd.js +1 -0
- package/dist/ui/assets/{whisper-session-nBcuStI7.js → whisper-session-DOG-n_Gl.js} +2 -2
- package/dist/ui/assets/{xai-grok-B0VdJo2K.js → xai-grok-BwRAMV0b.js} +1 -1
- package/dist/ui/assets/{xai-grok-B-1EsChx.js → xai-grok-D-s6Eti2.js} +1 -1
- package/dist/ui/index.html +12 -12
- package/dist/ui/lucide-icons.js +362 -359
- package/dist/ui/packages/webapp/index.html +12 -12
- package/dist/ui/slicc-diff.js +1 -1
- package/dist/ui/slicc-editor.js +1 -1
- package/package.json +2 -2
- package/dist/ui/assets/esp8266-6UF0nYRf.js +0 -1
- package/dist/ui/assets/icons-BUdZEBvI.js +0 -1
- package/dist/ui/assets/preload-helper-DjzSQ1t3.js +0 -1
- package/dist/ui/assets/provider-store-access-BG9uc1UB.js +0 -1
- package/dist/ui/assets/provider-store-access-CkviLtwb.js +0 -1
- package/dist/ui/assets/secret-topology-B-7q9k0Q.js +0 -1
- package/dist/ui/assets/slicc-editor-CnQU3MQS.js +0 -1
- package/dist/ui/assets/slicc-version-D_fWoQ7a.js +0 -1
- package/dist/ui/assets/welcome-detection-ZKXELBPe.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,t}from"./rolldown-runtime-Dd_uD5pT.js";import{m as n,n as r,o as i}from"./models-K_BYbYJy.js";import{i as a,o}from"./constrained-sampling-DA0j0g9I.js";import{t as s}from"./provider-retry-RVfYd5Vz.js";import{t as c}from"./sanitize-unicode-DmIE6hZJ.js";import{t as l}from"./transform-messages-Bx3wQh2R.js";var u=t(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0){if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1}var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),d=t((e=>{var t=u();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),f=t(((e,t)=>{t.exports=d()})),p=e(t(((e,t)=>{var n=f(),r=[`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`],i=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}},a=(e,t,n)=>{let r=n.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e},o=e=>r.includes(e),s=(e,t)=>new Promise((r,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};let c=n.operation(t);c.attempt(async n=>{try{r(await e(n))}catch(e){if(!(e instanceof Error)){s(TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));return}if(e instanceof i)c.stop(),s(e.originalError);else if(e instanceof TypeError&&!o(e.message))c.stop(),s(e);else{a(e,n,t);try{await t.onFailedAttempt(e)}catch(e){s(e);return}c.retry(e)||s(c.mainError())}}})});t.exports=s,t.exports.default=s,t.exports.AbortError=i}))(),1),m=void 0,h=void 0;function g(){return{geminiUrl:m,vertexUrl:h}}function _(e,t,n,r){if(!e?.baseUrl){let e=g();return t?e.vertexUrl??n:e.geminiUrl??r}return e.baseUrl}var v=class{};function y(e,t){return e.replace(/\{([^}]+)\}/g,(e,n)=>{if(Object.prototype.hasOwnProperty.call(t,n)){let e=t[n];return e==null?``:String(e)}throw Error(`Key '${n}' not found in valueMap.`)})}function b(e,t,n){for(let r=0;r<t.length-1;r++){let i=t[r];if(i.endsWith(`[]`)){let a=i.slice(0,-2);if(!(a in e)){if(Array.isArray(n))e[a]=Array.from({length:n.length},()=>({}));else throw Error(`Value must be a list given an array path ${i}`)}if(Array.isArray(e[a])){let i=e[a];if(Array.isArray(n))for(let e=0;e<i.length;e++){let a=i[e];b(a,t.slice(r+1),n[e])}else for(let e of i)b(e,t.slice(r+1),n)}return}if(i.endsWith(`[0]`)){let a=i.slice(0,-3);a in e||(e[a]=[{}]);let o=e[a];b(o[0],t.slice(r+1),n);return}(!e[i]||typeof e[i]!=`object`)&&(e[i]={}),e=e[i]}let r=t[t.length-1],i=e[r];if(i!==void 0){if(!n||typeof n==`object`&&Object.keys(n).length===0||n===i)return;if(typeof i==`object`&&typeof n==`object`&&i!==null&&n!==null)Object.assign(i,n);else throw Error(`Cannot set value for an existing key. Key: ${r}`)}else r===`_self`&&typeof n==`object`&&n&&!Array.isArray(n)?Object.assign(e,n):e[r]=n}function x(e,t,n=void 0){try{if(t.length===1&&t[0]===`_self`)return e;for(let r=0;r<t.length;r++){if(typeof e!=`object`||!e)return n;let i=t[r];if(i.endsWith(`[]`)){let a=i.slice(0,-2);if(a in e){let i=e[a];return Array.isArray(i)?i.map(e=>x(e,t.slice(r+1),n)):n}return n}e=e[i]}return e}catch(e){if(e instanceof TypeError)return n;throw e}}function S(e,t){for(let[n,r]of Object.entries(t)){let t=n.split(`.`),i=r.split(`.`),a=new Set,o=-1;for(let e=0;e<t.length;e++)if(t[e]===`*`){o=e;break}if(o!==-1&&i.length>o)for(let e=o;e<i.length;e++){let t=i[e];t!==`*`&&!t.endsWith(`[]`)&&!t.endsWith(`[0]`)&&a.add(t)}C(e,t,i,0,a)}}function C(e,t,n,r,i){if(r>=t.length||typeof e!=`object`||!e)return;let a=t[r];if(a.endsWith(`[]`)){let o=a.slice(0,-2),s=e;if(o in s&&Array.isArray(s[o]))for(let e of s[o])C(e,t,n,r+1,i)}else if(a===`*`){if(typeof e==`object`&&e&&!Array.isArray(e)){let t=e,a=Object.keys(t).filter(e=>!e.startsWith(`_`)&&!i.has(e)),o={};for(let e of a)o[e]=t[e];for(let[e,i]of Object.entries(o)){let a=[];for(let t of n.slice(r))t===`*`?a.push(e):a.push(t);b(t,a,i)}for(let e of a)delete t[e]}}else{let o=e;a in o&&C(o[a],t,n,r+1,i)}}function w(e){if(typeof e!=`string`)throw Error(`fromImageBytes must be a string`);return e}function T(e){let t={},n=x(e,[`operationName`]);n!=null&&b(t,[`operationName`],n);let r=x(e,[`resourceName`]);return r!=null&&b(t,[`_url`,`resourceName`],r),t}function E(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`metadata`]);r!=null&&b(t,[`metadata`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);a!=null&&b(t,[`error`],a);let o=x(e,[`response`,`generateVideoResponse`]);return o!=null&&b(t,[`response`],O(o)),t}function D(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`metadata`]);r!=null&&b(t,[`metadata`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);a!=null&&b(t,[`error`],a);let o=x(e,[`response`]);return o!=null&&b(t,[`response`],k(o)),t}function O(e){let t={},n=x(e,[`generatedSamples`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>A(e))),b(t,[`generatedVideos`],e)}let r=x(e,[`raiMediaFilteredCount`]);r!=null&&b(t,[`raiMediaFilteredCount`],r);let i=x(e,[`raiMediaFilteredReasons`]);return i!=null&&b(t,[`raiMediaFilteredReasons`],i),t}function k(e){let t={},n=x(e,[`videos`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>ee(e))),b(t,[`generatedVideos`],e)}let r=x(e,[`raiMediaFilteredCount`]);r!=null&&b(t,[`raiMediaFilteredCount`],r);let i=x(e,[`raiMediaFilteredReasons`]);return i!=null&&b(t,[`raiMediaFilteredReasons`],i),t}function A(e){let t={},n=x(e,[`video`]);return n!=null&&b(t,[`video`],se(n)),t}function ee(e){let t={},n=x(e,[`_self`]);return n!=null&&b(t,[`video`],ce(n)),t}function te(e){let t={},n=x(e,[`operationName`]);return n!=null&&b(t,[`_url`,`operationName`],n),t}function ne(e){let t={},n=x(e,[`operationName`]);return n!=null&&b(t,[`_url`,`operationName`],n),t}function re(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`metadata`]);r!=null&&b(t,[`metadata`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);a!=null&&b(t,[`error`],a);let o=x(e,[`response`]);return o!=null&&b(t,[`response`],ie(o)),t}function ie(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`parent`]);r!=null&&b(t,[`parent`],r);let i=x(e,[`documentName`]);return i!=null&&b(t,[`documentName`],i),t}function ae(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`metadata`]);r!=null&&b(t,[`metadata`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);a!=null&&b(t,[`error`],a);let o=x(e,[`response`]);return o!=null&&b(t,[`response`],oe(o)),t}function oe(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`parent`]);r!=null&&b(t,[`parent`],r);let i=x(e,[`documentName`]);return i!=null&&b(t,[`documentName`],i),t}function se(e){let t={},n=x(e,[`uri`]);n!=null&&b(t,[`uri`],n);let r=x(e,[`encodedVideo`]);r!=null&&b(t,[`videoBytes`],w(r));let i=x(e,[`encoding`]);return i!=null&&b(t,[`mimeType`],i),t}function ce(e){let t={},n=x(e,[`gcsUri`]);n!=null&&b(t,[`uri`],n);let r=x(e,[`bytesBase64Encoded`]);r!=null&&b(t,[`videoBytes`],w(r));let i=x(e,[`mimeType`]);return i!=null&&b(t,[`mimeType`],i),t}var le;(function(e){e.OUTCOME_UNSPECIFIED=`OUTCOME_UNSPECIFIED`,e.OUTCOME_OK=`OUTCOME_OK`,e.OUTCOME_FAILED=`OUTCOME_FAILED`,e.OUTCOME_DEADLINE_EXCEEDED=`OUTCOME_DEADLINE_EXCEEDED`})(le||={});var ue;(function(e){e.LANGUAGE_UNSPECIFIED=`LANGUAGE_UNSPECIFIED`,e.PYTHON=`PYTHON`})(ue||={});var de;(function(e){e.SCHEDULING_UNSPECIFIED=`SCHEDULING_UNSPECIFIED`,e.SILENT=`SILENT`,e.WHEN_IDLE=`WHEN_IDLE`,e.INTERRUPT=`INTERRUPT`})(de||={});var fe;(function(e){e.TYPE_UNSPECIFIED=`TYPE_UNSPECIFIED`,e.STRING=`STRING`,e.NUMBER=`NUMBER`,e.INTEGER=`INTEGER`,e.BOOLEAN=`BOOLEAN`,e.ARRAY=`ARRAY`,e.OBJECT=`OBJECT`,e.NULL=`NULL`})(fe||={});var pe;(function(e){e.AUTH_TYPE_UNSPECIFIED=`AUTH_TYPE_UNSPECIFIED`,e.NO_AUTH=`NO_AUTH`,e.API_KEY_AUTH=`API_KEY_AUTH`,e.HTTP_BASIC_AUTH=`HTTP_BASIC_AUTH`,e.GOOGLE_SERVICE_ACCOUNT_AUTH=`GOOGLE_SERVICE_ACCOUNT_AUTH`,e.OAUTH=`OAUTH`,e.OIDC_AUTH=`OIDC_AUTH`})(pe||={});var me;(function(e){e.HTTP_IN_UNSPECIFIED=`HTTP_IN_UNSPECIFIED`,e.HTTP_IN_QUERY=`HTTP_IN_QUERY`,e.HTTP_IN_HEADER=`HTTP_IN_HEADER`,e.HTTP_IN_PATH=`HTTP_IN_PATH`,e.HTTP_IN_BODY=`HTTP_IN_BODY`,e.HTTP_IN_COOKIE=`HTTP_IN_COOKIE`})(me||={});var he;(function(e){e.API_SPEC_UNSPECIFIED=`API_SPEC_UNSPECIFIED`,e.SIMPLE_SEARCH=`SIMPLE_SEARCH`,e.ELASTIC_SEARCH=`ELASTIC_SEARCH`})(he||={});var ge;(function(e){e.ENVIRONMENT_UNSPECIFIED=`ENVIRONMENT_UNSPECIFIED`,e.ENVIRONMENT_BROWSER=`ENVIRONMENT_BROWSER`,e.ENVIRONMENT_MOBILE=`ENVIRONMENT_MOBILE`,e.ENVIRONMENT_DESKTOP=`ENVIRONMENT_DESKTOP`})(ge||={});var _e;(function(e){e.SAFETY_POLICY_UNSPECIFIED=`SAFETY_POLICY_UNSPECIFIED`,e.FINANCIAL_TRANSACTIONS=`FINANCIAL_TRANSACTIONS`,e.SENSITIVE_DATA_MODIFICATION=`SENSITIVE_DATA_MODIFICATION`,e.COMMUNICATION_TOOL=`COMMUNICATION_TOOL`,e.ACCOUNT_CREATION=`ACCOUNT_CREATION`,e.DATA_MODIFICATION=`DATA_MODIFICATION`,e.USER_CONSENT_MANAGEMENT=`USER_CONSENT_MANAGEMENT`,e.LEGAL_TERMS_AND_AGREEMENTS=`LEGAL_TERMS_AND_AGREEMENTS`})(_e||={});var ve;(function(e){e.PHISH_BLOCK_THRESHOLD_UNSPECIFIED=`PHISH_BLOCK_THRESHOLD_UNSPECIFIED`,e.BLOCK_LOW_AND_ABOVE=`BLOCK_LOW_AND_ABOVE`,e.BLOCK_MEDIUM_AND_ABOVE=`BLOCK_MEDIUM_AND_ABOVE`,e.BLOCK_HIGH_AND_ABOVE=`BLOCK_HIGH_AND_ABOVE`,e.BLOCK_HIGHER_AND_ABOVE=`BLOCK_HIGHER_AND_ABOVE`,e.BLOCK_VERY_HIGH_AND_ABOVE=`BLOCK_VERY_HIGH_AND_ABOVE`,e.BLOCK_ONLY_EXTREMELY_HIGH=`BLOCK_ONLY_EXTREMELY_HIGH`})(ve||={});var ye;(function(e){e.UNSPECIFIED=`UNSPECIFIED`,e.BLOCKING=`BLOCKING`,e.NON_BLOCKING=`NON_BLOCKING`})(ye||={});var be;(function(e){e.MODE_UNSPECIFIED=`MODE_UNSPECIFIED`,e.MODE_DYNAMIC=`MODE_DYNAMIC`})(be||={});var xe;(function(e){e.THINKING_LEVEL_UNSPECIFIED=`THINKING_LEVEL_UNSPECIFIED`,e.MINIMAL=`MINIMAL`,e.LOW=`LOW`,e.MEDIUM=`MEDIUM`,e.HIGH=`HIGH`})(xe||={});var Se;(function(e){e.DONT_ALLOW=`DONT_ALLOW`,e.ALLOW_ADULT=`ALLOW_ADULT`,e.ALLOW_ALL=`ALLOW_ALL`})(Se||={});var Ce;(function(e){e.PROMINENT_PEOPLE_UNSPECIFIED=`PROMINENT_PEOPLE_UNSPECIFIED`,e.ALLOW_PROMINENT_PEOPLE=`ALLOW_PROMINENT_PEOPLE`,e.BLOCK_PROMINENT_PEOPLE=`BLOCK_PROMINENT_PEOPLE`})(Ce||={});var we;(function(e){e.HARM_CATEGORY_UNSPECIFIED=`HARM_CATEGORY_UNSPECIFIED`,e.HARM_CATEGORY_HARASSMENT=`HARM_CATEGORY_HARASSMENT`,e.HARM_CATEGORY_HATE_SPEECH=`HARM_CATEGORY_HATE_SPEECH`,e.HARM_CATEGORY_SEXUALLY_EXPLICIT=`HARM_CATEGORY_SEXUALLY_EXPLICIT`,e.HARM_CATEGORY_DANGEROUS_CONTENT=`HARM_CATEGORY_DANGEROUS_CONTENT`,e.HARM_CATEGORY_CIVIC_INTEGRITY=`HARM_CATEGORY_CIVIC_INTEGRITY`,e.HARM_CATEGORY_JAILBREAK=`HARM_CATEGORY_JAILBREAK`,e.HARM_CATEGORY_IMAGE_HATE=`HARM_CATEGORY_IMAGE_HATE`,e.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT=`HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT`,e.HARM_CATEGORY_IMAGE_HARASSMENT=`HARM_CATEGORY_IMAGE_HARASSMENT`,e.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT=`HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT`})(we||={});var Te;(function(e){e.HARM_BLOCK_METHOD_UNSPECIFIED=`HARM_BLOCK_METHOD_UNSPECIFIED`,e.SEVERITY=`SEVERITY`,e.PROBABILITY=`PROBABILITY`})(Te||={});var Ee;(function(e){e.HARM_BLOCK_THRESHOLD_UNSPECIFIED=`HARM_BLOCK_THRESHOLD_UNSPECIFIED`,e.BLOCK_LOW_AND_ABOVE=`BLOCK_LOW_AND_ABOVE`,e.BLOCK_MEDIUM_AND_ABOVE=`BLOCK_MEDIUM_AND_ABOVE`,e.BLOCK_ONLY_HIGH=`BLOCK_ONLY_HIGH`,e.BLOCK_NONE=`BLOCK_NONE`,e.OFF=`OFF`})(Ee||={});var De;(function(e){e.MODE_UNSPECIFIED=`MODE_UNSPECIFIED`,e.AUTO=`AUTO`,e.ANY=`ANY`,e.NONE=`NONE`,e.VALIDATED=`VALIDATED`})(De||={});var j;(function(e){e.FINISH_REASON_UNSPECIFIED=`FINISH_REASON_UNSPECIFIED`,e.STOP=`STOP`,e.MAX_TOKENS=`MAX_TOKENS`,e.SAFETY=`SAFETY`,e.RECITATION=`RECITATION`,e.LANGUAGE=`LANGUAGE`,e.OTHER=`OTHER`,e.BLOCKLIST=`BLOCKLIST`,e.PROHIBITED_CONTENT=`PROHIBITED_CONTENT`,e.SPII=`SPII`,e.MALFORMED_FUNCTION_CALL=`MALFORMED_FUNCTION_CALL`,e.IMAGE_SAFETY=`IMAGE_SAFETY`,e.UNEXPECTED_TOOL_CALL=`UNEXPECTED_TOOL_CALL`,e.TOO_MANY_TOOL_CALLS=`TOO_MANY_TOOL_CALLS`,e.IMAGE_PROHIBITED_CONTENT=`IMAGE_PROHIBITED_CONTENT`,e.NO_IMAGE=`NO_IMAGE`,e.IMAGE_RECITATION=`IMAGE_RECITATION`,e.IMAGE_OTHER=`IMAGE_OTHER`})(j||={});var Oe;(function(e){e.HARM_PROBABILITY_UNSPECIFIED=`HARM_PROBABILITY_UNSPECIFIED`,e.NEGLIGIBLE=`NEGLIGIBLE`,e.LOW=`LOW`,e.MEDIUM=`MEDIUM`,e.HIGH=`HIGH`})(Oe||={});var ke;(function(e){e.HARM_SEVERITY_UNSPECIFIED=`HARM_SEVERITY_UNSPECIFIED`,e.HARM_SEVERITY_NEGLIGIBLE=`HARM_SEVERITY_NEGLIGIBLE`,e.HARM_SEVERITY_LOW=`HARM_SEVERITY_LOW`,e.HARM_SEVERITY_MEDIUM=`HARM_SEVERITY_MEDIUM`,e.HARM_SEVERITY_HIGH=`HARM_SEVERITY_HIGH`})(ke||={});var Ae;(function(e){e.URL_RETRIEVAL_STATUS_UNSPECIFIED=`URL_RETRIEVAL_STATUS_UNSPECIFIED`,e.URL_RETRIEVAL_STATUS_SUCCESS=`URL_RETRIEVAL_STATUS_SUCCESS`,e.URL_RETRIEVAL_STATUS_ERROR=`URL_RETRIEVAL_STATUS_ERROR`,e.URL_RETRIEVAL_STATUS_PAYWALL=`URL_RETRIEVAL_STATUS_PAYWALL`,e.URL_RETRIEVAL_STATUS_UNSAFE=`URL_RETRIEVAL_STATUS_UNSAFE`})(Ae||={});var je;(function(e){e.BLOCKED_REASON_UNSPECIFIED=`BLOCKED_REASON_UNSPECIFIED`,e.SAFETY=`SAFETY`,e.OTHER=`OTHER`,e.BLOCKLIST=`BLOCKLIST`,e.PROHIBITED_CONTENT=`PROHIBITED_CONTENT`,e.IMAGE_SAFETY=`IMAGE_SAFETY`,e.MODEL_ARMOR=`MODEL_ARMOR`,e.JAILBREAK=`JAILBREAK`})(je||={});var Me;(function(e){e.TRAFFIC_TYPE_UNSPECIFIED=`TRAFFIC_TYPE_UNSPECIFIED`,e.ON_DEMAND=`ON_DEMAND`,e.ON_DEMAND_PRIORITY=`ON_DEMAND_PRIORITY`,e.ON_DEMAND_FLEX=`ON_DEMAND_FLEX`,e.PROVISIONED_THROUGHPUT=`PROVISIONED_THROUGHPUT`})(Me||={});var Ne;(function(e){e.MODALITY_UNSPECIFIED=`MODALITY_UNSPECIFIED`,e.TEXT=`TEXT`,e.IMAGE=`IMAGE`,e.VIDEO=`VIDEO`,e.AUDIO=`AUDIO`,e.DOCUMENT=`DOCUMENT`})(Ne||={});var Pe;(function(e){e.MODEL_STAGE_UNSPECIFIED=`MODEL_STAGE_UNSPECIFIED`,e.UNSTABLE_EXPERIMENTAL=`UNSTABLE_EXPERIMENTAL`,e.EXPERIMENTAL=`EXPERIMENTAL`,e.PREVIEW=`PREVIEW`,e.STABLE=`STABLE`,e.LEGACY=`LEGACY`,e.DEPRECATED=`DEPRECATED`,e.RETIRED=`RETIRED`})(Pe||={});var Fe;(function(e){e.MEDIA_RESOLUTION_UNSPECIFIED=`MEDIA_RESOLUTION_UNSPECIFIED`,e.MEDIA_RESOLUTION_LOW=`MEDIA_RESOLUTION_LOW`,e.MEDIA_RESOLUTION_MEDIUM=`MEDIA_RESOLUTION_MEDIUM`,e.MEDIA_RESOLUTION_HIGH=`MEDIA_RESOLUTION_HIGH`})(Fe||={});var Ie;(function(e){e.MODALITY_UNSPECIFIED=`MODALITY_UNSPECIFIED`,e.TEXT=`TEXT`,e.IMAGE=`IMAGE`,e.AUDIO=`AUDIO`,e.VIDEO=`VIDEO`})(Ie||={});var Le;(function(e){e.DELIVERY_UNSPECIFIED=`DELIVERY_UNSPECIFIED`,e.INLINE=`INLINE`,e.URI=`URI`})(Le||={});var Re;(function(e){e.ASPECT_RATIO_UNSPECIFIED=`ASPECT_RATIO_UNSPECIFIED`,e.ASPECT_RATIO_ONE_BY_ONE=`ASPECT_RATIO_ONE_BY_ONE`,e.ASPECT_RATIO_TWO_BY_THREE=`ASPECT_RATIO_TWO_BY_THREE`,e.ASPECT_RATIO_THREE_BY_TWO=`ASPECT_RATIO_THREE_BY_TWO`,e.ASPECT_RATIO_THREE_BY_FOUR=`ASPECT_RATIO_THREE_BY_FOUR`,e.ASPECT_RATIO_FOUR_BY_THREE=`ASPECT_RATIO_FOUR_BY_THREE`,e.ASPECT_RATIO_FOUR_BY_FIVE=`ASPECT_RATIO_FOUR_BY_FIVE`,e.ASPECT_RATIO_FIVE_BY_FOUR=`ASPECT_RATIO_FIVE_BY_FOUR`,e.ASPECT_RATIO_NINE_BY_SIXTEEN=`ASPECT_RATIO_NINE_BY_SIXTEEN`,e.ASPECT_RATIO_SIXTEEN_BY_NINE=`ASPECT_RATIO_SIXTEEN_BY_NINE`,e.ASPECT_RATIO_TWENTY_ONE_BY_NINE=`ASPECT_RATIO_TWENTY_ONE_BY_NINE`,e.ASPECT_RATIO_ONE_BY_EIGHT=`ASPECT_RATIO_ONE_BY_EIGHT`,e.ASPECT_RATIO_EIGHT_BY_ONE=`ASPECT_RATIO_EIGHT_BY_ONE`,e.ASPECT_RATIO_ONE_BY_FOUR=`ASPECT_RATIO_ONE_BY_FOUR`,e.ASPECT_RATIO_FOUR_BY_ONE=`ASPECT_RATIO_FOUR_BY_ONE`})(Re||={});var ze;(function(e){e.IMAGE_SIZE_UNSPECIFIED=`IMAGE_SIZE_UNSPECIFIED`,e.IMAGE_SIZE_FIVE_TWELVE=`IMAGE_SIZE_FIVE_TWELVE`,e.IMAGE_SIZE_ONE_K=`IMAGE_SIZE_ONE_K`,e.IMAGE_SIZE_TWO_K=`IMAGE_SIZE_TWO_K`,e.IMAGE_SIZE_FOUR_K=`IMAGE_SIZE_FOUR_K`})(ze||={});var Be;(function(e){e.TUNING_MODE_UNSPECIFIED=`TUNING_MODE_UNSPECIFIED`,e.TUNING_MODE_FULL=`TUNING_MODE_FULL`,e.TUNING_MODE_PEFT_ADAPTER=`TUNING_MODE_PEFT_ADAPTER`})(Be||={});var Ve;(function(e){e.ADAPTER_SIZE_UNSPECIFIED=`ADAPTER_SIZE_UNSPECIFIED`,e.ADAPTER_SIZE_ONE=`ADAPTER_SIZE_ONE`,e.ADAPTER_SIZE_TWO=`ADAPTER_SIZE_TWO`,e.ADAPTER_SIZE_FOUR=`ADAPTER_SIZE_FOUR`,e.ADAPTER_SIZE_EIGHT=`ADAPTER_SIZE_EIGHT`,e.ADAPTER_SIZE_SIXTEEN=`ADAPTER_SIZE_SIXTEEN`,e.ADAPTER_SIZE_THIRTY_TWO=`ADAPTER_SIZE_THIRTY_TWO`})(Ve||={});var He;(function(e){e.RESPONSE_PARSE_TYPE_UNSPECIFIED=`RESPONSE_PARSE_TYPE_UNSPECIFIED`,e.IDENTITY=`IDENTITY`,e.REGEX_EXTRACT=`REGEX_EXTRACT`})(He||={});var Ue;(function(e){e.MATCH_OPERATION_UNSPECIFIED=`MATCH_OPERATION_UNSPECIFIED`,e.REGEX_CONTAINS=`REGEX_CONTAINS`,e.PARTIAL_MATCH=`PARTIAL_MATCH`,e.EXACT_MATCH=`EXACT_MATCH`})(Ue||={});var We;(function(e){e.REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED=`REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED`,e.MINIMAL=`MINIMAL`,e.HIGH=`HIGH`})(We||={});var Ge;(function(e){e.JOB_STATE_UNSPECIFIED=`JOB_STATE_UNSPECIFIED`,e.JOB_STATE_QUEUED=`JOB_STATE_QUEUED`,e.JOB_STATE_PENDING=`JOB_STATE_PENDING`,e.JOB_STATE_RUNNING=`JOB_STATE_RUNNING`,e.JOB_STATE_SUCCEEDED=`JOB_STATE_SUCCEEDED`,e.JOB_STATE_FAILED=`JOB_STATE_FAILED`,e.JOB_STATE_CANCELLING=`JOB_STATE_CANCELLING`,e.JOB_STATE_CANCELLED=`JOB_STATE_CANCELLED`,e.JOB_STATE_PAUSED=`JOB_STATE_PAUSED`,e.JOB_STATE_EXPIRED=`JOB_STATE_EXPIRED`,e.JOB_STATE_UPDATING=`JOB_STATE_UPDATING`,e.JOB_STATE_PARTIALLY_SUCCEEDED=`JOB_STATE_PARTIALLY_SUCCEEDED`})(Ge||={});var Ke;(function(e){e.TUNING_JOB_STATE_UNSPECIFIED=`TUNING_JOB_STATE_UNSPECIFIED`,e.TUNING_JOB_STATE_WAITING_FOR_QUOTA=`TUNING_JOB_STATE_WAITING_FOR_QUOTA`,e.TUNING_JOB_STATE_PROCESSING_DATASET=`TUNING_JOB_STATE_PROCESSING_DATASET`,e.TUNING_JOB_STATE_WAITING_FOR_CAPACITY=`TUNING_JOB_STATE_WAITING_FOR_CAPACITY`,e.TUNING_JOB_STATE_TUNING=`TUNING_JOB_STATE_TUNING`,e.TUNING_JOB_STATE_POST_PROCESSING=`TUNING_JOB_STATE_POST_PROCESSING`})(Ke||={});var qe;(function(e){e.AGGREGATION_METRIC_UNSPECIFIED=`AGGREGATION_METRIC_UNSPECIFIED`,e.AVERAGE=`AVERAGE`,e.MODE=`MODE`,e.STANDARD_DEVIATION=`STANDARD_DEVIATION`,e.VARIANCE=`VARIANCE`,e.MINIMUM=`MINIMUM`,e.MAXIMUM=`MAXIMUM`,e.MEDIAN=`MEDIAN`,e.PERCENTILE_P90=`PERCENTILE_P90`,e.PERCENTILE_P95=`PERCENTILE_P95`,e.PERCENTILE_P99=`PERCENTILE_P99`})(qe||={});var Je;(function(e){e.PAIRWISE_CHOICE_UNSPECIFIED=`PAIRWISE_CHOICE_UNSPECIFIED`,e.BASELINE=`BASELINE`,e.CANDIDATE=`CANDIDATE`,e.TIE=`TIE`})(Je||={});var Ye;(function(e){e.VIDEO_ORIENTATION_UNSPECIFIED=`VIDEO_ORIENTATION_UNSPECIFIED`,e.LANDSCAPE=`LANDSCAPE`,e.PORTRAIT=`PORTRAIT`})(Ye||={});var Xe;(function(e){e.TUNING_SPEED_UNSPECIFIED=`TUNING_SPEED_UNSPECIFIED`,e.REGULAR=`REGULAR`,e.FAST=`FAST`})(Xe||={});var Ze;(function(e){e.TUNING_TASK_UNSPECIFIED=`TUNING_TASK_UNSPECIFIED`,e.TUNING_TASK_I2V=`TUNING_TASK_I2V`,e.TUNING_TASK_T2V=`TUNING_TASK_T2V`,e.TUNING_TASK_R2V=`TUNING_TASK_R2V`})(Ze||={});var Qe;(function(e){e.STATE_UNSPECIFIED=`STATE_UNSPECIFIED`,e.STATE_PENDING=`STATE_PENDING`,e.STATE_ACTIVE=`STATE_ACTIVE`,e.STATE_FAILED=`STATE_FAILED`})(Qe||={});var $e;(function(e){e.UNSPECIFIED=`unspecified`,e.FLEX=`flex`,e.STANDARD=`standard`,e.PRIORITY=`priority`})($e||={});var et;(function(e){e.MEDIA_PROCESSING_UNSPECIFIED=`MEDIA_PROCESSING_UNSPECIFIED`,e.STATIC=`STATIC`,e.AGENTIC=`AGENTIC`})(et||={});var tt;(function(e){e.MEDIA_RESOLUTION_UNSPECIFIED=`MEDIA_RESOLUTION_UNSPECIFIED`,e.MEDIA_RESOLUTION_LOW=`MEDIA_RESOLUTION_LOW`,e.MEDIA_RESOLUTION_MEDIUM=`MEDIA_RESOLUTION_MEDIUM`,e.MEDIA_RESOLUTION_HIGH=`MEDIA_RESOLUTION_HIGH`,e.MEDIA_RESOLUTION_ULTRA_HIGH=`MEDIA_RESOLUTION_ULTRA_HIGH`})(tt||={});var nt;(function(e){e.TOOL_TYPE_UNSPECIFIED=`TOOL_TYPE_UNSPECIFIED`,e.GOOGLE_SEARCH_WEB=`GOOGLE_SEARCH_WEB`,e.GOOGLE_SEARCH_IMAGE=`GOOGLE_SEARCH_IMAGE`,e.URL_CONTEXT=`URL_CONTEXT`,e.GOOGLE_MAPS=`GOOGLE_MAPS`,e.FILE_SEARCH=`FILE_SEARCH`,e.MEDIA_PROCESSING=`MEDIA_PROCESSING`})(nt||={});var rt;(function(e){e.COLLECTION=`COLLECTION`})(rt||={});var it;(function(e){e.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED=`FEATURE_SELECTION_PREFERENCE_UNSPECIFIED`,e.PRIORITIZE_QUALITY=`PRIORITIZE_QUALITY`,e.BALANCED=`BALANCED`,e.PRIORITIZE_COST=`PRIORITIZE_COST`})(it||={});var at;(function(e){e.PREDICT=`PREDICT`,e.EMBED_CONTENT=`EMBED_CONTENT`})(at||={});var ot;(function(e){e.BLOCK_LOW_AND_ABOVE=`BLOCK_LOW_AND_ABOVE`,e.BLOCK_MEDIUM_AND_ABOVE=`BLOCK_MEDIUM_AND_ABOVE`,e.BLOCK_ONLY_HIGH=`BLOCK_ONLY_HIGH`,e.BLOCK_NONE=`BLOCK_NONE`})(ot||={});var st;(function(e){e.auto=`auto`,e.en=`en`,e.ja=`ja`,e.ko=`ko`,e.hi=`hi`,e.zh=`zh`,e.pt=`pt`,e.es=`es`})(st||={});var ct;(function(e){e.MASK_MODE_DEFAULT=`MASK_MODE_DEFAULT`,e.MASK_MODE_USER_PROVIDED=`MASK_MODE_USER_PROVIDED`,e.MASK_MODE_BACKGROUND=`MASK_MODE_BACKGROUND`,e.MASK_MODE_FOREGROUND=`MASK_MODE_FOREGROUND`,e.MASK_MODE_SEMANTIC=`MASK_MODE_SEMANTIC`})(ct||={});var lt;(function(e){e.CONTROL_TYPE_DEFAULT=`CONTROL_TYPE_DEFAULT`,e.CONTROL_TYPE_CANNY=`CONTROL_TYPE_CANNY`,e.CONTROL_TYPE_SCRIBBLE=`CONTROL_TYPE_SCRIBBLE`,e.CONTROL_TYPE_FACE_MESH=`CONTROL_TYPE_FACE_MESH`})(lt||={});var ut;(function(e){e.SUBJECT_TYPE_DEFAULT=`SUBJECT_TYPE_DEFAULT`,e.SUBJECT_TYPE_PERSON=`SUBJECT_TYPE_PERSON`,e.SUBJECT_TYPE_ANIMAL=`SUBJECT_TYPE_ANIMAL`,e.SUBJECT_TYPE_PRODUCT=`SUBJECT_TYPE_PRODUCT`})(ut||={});var dt;(function(e){e.EDIT_MODE_DEFAULT=`EDIT_MODE_DEFAULT`,e.EDIT_MODE_INPAINT_REMOVAL=`EDIT_MODE_INPAINT_REMOVAL`,e.EDIT_MODE_INPAINT_INSERTION=`EDIT_MODE_INPAINT_INSERTION`,e.EDIT_MODE_OUTPAINT=`EDIT_MODE_OUTPAINT`,e.EDIT_MODE_CONTROLLED_EDITING=`EDIT_MODE_CONTROLLED_EDITING`,e.EDIT_MODE_STYLE=`EDIT_MODE_STYLE`,e.EDIT_MODE_BGSWAP=`EDIT_MODE_BGSWAP`,e.EDIT_MODE_PRODUCT_IMAGE=`EDIT_MODE_PRODUCT_IMAGE`})(dt||={});var ft;(function(e){e.FOREGROUND=`FOREGROUND`,e.BACKGROUND=`BACKGROUND`,e.PROMPT=`PROMPT`,e.SEMANTIC=`SEMANTIC`,e.INTERACTIVE=`INTERACTIVE`})(ft||={});var pt;(function(e){e.ASSET=`ASSET`,e.STYLE=`STYLE`})(pt||={});var mt;(function(e){e.INSERT=`INSERT`,e.REMOVE=`REMOVE`,e.REMOVE_STATIC=`REMOVE_STATIC`,e.OUTPAINT=`OUTPAINT`})(mt||={});var ht;(function(e){e.OPTIMIZED=`OPTIMIZED`,e.LOSSLESS=`LOSSLESS`})(ht||={});var gt;(function(e){e.CROP=`CROP`,e.PAD=`PAD`})(gt||={});var _t;(function(e){e.SUPERVISED_FINE_TUNING=`SUPERVISED_FINE_TUNING`,e.PREFERENCE_TUNING=`PREFERENCE_TUNING`,e.DISTILLATION=`DISTILLATION`,e.REINFORCEMENT_TUNING=`REINFORCEMENT_TUNING`})(_t||={});var vt;(function(e){e.STATE_UNSPECIFIED=`STATE_UNSPECIFIED`,e.PROCESSING=`PROCESSING`,e.ACTIVE=`ACTIVE`,e.FAILED=`FAILED`})(vt||={});var yt;(function(e){e.SOURCE_UNSPECIFIED=`SOURCE_UNSPECIFIED`,e.UPLOADED=`UPLOADED`,e.GENERATED=`GENERATED`,e.REGISTERED=`REGISTERED`})(yt||={});var bt;(function(e){e.TURN_COMPLETE_REASON_UNSPECIFIED=`TURN_COMPLETE_REASON_UNSPECIFIED`,e.MALFORMED_FUNCTION_CALL=`MALFORMED_FUNCTION_CALL`,e.RESPONSE_REJECTED=`RESPONSE_REJECTED`,e.NEED_MORE_INPUT=`NEED_MORE_INPUT`,e.PROHIBITED_INPUT_CONTENT=`PROHIBITED_INPUT_CONTENT`,e.IMAGE_PROHIBITED_INPUT_CONTENT=`IMAGE_PROHIBITED_INPUT_CONTENT`,e.INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED=`INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED`,e.INPUT_IMAGE_CELEBRITY=`INPUT_IMAGE_CELEBRITY`,e.INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED=`INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED`,e.INPUT_TEXT_NCII_PROHIBITED=`INPUT_TEXT_NCII_PROHIBITED`,e.INPUT_OTHER=`INPUT_OTHER`,e.INPUT_IP_PROHIBITED=`INPUT_IP_PROHIBITED`,e.BLOCKLIST=`BLOCKLIST`,e.UNSAFE_PROMPT_FOR_IMAGE_GENERATION=`UNSAFE_PROMPT_FOR_IMAGE_GENERATION`,e.GENERATED_IMAGE_SAFETY=`GENERATED_IMAGE_SAFETY`,e.GENERATED_CONTENT_SAFETY=`GENERATED_CONTENT_SAFETY`,e.GENERATED_AUDIO_SAFETY=`GENERATED_AUDIO_SAFETY`,e.GENERATED_VIDEO_SAFETY=`GENERATED_VIDEO_SAFETY`,e.GENERATED_CONTENT_PROHIBITED=`GENERATED_CONTENT_PROHIBITED`,e.GENERATED_CONTENT_BLOCKLIST=`GENERATED_CONTENT_BLOCKLIST`,e.GENERATED_IMAGE_PROHIBITED=`GENERATED_IMAGE_PROHIBITED`,e.GENERATED_IMAGE_CELEBRITY=`GENERATED_IMAGE_CELEBRITY`,e.GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER=`GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER`,e.GENERATED_IMAGE_IDENTIFIABLE_PEOPLE=`GENERATED_IMAGE_IDENTIFIABLE_PEOPLE`,e.GENERATED_IMAGE_MINORS=`GENERATED_IMAGE_MINORS`,e.OUTPUT_IMAGE_IP_PROHIBITED=`OUTPUT_IMAGE_IP_PROHIBITED`,e.GENERATED_OTHER=`GENERATED_OTHER`,e.MAX_REGENERATION_REACHED=`MAX_REGENERATION_REACHED`})(bt||={});var xt;(function(e){e.INTERACTION_STATUS_UNSPECIFIED=`INTERACTION_STATUS_UNSPECIFIED`,e.IN_PROGRESS=`IN_PROGRESS`,e.REQUIRES_ACTION=`REQUIRES_ACTION`,e.IDLE=`IDLE`})(xt||={});var St;(function(e){e.VAD_SIGNAL_TYPE_UNSPECIFIED=`VAD_SIGNAL_TYPE_UNSPECIFIED`,e.VAD_SIGNAL_TYPE_SOS=`VAD_SIGNAL_TYPE_SOS`,e.VAD_SIGNAL_TYPE_EOS=`VAD_SIGNAL_TYPE_EOS`})(St||={});var Ct;(function(e){e.TYPE_UNSPECIFIED=`TYPE_UNSPECIFIED`,e.ACTIVITY_START=`ACTIVITY_START`,e.ACTIVITY_END=`ACTIVITY_END`})(Ct||={});var wt;(function(e){e.START_SENSITIVITY_UNSPECIFIED=`START_SENSITIVITY_UNSPECIFIED`,e.START_SENSITIVITY_HIGH=`START_SENSITIVITY_HIGH`,e.START_SENSITIVITY_LOW=`START_SENSITIVITY_LOW`})(wt||={});var Tt;(function(e){e.END_SENSITIVITY_UNSPECIFIED=`END_SENSITIVITY_UNSPECIFIED`,e.END_SENSITIVITY_HIGH=`END_SENSITIVITY_HIGH`,e.END_SENSITIVITY_LOW=`END_SENSITIVITY_LOW`})(Tt||={});var Et;(function(e){e.ACTIVITY_HANDLING_UNSPECIFIED=`ACTIVITY_HANDLING_UNSPECIFIED`,e.START_OF_ACTIVITY_INTERRUPTS=`START_OF_ACTIVITY_INTERRUPTS`,e.NO_INTERRUPTION=`NO_INTERRUPTION`})(Et||={});var Dt;(function(e){e.TURN_COVERAGE_UNSPECIFIED=`TURN_COVERAGE_UNSPECIFIED`,e.TURN_INCLUDES_ONLY_ACTIVITY=`TURN_INCLUDES_ONLY_ACTIVITY`,e.TURN_INCLUDES_ALL_INPUT=`TURN_INCLUDES_ALL_INPUT`,e.TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO=`TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO`})(Dt||={});var Ot;(function(e){e.MODE_UNSPECIFIED=`MODE_UNSPECIFIED`,e.VERBATIM=`VERBATIM`,e.SMART=`SMART`})(Ot||={});var kt;(function(e){e.SCALE_UNSPECIFIED=`SCALE_UNSPECIFIED`,e.C_MAJOR_A_MINOR=`C_MAJOR_A_MINOR`,e.D_FLAT_MAJOR_B_FLAT_MINOR=`D_FLAT_MAJOR_B_FLAT_MINOR`,e.D_MAJOR_B_MINOR=`D_MAJOR_B_MINOR`,e.E_FLAT_MAJOR_C_MINOR=`E_FLAT_MAJOR_C_MINOR`,e.E_MAJOR_D_FLAT_MINOR=`E_MAJOR_D_FLAT_MINOR`,e.F_MAJOR_D_MINOR=`F_MAJOR_D_MINOR`,e.G_FLAT_MAJOR_E_FLAT_MINOR=`G_FLAT_MAJOR_E_FLAT_MINOR`,e.G_MAJOR_E_MINOR=`G_MAJOR_E_MINOR`,e.A_FLAT_MAJOR_F_MINOR=`A_FLAT_MAJOR_F_MINOR`,e.A_MAJOR_G_FLAT_MINOR=`A_MAJOR_G_FLAT_MINOR`,e.B_FLAT_MAJOR_G_MINOR=`B_FLAT_MAJOR_G_MINOR`,e.B_MAJOR_A_FLAT_MINOR=`B_MAJOR_A_FLAT_MINOR`})(kt||={});var At;(function(e){e.MUSIC_GENERATION_MODE_UNSPECIFIED=`MUSIC_GENERATION_MODE_UNSPECIFIED`,e.QUALITY=`QUALITY`,e.DIVERSITY=`DIVERSITY`,e.VOCALIZATION=`VOCALIZATION`})(At||={});var jt;(function(e){e.PLAYBACK_CONTROL_UNSPECIFIED=`PLAYBACK_CONTROL_UNSPECIFIED`,e.PLAY=`PLAY`,e.PAUSE=`PAUSE`,e.STOP=`STOP`,e.RESET_CONTEXT=`RESET_CONTEXT`})(jt||={});var Mt=class{constructor(e){let t={};for(let n of e.headers.entries())t[n[0]]=n[1];this.headers=t,this.responseInternal=e}json(){return this.responseInternal.json()}},Nt=class{get text(){if(this.candidates?.[0]?.content?.parts?.length===0)return;this.candidates&&this.candidates.length>1&&console.warn(`there are multiple candidates in the response, returning text from the first one.`);let e=``,t=!1,n=[];for(let r of this.candidates?.[0]?.content?.parts??[]){for(let[e,t]of Object.entries(r))e!==`text`&&e!==`thought`&&e!==`thoughtSignature`&&(t!==null||t!==void 0)&&n.push(e);if(typeof r.text==`string`){if(typeof r.thought==`boolean`&&r.thought)continue;t=!0,e+=r.text}}return n.length>0&&console.warn(`there are non-text parts ${n} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),t?e:void 0}get data(){if(this.candidates?.[0]?.content?.parts?.length===0)return;this.candidates&&this.candidates.length>1&&console.warn(`there are multiple candidates in the response, returning data from the first one.`);let e=``,t=[];for(let n of this.candidates?.[0]?.content?.parts??[]){for(let[e,r]of Object.entries(n))e!==`inlineData`&&(r!==null||r!==void 0)&&t.push(e);n.inlineData&&typeof n.inlineData.data==`string`&&(e+=atob(n.inlineData.data))}return t.length>0&&console.warn(`there are non-data parts ${t} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),e.length>0?btoa(e):void 0}get functionCalls(){if(this.candidates?.[0]?.content?.parts?.length===0)return;this.candidates&&this.candidates.length>1&&console.warn(`there are multiple candidates in the response, returning function calls from the first one.`);let e=(this.candidates?.[0]?.content?.parts)?.filter(e=>e.functionCall).map(e=>e.functionCall).filter(e=>e!==void 0);if(e?.length!==0)return e}get executableCode(){if(this.candidates?.[0]?.content?.parts?.length===0)return;this.candidates&&this.candidates.length>1&&console.warn(`there are multiple candidates in the response, returning executable code from the first one.`);let e=(this.candidates?.[0]?.content?.parts)?.filter(e=>e.executableCode).map(e=>e.executableCode).filter(e=>e!==void 0);if(e?.length!==0)return e?.[0]?.code}get codeExecutionResult(){if(this.candidates?.[0]?.content?.parts?.length===0)return;this.candidates&&this.candidates.length>1&&console.warn(`there are multiple candidates in the response, returning code execution result from the first one.`);let e=(this.candidates?.[0]?.content?.parts)?.filter(e=>e.codeExecutionResult).map(e=>e.codeExecutionResult).filter(e=>e!==void 0);if(e?.length!==0)return e?.[0]?.output}},Pt=class{},Ft=class{},It=class{},Lt=class{},Rt=class{},zt=class{},Bt=class{},Vt=class{},Ht=class{},Ut=class{},Wt=class e{_fromAPIResponse({apiResponse:t,_isVertexAI:n}){let r=new e,i,a=t;return i=n?D(a):E(a),Object.assign(r,i),r}},Gt=class{},Kt=class{},qt=class{},Jt=class{},Yt=class{},Xt=class{},Zt=class{},Qt=class{},$t=class e{_fromAPIResponse({apiResponse:t,_isVertexAI:n}){let r=new e,i=re(t);return Object.assign(r,i),r}},en=class{},tn=class{},nn=class{},rn=class{},an=class{},on=class{get text(){let e=``,t=!1,n=[];for(let r of this.serverContent?.modelTurn?.parts??[]){for(let[e,t]of Object.entries(r))e!==`text`&&e!==`thought`&&t!==null&&n.push(e);if(typeof r.text==`string`){if(typeof r.thought==`boolean`&&r.thought)continue;t=!0,e+=r.text}}return n.length>0&&console.warn(`there are non-text parts ${n} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),t?e:void 0}get data(){let e=``,t=[];for(let n of this.serverContent?.modelTurn?.parts??[]){for(let[e,r]of Object.entries(n))e!==`inlineData`&&r!==null&&t.push(e);n.inlineData&&typeof n.inlineData.data==`string`&&(e+=atob(n.inlineData.data))}return t.length>0&&console.warn(`there are non-data parts ${t} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),e.length>0?btoa(e):void 0}},sn=class{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}},cn=class e{_fromAPIResponse({apiResponse:t,_isVertexAI:n}){let r=new e,i=ae(t);return Object.assign(r,i),r}};function M(e,t){if(!t||typeof t!=`string`)throw Error(`model is required and must be a string`);if(t.includes(`..`)||t.includes(`?`)||t.includes(`&`))throw Error(`invalid model parameter`);if(e.isVertexAI()){if(t.startsWith(`publishers/`)||t.startsWith(`projects/`)||t.startsWith(`models/`))return t;if(t.indexOf(`/`)>=0){let e=t.split(`/`,2);return`publishers/${e[0]}/models/${e[1]}`}return`publishers/google/models/${t}`}return t.startsWith(`models/`)||t.startsWith(`tunedModels/`)?t:`models/${t}`}function ln(e,t){let n=M(e,t);return n?n.startsWith(`publishers/`)&&e.isVertexAI()?`projects/${e.getProject()}/locations/${e.getLocation()}/${n}`:n.startsWith(`models/`)&&e.isVertexAI()?`projects/${e.getProject()}/locations/${e.getLocation()}/publishers/google/${n}`:n:``}function un(e){return Array.isArray(e)?e.map(e=>dn(e)):[dn(e)]}function dn(e){if(typeof e==`object`&&e)return e;throw Error(`Could not parse input as Blob. Unsupported blob type: ${typeof e}`)}function fn(e){let t=dn(e);if(t.mimeType&&t.mimeType.startsWith(`image/`))return t;throw Error(`Unsupported mime type: ${t.mimeType}`)}function pn(e){let t=dn(e);if(t.mimeType&&t.mimeType.startsWith(`audio/`))return t;throw Error(`Unsupported mime type: ${t.mimeType}`)}function mn(e){if(e==null)throw Error(`PartUnion is required`);if(typeof e==`object`)return e;if(typeof e==`string`)return{text:e};throw Error(`Unsupported part type: ${typeof e}`)}function hn(e){if(e==null||Array.isArray(e)&&e.length===0)throw Error(`PartListUnion is required`);return Array.isArray(e)?e.map(e=>mn(e)):[mn(e)]}function gn(e){return typeof e==`object`&&!!e&&`parts`in e&&Array.isArray(e.parts)}function _n(e){return typeof e==`object`&&!!e&&`functionCall`in e}function vn(e){return typeof e==`object`&&!!e&&`functionResponse`in e}function N(e){if(e==null)throw Error(`ContentUnion is required`);return gn(e)?e:{role:`user`,parts:hn(e)}}function yn(e,t){if(!t)return[];if(e.isVertexAI()&&Array.isArray(t))return t.flatMap(e=>{let t=N(e);return t.parts&&t.parts.length>0&&t.parts[0].text!==void 0?[t.parts[0].text]:[]});if(e.isVertexAI()){let e=N(t);return e.parts&&e.parts.length>0&&e.parts[0].text!==void 0?[e.parts[0].text]:[]}return Array.isArray(t)?t.map(e=>N(e)):[N(t)]}function P(e){if(e==null||Array.isArray(e)&&e.length===0)throw Error(`contents are required`);if(!Array.isArray(e)){if(_n(e)||vn(e))throw Error(`To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them`);return[N(e)]}let t=[],n=[],r=gn(e[0]);for(let i of e){let e=gn(i);if(e!=r)throw Error(`Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them`);if(e)t.push(i);else if(_n(i)||vn(i))throw Error(`To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them`);else n.push(i)}return r||t.push({role:`user`,parts:hn(n)}),t}function bn(e,t){e.includes(`null`)&&(t.nullable=!0);let n=e.filter(e=>e!==`null`);if(n.length===1)t.type=Object.values(fe).includes(n[0].toUpperCase())?n[0].toUpperCase():fe.TYPE_UNSPECIFIED;else{t.anyOf=[];for(let e of n)t.anyOf.push({type:Object.values(fe).includes(e.toUpperCase())?e.toUpperCase():fe.TYPE_UNSPECIFIED})}}function xn(e){let t={},n=[`items`],r=[`anyOf`],i=[`properties`];if(e.type&&e.anyOf)throw Error(`type and anyOf cannot be both populated.`);let a=e.anyOf;a!=null&&a.length==2&&(a[0].type===`null`?(t.nullable=!0,e=a[1]):a[1].type===`null`&&(t.nullable=!0,e=a[0])),e.type instanceof Array&&bn(e.type,t);for(let[a,o]of Object.entries(e))if(o!=null){if(a==`type`){if(o===`null`)throw Error(`type: null can not be the only possible type for the field.`);if(o instanceof Array)continue;t.type=Object.values(fe).includes(o.toUpperCase())?o.toUpperCase():fe.TYPE_UNSPECIFIED}else if(n.includes(a))t[a]=xn(o);else if(r.includes(a)){let e=[];for(let n of o){if(n.type==`null`){t.nullable=!0;continue}e.push(xn(n))}t[a]=e}else if(i.includes(a)){let e={};for(let[t,n]of Object.entries(o))e[t]=xn(n);t[a]=e}else{if(a===`additionalProperties`)continue;t[a]=o}}return t}function Sn(e){return xn(e)}function Cn(e){return e}function wn(e){if(typeof e==`object`)return e;if(typeof e==`string`)return{voiceConfig:{prebuiltVoiceConfig:{voiceName:e}}};throw Error(`Unsupported speechConfig type: ${typeof e}`)}function Tn(e){if(`multiSpeakerVoiceConfig`in e)throw Error(`multiSpeakerVoiceConfig is not supported in the live API.`);return e}function En(e){if(e.functionDeclarations)for(let t of e.functionDeclarations)t.parameters&&(Object.keys(t.parameters).includes(`$schema`)?t.parametersJsonSchema||(t.parametersJsonSchema=t.parameters,delete t.parameters):t.parameters=xn(t.parameters)),t.response&&(Object.keys(t.response).includes(`$schema`)?t.responseJsonSchema||(t.responseJsonSchema=t.response,delete t.response):t.response=xn(t.response));return e}function Dn(e){if(e==null)throw Error(`tools is required`);if(!Array.isArray(e))throw Error(`tools is required and must be an array of Tools`);let t=[];for(let n of e)t.push(n);return t}function On(e,t,n,r=1){let i=!t.startsWith(`${n}/`)&&t.split(`/`).length===r;return e.isVertexAI()?t.startsWith(`projects/`)?t:t.startsWith(`locations/`)?`projects/${e.getProject()}/${t}`:t.startsWith(`${n}/`)?`projects/${e.getProject()}/locations/${e.getLocation()}/${t}`:i?`projects/${e.getProject()}/locations/${e.getLocation()}/${n}/${t}`:t:i?`${n}/${t}`:t}function kn(e,t){if(typeof t!=`string`)throw Error(`name must be a string`);return On(e,t,`cachedContents`)}function An(e){switch(e){case`STATE_UNSPECIFIED`:return`JOB_STATE_UNSPECIFIED`;case`CREATING`:return`JOB_STATE_RUNNING`;case`ACTIVE`:return`JOB_STATE_SUCCEEDED`;case`FAILED`:return`JOB_STATE_FAILED`;default:return e}}function jn(e){return w(e)}function Mn(e){return typeof e==`object`&&!!e&&`name`in e}function Nn(e){return typeof e==`object`&&!!e&&`video`in e}function Pn(e){return typeof e==`object`&&!!e&&`uri`in e}function Fn(e){let t;if(Mn(e)&&(t=e.name),!(Pn(e)&&(t=e.uri,t===void 0))&&!(Nn(e)&&(t=e.video?.uri,t===void 0))){if(typeof e==`string`&&(t=e),t===void 0)throw Error(`Could not extract file name from the provided input.`);if(t.startsWith(`https://`)){let e=t.split(`files/`)[1].match(/[a-z0-9]+/);if(e===null)throw Error(`Could not extract file name from URI ${t}`);t=e[0]}else t.startsWith(`files/`)&&(t=t.split(`files/`)[1]);return t}}function In(e,t){let n;return n=e.isVertexAI()?t?`publishers/google/models`:`models`:t?`models`:`tunedModels`,n}function Ln(e){for(let t of[`models`,`tunedModels`,`publisherModels`])if(Rn(e,t))return e[t];return[]}function Rn(e,t){return typeof e==`object`&&!!e&&t in e}function zn(e,t={}){let n=e,r={name:n.name,description:n.description,parametersJsonSchema:n.inputSchema};return n.outputSchema&&(r.responseJsonSchema=n.outputSchema),t.behavior&&(r.behavior=t.behavior),{functionDeclarations:[r]}}function Bn(e,t={}){let n=[],r=new Set;for(let i of e){let e=i.name;if(r.has(e))throw Error(`Duplicate function name ${e} found in MCP tools. Please ensure function names are unique.`);r.add(e);let a=zn(i,t);a.functionDeclarations&&n.push(...a.functionDeclarations)}return{functionDeclarations:n}}function Vn(e,t){let n;if(typeof t==`string`){if(e.isVertexAI()){if(t.startsWith(`gs://`))n={format:`jsonl`,gcsUri:[t]};else if(t.startsWith(`bq://`))n={format:`bigquery`,bigqueryUri:t};else if(/^projects\/[^/]+\/locations\/[^/]+\/datasets\/[^/]+$/.test(t))n={format:`vertex-dataset`,vertexDatasetName:t};else throw Error(`Unsupported string source for Vertex AI: ${t}`)}else if(t.startsWith(`files/`))n={fileName:t};else throw Error(`Unsupported string source for Gemini API: ${t}`)}else if(Array.isArray(t)){if(e.isVertexAI())throw Error(`InlinedRequest[] is not supported in Vertex AI.`);n={inlinedRequests:t}}else n=t;let r=[n.gcsUri,n.bigqueryUri,n.vertexDatasetName].filter(Boolean).length,i=[n.inlinedRequests,n.fileName].filter(Boolean).length;if(e.isVertexAI()){if(i>0||r!==1)throw Error("Exactly one of `gcsUri`, `bigqueryUri`, or `vertexDatasetName` must be set for Vertex AI.")}else if(r>0||i!==1)throw Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return n}function Hn(e){if(typeof e!=`string`)return e;let t=e;if(t.startsWith(`gs://`))return{format:`jsonl`,gcsUri:t};if(t.startsWith(`bq://`))return{format:`bigquery`,bigqueryUri:t};throw Error(`Unsupported destination: ${t}`)}function Un(e){if(typeof e!=`object`||!e)return{};let t=e,n=t.inlinedResponses;if(typeof n!=`object`||!n)return e;let r=n.inlinedResponses;if(!Array.isArray(r)||r.length===0)return e;let i=!1;for(let e of r){if(typeof e!=`object`||!e)continue;let t=e.response;if(typeof t==`object`&&t&&t.embedding!==void 0){i=!0;break}}return i&&(t.inlinedEmbedContentResponses=t.inlinedResponses,delete t.inlinedResponses),e}function Wn(e,t){let n=t;if(!e.isVertexAI()){if(/batches\/[^/]+$/.test(n))return n.split(`/`).pop();throw Error(`Invalid batch job name: ${n}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(n))return n.split(`/`).pop();if(/^\d+$/.test(n))return n;throw Error(`Invalid batch job name: ${n}.`)}function Gn(e){let t=e;return t===`BATCH_STATE_UNSPECIFIED`?`JOB_STATE_UNSPECIFIED`:t===`BATCH_STATE_PENDING`?`JOB_STATE_PENDING`:t===`BATCH_STATE_RUNNING`?`JOB_STATE_RUNNING`:t===`BATCH_STATE_SUCCEEDED`?`JOB_STATE_SUCCEEDED`:t===`BATCH_STATE_FAILED`?`JOB_STATE_FAILED`:t===`BATCH_STATE_CANCELLED`?`JOB_STATE_CANCELLED`:t===`BATCH_STATE_EXPIRED`?`JOB_STATE_EXPIRED`:t}function Kn(e){return e.includes(`gemini`)&&e!==`gemini-embedding-001`||e.includes(`maas`)}function qn(e){let t={},n=x(e,[`apiKey`]);if(n!=null&&b(t,[`apiKey`],n),x(e,[`apiKeyConfig`])!==void 0)throw Error(`apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`authType`])!==void 0)throw Error(`authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`googleServiceAccountConfig`])!==void 0)throw Error(`googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`httpBasicAuthConfig`])!==void 0)throw Error(`httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oauthConfig`])!==void 0)throw Error(`oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oidcConfig`])!==void 0)throw Error(`oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function Jn(e){let t={},n=x(e,[`responsesFile`]);n!=null&&b(t,[`fileName`],n);let r=x(e,[`inlinedResponses`,`inlinedResponses`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>Mr(e))),b(t,[`inlinedResponses`],e)}let i=x(e,[`inlinedEmbedContentResponses`,`inlinedResponses`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`inlinedEmbedContentResponses`],e)}return t}function Yn(e){let t={},n=x(e,[`predictionsFormat`]);n!=null&&b(t,[`format`],n);let r=x(e,[`gcsDestination`,`outputUriPrefix`]);r!=null&&b(t,[`gcsUri`],r);let i=x(e,[`bigqueryDestination`,`outputUri`]);i!=null&&b(t,[`bigqueryUri`],i);let a=x(e,[`vertexMultimodalDatasetDestination`]);return a!=null&&b(t,[`vertexDataset`],Ur(a)),t}function Xn(e){let t={},n=x(e,[`format`]);n!=null&&b(t,[`predictionsFormat`],n);let r=x(e,[`gcsUri`]);r!=null&&b(t,[`gcsDestination`,`outputUriPrefix`],r);let i=x(e,[`bigqueryUri`]);i!=null&&b(t,[`bigqueryDestination`,`outputUri`],i);let a=x(e,[`vertexDataset`]);if(a!=null&&b(t,[`vertexMultimodalDatasetDestination`],Wr(a)),x(e,[`fileName`])!==void 0)throw Error(`fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`inlinedResponses`])!==void 0)throw Error(`inlinedResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`inlinedEmbedContentResponses`])!==void 0)throw Error(`inlinedEmbedContentResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function Zn(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`metadata`,`displayName`]);r!=null&&b(t,[`displayName`],r);let i=x(e,[`metadata`,`state`]);i!=null&&b(t,[`state`],Gn(i));let a=x(e,[`metadata`,`createTime`]);a!=null&&b(t,[`createTime`],a);let o=x(e,[`metadata`,`endTime`]);o!=null&&b(t,[`endTime`],o);let s=x(e,[`metadata`,`updateTime`]);s!=null&&b(t,[`updateTime`],s);let c=x(e,[`metadata`,`model`]);c!=null&&b(t,[`model`],c);let l=x(e,[`metadata`,`output`]);return l!=null&&b(t,[`dest`],Jn(Un(l))),t}function Qn(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`displayName`]);r!=null&&b(t,[`displayName`],r);let i=x(e,[`state`]);i!=null&&b(t,[`state`],Gn(i));let a=x(e,[`error`]);a!=null&&b(t,[`error`],a);let o=x(e,[`createTime`]);o!=null&&b(t,[`createTime`],o);let s=x(e,[`startTime`]);s!=null&&b(t,[`startTime`],s);let c=x(e,[`endTime`]);c!=null&&b(t,[`endTime`],c);let l=x(e,[`updateTime`]);l!=null&&b(t,[`updateTime`],l);let u=x(e,[`model`]);u!=null&&b(t,[`model`],u);let d=x(e,[`inputConfig`]);d!=null&&b(t,[`src`],$n(d));let f=x(e,[`outputConfig`]);f!=null&&b(t,[`dest`],Yn(Un(f)));let p=x(e,[`outputInfo`]);p!=null&&b(t,[`outputInfo`],p);let m=x(e,[`completionStats`]);return m!=null&&b(t,[`completionStats`],m),t}function $n(e){let t={},n=x(e,[`instancesFormat`]);n!=null&&b(t,[`format`],n);let r=x(e,[`gcsSource`,`uris`]);r!=null&&b(t,[`gcsUri`],r);let i=x(e,[`bigquerySource`,`inputUri`]);i!=null&&b(t,[`bigqueryUri`],i);let a=x(e,[`vertexMultimodalDatasetSource`,`datasetName`]);return a!=null&&b(t,[`vertexDatasetName`],a),t}function er(e,t){let n={};if(x(t,[`format`])!==void 0)throw Error(`format parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(t,[`gcsUri`])!==void 0)throw Error(`gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(t,[`bigqueryUri`])!==void 0)throw Error(`bigqueryUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(t,[`vertexDatasetName`])!==void 0)throw Error(`vertexDatasetName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(t,[`fileName`]);r!=null&&b(n,[`fileName`],r);let i=x(t,[`inlinedRequests`]);if(i!=null){let t=i;Array.isArray(t)&&(t=t.map(t=>jr(e,t))),b(n,[`requests`,`requests`],t)}return n}function tr(e){let t={},n=x(e,[`format`]);n!=null&&b(t,[`instancesFormat`],n);let r=x(e,[`gcsUri`]);r!=null&&b(t,[`gcsSource`,`uris`],r);let i=x(e,[`bigqueryUri`]);i!=null&&b(t,[`bigquerySource`,`inputUri`],i);let a=x(e,[`vertexDatasetName`]);if(a!=null&&b(t,[`vertexMultimodalDatasetSource`,`datasetName`],a),x(e,[`fileName`])!==void 0)throw Error(`fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`inlinedRequests`])!==void 0)throw Error(`inlinedRequests parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function nr(e){let t={},n=x(e,[`data`]);if(n!=null&&b(t,[`data`],n),x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`mimeType`]);return r!=null&&b(t,[`mimeType`],r),t}function rr(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],Wn(e,r)),n}function ir(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],Wn(e,r)),n}function ar(e){let t={},n=x(e,[`content`]);n!=null&&b(t,[`content`],n);let r=x(e,[`citationMetadata`]);r!=null&&b(t,[`citationMetadata`],or(r));let i=x(e,[`tokenCount`]);i!=null&&b(t,[`tokenCount`],i);let a=x(e,[`finishReason`]);a!=null&&b(t,[`finishReason`],a);let o=x(e,[`groundingMetadata`]);o!=null&&b(t,[`groundingMetadata`],o);let s=x(e,[`avgLogprobs`]);s!=null&&b(t,[`avgLogprobs`],s);let c=x(e,[`index`]);c!=null&&b(t,[`index`],c);let l=x(e,[`logprobsResult`]);l!=null&&b(t,[`logprobsResult`],l);let u=x(e,[`safetyRatings`]);if(u!=null){let e=u;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`safetyRatings`],e)}let d=x(e,[`urlContextMetadata`]);return d!=null&&b(t,[`urlContextMetadata`],d),t}function or(e){let t={},n=x(e,[`citationSources`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`citations`],e)}return t}function sr(e){let t={},n=x(e,[`parts`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>zr(e))),b(t,[`parts`],e)}let r=x(e,[`role`]);return r!=null&&b(t,[`role`],r),t}function cr(e,t){let n={},r=x(e,[`displayName`]);if(t!==void 0&&r!=null&&b(t,[`batch`,`displayName`],r),x(e,[`dest`])!==void 0)throw Error(`dest parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let i=x(e,[`webhookConfig`]);return t!==void 0&&i!=null&&b(t,[`batch`,`webhookConfig`],i),n}function lr(e,t){let n={},r=x(e,[`displayName`]);t!==void 0&&r!=null&&b(t,[`displayName`],r);let i=x(e,[`dest`]);if(t!==void 0&&i!=null&&b(t,[`outputConfig`],Xn(Hn(i))),x(e,[`webhookConfig`])!==void 0)throw Error(`webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function ur(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`_url`,`model`],M(e,r));let i=x(t,[`src`]);i!=null&&b(n,[`batch`,`inputConfig`],er(e,Vn(e,i)));let a=x(t,[`config`]);return a!=null&&cr(a,n),n}function dr(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`model`],M(e,r));let i=x(t,[`src`]);i!=null&&b(n,[`inputConfig`],tr(Vn(e,i)));let a=x(t,[`config`]);return a!=null&&lr(a,n),n}function fr(e,t){let n={},r=x(e,[`displayName`]);return t!==void 0&&r!=null&&b(t,[`batch`,`displayName`],r),n}function pr(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`_url`,`model`],M(e,r));let i=x(t,[`src`]);i!=null&&b(n,[`batch`,`inputConfig`],br(e,i));let a=x(t,[`config`]);return a!=null&&fr(a,n),n}function mr(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],Wn(e,r)),n}function hr(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],Wn(e,r)),n}function gr(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`name`]);r!=null&&b(t,[`name`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);return a!=null&&b(t,[`error`],a),t}function _r(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`name`]);r!=null&&b(t,[`name`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);return a!=null&&b(t,[`error`],a),t}function vr(e,t){let n={},r=x(t,[`contents`]);if(r!=null){let t=yn(e,r);Array.isArray(t)&&(t=t.map(e=>e)),b(n,[`requests[]`,`request`,`content`],t)}let i=x(t,[`config`]);return i!=null&&(b(n,[`_self`],yr(i,n)),S(n,{"requests[].*":`requests[].request.*`})),n}function yr(e,t){let n={},r=x(e,[`taskType`]);t!==void 0&&r!=null&&b(t,[`requests[]`,`taskType`],r);let i=x(e,[`title`]);t!==void 0&&i!=null&&b(t,[`requests[]`,`title`],i);let a=x(e,[`outputDimensionality`]);if(t!==void 0&&a!=null&&b(t,[`requests[]`,`outputDimensionality`],a),x(e,[`mimeType`])!==void 0)throw Error(`mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`autoTruncate`])!==void 0)throw Error(`autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`documentOcr`])!==void 0)throw Error(`documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`audioTrackExtraction`])!==void 0)throw Error(`audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function br(e,t){let n={},r=x(t,[`fileName`]);r!=null&&b(n,[`file_name`],r);let i=x(t,[`inlinedRequests`]);return i!=null&&b(n,[`requests`],vr(e,i)),n}function xr(e){let t={};if(x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`fileUri`]);n!=null&&b(t,[`fileUri`],n);let r=x(e,[`mimeType`]);return r!=null&&b(t,[`mimeType`],r),t}function Sr(e){let t={},n=x(e,[`args`]);n!=null&&b(t,[`args`],n);let r=x(e,[`id`]);r!=null&&b(t,[`id`],r);let i=x(e,[`name`]);if(i!=null&&b(t,[`name`],i),x(e,[`partialArgs`])!==void 0)throw Error(`partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`willContinue`])!==void 0)throw Error(`willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function Cr(e){let t={},n=x(e,[`allowedFunctionNames`]);n!=null&&b(t,[`allowedFunctionNames`],n);let r=x(e,[`mode`]);if(r!=null&&b(t,[`mode`],r),x(e,[`streamFunctionCallArguments`])!==void 0)throw Error(`streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function wr(e,t,n){let r={},i=x(t,[`serviceTier`]);n!==void 0&&i!=null&&b(n,[`serviceTier`],i);let a=x(t,[`systemInstruction`]);n!==void 0&&a!=null&&b(n,[`systemInstruction`],sr(N(a)));let o=x(t,[`temperature`]);o!=null&&b(r,[`temperature`],o);let s=x(t,[`topP`]);s!=null&&b(r,[`topP`],s);let c=x(t,[`topK`]);c!=null&&b(r,[`topK`],c);let l=x(t,[`candidateCount`]);l!=null&&b(r,[`candidateCount`],l);let u=x(t,[`maxOutputTokens`]);u!=null&&b(r,[`maxOutputTokens`],u);let d=x(t,[`stopSequences`]);d!=null&&b(r,[`stopSequences`],d);let f=x(t,[`responseLogprobs`]);f!=null&&b(r,[`responseLogprobs`],f);let p=x(t,[`logprobs`]);p!=null&&b(r,[`logprobs`],p);let m=x(t,[`presencePenalty`]);m!=null&&b(r,[`presencePenalty`],m);let h=x(t,[`frequencyPenalty`]);h!=null&&b(r,[`frequencyPenalty`],h);let g=x(t,[`seed`]);g!=null&&b(r,[`seed`],g);let _=x(t,[`responseMimeType`]);_!=null&&b(r,[`responseMimeType`],_);let v=x(t,[`responseSchema`]);v!=null&&b(r,[`responseSchema`],Sn(v));let y=x(t,[`responseJsonSchema`]);if(y!=null&&b(r,[`responseJsonSchema`],Cn(y)),x(t,[`routingConfig`])!==void 0)throw Error(`routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(t,[`modelSelectionConfig`])!==void 0)throw Error(`modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let S=x(t,[`safetySettings`]);if(n!==void 0&&S!=null){let e=S;Array.isArray(e)&&(e=e.map(e=>Br(e))),b(n,[`safetySettings`],e)}let C=x(t,[`tools`]);if(n!==void 0&&C!=null){let e=Dn(C);Array.isArray(e)&&(e=e.map(e=>Hr(En(e)))),b(n,[`tools`],e)}let w=x(t,[`toolConfig`]);if(n!==void 0&&w!=null&&b(n,[`toolConfig`],Vr(w)),x(t,[`labels`])!==void 0)throw Error(`labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let T=x(t,[`cachedContent`]);n!==void 0&&T!=null&&b(n,[`cachedContent`],kn(e,T));let E=x(t,[`responseModalities`]);E!=null&&b(r,[`responseModalities`],E);let D=x(t,[`mediaResolution`]);D!=null&&b(r,[`mediaResolution`],D);let O=x(t,[`speechConfig`]);if(O!=null&&b(r,[`speechConfig`],wn(O)),x(t,[`audioTimestamp`])!==void 0)throw Error(`audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let k=x(t,[`thinkingConfig`]);k!=null&&b(r,[`thinkingConfig`],k);let A=x(t,[`audioTranscriptionConfig`]);A!=null&&b(r,[`audioTranscriptionConfig`],A);let ee=x(t,[`imageConfig`]);ee!=null&&b(r,[`imageConfig`],Ar(ee));let te=x(t,[`enableEnhancedCivicAnswers`]);if(te!=null&&b(r,[`enableEnhancedCivicAnswers`],te),x(t,[`modelArmorConfig`])!==void 0)throw Error(`modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return r}function Tr(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`candidates`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>ar(e))),b(t,[`candidates`],e)}let i=x(e,[`modelVersion`]);i!=null&&b(t,[`modelVersion`],i);let a=x(e,[`promptFeedback`]);a!=null&&b(t,[`promptFeedback`],a);let o=x(e,[`responseId`]);o!=null&&b(t,[`responseId`],o);let s=x(e,[`usageMetadata`]);s!=null&&b(t,[`usageMetadata`],s);let c=x(e,[`modelStatus`]);return c!=null&&b(t,[`modelStatus`],c),t}function Er(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],Wn(e,r)),n}function Dr(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],Wn(e,r)),n}function Or(e){let t={},n=x(e,[`authConfig`]);n!=null&&b(t,[`authConfig`],qn(n));let r=x(e,[`enableWidget`]);if(r!=null&&b(t,[`enableWidget`],r),x(e,[`groundingTypes`])!==void 0)throw Error(`groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function kr(e){let t={};if(x(e,[`blockingConfidence`])!==void 0)throw Error(`blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`excludeDomains`])!==void 0)throw Error(`excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`searchTypes`]);n!=null&&b(t,[`searchTypes`],n);let r=x(e,[`timeRangeFilter`]);return r!=null&&b(t,[`timeRangeFilter`],r),t}function Ar(e){let t={},n=x(e,[`aspectRatio`]);n!=null&&b(t,[`aspectRatio`],n);let r=x(e,[`imageSize`]);if(r!=null&&b(t,[`imageSize`],r),x(e,[`personGeneration`])!==void 0)throw Error(`personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`outputMimeType`])!==void 0)throw Error(`outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`outputCompressionQuality`])!==void 0)throw Error(`outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`imageOutputOptions`])!==void 0)throw Error(`imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`prominentPeople`])!==void 0)throw Error(`prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function jr(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`request`,`model`],M(e,r));let i=x(t,[`contents`]);if(i!=null){let e=P(i);Array.isArray(e)&&(e=e.map(e=>sr(e))),b(n,[`request`,`contents`],e)}let a=x(t,[`metadata`]);a!=null&&b(n,[`metadata`],a);let o=x(t,[`config`]);return o!=null&&b(n,[`request`,`generationConfig`],wr(e,o,x(n,[`request`],{}))),n}function Mr(e){let t={},n=x(e,[`response`]);n!=null&&b(t,[`response`],Tr(n));let r=x(e,[`metadata`]);r!=null&&b(t,[`metadata`],r);let i=x(e,[`error`]);return i!=null&&b(t,[`error`],i),t}function Nr(e,t){let n={},r=x(e,[`pageSize`]);t!==void 0&&r!=null&&b(t,[`_query`,`pageSize`],r);let i=x(e,[`pageToken`]);if(t!==void 0&&i!=null&&b(t,[`_query`,`pageToken`],i),x(e,[`filter`])!==void 0)throw Error(`filter parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function Pr(e,t){let n={},r=x(e,[`pageSize`]);t!==void 0&&r!=null&&b(t,[`_query`,`pageSize`],r);let i=x(e,[`pageToken`]);t!==void 0&&i!=null&&b(t,[`_query`,`pageToken`],i);let a=x(e,[`filter`]);return t!==void 0&&a!=null&&b(t,[`_query`,`filter`],a),n}function Fr(e){let t={},n=x(e,[`config`]);return n!=null&&Nr(n,t),t}function Ir(e){let t={},n=x(e,[`config`]);return n!=null&&Pr(n,t),t}function Lr(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`nextPageToken`]);r!=null&&b(t,[`nextPageToken`],r);let i=x(e,[`operations`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>Zn(e))),b(t,[`batchJobs`],e)}return t}function Rr(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`nextPageToken`]);r!=null&&b(t,[`nextPageToken`],r);let i=x(e,[`batchPredictionJobs`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>Qn(e))),b(t,[`batchJobs`],e)}return t}function zr(e){let t={},n=x(e,[`mediaResolution`]);n!=null&&b(t,[`mediaResolution`],n);let r=x(e,[`toolCall`]);r!=null&&b(t,[`toolCall`],r);let i=x(e,[`toolResponse`]);i!=null&&b(t,[`toolResponse`],i);let a=x(e,[`audioTranscription`]);a!=null&&b(t,[`audioTranscription`],a);let o=x(e,[`codeExecutionResult`]);o!=null&&b(t,[`codeExecutionResult`],o);let s=x(e,[`executableCode`]);s!=null&&b(t,[`executableCode`],s);let c=x(e,[`fileData`]);c!=null&&b(t,[`fileData`],xr(c));let l=x(e,[`functionCall`]);l!=null&&b(t,[`functionCall`],Sr(l));let u=x(e,[`functionResponse`]);u!=null&&b(t,[`functionResponse`],u);let d=x(e,[`inlineData`]);d!=null&&b(t,[`inlineData`],nr(d));let f=x(e,[`text`]);f!=null&&b(t,[`text`],f);let p=x(e,[`thought`]);p!=null&&b(t,[`thought`],p);let m=x(e,[`thoughtSignature`]);m!=null&&b(t,[`thoughtSignature`],m);let h=x(e,[`videoMetadata`]);h!=null&&b(t,[`videoMetadata`],h);let g=x(e,[`partMetadata`]);g!=null&&b(t,[`partMetadata`],g);let _=x(e,[`mediaProcessing`]);return _!=null&&b(t,[`mediaProcessing`],_),t}function Br(e){let t={},n=x(e,[`category`]);if(n!=null&&b(t,[`category`],n),x(e,[`method`])!==void 0)throw Error(`method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`threshold`]);return r!=null&&b(t,[`threshold`],r),t}function Vr(e){let t={},n=x(e,[`functionCallingConfig`]);n!=null&&b(t,[`functionCallingConfig`],Cr(n));let r=x(e,[`retrievalConfig`]);r!=null&&b(t,[`retrievalConfig`],r);let i=x(e,[`includeServerSideToolInvocations`]);return i!=null&&b(t,[`includeServerSideToolInvocations`],i),t}function Hr(e){let t={};if(x(e,[`retrieval`])!==void 0)throw Error(`retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`googleMaps`]);n!=null&&b(t,[`googleMaps`],Or(n));let r=x(e,[`mcpServers`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`mcpServers`],e)}let i=x(e,[`codeExecution`]);i!=null&&b(t,[`codeExecution`],i);let a=x(e,[`computerUse`]);if(a!=null&&b(t,[`computerUse`],a),x(e,[`enterpriseWebSearch`])!==void 0)throw Error(`enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`exaAiSearch`])!==void 0)throw Error(`exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let o=x(e,[`functionDeclarations`]);if(o!=null){let e=o;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`functionDeclarations`],e)}let s=x(e,[`googleSearch`]);s!=null&&b(t,[`googleSearch`],kr(s));let c=x(e,[`googleSearchRetrieval`]);if(c!=null&&b(t,[`googleSearchRetrieval`],c),x(e,[`parallelAiSearch`])!==void 0)throw Error(`parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let l=x(e,[`urlContext`]);l!=null&&b(t,[`urlContext`],l);let u=x(e,[`fileSearch`]);return u!=null&&b(t,[`fileSearch`],u),t}function Ur(e){let t={},n=x(e,[`bigqueryDestination`,`outputUri`]);n!=null&&b(t,[`bigqueryDestination`],n);let r=x(e,[`displayName`]);return r!=null&&b(t,[`displayName`],r),t}function Wr(e){let t={},n=x(e,[`bigqueryDestination`]);n!=null&&b(t,[`bigqueryDestination`,`outputUri`],n);let r=x(e,[`displayName`]);return r!=null&&b(t,[`displayName`],r),t}var Gr;(function(e){e.PAGED_ITEM_BATCH_JOBS=`batchJobs`,e.PAGED_ITEM_MODELS=`models`,e.PAGED_ITEM_TUNING_JOBS=`tuningJobs`,e.PAGED_ITEM_FILES=`files`,e.PAGED_ITEM_CACHED_CONTENTS=`cachedContents`,e.PAGED_ITEM_FILE_SEARCH_STORES=`fileSearchStores`,e.PAGED_ITEM_DOCUMENTS=`documents`,e.PAGED_ITEM_SKILLS=`skills`})(Gr||={});var Kr=class{constructor(e,t,n,r){this.pageInternal=[],this.paramsInternal={},this.requestInternal=t,this.init(e,n,r)}init(e,t,n){this.nameInternal=e,this.pageInternal=t[this.nameInternal]||[],this.sdkHttpResponseInternal=t?.sdkHttpResponse,this.idxInternal=0;let r={config:{}};r=!n||Object.keys(n).length===0?{config:{}}:typeof n==`object`?Object.assign({},n):n,r.config&&(r.config.pageToken=t.nextPageToken),this.paramsInternal=r,this.pageInternalSize=r.config?.pageSize??this.pageInternal.length}initNextPage(e){this.init(this.nameInternal,e,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get sdkHttpResponse(){return this.sdkHttpResponseInternal}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(e){return this.pageInternal[e]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength){if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0}}let e=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:e,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw Error(`No more pages to fetch.`);let e=await this.requestInternal(this.params);return this.initNextPage(e),this.page}hasNextPage(){return this.params.config?.pageToken!==void 0}},qr=class extends v{constructor(e){super(),this.apiClient=e,this.list=async(e={})=>new Kr(Gr.PAGED_ITEM_BATCH_JOBS,e=>this.listInternal(e),await this.listInternal(e),e),this.create=async e=>(this.apiClient.isVertexAI()&&(e.config=this.formatDestination(e.src,e.config)),this.createInternal(e)),this.createEmbeddings=async e=>{if(console.warn(`batches.createEmbeddings() is experimental and may change without notice.`),this.apiClient.isVertexAI())throw Error(`Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support batches.createEmbeddings.`);return this.createEmbeddingsInternal(e)}}createInlinedGenerateContentRequest(e){let t=ur(this.apiClient,e),n=t._url,r=y(`{model}:batchGenerateContent`,n),i=t.batch.inputConfig.requests,a=i.requests,o=[];for(let e of a){let t=Object.assign({},e);if(t.systemInstruction){let e=t.systemInstruction;delete t.systemInstruction;let n=t.request;n.systemInstruction=e,t.request=n}o.push(t)}return i.requests=o,delete t.config,delete t._url,delete t._query,{path:r,body:t}}getGcsUri(e){if(typeof e==`string`)return e.startsWith(`gs://`)?e:void 0;if(!Array.isArray(e)&&e.gcsUri&&e.gcsUri.length>0)return e.gcsUri[0]}getBigqueryUri(e){if(typeof e==`string`)return e.startsWith(`bq://`)?e:void 0;if(!Array.isArray(e))return e.bigqueryUri}formatDestination(e,t){let n=t?Object.assign({},t):{},r=Date.now().toString();if(n.displayName||=`genaiBatchJob_${r}`,n.dest===void 0){let t=this.getGcsUri(e),i=this.getBigqueryUri(e);if(t)n.dest=t.endsWith(`.jsonl`)?`${t.slice(0,-6)}/dest`:`${t}_dest_${r}`;else if(i)n.dest=`${i}_dest_${r}`;else throw Error(`Unsupported source for Gemini Enterprise Agent Platform (previously known as Vertex AI): No GCS or BigQuery URI found.`)}return n}async createInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=dr(this.apiClient,e);return n=y(`batchPredictionJobs`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>Qn(e))}{let i=ur(this.apiClient,e);return n=y(`{model}:batchGenerateContent`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>Zn(e))}}async createEmbeddingsInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=pr(this.apiClient,e);return n=y(`{model}:asyncBatchEmbedContent`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>Zn(e))}}async get(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=Dr(this.apiClient,e);return n=y(`batchPredictionJobs/{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>Qn(e))}{let i=Er(this.apiClient,e);return n=y(`batches/{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>Zn(e))}}async cancel(e){let t=``,n={};if(this.apiClient.isVertexAI()){let r=ir(this.apiClient,e);t=y(`batchPredictionJobs/{name}:cancel`,r._url),n=r._query,delete r._url,delete r._query,await this.apiClient.request({path:t,queryParams:n,body:JSON.stringify(r),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal})}else{let r=rr(this.apiClient,e);t=y(`batches/{name}:cancel`,r._url),n=r._query,delete r._url,delete r._query,await this.apiClient.request({path:t,queryParams:n,body:JSON.stringify(r),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal})}}async listInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=Ir(e);return n=y(`batchPredictionJobs`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=Rr(e),n=new an;return Object.assign(n,t),n})}{let i=Fr(e);return n=y(`batches`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=Lr(e),n=new an;return Object.assign(n,t),n})}}async delete(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=hr(this.apiClient,e);return n=y(`batchPredictionJobs/{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`DELETE`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>_r(e))}{let i=mr(this.apiClient,e);return n=y(`batches/{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`DELETE`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>gr(e))}}};function Jr(e){let t={},n=x(e,[`apiKey`]);if(n!=null&&b(t,[`apiKey`],n),x(e,[`apiKeyConfig`])!==void 0)throw Error(`apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`authType`])!==void 0)throw Error(`authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`googleServiceAccountConfig`])!==void 0)throw Error(`googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`httpBasicAuthConfig`])!==void 0)throw Error(`httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oauthConfig`])!==void 0)throw Error(`oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oidcConfig`])!==void 0)throw Error(`oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function Yr(e){let t={},n=x(e,[`data`]);if(n!=null&&b(t,[`data`],n),x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`mimeType`]);return r!=null&&b(t,[`mimeType`],r),t}function Xr(e){let t={},n=x(e,[`enablePromptInjectionDetection`]);n!=null&&b(t,[`enablePromptInjectionDetection`],n);let r=x(e,[`environment`]);r!=null&&b(t,[`environment`],r);let i=x(e,[`excludedPredefinedFunctions`]);if(i!=null&&b(t,[`excludedPredefinedFunctions`],i),x(e,[`disabledSafetyPolicies`])!==void 0)throw Error(`disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function Zr(e){let t={},n=x(e,[`parts`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>xi(e))),b(t,[`parts`],e)}let r=x(e,[`role`]);return r!=null&&b(t,[`role`],r),t}function Qr(e){let t={},n=x(e,[`parts`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>Si(e))),b(t,[`parts`],e)}let r=x(e,[`role`]);return r!=null&&b(t,[`role`],r),t}function $r(e,t){let n={},r=x(e,[`ttl`]);t!==void 0&&r!=null&&b(t,[`ttl`],r);let i=x(e,[`expireTime`]);t!==void 0&&i!=null&&b(t,[`expireTime`],i);let a=x(e,[`displayName`]);t!==void 0&&a!=null&&b(t,[`displayName`],a);let o=x(e,[`contents`]);if(t!==void 0&&o!=null){let e=P(o);Array.isArray(e)&&(e=e.map(e=>Zr(e))),b(t,[`contents`],e)}let s=x(e,[`systemInstruction`]);t!==void 0&&s!=null&&b(t,[`systemInstruction`],Zr(N(s)));let c=x(e,[`tools`]);if(t!==void 0&&c!=null){let e=c;Array.isArray(e)&&(e=e.map(e=>Ti(e))),b(t,[`tools`],e)}let l=x(e,[`toolConfig`]);if(t!==void 0&&l!=null&&b(t,[`toolConfig`],Ci(l)),x(e,[`kmsKeyName`])!==void 0)throw Error(`kmsKeyName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function ei(e,t){let n={},r=x(e,[`ttl`]);t!==void 0&&r!=null&&b(t,[`ttl`],r);let i=x(e,[`expireTime`]);t!==void 0&&i!=null&&b(t,[`expireTime`],i);let a=x(e,[`displayName`]);t!==void 0&&a!=null&&b(t,[`displayName`],a);let o=x(e,[`contents`]);if(t!==void 0&&o!=null){let e=P(o);Array.isArray(e)&&(e=e.map(e=>Qr(e))),b(t,[`contents`],e)}let s=x(e,[`systemInstruction`]);t!==void 0&&s!=null&&b(t,[`systemInstruction`],Qr(N(s)));let c=x(e,[`tools`]);if(t!==void 0&&c!=null){let e=c;Array.isArray(e)&&(e=e.map(e=>Ei(e))),b(t,[`tools`],e)}let l=x(e,[`toolConfig`]);t!==void 0&&l!=null&&b(t,[`toolConfig`],wi(l));let u=x(e,[`kmsKeyName`]);return t!==void 0&&u!=null&&b(t,[`encryption_spec`,`kmsKeyName`],u),n}function ti(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`model`],ln(e,r));let i=x(t,[`config`]);return i!=null&&$r(i,n),n}function ni(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`model`],ln(e,r));let i=x(t,[`config`]);return i!=null&&ei(i,n),n}function ri(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],kn(e,r)),n}function ii(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],kn(e,r)),n}function ai(e){let t={},n=x(e,[`sdkHttpResponse`]);return n!=null&&b(t,[`sdkHttpResponse`],n),t}function oi(e){let t={},n=x(e,[`sdkHttpResponse`]);return n!=null&&b(t,[`sdkHttpResponse`],n),t}function si(e){let t={};if(x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`fileUri`]);n!=null&&b(t,[`fileUri`],n);let r=x(e,[`mimeType`]);return r!=null&&b(t,[`mimeType`],r),t}function ci(e){let t={},n=x(e,[`args`]);n!=null&&b(t,[`args`],n);let r=x(e,[`id`]);r!=null&&b(t,[`id`],r);let i=x(e,[`name`]);if(i!=null&&b(t,[`name`],i),x(e,[`partialArgs`])!==void 0)throw Error(`partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`willContinue`])!==void 0)throw Error(`willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function li(e){let t={},n=x(e,[`allowedFunctionNames`]);n!=null&&b(t,[`allowedFunctionNames`],n);let r=x(e,[`mode`]);if(r!=null&&b(t,[`mode`],r),x(e,[`streamFunctionCallArguments`])!==void 0)throw Error(`streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function ui(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],kn(e,r)),n}function di(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],kn(e,r)),n}function fi(e){let t={},n=x(e,[`authConfig`]);n!=null&&b(t,[`authConfig`],Jr(n));let r=x(e,[`enableWidget`]);if(r!=null&&b(t,[`enableWidget`],r),x(e,[`groundingTypes`])!==void 0)throw Error(`groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function pi(e){let t={};if(x(e,[`blockingConfidence`])!==void 0)throw Error(`blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`excludeDomains`])!==void 0)throw Error(`excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`searchTypes`]);n!=null&&b(t,[`searchTypes`],n);let r=x(e,[`timeRangeFilter`]);return r!=null&&b(t,[`timeRangeFilter`],r),t}function mi(e,t){let n={},r=x(e,[`pageSize`]);t!==void 0&&r!=null&&b(t,[`_query`,`pageSize`],r);let i=x(e,[`pageToken`]);return t!==void 0&&i!=null&&b(t,[`_query`,`pageToken`],i),n}function hi(e,t){let n={},r=x(e,[`pageSize`]);t!==void 0&&r!=null&&b(t,[`_query`,`pageSize`],r);let i=x(e,[`pageToken`]);return t!==void 0&&i!=null&&b(t,[`_query`,`pageToken`],i),n}function gi(e){let t={},n=x(e,[`config`]);return n!=null&&mi(n,t),t}function _i(e){let t={},n=x(e,[`config`]);return n!=null&&hi(n,t),t}function vi(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`nextPageToken`]);r!=null&&b(t,[`nextPageToken`],r);let i=x(e,[`cachedContents`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`cachedContents`],e)}return t}function yi(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`nextPageToken`]);r!=null&&b(t,[`nextPageToken`],r);let i=x(e,[`cachedContents`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`cachedContents`],e)}return t}function bi(e){let t={};if(x(e,[`name`])!==void 0)throw Error(`name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`streamableHttpTransport`])!==void 0)throw Error(`streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function xi(e){let t={},n=x(e,[`mediaResolution`]);n!=null&&b(t,[`mediaResolution`],n);let r=x(e,[`toolCall`]);r!=null&&b(t,[`toolCall`],r);let i=x(e,[`toolResponse`]);i!=null&&b(t,[`toolResponse`],i);let a=x(e,[`audioTranscription`]);a!=null&&b(t,[`audioTranscription`],a);let o=x(e,[`codeExecutionResult`]);o!=null&&b(t,[`codeExecutionResult`],o);let s=x(e,[`executableCode`]);s!=null&&b(t,[`executableCode`],s);let c=x(e,[`fileData`]);c!=null&&b(t,[`fileData`],si(c));let l=x(e,[`functionCall`]);l!=null&&b(t,[`functionCall`],ci(l));let u=x(e,[`functionResponse`]);u!=null&&b(t,[`functionResponse`],u);let d=x(e,[`inlineData`]);d!=null&&b(t,[`inlineData`],Yr(d));let f=x(e,[`text`]);f!=null&&b(t,[`text`],f);let p=x(e,[`thought`]);p!=null&&b(t,[`thought`],p);let m=x(e,[`thoughtSignature`]);m!=null&&b(t,[`thoughtSignature`],m);let h=x(e,[`videoMetadata`]);h!=null&&b(t,[`videoMetadata`],h);let g=x(e,[`partMetadata`]);g!=null&&b(t,[`partMetadata`],g);let _=x(e,[`mediaProcessing`]);return _!=null&&b(t,[`mediaProcessing`],_),t}function Si(e){let t={},n=x(e,[`mediaResolution`]);if(n!=null&&b(t,[`mediaResolution`],n),x(e,[`toolCall`])!==void 0)throw Error(`toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`toolResponse`])!==void 0)throw Error(`toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let r=x(e,[`audioTranscription`]);r!=null&&b(t,[`audioTranscription`],r);let i=x(e,[`codeExecutionResult`]);i!=null&&b(t,[`codeExecutionResult`],i);let a=x(e,[`executableCode`]);a!=null&&b(t,[`executableCode`],a);let o=x(e,[`fileData`]);o!=null&&b(t,[`fileData`],o);let s=x(e,[`functionCall`]);s!=null&&b(t,[`functionCall`],s);let c=x(e,[`functionResponse`]);c!=null&&b(t,[`functionResponse`],c);let l=x(e,[`inlineData`]);l!=null&&b(t,[`inlineData`],l);let u=x(e,[`text`]);u!=null&&b(t,[`text`],u);let d=x(e,[`thought`]);d!=null&&b(t,[`thought`],d);let f=x(e,[`thoughtSignature`]);f!=null&&b(t,[`thoughtSignature`],f);let p=x(e,[`videoMetadata`]);if(p!=null&&b(t,[`videoMetadata`],p),x(e,[`partMetadata`])!==void 0)throw Error(`partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let m=x(e,[`mediaProcessing`]);return m!=null&&b(t,[`mediaProcessing`],m),t}function Ci(e){let t={},n=x(e,[`functionCallingConfig`]);n!=null&&b(t,[`functionCallingConfig`],li(n));let r=x(e,[`retrievalConfig`]);r!=null&&b(t,[`retrievalConfig`],r);let i=x(e,[`includeServerSideToolInvocations`]);return i!=null&&b(t,[`includeServerSideToolInvocations`],i),t}function wi(e){let t={},n=x(e,[`functionCallingConfig`]);n!=null&&b(t,[`functionCallingConfig`],n);let r=x(e,[`retrievalConfig`]);if(r!=null&&b(t,[`retrievalConfig`],r),x(e,[`includeServerSideToolInvocations`])!==void 0)throw Error(`includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function Ti(e){let t={};if(x(e,[`retrieval`])!==void 0)throw Error(`retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`googleMaps`]);n!=null&&b(t,[`googleMaps`],fi(n));let r=x(e,[`mcpServers`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`mcpServers`],e)}let i=x(e,[`codeExecution`]);i!=null&&b(t,[`codeExecution`],i);let a=x(e,[`computerUse`]);if(a!=null&&b(t,[`computerUse`],a),x(e,[`enterpriseWebSearch`])!==void 0)throw Error(`enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`exaAiSearch`])!==void 0)throw Error(`exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let o=x(e,[`functionDeclarations`]);if(o!=null){let e=o;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`functionDeclarations`],e)}let s=x(e,[`googleSearch`]);s!=null&&b(t,[`googleSearch`],pi(s));let c=x(e,[`googleSearchRetrieval`]);if(c!=null&&b(t,[`googleSearchRetrieval`],c),x(e,[`parallelAiSearch`])!==void 0)throw Error(`parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let l=x(e,[`urlContext`]);l!=null&&b(t,[`urlContext`],l);let u=x(e,[`fileSearch`]);return u!=null&&b(t,[`fileSearch`],u),t}function Ei(e){let t={},n=x(e,[`retrieval`]);n!=null&&b(t,[`retrieval`],n);let r=x(e,[`googleMaps`]);r!=null&&b(t,[`googleMaps`],r);let i=x(e,[`mcpServers`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>bi(e))),b(t,[`mcpServers`],e)}let a=x(e,[`codeExecution`]);a!=null&&b(t,[`codeExecution`],a);let o=x(e,[`computerUse`]);o!=null&&b(t,[`computerUse`],Xr(o));let s=x(e,[`enterpriseWebSearch`]);s!=null&&b(t,[`enterpriseWebSearch`],s);let c=x(e,[`exaAiSearch`]);c!=null&&b(t,[`exaAiSearch`],c);let l=x(e,[`functionDeclarations`]);if(l!=null){let e=l;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`functionDeclarations`],e)}let u=x(e,[`googleSearch`]);u!=null&&b(t,[`googleSearch`],u);let d=x(e,[`googleSearchRetrieval`]);d!=null&&b(t,[`googleSearchRetrieval`],d);let f=x(e,[`parallelAiSearch`]);f!=null&&b(t,[`parallelAiSearch`],f);let p=x(e,[`urlContext`]);if(p!=null&&b(t,[`urlContext`],p),x(e,[`fileSearch`])!==void 0)throw Error(`fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function Di(e,t){let n={},r=x(e,[`ttl`]);t!==void 0&&r!=null&&b(t,[`ttl`],r);let i=x(e,[`expireTime`]);return t!==void 0&&i!=null&&b(t,[`expireTime`],i),n}function Oi(e,t){let n={},r=x(e,[`ttl`]);t!==void 0&&r!=null&&b(t,[`ttl`],r);let i=x(e,[`expireTime`]);return t!==void 0&&i!=null&&b(t,[`expireTime`],i),n}function ki(e,t){let n={},r=x(t,[`name`]);r!=null&&b(n,[`_url`,`name`],kn(e,r));let i=x(t,[`config`]);return i!=null&&Di(i,n),n}function Ai(e,t){let n={},r=x(t,[`name`]);r!=null&&b(n,[`_url`,`name`],kn(e,r));let i=x(t,[`config`]);return i!=null&&Oi(i,n),n}var ji=class extends v{constructor(e){super(),this.apiClient=e,this.list=async(e={})=>new Kr(Gr.PAGED_ITEM_CACHED_CONTENTS,e=>this.listInternal(e),await this.listInternal(e),e)}async create(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=ni(this.apiClient,e);return n=y(`cachedContents`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}{let i=ti(this.apiClient,e);return n=y(`cachedContents`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}}async get(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=di(this.apiClient,e);return n=y(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}{let i=ui(this.apiClient,e);return n=y(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}}async delete(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=ii(this.apiClient,e);return n=y(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`DELETE`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=oi(e),n=new Jt;return Object.assign(n,t),n})}{let i=ri(this.apiClient,e);return n=y(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`DELETE`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=ai(e),n=new Jt;return Object.assign(n,t),n})}}async update(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=Ai(this.apiClient,e);return n=y(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`PATCH`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}{let i=ki(this.apiClient,e);return n=y(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`PATCH`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}}async listInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=_i(e);return n=y(`cachedContents`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=yi(e),n=new Yt;return Object.assign(n,t),n})}{let i=gi(e);return n=y(`cachedContents`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=vi(e),n=new Yt;return Object.assign(n,t),n})}}};function F(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Mi(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function I(e){return this instanceof I?(this.v=e,this):new I(e)}function Ni(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof I?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Pi(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Mi==`function`?Mi(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function Fi(e){if(e.candidates==null||e.candidates.length===0)return!1;let t=e.candidates[0]?.content;return t!==void 0&&Ii(t)}function Ii(e){if(e.parts===void 0||e.parts.length===0)return!1;for(let t of e.parts)if(t===void 0||Object.keys(t).length===0)return!1;return!0}function Li(e){if(e.length!==0){for(let t of e)if(t.role!==`user`&&t.role!==`model`)throw Error(`Role must be user or model, but got ${t.role}.`)}}function Ri(e){if(e===void 0||e.length===0)return[];let t=[],n=e.length,r=0;for(;r<n;)if(e[r].role===`user`)t.push(e[r]),r++;else{let i=[],a=!0;for(;r<n&&e[r].role===`model`;)i.push(e[r]),a&&!Ii(e[r])&&(a=!1),r++;a?t.push(...i):t.pop()}return t}var zi=class{constructor(e,t){this.modelsModule=e,this.apiClient=t}create(e){return new Bi(this.apiClient,this.modelsModule,e.model,e.config,structuredClone(e.history))}},Bi=class{constructor(e,t,n,r={},i=[]){this.apiClient=e,this.modelsModule=t,this.model=n,this.config=r,this.history=i,this.sendPromise=Promise.resolve(),Li(i)}async sendMessage(e){await this.sendPromise;let t=N(e.message),n=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(t),config:e.config??this.config});return this.sendPromise=(async()=>{let e=await n,r=e.candidates?.[0]?.content,i=e.automaticFunctionCallingHistory,a=this.getHistory(!0).length,o=[];i!=null&&(o=i.slice(a)??[]);let s=r?[r]:[];this.recordHistory(t,s,o)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),n}async sendMessageStream(e){await this.sendPromise;let t=N(e.message),n=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(t),config:e.config??this.config});this.sendPromise=n.then(()=>void 0).catch(()=>void 0);let r=await n;return this.processStreamResponse(r,t)}getHistory(e=!1){let t=e?Ri(this.history):this.history;return structuredClone(t)}processStreamResponse(e,t){return Ni(this,arguments,function*(){var n,r,i,a;let o=[];try{for(var s=!0,c=Pi(e),l;l=yield I(c.next()),n=l.done,!n;s=!0){a=l.value,s=!1;let e=a;if(Fi(e)){let t=e.candidates?.[0]?.content;t!==void 0&&o.push(t)}yield yield I(e)}}catch(e){r={error:e}}finally{try{!s&&!n&&(i=c.return)&&(yield I(i.call(c)))}finally{if(r)throw r.error}}this.recordHistory(t,o)})}recordHistory(e,t,n){let r=[];t.length>0&&t.every(e=>e.role!==void 0)?r=t:r.push({role:`model`,parts:[]}),n&&n.length>0?this.history.push(...Ri(n)):this.history.push(e),this.history.push(...r)}},Vi=class e extends Error{constructor(t){super(t.message),this.name=`ApiError`,this.status=t.status,Object.setPrototypeOf(this,e.prototype)}};function Hi(e){let t={},n=x(e,[`file`]);return n!=null&&b(t,[`file`],n),t}function Ui(e){let t={},n=x(e,[`sdkHttpResponse`]);return n!=null&&b(t,[`sdkHttpResponse`],n),t}function Wi(e){let t={},n=x(e,[`name`]);return n!=null&&b(t,[`_url`,`file`],Fn(n)),t}function Gi(e){let t={},n=x(e,[`sdkHttpResponse`]);return n!=null&&b(t,[`sdkHttpResponse`],n),t}function Ki(e){let t={},n=x(e,[`name`]);return n!=null&&b(t,[`_url`,`file`],Fn(n)),t}function qi(e){let t={},n=x(e,[`uris`]);return n!=null&&b(t,[`uris`],n),t}function Ji(e,t){let n={},r=x(e,[`pageSize`]);t!==void 0&&r!=null&&b(t,[`_query`,`pageSize`],r);let i=x(e,[`pageToken`]);return t!==void 0&&i!=null&&b(t,[`_query`,`pageToken`],i),n}function Yi(e){let t={},n=x(e,[`config`]);return n!=null&&Ji(n,t),t}function Xi(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`nextPageToken`]);r!=null&&b(t,[`nextPageToken`],r);let i=x(e,[`files`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`files`],e)}return t}function Zi(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`files`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`files`],e)}return t}var Qi=class extends v{constructor(e){super(),this.apiClient=e,this.list=async(e={})=>new Kr(Gr.PAGED_ITEM_FILES,e=>this.listInternal(e),await this.listInternal(e),e)}async upload(e){if(this.apiClient.isVertexAI())throw Error(`Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support uploading files. You can share files through a GCS bucket.`);return this.apiClient.uploadFile(e.file,e.config).then(e=>e)}async download(e){await this.apiClient.downloadFile(e)}async registerFiles(e){throw Error(`registerFiles is only supported in Node.js environments.`)}async _registerFiles(e){return this.registerFilesInternal(e)}async listInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=Yi(e);return n=y(`files`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=Xi(e),n=new en;return Object.assign(n,t),n})}}async createInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=Hi(e);return n=y(`upload/v1beta/files`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>{let t=Ui(e),n=new tn;return Object.assign(n,t),n})}}async get(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=Ki(e);return n=y(`files/{file}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}}async delete(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=Wi(e);return n=y(`files/{file}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`DELETE`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=Gi(e),n=new nn;return Object.assign(n,t),n})}}async registerFilesInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=qi(e);return n=y(`files:register`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>{let t=Zi(e),n=new rn;return Object.assign(n,t),n})}}};function $i(e){let t={},n=x(e,[`apiKey`]);if(n!=null&&b(t,[`apiKey`],n),x(e,[`apiKeyConfig`])!==void 0)throw Error(`apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`authType`])!==void 0)throw Error(`authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`googleServiceAccountConfig`])!==void 0)throw Error(`googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`httpBasicAuthConfig`])!==void 0)throw Error(`httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oauthConfig`])!==void 0)throw Error(`oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oidcConfig`])!==void 0)throw Error(`oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function ea(e){let t={},n=x(e,[`data`]);if(n!=null&&b(t,[`data`],n),x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`mimeType`]);return r!=null&&b(t,[`mimeType`],r),t}function ta(e){let t={},n=x(e,[`enablePromptInjectionDetection`]);n!=null&&b(t,[`enablePromptInjectionDetection`],n);let r=x(e,[`environment`]);r!=null&&b(t,[`environment`],r);let i=x(e,[`excludedPredefinedFunctions`]);if(i!=null&&b(t,[`excludedPredefinedFunctions`],i),x(e,[`disabledSafetyPolicies`])!==void 0)throw Error(`disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function na(e){let t={},n=x(e,[`parts`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>ba(e))),b(t,[`parts`],e)}let r=x(e,[`role`]);return r!=null&&b(t,[`role`],r),t}function ra(e){let t={},n=x(e,[`parts`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>xa(e))),b(t,[`parts`],e)}let r=x(e,[`role`]);return r!=null&&b(t,[`role`],r),t}function ia(e){let t={};if(x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`fileUri`]);n!=null&&b(t,[`fileUri`],n);let r=x(e,[`mimeType`]);return r!=null&&b(t,[`mimeType`],r),t}function aa(e){let t={},n=x(e,[`args`]);n!=null&&b(t,[`args`],n);let r=x(e,[`id`]);r!=null&&b(t,[`id`],r);let i=x(e,[`name`]);if(i!=null&&b(t,[`name`],i),x(e,[`partialArgs`])!==void 0)throw Error(`partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`willContinue`])!==void 0)throw Error(`willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function oa(e){let t={},n=x(e,[`modelSelectionConfig`]);n!=null&&b(t,[`modelConfig`],n);let r=x(e,[`responseJsonSchema`]);r!=null&&b(t,[`responseJsonSchema`],Cn(r));let i=x(e,[`audioTranscriptionConfig`]);i!=null&&b(t,[`audioTranscriptionConfig`],i);let a=x(e,[`audioTimestamp`]);a!=null&&b(t,[`audioTimestamp`],a);let o=x(e,[`candidateCount`]);o!=null&&b(t,[`candidateCount`],o);let s=x(e,[`enableAffectiveDialog`]);s!=null&&b(t,[`enableAffectiveDialog`],s);let c=x(e,[`frequencyPenalty`]);c!=null&&b(t,[`frequencyPenalty`],c);let l=x(e,[`logprobs`]);l!=null&&b(t,[`logprobs`],l);let u=x(e,[`maxOutputTokens`]);u!=null&&b(t,[`maxOutputTokens`],u);let d=x(e,[`mediaResolution`]);d!=null&&b(t,[`mediaResolution`],d);let f=x(e,[`presencePenalty`]);f!=null&&b(t,[`presencePenalty`],f);let p=x(e,[`responseFormat`]);if(p!=null){let e=p;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`responseFormat`],e)}let m=x(e,[`responseLogprobs`]);m!=null&&b(t,[`responseLogprobs`],m);let h=x(e,[`responseMimeType`]);h!=null&&b(t,[`responseMimeType`],h);let g=x(e,[`responseModalities`]);g!=null&&b(t,[`responseModalities`],g);let _=x(e,[`responseSchema`]);_!=null&&b(t,[`responseSchema`],_);let v=x(e,[`routingConfig`]);v!=null&&b(t,[`routingConfig`],v);let y=x(e,[`seed`]);y!=null&&b(t,[`seed`],y);let S=x(e,[`speechConfig`]);S!=null&&b(t,[`speechConfig`],Ea(S));let C=x(e,[`stopSequences`]);C!=null&&b(t,[`stopSequences`],C);let w=x(e,[`temperature`]);w!=null&&b(t,[`temperature`],w);let T=x(e,[`thinkingConfig`]);T!=null&&b(t,[`thinkingConfig`],T);let E=x(e,[`topK`]);E!=null&&b(t,[`topK`],E);let D=x(e,[`topP`]);if(D!=null&&b(t,[`topP`],D),x(e,[`enableEnhancedCivicAnswers`])!==void 0)throw Error(`enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`translationConfig`])!==void 0)throw Error(`translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function sa(e){let t={},n=x(e,[`authConfig`]);n!=null&&b(t,[`authConfig`],$i(n));let r=x(e,[`enableWidget`]);if(r!=null&&b(t,[`enableWidget`],r),x(e,[`groundingTypes`])!==void 0)throw Error(`groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function ca(e){let t={};if(x(e,[`blockingConfidence`])!==void 0)throw Error(`blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`excludeDomains`])!==void 0)throw Error(`excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`searchTypes`]);n!=null&&b(t,[`searchTypes`],n);let r=x(e,[`timeRangeFilter`]);return r!=null&&b(t,[`timeRangeFilter`],r),t}function la(e,t){let n={},r=x(e,[`generationConfig`]);t!==void 0&&r!=null&&b(t,[`setup`,`generationConfig`],r);let i=x(e,[`responseModalities`]);t!==void 0&&i!=null&&b(t,[`setup`,`generationConfig`,`responseModalities`],i);let a=x(e,[`temperature`]);t!==void 0&&a!=null&&b(t,[`setup`,`generationConfig`,`temperature`],a);let o=x(e,[`topP`]);t!==void 0&&o!=null&&b(t,[`setup`,`generationConfig`,`topP`],o);let s=x(e,[`topK`]);t!==void 0&&s!=null&&b(t,[`setup`,`generationConfig`,`topK`],s);let c=x(e,[`maxOutputTokens`]);t!==void 0&&c!=null&&b(t,[`setup`,`generationConfig`,`maxOutputTokens`],c);let l=x(e,[`mediaResolution`]);t!==void 0&&l!=null&&b(t,[`setup`,`generationConfig`,`mediaResolution`],l);let u=x(e,[`seed`]);t!==void 0&&u!=null&&b(t,[`setup`,`generationConfig`,`seed`],u);let d=x(e,[`speechConfig`]);t!==void 0&&d!=null&&b(t,[`setup`,`generationConfig`,`speechConfig`],Tn(d));let f=x(e,[`thinkingConfig`]);t!==void 0&&f!=null&&b(t,[`setup`,`generationConfig`,`thinkingConfig`],f);let p=x(e,[`enableAffectiveDialog`]);t!==void 0&&p!=null&&b(t,[`setup`,`generationConfig`,`enableAffectiveDialog`],p);let m=x(e,[`systemInstruction`]);t!==void 0&&m!=null&&b(t,[`setup`,`systemInstruction`],na(N(m)));let h=x(e,[`tools`]);if(t!==void 0&&h!=null){let e=Dn(h);Array.isArray(e)&&(e=e.map(e=>Da(En(e)))),b(t,[`setup`,`tools`],e)}let g=x(e,[`sessionResumption`]);t!==void 0&&g!=null&&b(t,[`setup`,`sessionResumption`],wa(g));let _=x(e,[`inputAudioTranscription`]);t!==void 0&&_!=null&&b(t,[`setup`,`inputAudioTranscription`],_);let v=x(e,[`outputAudioTranscription`]);t!==void 0&&v!=null&&b(t,[`setup`,`outputAudioTranscription`],v);let y=x(e,[`realtimeInputConfig`]);t!==void 0&&y!=null&&b(t,[`setup`,`realtimeInputConfig`],y);let S=x(e,[`contextWindowCompression`]);t!==void 0&&S!=null&&b(t,[`setup`,`contextWindowCompression`],S);let C=x(e,[`proactivity`]);if(t!==void 0&&C!=null&&b(t,[`setup`,`proactivity`],C),x(e,[`explicitVadSignal`])!==void 0)throw Error(`explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let w=x(e,[`avatarConfig`]);t!==void 0&&w!=null&&b(t,[`setup`,`avatarConfig`],w);let T=x(e,[`safetySettings`]);if(t!==void 0&&T!=null){let e=T;Array.isArray(e)&&(e=e.map(e=>Ca(e))),b(t,[`setup`,`safetySettings`],e)}let E=x(e,[`translationConfig`]);return t!==void 0&&E!=null&&b(t,[`setup`,`generationConfig`,`translationConfig`],E),n}function ua(e,t){let n={},r=x(e,[`generationConfig`]);t!==void 0&&r!=null&&b(t,[`setup`,`generationConfig`],oa(r));let i=x(e,[`responseModalities`]);t!==void 0&&i!=null&&b(t,[`setup`,`generationConfig`,`responseModalities`],i);let a=x(e,[`temperature`]);t!==void 0&&a!=null&&b(t,[`setup`,`generationConfig`,`temperature`],a);let o=x(e,[`topP`]);t!==void 0&&o!=null&&b(t,[`setup`,`generationConfig`,`topP`],o);let s=x(e,[`topK`]);t!==void 0&&s!=null&&b(t,[`setup`,`generationConfig`,`topK`],s);let c=x(e,[`maxOutputTokens`]);t!==void 0&&c!=null&&b(t,[`setup`,`generationConfig`,`maxOutputTokens`],c);let l=x(e,[`mediaResolution`]);t!==void 0&&l!=null&&b(t,[`setup`,`generationConfig`,`mediaResolution`],l);let u=x(e,[`seed`]);t!==void 0&&u!=null&&b(t,[`setup`,`generationConfig`,`seed`],u);let d=x(e,[`speechConfig`]);t!==void 0&&d!=null&&b(t,[`setup`,`generationConfig`,`speechConfig`],Ea(Tn(d)));let f=x(e,[`thinkingConfig`]);t!==void 0&&f!=null&&b(t,[`setup`,`generationConfig`,`thinkingConfig`],f);let p=x(e,[`enableAffectiveDialog`]);t!==void 0&&p!=null&&b(t,[`setup`,`generationConfig`,`enableAffectiveDialog`],p);let m=x(e,[`systemInstruction`]);t!==void 0&&m!=null&&b(t,[`setup`,`systemInstruction`],ra(N(m)));let h=x(e,[`tools`]);if(t!==void 0&&h!=null){let e=Dn(h);Array.isArray(e)&&(e=e.map(e=>Oa(En(e)))),b(t,[`setup`,`tools`],e)}let g=x(e,[`sessionResumption`]);t!==void 0&&g!=null&&b(t,[`setup`,`sessionResumption`],g);let _=x(e,[`inputAudioTranscription`]);t!==void 0&&_!=null&&b(t,[`setup`,`inputAudioTranscription`],_);let v=x(e,[`outputAudioTranscription`]);t!==void 0&&v!=null&&b(t,[`setup`,`outputAudioTranscription`],v);let y=x(e,[`realtimeInputConfig`]);t!==void 0&&y!=null&&b(t,[`setup`,`realtimeInputConfig`],y);let S=x(e,[`contextWindowCompression`]);t!==void 0&&S!=null&&b(t,[`setup`,`contextWindowCompression`],S);let C=x(e,[`proactivity`]);t!==void 0&&C!=null&&b(t,[`setup`,`proactivity`],C);let w=x(e,[`explicitVadSignal`]);t!==void 0&&w!=null&&b(t,[`setup`,`explicitVadSignal`],w);let T=x(e,[`avatarConfig`]);t!==void 0&&T!=null&&b(t,[`setup`,`avatarConfig`],T);let E=x(e,[`safetySettings`]);if(t!==void 0&&E!=null){let e=E;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`setup`,`safetySettings`],e)}let D=x(e,[`translationConfig`]);return t!==void 0&&D!=null&&b(t,[`setup`,`generationConfig`,`translationConfig`],D),n}function da(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`setup`,`model`],M(e,r));let i=x(t,[`config`]);return i!=null&&b(n,[`config`],la(i,n)),n}function fa(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`setup`,`model`],M(e,r));let i=x(t,[`config`]);return i!=null&&b(n,[`config`],ua(i,n)),n}function pa(e){let t={},n=x(e,[`musicGenerationConfig`]);return n!=null&&b(t,[`musicGenerationConfig`],n),t}function ma(e){let t={},n=x(e,[`weightedPrompts`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`weightedPrompts`],e)}return t}function ha(e){let t={},n=x(e,[`media`]);if(n!=null){let e=un(n);Array.isArray(e)&&(e=e.map(e=>ea(e))),b(t,[`mediaChunks`],e)}let r=x(e,[`audio`]);r!=null&&b(t,[`audio`],ea(pn(r)));let i=x(e,[`audioStreamEnd`]);i!=null&&b(t,[`audioStreamEnd`],i);let a=x(e,[`video`]);a!=null&&b(t,[`video`],ea(fn(a)));let o=x(e,[`text`]);o!=null&&b(t,[`text`],o);let s=x(e,[`activityStart`]);s!=null&&b(t,[`activityStart`],s);let c=x(e,[`activityEnd`]);return c!=null&&b(t,[`activityEnd`],c),t}function ga(e){let t={},n=x(e,[`media`]);if(n!=null){let e=un(n);Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`mediaChunks`],e)}let r=x(e,[`audio`]);r!=null&&b(t,[`audio`],pn(r));let i=x(e,[`audioStreamEnd`]);i!=null&&b(t,[`audioStreamEnd`],i);let a=x(e,[`video`]);a!=null&&b(t,[`video`],fn(a));let o=x(e,[`text`]);o!=null&&b(t,[`text`],o);let s=x(e,[`activityStart`]);s!=null&&b(t,[`activityStart`],s);let c=x(e,[`activityEnd`]);return c!=null&&b(t,[`activityEnd`],c),t}function _a(e){let t={},n=x(e,[`setupComplete`]);n!=null&&b(t,[`setupComplete`],n);let r=x(e,[`serverContent`]);r!=null&&b(t,[`serverContent`],r);let i=x(e,[`toolCall`]);i!=null&&b(t,[`toolCall`],i);let a=x(e,[`toolCallCancellation`]);a!=null&&b(t,[`toolCallCancellation`],a);let o=x(e,[`usageMetadata`]);o!=null&&b(t,[`usageMetadata`],ka(o));let s=x(e,[`goAway`]);s!=null&&b(t,[`goAway`],s);let c=x(e,[`sessionResumptionUpdate`]);c!=null&&b(t,[`sessionResumptionUpdate`],c);let l=x(e,[`voiceActivityDetectionSignal`]);l!=null&&b(t,[`voiceActivityDetectionSignal`],l);let u=x(e,[`voiceActivity`]);return u!=null&&b(t,[`voiceActivity`],Aa(u)),t}function va(e){let t={};if(x(e,[`name`])!==void 0)throw Error(`name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`streamableHttpTransport`])!==void 0)throw Error(`streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function ya(e){let t={},n=x(e,[`speakerVoiceConfigs`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>Ta(e))),b(t,[`speakerVoiceConfigs`],e)}return t}function ba(e){let t={},n=x(e,[`mediaResolution`]);n!=null&&b(t,[`mediaResolution`],n);let r=x(e,[`toolCall`]);r!=null&&b(t,[`toolCall`],r);let i=x(e,[`toolResponse`]);i!=null&&b(t,[`toolResponse`],i);let a=x(e,[`audioTranscription`]);a!=null&&b(t,[`audioTranscription`],a);let o=x(e,[`codeExecutionResult`]);o!=null&&b(t,[`codeExecutionResult`],o);let s=x(e,[`executableCode`]);s!=null&&b(t,[`executableCode`],s);let c=x(e,[`fileData`]);c!=null&&b(t,[`fileData`],ia(c));let l=x(e,[`functionCall`]);l!=null&&b(t,[`functionCall`],aa(l));let u=x(e,[`functionResponse`]);u!=null&&b(t,[`functionResponse`],u);let d=x(e,[`inlineData`]);d!=null&&b(t,[`inlineData`],ea(d));let f=x(e,[`text`]);f!=null&&b(t,[`text`],f);let p=x(e,[`thought`]);p!=null&&b(t,[`thought`],p);let m=x(e,[`thoughtSignature`]);m!=null&&b(t,[`thoughtSignature`],m);let h=x(e,[`videoMetadata`]);h!=null&&b(t,[`videoMetadata`],h);let g=x(e,[`partMetadata`]);g!=null&&b(t,[`partMetadata`],g);let _=x(e,[`mediaProcessing`]);return _!=null&&b(t,[`mediaProcessing`],_),t}function xa(e){let t={},n=x(e,[`mediaResolution`]);if(n!=null&&b(t,[`mediaResolution`],n),x(e,[`toolCall`])!==void 0)throw Error(`toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`toolResponse`])!==void 0)throw Error(`toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let r=x(e,[`audioTranscription`]);r!=null&&b(t,[`audioTranscription`],r);let i=x(e,[`codeExecutionResult`]);i!=null&&b(t,[`codeExecutionResult`],i);let a=x(e,[`executableCode`]);a!=null&&b(t,[`executableCode`],a);let o=x(e,[`fileData`]);o!=null&&b(t,[`fileData`],o);let s=x(e,[`functionCall`]);s!=null&&b(t,[`functionCall`],s);let c=x(e,[`functionResponse`]);c!=null&&b(t,[`functionResponse`],c);let l=x(e,[`inlineData`]);l!=null&&b(t,[`inlineData`],l);let u=x(e,[`text`]);u!=null&&b(t,[`text`],u);let d=x(e,[`thought`]);d!=null&&b(t,[`thought`],d);let f=x(e,[`thoughtSignature`]);f!=null&&b(t,[`thoughtSignature`],f);let p=x(e,[`videoMetadata`]);if(p!=null&&b(t,[`videoMetadata`],p),x(e,[`partMetadata`])!==void 0)throw Error(`partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let m=x(e,[`mediaProcessing`]);return m!=null&&b(t,[`mediaProcessing`],m),t}function Sa(e){let t={},n=x(e,[`mimeType`]);n!=null&&b(t,[`mimeType`],n);let r=x(e,[`voiceSampleAudio`]);if(r!=null&&b(t,[`voiceSampleAudio`],r),x(e,[`consentAudio`])!==void 0)throw Error(`consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`voiceConsentSignature`])!==void 0)throw Error(`voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function Ca(e){let t={},n=x(e,[`category`]);if(n!=null&&b(t,[`category`],n),x(e,[`method`])!==void 0)throw Error(`method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`threshold`]);return r!=null&&b(t,[`threshold`],r),t}function wa(e){let t={},n=x(e,[`handle`]);if(n!=null&&b(t,[`handle`],n),x(e,[`transparent`])!==void 0)throw Error(`transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function Ta(e){let t={},n=x(e,[`speaker`]);n!=null&&b(t,[`speaker`],n);let r=x(e,[`voiceConfig`]);return r!=null&&b(t,[`voiceConfig`],ja(r)),t}function Ea(e){let t={},n=x(e,[`voiceConfig`]);n!=null&&b(t,[`voiceConfig`],ja(n));let r=x(e,[`languageCode`]);r!=null&&b(t,[`languageCode`],r);let i=x(e,[`multiSpeakerVoiceConfig`]);return i!=null&&b(t,[`multiSpeakerVoiceConfig`],ya(i)),t}function Da(e){let t={};if(x(e,[`retrieval`])!==void 0)throw Error(`retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`googleMaps`]);n!=null&&b(t,[`googleMaps`],sa(n));let r=x(e,[`mcpServers`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`mcpServers`],e)}let i=x(e,[`codeExecution`]);i!=null&&b(t,[`codeExecution`],i);let a=x(e,[`computerUse`]);if(a!=null&&b(t,[`computerUse`],a),x(e,[`enterpriseWebSearch`])!==void 0)throw Error(`enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`exaAiSearch`])!==void 0)throw Error(`exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let o=x(e,[`functionDeclarations`]);if(o!=null){let e=o;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`functionDeclarations`],e)}let s=x(e,[`googleSearch`]);s!=null&&b(t,[`googleSearch`],ca(s));let c=x(e,[`googleSearchRetrieval`]);if(c!=null&&b(t,[`googleSearchRetrieval`],c),x(e,[`parallelAiSearch`])!==void 0)throw Error(`parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let l=x(e,[`urlContext`]);l!=null&&b(t,[`urlContext`],l);let u=x(e,[`fileSearch`]);return u!=null&&b(t,[`fileSearch`],u),t}function Oa(e){let t={},n=x(e,[`retrieval`]);n!=null&&b(t,[`retrieval`],n);let r=x(e,[`googleMaps`]);r!=null&&b(t,[`googleMaps`],r);let i=x(e,[`mcpServers`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>va(e))),b(t,[`mcpServers`],e)}let a=x(e,[`codeExecution`]);a!=null&&b(t,[`codeExecution`],a);let o=x(e,[`computerUse`]);o!=null&&b(t,[`computerUse`],ta(o));let s=x(e,[`enterpriseWebSearch`]);s!=null&&b(t,[`enterpriseWebSearch`],s);let c=x(e,[`exaAiSearch`]);c!=null&&b(t,[`exaAiSearch`],c);let l=x(e,[`functionDeclarations`]);if(l!=null){let e=l;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`functionDeclarations`],e)}let u=x(e,[`googleSearch`]);u!=null&&b(t,[`googleSearch`],u);let d=x(e,[`googleSearchRetrieval`]);d!=null&&b(t,[`googleSearchRetrieval`],d);let f=x(e,[`parallelAiSearch`]);f!=null&&b(t,[`parallelAiSearch`],f);let p=x(e,[`urlContext`]);if(p!=null&&b(t,[`urlContext`],p),x(e,[`fileSearch`])!==void 0)throw Error(`fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function ka(e){let t={},n=x(e,[`candidatesTokenCount`]);n!=null&&b(t,[`responseTokenCount`],n);let r=x(e,[`candidatesTokensDetails`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`responseTokensDetails`],e)}let i=x(e,[`cacheTokensDetails`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`cacheTokensDetails`],e)}let a=x(e,[`cachedContentTokenCount`]);a!=null&&b(t,[`cachedContentTokenCount`],a);let o=x(e,[`promptTokenCount`]);o!=null&&b(t,[`promptTokenCount`],o);let s=x(e,[`promptTokensDetails`]);if(s!=null){let e=s;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`promptTokensDetails`],e)}let c=x(e,[`thoughtsTokenCount`]);c!=null&&b(t,[`thoughtsTokenCount`],c);let l=x(e,[`toolUsePromptTokenCount`]);l!=null&&b(t,[`toolUsePromptTokenCount`],l);let u=x(e,[`toolUsePromptTokensDetails`]);if(u!=null){let e=u;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`toolUsePromptTokensDetails`],e)}let d=x(e,[`totalTokenCount`]);d!=null&&b(t,[`totalTokenCount`],d);let f=x(e,[`trafficType`]);return f!=null&&b(t,[`trafficType`],f),t}function Aa(e){let t={},n=x(e,[`type`]);n!=null&&b(t,[`voiceActivityType`],n);let r=x(e,[`audioOffset`]);return r!=null&&b(t,[`audioOffset`],r),t}function ja(e){let t={},n=x(e,[`replicatedVoiceConfig`]);n!=null&&b(t,[`replicatedVoiceConfig`],Sa(n));let r=x(e,[`prebuiltVoiceConfig`]);return r!=null&&b(t,[`prebuiltVoiceConfig`],r),t}function Ma(e,t){let n={},r=x(e,[`apiKey`]);if(r!=null&&b(n,[`apiKey`],r),x(e,[`apiKeyConfig`])!==void 0)throw Error(`apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`authType`])!==void 0)throw Error(`authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`googleServiceAccountConfig`])!==void 0)throw Error(`googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`httpBasicAuthConfig`])!==void 0)throw Error(`httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oauthConfig`])!==void 0)throw Error(`oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oidcConfig`])!==void 0)throw Error(`oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function Na(e,t){let n={},r=x(e,[`data`]);if(r!=null&&b(n,[`data`],r),x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let i=x(e,[`mimeType`]);return i!=null&&b(n,[`mimeType`],i),n}function Pa(e,t){let n={},r=x(e,[`content`]);r!=null&&b(n,[`content`],r);let i=x(e,[`citationMetadata`]);i!=null&&b(n,[`citationMetadata`],Fa(i));let a=x(e,[`tokenCount`]);a!=null&&b(n,[`tokenCount`],a);let o=x(e,[`finishReason`]);o!=null&&b(n,[`finishReason`],o);let s=x(e,[`groundingMetadata`]);s!=null&&b(n,[`groundingMetadata`],s);let c=x(e,[`avgLogprobs`]);c!=null&&b(n,[`avgLogprobs`],c);let l=x(e,[`index`]);l!=null&&b(n,[`index`],l);let u=x(e,[`logprobsResult`]);u!=null&&b(n,[`logprobsResult`],u);let d=x(e,[`safetyRatings`]);if(d!=null){let e=d;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`safetyRatings`],e)}let f=x(e,[`urlContextMetadata`]);return f!=null&&b(n,[`urlContextMetadata`],f),n}function Fa(e,t){let n={},r=x(e,[`citationSources`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`citations`],e)}return n}function Ia(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`contents`]);if(a!=null){let e=P(a);Array.isArray(e)&&(e=e.map(e=>Ha(e))),b(r,[`contents`],e)}return r}function La(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`tokensInfo`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`tokensInfo`],e)}return n}function Ra(e,t){let n={},r=x(e,[`enablePromptInjectionDetection`]);r!=null&&b(n,[`enablePromptInjectionDetection`],r);let i=x(e,[`environment`]);i!=null&&b(n,[`environment`],i);let a=x(e,[`excludedPredefinedFunctions`]);if(a!=null&&b(n,[`excludedPredefinedFunctions`],a),x(e,[`disabledSafetyPolicies`])!==void 0)throw Error(`disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function za(e,t){let n={},r=x(e,[`values`]);r!=null&&b(n,[`values`],r);let i=x(e,[`statistics`]);return i!=null&&b(n,[`statistics`],Ba(i)),n}function Ba(e,t){let n={},r=x(e,[`truncated`]);r!=null&&b(n,[`truncated`],r);let i=x(e,[`token_count`]);i!=null&&b(n,[`tokenCount`],i);let a=x(e,[`tokensDetails`]);if(a!=null){let e=a;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`tokensDetails`],e)}return n}function Va(e,t){let n={},r=x(e,[`parts`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>rs(e))),b(n,[`parts`],e)}let i=x(e,[`role`]);return i!=null&&b(n,[`role`],i),n}function Ha(e,t){let n={},r=x(e,[`parts`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>is(e))),b(n,[`parts`],e)}let i=x(e,[`role`]);return i!=null&&b(n,[`role`],i),n}function Ua(e,t){let n={},r=x(e,[`controlType`]);r!=null&&b(n,[`controlType`],r);let i=x(e,[`enableControlImageComputation`]);return i!=null&&b(n,[`computeControl`],i),n}function Wa(e,t){let n={};if(x(e,[`systemInstruction`])!==void 0)throw Error(`systemInstruction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`tools`])!==void 0)throw Error(`tools parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`generationConfig`])!==void 0)throw Error(`generationConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function Ga(e,t,n){let r={},i=x(e,[`systemInstruction`]);t!==void 0&&i!=null&&b(t,[`systemInstruction`],Ha(N(i)));let a=x(e,[`tools`]);if(t!==void 0&&a!=null){let e=a;Array.isArray(e)&&(e=e.map(e=>ws(e))),b(t,[`tools`],e)}let o=x(e,[`generationConfig`]);return t!==void 0&&o!=null&&b(t,[`generationConfig`],Lo(o)),r}function Ka(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`contents`]);if(a!=null){let e=P(a);Array.isArray(e)&&(e=e.map(e=>Va(e))),b(r,[`contents`],e)}let o=x(t,[`config`]);return o!=null&&Wa(o),r}function qa(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`contents`]);if(a!=null){let e=P(a);Array.isArray(e)&&(e=e.map(e=>Ha(e))),b(r,[`contents`],e)}let o=x(t,[`config`]);return o!=null&&Ga(o,r),r}function Ja(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`totalTokens`]);i!=null&&b(n,[`totalTokens`],i);let a=x(e,[`cachedContentTokenCount`]);return a!=null&&b(n,[`cachedContentTokenCount`],a),n}function Ya(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`totalTokens`]);return i!=null&&b(n,[`totalTokens`],i),n}function Xa(e,t,n){let r={},i=x(t,[`model`]);return i!=null&&b(r,[`_url`,`name`],M(e,i)),r}function Za(e,t,n){let r={},i=x(t,[`model`]);return i!=null&&b(r,[`_url`,`name`],M(e,i)),r}function Qa(e,t){let n={},r=x(e,[`sdkHttpResponse`]);return r!=null&&b(n,[`sdkHttpResponse`],r),n}function $a(e,t){let n={},r=x(e,[`sdkHttpResponse`]);return r!=null&&b(n,[`sdkHttpResponse`],r),n}function eo(e,t,n){let r={},i=x(e,[`outputGcsUri`]);t!==void 0&&i!=null&&b(t,[`parameters`,`storageUri`],i);let a=x(e,[`negativePrompt`]);t!==void 0&&a!=null&&b(t,[`parameters`,`negativePrompt`],a);let o=x(e,[`numberOfImages`]);t!==void 0&&o!=null&&b(t,[`parameters`,`sampleCount`],o);let s=x(e,[`aspectRatio`]);t!==void 0&&s!=null&&b(t,[`parameters`,`aspectRatio`],s);let c=x(e,[`guidanceScale`]);t!==void 0&&c!=null&&b(t,[`parameters`,`guidanceScale`],c);let l=x(e,[`seed`]);t!==void 0&&l!=null&&b(t,[`parameters`,`seed`],l);let u=x(e,[`safetyFilterLevel`]);t!==void 0&&u!=null&&b(t,[`parameters`,`safetySetting`],u);let d=x(e,[`personGeneration`]);t!==void 0&&d!=null&&b(t,[`parameters`,`personGeneration`],d);let f=x(e,[`includeSafetyAttributes`]);t!==void 0&&f!=null&&b(t,[`parameters`,`includeSafetyAttributes`],f);let p=x(e,[`includeRaiReason`]);t!==void 0&&p!=null&&b(t,[`parameters`,`includeRaiReason`],p);let m=x(e,[`language`]);t!==void 0&&m!=null&&b(t,[`parameters`,`language`],m);let h=x(e,[`outputMimeType`]);t!==void 0&&h!=null&&b(t,[`parameters`,`outputOptions`,`mimeType`],h);let g=x(e,[`outputCompressionQuality`]);t!==void 0&&g!=null&&b(t,[`parameters`,`outputOptions`,`compressionQuality`],g);let _=x(e,[`addWatermark`]);t!==void 0&&_!=null&&b(t,[`parameters`,`addWatermark`],_);let v=x(e,[`labels`]);t!==void 0&&v!=null&&b(t,[`labels`],v);let y=x(e,[`editMode`]);t!==void 0&&y!=null&&b(t,[`parameters`,`editMode`],y);let S=x(e,[`baseSteps`]);return t!==void 0&&S!=null&&b(t,[`parameters`,`editConfig`,`baseSteps`],S),r}function to(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`prompt`]);a!=null&&b(r,[`instances[0]`,`prompt`],a);let o=x(t,[`referenceImages`]);if(o!=null){let e=o;Array.isArray(e)&&(e=e.map(e=>us(e))),b(r,[`instances[0]`,`referenceImages`],e)}let s=x(t,[`config`]);return s!=null&&eo(s,r),r}function no(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`predictions`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>No(e))),b(n,[`generatedImages`],e)}return n}function ro(e,t,n){let r={},i=x(e,[`taskType`]);t!==void 0&&i!=null&&b(t,[`requests[]`,`taskType`],i);let a=x(e,[`title`]);t!==void 0&&a!=null&&b(t,[`requests[]`,`title`],a);let o=x(e,[`outputDimensionality`]);if(t!==void 0&&o!=null&&b(t,[`requests[]`,`outputDimensionality`],o),x(e,[`mimeType`])!==void 0)throw Error(`mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`autoTruncate`])!==void 0)throw Error(`autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`documentOcr`])!==void 0)throw Error(`documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`audioTrackExtraction`])!==void 0)throw Error(`audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return r}function io(e,t,n){let r={},i=x(n,[`embeddingApiType`]);if(i===void 0&&(i=`PREDICT`),i===`PREDICT`){let n=x(e,[`taskType`]);t!==void 0&&n!=null&&b(t,[`instances[]`,`task_type`],n)}else if(i===`EMBED_CONTENT`){let n=x(e,[`taskType`]);t!==void 0&&n!=null&&b(t,[`embedContentConfig`,`taskType`],n)}let a=x(n,[`embeddingApiType`]);if(a===void 0&&(a=`PREDICT`),a===`PREDICT`){let n=x(e,[`title`]);t!==void 0&&n!=null&&b(t,[`instances[]`,`title`],n)}else if(a===`EMBED_CONTENT`){let n=x(e,[`title`]);t!==void 0&&n!=null&&b(t,[`embedContentConfig`,`title`],n)}let o=x(n,[`embeddingApiType`]);if(o===void 0&&(o=`PREDICT`),o===`PREDICT`){let n=x(e,[`outputDimensionality`]);t!==void 0&&n!=null&&b(t,[`parameters`,`outputDimensionality`],n)}else if(o===`EMBED_CONTENT`){let n=x(e,[`outputDimensionality`]);t!==void 0&&n!=null&&b(t,[`embedContentConfig`,`outputDimensionality`],n)}let s=x(n,[`embeddingApiType`]);if(s===void 0&&(s=`PREDICT`),s===`PREDICT`){let n=x(e,[`mimeType`]);t!==void 0&&n!=null&&b(t,[`instances[]`,`mimeType`],n)}let c=x(n,[`embeddingApiType`]);if(c===void 0&&(c=`PREDICT`),c===`PREDICT`){let n=x(e,[`autoTruncate`]);t!==void 0&&n!=null&&b(t,[`parameters`,`autoTruncate`],n)}else if(c===`EMBED_CONTENT`){let n=x(e,[`autoTruncate`]);t!==void 0&&n!=null&&b(t,[`embedContentConfig`,`autoTruncate`],n)}let l=x(n,[`embeddingApiType`]);if(l===void 0&&(l=`PREDICT`),l===`EMBED_CONTENT`){let n=x(e,[`documentOcr`]);t!==void 0&&n!=null&&b(t,[`embedContentConfig`,`documentOcr`],n)}let u=x(n,[`embeddingApiType`]);if(u===void 0&&(u=`PREDICT`),u===`EMBED_CONTENT`){let n=x(e,[`audioTrackExtraction`]);t!==void 0&&n!=null&&b(t,[`embedContentConfig`,`audioTrackExtraction`],n)}return r}function ao(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`contents`]);if(a!=null){let t=yn(e,a);Array.isArray(t)&&(t=t.map(e=>e)),b(r,[`requests[]`,`content`],t)}let o=x(t,[`content`]);o!=null&&Va(N(o));let s=x(t,[`config`]);s!=null&&ro(s,r);let c=x(t,[`model`]);return c!==void 0&&b(r,[`requests[]`,`model`],M(e,c)),r}function oo(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(n,[`embeddingApiType`]);if(a===void 0&&(a=`PREDICT`),a===`PREDICT`){let n=x(t,[`contents`]);if(n!=null){let t=yn(e,n);Array.isArray(t)&&(t=t.map(e=>e)),b(r,[`instances[]`,`content`],t)}}let o=x(n,[`embeddingApiType`]);if(o===void 0&&(o=`PREDICT`),o===`EMBED_CONTENT`){let e=x(t,[`content`]);e!=null&&b(r,[`content`],Ha(N(e)))}let s=x(t,[`config`]);return s!=null&&io(s,r,n),r}function so(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`embeddings`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`embeddings`],e)}let a=x(e,[`metadata`]);return a!=null&&b(n,[`metadata`],a),n}function co(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`predictions[]`,`embeddings`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>za(e))),b(n,[`embeddings`],e)}let a=x(e,[`metadata`]);if(a!=null&&b(n,[`metadata`],a),t&&x(t,[`embeddingApiType`])===`EMBED_CONTENT`){let t=x(e,[`embedding`]),r=x(e,[`usageMetadata`]),i=x(e,[`truncated`]);if(t){let e={};r&&r.promptTokenCount&&(e.tokenCount=r.promptTokenCount),r&&r.promptTokensDetails&&(e.tokensDetails=r.promptTokensDetails),i&&(e.truncated=i),t.statistics=e,b(n,[`embeddings`],[t])}}return n}function lo(e,t){let n={},r=x(e,[`endpoint`]);r!=null&&b(n,[`name`],r);let i=x(e,[`deployedModelId`]);return i!=null&&b(n,[`deployedModelId`],i),n}function uo(e,t){let n={};if(x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`fileUri`]);r!=null&&b(n,[`fileUri`],r);let i=x(e,[`mimeType`]);return i!=null&&b(n,[`mimeType`],i),n}function fo(e,t){let n={},r=x(e,[`args`]);r!=null&&b(n,[`args`],r);let i=x(e,[`id`]);i!=null&&b(n,[`id`],i);let a=x(e,[`name`]);if(a!=null&&b(n,[`name`],a),x(e,[`partialArgs`])!==void 0)throw Error(`partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`willContinue`])!==void 0)throw Error(`willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function po(e,t){let n={},r=x(e,[`allowedFunctionNames`]);r!=null&&b(n,[`allowedFunctionNames`],r);let i=x(e,[`mode`]);if(i!=null&&b(n,[`mode`],i),x(e,[`streamFunctionCallArguments`])!==void 0)throw Error(`streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function mo(e,t,n,r){let i={},a=x(t,[`serviceTier`]);n!==void 0&&a!=null&&b(n,[`serviceTier`],a);let o=x(t,[`systemInstruction`]);n!==void 0&&o!=null&&b(n,[`systemInstruction`],Va(N(o)));let s=x(t,[`temperature`]);s!=null&&b(i,[`temperature`],s);let c=x(t,[`topP`]);c!=null&&b(i,[`topP`],c);let l=x(t,[`topK`]);l!=null&&b(i,[`topK`],l);let u=x(t,[`candidateCount`]);u!=null&&b(i,[`candidateCount`],u);let d=x(t,[`maxOutputTokens`]);d!=null&&b(i,[`maxOutputTokens`],d);let f=x(t,[`stopSequences`]);f!=null&&b(i,[`stopSequences`],f);let p=x(t,[`responseLogprobs`]);p!=null&&b(i,[`responseLogprobs`],p);let m=x(t,[`logprobs`]);m!=null&&b(i,[`logprobs`],m);let h=x(t,[`presencePenalty`]);h!=null&&b(i,[`presencePenalty`],h);let g=x(t,[`frequencyPenalty`]);g!=null&&b(i,[`frequencyPenalty`],g);let _=x(t,[`seed`]);_!=null&&b(i,[`seed`],_);let v=x(t,[`responseMimeType`]);v!=null&&b(i,[`responseMimeType`],v);let y=x(t,[`responseSchema`]);y!=null&&b(i,[`responseSchema`],Sn(y));let S=x(t,[`responseJsonSchema`]);if(S!=null&&b(i,[`responseJsonSchema`],Cn(S)),x(t,[`routingConfig`])!==void 0)throw Error(`routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(t,[`modelSelectionConfig`])!==void 0)throw Error(`modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let C=x(t,[`safetySettings`]);if(n!==void 0&&C!=null){let e=C;Array.isArray(e)&&(e=e.map(e=>ps(e))),b(n,[`safetySettings`],e)}let w=x(t,[`tools`]);if(n!==void 0&&w!=null){let e=Dn(w);Array.isArray(e)&&(e=e.map(e=>Cs(En(e)))),b(n,[`tools`],e)}let T=x(t,[`toolConfig`]);if(n!==void 0&&T!=null&&b(n,[`toolConfig`],xs(T)),x(t,[`labels`])!==void 0)throw Error(`labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let E=x(t,[`cachedContent`]);n!==void 0&&E!=null&&b(n,[`cachedContent`],kn(e,E));let D=x(t,[`responseModalities`]);D!=null&&b(i,[`responseModalities`],D);let O=x(t,[`mediaResolution`]);O!=null&&b(i,[`mediaResolution`],O);let k=x(t,[`speechConfig`]);if(k!=null&&b(i,[`speechConfig`],wn(k)),x(t,[`audioTimestamp`])!==void 0)throw Error(`audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let A=x(t,[`thinkingConfig`]);A!=null&&b(i,[`thinkingConfig`],A);let ee=x(t,[`audioTranscriptionConfig`]);ee!=null&&b(i,[`audioTranscriptionConfig`],ee);let te=x(t,[`imageConfig`]);te!=null&&b(i,[`imageConfig`],Ho(te));let ne=x(t,[`enableEnhancedCivicAnswers`]);if(ne!=null&&b(i,[`enableEnhancedCivicAnswers`],ne),x(t,[`modelArmorConfig`])!==void 0)throw Error(`modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return i}function ho(e,t,n,r){let i={},a=x(t,[`serviceTier`]);n!==void 0&&a!=null&&b(n,[`serviceTier`],a);let o=x(t,[`systemInstruction`]);n!==void 0&&o!=null&&b(n,[`systemInstruction`],Ha(N(o)));let s=x(t,[`temperature`]);s!=null&&b(i,[`temperature`],s);let c=x(t,[`topP`]);c!=null&&b(i,[`topP`],c);let l=x(t,[`topK`]);l!=null&&b(i,[`topK`],l);let u=x(t,[`candidateCount`]);u!=null&&b(i,[`candidateCount`],u);let d=x(t,[`maxOutputTokens`]);d!=null&&b(i,[`maxOutputTokens`],d);let f=x(t,[`stopSequences`]);f!=null&&b(i,[`stopSequences`],f);let p=x(t,[`responseLogprobs`]);p!=null&&b(i,[`responseLogprobs`],p);let m=x(t,[`logprobs`]);m!=null&&b(i,[`logprobs`],m);let h=x(t,[`presencePenalty`]);h!=null&&b(i,[`presencePenalty`],h);let g=x(t,[`frequencyPenalty`]);g!=null&&b(i,[`frequencyPenalty`],g);let _=x(t,[`seed`]);_!=null&&b(i,[`seed`],_);let v=x(t,[`responseMimeType`]);v!=null&&b(i,[`responseMimeType`],v);let y=x(t,[`responseSchema`]);y!=null&&b(i,[`responseSchema`],Sn(y));let S=x(t,[`responseJsonSchema`]);S!=null&&b(i,[`responseJsonSchema`],Cn(S));let C=x(t,[`routingConfig`]);C!=null&&b(i,[`routingConfig`],C);let w=x(t,[`modelSelectionConfig`]);w!=null&&b(i,[`modelConfig`],w);let T=x(t,[`safetySettings`]);if(n!==void 0&&T!=null){let e=T;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`safetySettings`],e)}let E=x(t,[`tools`]);if(n!==void 0&&E!=null){let e=Dn(E);Array.isArray(e)&&(e=e.map(e=>ws(En(e)))),b(n,[`tools`],e)}let D=x(t,[`toolConfig`]);n!==void 0&&D!=null&&b(n,[`toolConfig`],Ss(D));let O=x(t,[`labels`]);n!==void 0&&O!=null&&b(n,[`labels`],O);let k=x(t,[`cachedContent`]);n!==void 0&&k!=null&&b(n,[`cachedContent`],kn(e,k));let A=x(t,[`responseModalities`]);A!=null&&b(i,[`responseModalities`],A);let ee=x(t,[`mediaResolution`]);ee!=null&&b(i,[`mediaResolution`],ee);let te=x(t,[`speechConfig`]);te!=null&&b(i,[`speechConfig`],bs(wn(te)));let ne=x(t,[`audioTimestamp`]);ne!=null&&b(i,[`audioTimestamp`],ne);let re=x(t,[`thinkingConfig`]);re!=null&&b(i,[`thinkingConfig`],re);let ie=x(t,[`audioTranscriptionConfig`]);ie!=null&&b(i,[`audioTranscriptionConfig`],ie);let ae=x(t,[`imageConfig`]);if(ae!=null&&b(i,[`imageConfig`],Uo(ae)),x(t,[`enableEnhancedCivicAnswers`])!==void 0)throw Error(`enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let oe=x(t,[`modelArmorConfig`]);return n!==void 0&&oe!=null&&b(n,[`modelArmorConfig`],oe),i}function go(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`contents`]);if(a!=null){let e=P(a);Array.isArray(e)&&(e=e.map(e=>Va(e))),b(r,[`contents`],e)}let o=x(t,[`config`]);return o!=null&&b(r,[`generationConfig`],mo(e,o,r)),r}function _o(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`contents`]);if(a!=null){let e=P(a);Array.isArray(e)&&(e=e.map(e=>Ha(e))),b(r,[`contents`],e)}let o=x(t,[`config`]);return o!=null&&b(r,[`generationConfig`],ho(e,o,r)),r}function vo(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`candidates`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>Pa(e))),b(n,[`candidates`],e)}let a=x(e,[`modelVersion`]);a!=null&&b(n,[`modelVersion`],a);let o=x(e,[`promptFeedback`]);o!=null&&b(n,[`promptFeedback`],o);let s=x(e,[`responseId`]);s!=null&&b(n,[`responseId`],s);let c=x(e,[`usageMetadata`]);c!=null&&b(n,[`usageMetadata`],c);let l=x(e,[`modelStatus`]);return l!=null&&b(n,[`modelStatus`],l),n}function yo(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`candidates`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`candidates`],e)}let a=x(e,[`createTime`]);a!=null&&b(n,[`createTime`],a);let o=x(e,[`modelVersion`]);o!=null&&b(n,[`modelVersion`],o);let s=x(e,[`promptFeedback`]);s!=null&&b(n,[`promptFeedback`],s);let c=x(e,[`responseId`]);c!=null&&b(n,[`responseId`],c);let l=x(e,[`usageMetadata`]);return l!=null&&b(n,[`usageMetadata`],l),n}function bo(e,t,n){let r={},i=x(e,[`outputGcsUri`]);t!==void 0&&i!=null&&b(t,[`parameters`,`storageUri`],i);let a=x(e,[`negativePrompt`]);t!==void 0&&a!=null&&b(t,[`parameters`,`negativePrompt`],a);let o=x(e,[`numberOfImages`]);t!==void 0&&o!=null&&b(t,[`parameters`,`sampleCount`],o);let s=x(e,[`aspectRatio`]);t!==void 0&&s!=null&&b(t,[`parameters`,`aspectRatio`],s);let c=x(e,[`guidanceScale`]);t!==void 0&&c!=null&&b(t,[`parameters`,`guidanceScale`],c);let l=x(e,[`seed`]);t!==void 0&&l!=null&&b(t,[`parameters`,`seed`],l);let u=x(e,[`safetyFilterLevel`]);t!==void 0&&u!=null&&b(t,[`parameters`,`safetySetting`],u);let d=x(e,[`personGeneration`]);t!==void 0&&d!=null&&b(t,[`parameters`,`personGeneration`],d);let f=x(e,[`includeSafetyAttributes`]);t!==void 0&&f!=null&&b(t,[`parameters`,`includeSafetyAttributes`],f);let p=x(e,[`includeRaiReason`]);t!==void 0&&p!=null&&b(t,[`parameters`,`includeRaiReason`],p);let m=x(e,[`language`]);t!==void 0&&m!=null&&b(t,[`parameters`,`language`],m);let h=x(e,[`outputMimeType`]);t!==void 0&&h!=null&&b(t,[`parameters`,`outputOptions`,`mimeType`],h);let g=x(e,[`outputCompressionQuality`]);t!==void 0&&g!=null&&b(t,[`parameters`,`outputOptions`,`compressionQuality`],g);let _=x(e,[`addWatermark`]);t!==void 0&&_!=null&&b(t,[`parameters`,`addWatermark`],_);let v=x(e,[`labels`]);t!==void 0&&v!=null&&b(t,[`labels`],v);let y=x(e,[`imageSize`]);t!==void 0&&y!=null&&b(t,[`parameters`,`sampleImageSize`],y);let S=x(e,[`enhancePrompt`]);return t!==void 0&&S!=null&&b(t,[`parameters`,`enhancePrompt`],S),r}function xo(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`prompt`]);a!=null&&b(r,[`instances[0]`,`prompt`],a);let o=x(t,[`config`]);return o!=null&&bo(o,r),r}function So(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`predictions`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>No(e))),b(n,[`generatedImages`],e)}let a=x(e,[`positivePromptSafetyAttributes`]);return a!=null&&b(n,[`positivePromptSafetyAttributes`],fs(a)),n}function Co(e,t,n){let r={},i=x(e,[`numberOfVideos`]);if(t!==void 0&&i!=null&&b(t,[`parameters`,`sampleCount`],i),x(e,[`outputGcsUri`])!==void 0)throw Error(`outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`fps`])!==void 0)throw Error(`fps parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let a=x(e,[`durationSeconds`]);if(t!==void 0&&a!=null&&b(t,[`parameters`,`durationSeconds`],a),x(e,[`seed`])!==void 0)throw Error(`seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let o=x(e,[`aspectRatio`]);t!==void 0&&o!=null&&b(t,[`parameters`,`aspectRatio`],o);let s=x(e,[`resolution`]);t!==void 0&&s!=null&&b(t,[`parameters`,`resolution`],s);let c=x(e,[`personGeneration`]);if(t!==void 0&&c!=null&&b(t,[`parameters`,`personGeneration`],c),x(e,[`pubsubTopic`])!==void 0)throw Error(`pubsubTopic parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let l=x(e,[`negativePrompt`]);t!==void 0&&l!=null&&b(t,[`parameters`,`negativePrompt`],l);let u=x(e,[`enhancePrompt`]);if(t!==void 0&&u!=null&&b(t,[`parameters`,`enhancePrompt`],u),x(e,[`generateAudio`])!==void 0)throw Error(`generateAudio parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let d=x(e,[`lastFrame`]);t!==void 0&&d!=null&&b(t,[`instances[0]`,`lastFrame`],Go(d));let f=x(e,[`referenceImages`]);if(t!==void 0&&f!=null){let e=f;Array.isArray(e)&&(e=e.map(e=>Ls(e))),b(t,[`instances[0]`,`referenceImages`],e)}if(x(e,[`mask`])!==void 0)throw Error(`mask parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`compressionQuality`])!==void 0)throw Error(`compressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`labels`])!==void 0)throw Error(`labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let p=x(e,[`webhookConfig`]);if(t!==void 0&&p!=null&&b(t,[`webhookConfig`],p),x(e,[`resizeMode`])!==void 0)throw Error(`resizeMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return r}function wo(e,t,n){let r={},i=x(e,[`numberOfVideos`]);t!==void 0&&i!=null&&b(t,[`parameters`,`sampleCount`],i);let a=x(e,[`outputGcsUri`]);t!==void 0&&a!=null&&b(t,[`parameters`,`storageUri`],a);let o=x(e,[`fps`]);t!==void 0&&o!=null&&b(t,[`parameters`,`fps`],o);let s=x(e,[`durationSeconds`]);t!==void 0&&s!=null&&b(t,[`parameters`,`durationSeconds`],s);let c=x(e,[`seed`]);t!==void 0&&c!=null&&b(t,[`parameters`,`seed`],c);let l=x(e,[`aspectRatio`]);t!==void 0&&l!=null&&b(t,[`parameters`,`aspectRatio`],l);let u=x(e,[`resolution`]);t!==void 0&&u!=null&&b(t,[`parameters`,`resolution`],u);let d=x(e,[`personGeneration`]);t!==void 0&&d!=null&&b(t,[`parameters`,`personGeneration`],d);let f=x(e,[`pubsubTopic`]);t!==void 0&&f!=null&&b(t,[`parameters`,`pubsubTopic`],f);let p=x(e,[`negativePrompt`]);t!==void 0&&p!=null&&b(t,[`parameters`,`negativePrompt`],p);let m=x(e,[`enhancePrompt`]);t!==void 0&&m!=null&&b(t,[`parameters`,`enhancePrompt`],m);let h=x(e,[`generateAudio`]);t!==void 0&&h!=null&&b(t,[`parameters`,`generateAudio`],h);let g=x(e,[`lastFrame`]);t!==void 0&&g!=null&&b(t,[`instances[0]`,`lastFrame`],L(g));let _=x(e,[`referenceImages`]);if(t!==void 0&&_!=null){let e=_;Array.isArray(e)&&(e=e.map(e=>Rs(e))),b(t,[`instances[0]`,`referenceImages`],e)}let v=x(e,[`mask`]);t!==void 0&&v!=null&&b(t,[`instances[0]`,`mask`],Is(v));let y=x(e,[`compressionQuality`]);t!==void 0&&y!=null&&b(t,[`parameters`,`compressionQuality`],y);let S=x(e,[`labels`]);if(t!==void 0&&S!=null&&b(t,[`labels`],S),x(e,[`webhookConfig`])!==void 0)throw Error(`webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let C=x(e,[`resizeMode`]);return t!==void 0&&C!=null&&b(t,[`parameters`,`resizeMode`],C),r}function To(e,t){let n={},r=x(e,[`name`]);r!=null&&b(n,[`name`],r);let i=x(e,[`metadata`]);i!=null&&b(n,[`metadata`],i);let a=x(e,[`done`]);a!=null&&b(n,[`done`],a);let o=x(e,[`error`]);o!=null&&b(n,[`error`],o);let s=x(e,[`response`,`generateVideoResponse`]);return s!=null&&b(n,[`response`],ko(s)),n}function Eo(e,t){let n={},r=x(e,[`name`]);r!=null&&b(n,[`name`],r);let i=x(e,[`metadata`]);i!=null&&b(n,[`metadata`],i);let a=x(e,[`done`]);a!=null&&b(n,[`done`],a);let o=x(e,[`error`]);o!=null&&b(n,[`error`],o);let s=x(e,[`response`]);return s!=null&&b(n,[`response`],Ao(s)),n}function Do(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`prompt`]);a!=null&&b(r,[`instances[0]`,`prompt`],a);let o=x(t,[`image`]);o!=null&&b(r,[`instances[0]`,`image`],Go(o));let s=x(t,[`video`]);s!=null&&b(r,[`instances[0]`,`video`],zs(s));let c=x(t,[`source`]);c!=null&&jo(c,r);let l=x(t,[`config`]);return l!=null&&Co(l,r),r}function Oo(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`prompt`]);a!=null&&b(r,[`instances[0]`,`prompt`],a);let o=x(t,[`image`]);o!=null&&b(r,[`instances[0]`,`image`],L(o));let s=x(t,[`video`]);s!=null&&b(r,[`instances[0]`,`video`],Bs(s));let c=x(t,[`source`]);c!=null&&Mo(c,r);let l=x(t,[`config`]);return l!=null&&wo(l,r),r}function ko(e,t){let n={},r=x(e,[`generatedSamples`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>Fo(e))),b(n,[`generatedVideos`],e)}let i=x(e,[`raiMediaFilteredCount`]);i!=null&&b(n,[`raiMediaFilteredCount`],i);let a=x(e,[`raiMediaFilteredReasons`]);return a!=null&&b(n,[`raiMediaFilteredReasons`],a),n}function Ao(e,t){let n={},r=x(e,[`videos`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>Io(e))),b(n,[`generatedVideos`],e)}let i=x(e,[`raiMediaFilteredCount`]);i!=null&&b(n,[`raiMediaFilteredCount`],i);let a=x(e,[`raiMediaFilteredReasons`]);return a!=null&&b(n,[`raiMediaFilteredReasons`],a),n}function jo(e,t,n){let r={},i=x(e,[`prompt`]);t!==void 0&&i!=null&&b(t,[`instances[0]`,`prompt`],i);let a=x(e,[`image`]);t!==void 0&&a!=null&&b(t,[`instances[0]`,`image`],Go(a));let o=x(e,[`video`]);return t!==void 0&&o!=null&&b(t,[`instances[0]`,`video`],zs(o)),r}function Mo(e,t,n){let r={},i=x(e,[`prompt`]);t!==void 0&&i!=null&&b(t,[`instances[0]`,`prompt`],i);let a=x(e,[`image`]);t!==void 0&&a!=null&&b(t,[`instances[0]`,`image`],L(a));let o=x(e,[`video`]);return t!==void 0&&o!=null&&b(t,[`instances[0]`,`video`],Bs(o)),r}function No(e,t){let n={},r=x(e,[`_self`]);r!=null&&b(n,[`image`],Wo(r));let i=x(e,[`raiFilteredReason`]);i!=null&&b(n,[`raiFilteredReason`],i);let a=x(e,[`_self`]);a!=null&&b(n,[`safetyAttributes`],fs(a));let o=x(e,[`prompt`]);return o!=null&&b(n,[`enhancedPrompt`],o),n}function Po(e,t){let n={},r=x(e,[`_self`]);r!=null&&b(n,[`mask`],Wo(r));let i=x(e,[`labels`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`labels`],e)}return n}function Fo(e,t){let n={},r=x(e,[`video`]);return r!=null&&b(n,[`video`],Ps(r)),n}function Io(e,t){let n={},r=x(e,[`_self`]);return r!=null&&b(n,[`video`],Fs(r)),n}function Lo(e,t){let n={},r=x(e,[`modelSelectionConfig`]);r!=null&&b(n,[`modelConfig`],r);let i=x(e,[`responseJsonSchema`]);i!=null&&b(n,[`responseJsonSchema`],Cn(i));let a=x(e,[`audioTranscriptionConfig`]);a!=null&&b(n,[`audioTranscriptionConfig`],a);let o=x(e,[`audioTimestamp`]);o!=null&&b(n,[`audioTimestamp`],o);let s=x(e,[`candidateCount`]);s!=null&&b(n,[`candidateCount`],s);let c=x(e,[`enableAffectiveDialog`]);c!=null&&b(n,[`enableAffectiveDialog`],c);let l=x(e,[`frequencyPenalty`]);l!=null&&b(n,[`frequencyPenalty`],l);let u=x(e,[`logprobs`]);u!=null&&b(n,[`logprobs`],u);let d=x(e,[`maxOutputTokens`]);d!=null&&b(n,[`maxOutputTokens`],d);let f=x(e,[`mediaResolution`]);f!=null&&b(n,[`mediaResolution`],f);let p=x(e,[`presencePenalty`]);p!=null&&b(n,[`presencePenalty`],p);let m=x(e,[`responseFormat`]);if(m!=null){let e=m;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`responseFormat`],e)}let h=x(e,[`responseLogprobs`]);h!=null&&b(n,[`responseLogprobs`],h);let g=x(e,[`responseMimeType`]);g!=null&&b(n,[`responseMimeType`],g);let _=x(e,[`responseModalities`]);_!=null&&b(n,[`responseModalities`],_);let v=x(e,[`responseSchema`]);v!=null&&b(n,[`responseSchema`],v);let y=x(e,[`routingConfig`]);y!=null&&b(n,[`routingConfig`],y);let S=x(e,[`seed`]);S!=null&&b(n,[`seed`],S);let C=x(e,[`speechConfig`]);C!=null&&b(n,[`speechConfig`],bs(C));let w=x(e,[`stopSequences`]);w!=null&&b(n,[`stopSequences`],w);let T=x(e,[`temperature`]);T!=null&&b(n,[`temperature`],T);let E=x(e,[`thinkingConfig`]);E!=null&&b(n,[`thinkingConfig`],E);let D=x(e,[`topK`]);D!=null&&b(n,[`topK`],D);let O=x(e,[`topP`]);if(O!=null&&b(n,[`topP`],O),x(e,[`enableEnhancedCivicAnswers`])!==void 0)throw Error(`enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`translationConfig`])!==void 0)throw Error(`translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function Ro(e,t,n){let r={},i=x(t,[`model`]);return i!=null&&b(r,[`_url`,`name`],M(e,i)),r}function zo(e,t,n){let r={},i=x(t,[`model`]);return i!=null&&b(r,[`_url`,`name`],M(e,i)),r}function Bo(e,t){let n={},r=x(e,[`authConfig`]);r!=null&&b(n,[`authConfig`],Ma(r));let i=x(e,[`enableWidget`]);if(i!=null&&b(n,[`enableWidget`],i),x(e,[`groundingTypes`])!==void 0)throw Error(`groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function Vo(e,t){let n={};if(x(e,[`blockingConfidence`])!==void 0)throw Error(`blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`excludeDomains`])!==void 0)throw Error(`excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`searchTypes`]);r!=null&&b(n,[`searchTypes`],r);let i=x(e,[`timeRangeFilter`]);return i!=null&&b(n,[`timeRangeFilter`],i),n}function Ho(e,t){let n={},r=x(e,[`aspectRatio`]);r!=null&&b(n,[`aspectRatio`],r);let i=x(e,[`imageSize`]);if(i!=null&&b(n,[`imageSize`],i),x(e,[`personGeneration`])!==void 0)throw Error(`personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`outputMimeType`])!==void 0)throw Error(`outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`outputCompressionQuality`])!==void 0)throw Error(`outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`imageOutputOptions`])!==void 0)throw Error(`imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`prominentPeople`])!==void 0)throw Error(`prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function Uo(e,t){let n={},r=x(e,[`aspectRatio`]);r!=null&&b(n,[`aspectRatio`],r);let i=x(e,[`imageSize`]);i!=null&&b(n,[`imageSize`],i);let a=x(e,[`personGeneration`]);a!=null&&b(n,[`personGeneration`],a);let o=x(e,[`outputMimeType`]);o!=null&&b(n,[`imageOutputOptions`,`mimeType`],o);let s=x(e,[`outputCompressionQuality`]);s!=null&&b(n,[`imageOutputOptions`,`compressionQuality`],s);let c=x(e,[`imageOutputOptions`]);c!=null&&b(n,[`imageOutputOptions`],c);let l=x(e,[`prominentPeople`]);return l!=null&&b(n,[`prominentPeople`],l),n}function Wo(e,t){let n={},r=x(e,[`gcsUri`]);r!=null&&b(n,[`gcsUri`],r);let i=x(e,[`bytesBase64Encoded`]);i!=null&&b(n,[`imageBytes`],jn(i));let a=x(e,[`mimeType`]);return a!=null&&b(n,[`mimeType`],a),n}function Go(e,t){let n={};if(x(e,[`gcsUri`])!==void 0)throw Error(`gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`imageBytes`]);r!=null&&b(n,[`bytesBase64Encoded`],jn(r));let i=x(e,[`mimeType`]);return i!=null&&b(n,[`mimeType`],i),n}function L(e,t){let n={},r=x(e,[`gcsUri`]);r!=null&&b(n,[`gcsUri`],r);let i=x(e,[`imageBytes`]);i!=null&&b(n,[`bytesBase64Encoded`],jn(i));let a=x(e,[`mimeType`]);return a!=null&&b(n,[`mimeType`],a),n}function Ko(e,t,n,r){let i={},a=x(t,[`pageSize`]);n!==void 0&&a!=null&&b(n,[`_query`,`pageSize`],a);let o=x(t,[`pageToken`]);n!==void 0&&o!=null&&b(n,[`_query`,`pageToken`],o);let s=x(t,[`filter`]);n!==void 0&&s!=null&&b(n,[`_query`,`filter`],s);let c=x(t,[`queryBase`]);return n!==void 0&&c!=null&&b(n,[`_url`,`models_url`],In(e,c)),i}function qo(e,t,n,r){let i={},a=x(t,[`pageSize`]);n!==void 0&&a!=null&&b(n,[`_query`,`pageSize`],a);let o=x(t,[`pageToken`]);n!==void 0&&o!=null&&b(n,[`_query`,`pageToken`],o);let s=x(t,[`filter`]);n!==void 0&&s!=null&&b(n,[`_query`,`filter`],s);let c=x(t,[`queryBase`]);return n!==void 0&&c!=null&&b(n,[`_url`,`models_url`],In(e,c)),i}function Jo(e,t,n){let r={},i=x(t,[`config`]);return i!=null&&Ko(e,i,r),r}function Yo(e,t,n){let r={},i=x(t,[`config`]);return i!=null&&qo(e,i,r),r}function Xo(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`nextPageToken`]);i!=null&&b(n,[`nextPageToken`],i);let a=x(e,[`_self`]);if(a!=null){let e=Ln(a);Array.isArray(e)&&(e=e.map(e=>es(e))),b(n,[`models`],e)}return n}function Zo(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`nextPageToken`]);i!=null&&b(n,[`nextPageToken`],i);let a=x(e,[`_self`]);if(a!=null){let e=Ln(a);Array.isArray(e)&&(e=e.map(e=>ts(e))),b(n,[`models`],e)}return n}function Qo(e,t){let n={},r=x(e,[`maskMode`]);r!=null&&b(n,[`maskMode`],r);let i=x(e,[`segmentationClasses`]);i!=null&&b(n,[`maskClasses`],i);let a=x(e,[`maskDilation`]);return a!=null&&b(n,[`dilation`],a),n}function $o(e,t){let n={};if(x(e,[`name`])!==void 0)throw Error(`name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`streamableHttpTransport`])!==void 0)throw Error(`streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function es(e,t){let n={},r=x(e,[`name`]);r!=null&&b(n,[`name`],r);let i=x(e,[`displayName`]);i!=null&&b(n,[`displayName`],i);let a=x(e,[`description`]);a!=null&&b(n,[`description`],a);let o=x(e,[`version`]);o!=null&&b(n,[`version`],o);let s=x(e,[`_self`]);s!=null&&b(n,[`tunedModelInfo`],Ts(s));let c=x(e,[`inputTokenLimit`]);c!=null&&b(n,[`inputTokenLimit`],c);let l=x(e,[`outputTokenLimit`]);l!=null&&b(n,[`outputTokenLimit`],l);let u=x(e,[`supportedGenerationMethods`]);u!=null&&b(n,[`supportedActions`],u);let d=x(e,[`temperature`]);d!=null&&b(n,[`temperature`],d);let f=x(e,[`maxTemperature`]);f!=null&&b(n,[`maxTemperature`],f);let p=x(e,[`topP`]);p!=null&&b(n,[`topP`],p);let m=x(e,[`topK`]);m!=null&&b(n,[`topK`],m);let h=x(e,[`thinking`]);return h!=null&&b(n,[`thinking`],h),n}function ts(e,t){let n={},r=x(e,[`name`]);r!=null&&b(n,[`name`],r);let i=x(e,[`displayName`]);i!=null&&b(n,[`displayName`],i);let a=x(e,[`description`]);a!=null&&b(n,[`description`],a);let o=x(e,[`versionId`]);o!=null&&b(n,[`version`],o);let s=x(e,[`deployedModels`]);if(s!=null){let e=s;Array.isArray(e)&&(e=e.map(e=>lo(e))),b(n,[`endpoints`],e)}let c=x(e,[`labels`]);c!=null&&b(n,[`labels`],c);let l=x(e,[`_self`]);l!=null&&b(n,[`tunedModelInfo`],Es(l));let u=x(e,[`defaultCheckpointId`]);u!=null&&b(n,[`defaultCheckpointId`],u);let d=x(e,[`checkpoints`]);if(d!=null){let e=d;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`checkpoints`],e)}return n}function ns(e,t){let n={},r=x(e,[`speakerVoiceConfigs`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>ys(e))),b(n,[`speakerVoiceConfigs`],e)}return n}function rs(e,t){let n={},r=x(e,[`mediaResolution`]);r!=null&&b(n,[`mediaResolution`],r);let i=x(e,[`toolCall`]);i!=null&&b(n,[`toolCall`],i);let a=x(e,[`toolResponse`]);a!=null&&b(n,[`toolResponse`],a);let o=x(e,[`audioTranscription`]);o!=null&&b(n,[`audioTranscription`],o);let s=x(e,[`codeExecutionResult`]);s!=null&&b(n,[`codeExecutionResult`],s);let c=x(e,[`executableCode`]);c!=null&&b(n,[`executableCode`],c);let l=x(e,[`fileData`]);l!=null&&b(n,[`fileData`],uo(l));let u=x(e,[`functionCall`]);u!=null&&b(n,[`functionCall`],fo(u));let d=x(e,[`functionResponse`]);d!=null&&b(n,[`functionResponse`],d);let f=x(e,[`inlineData`]);f!=null&&b(n,[`inlineData`],Na(f));let p=x(e,[`text`]);p!=null&&b(n,[`text`],p);let m=x(e,[`thought`]);m!=null&&b(n,[`thought`],m);let h=x(e,[`thoughtSignature`]);h!=null&&b(n,[`thoughtSignature`],h);let g=x(e,[`videoMetadata`]);g!=null&&b(n,[`videoMetadata`],g);let _=x(e,[`partMetadata`]);_!=null&&b(n,[`partMetadata`],_);let v=x(e,[`mediaProcessing`]);return v!=null&&b(n,[`mediaProcessing`],v),n}function is(e,t){let n={},r=x(e,[`mediaResolution`]);if(r!=null&&b(n,[`mediaResolution`],r),x(e,[`toolCall`])!==void 0)throw Error(`toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`toolResponse`])!==void 0)throw Error(`toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let i=x(e,[`audioTranscription`]);i!=null&&b(n,[`audioTranscription`],i);let a=x(e,[`codeExecutionResult`]);a!=null&&b(n,[`codeExecutionResult`],a);let o=x(e,[`executableCode`]);o!=null&&b(n,[`executableCode`],o);let s=x(e,[`fileData`]);s!=null&&b(n,[`fileData`],s);let c=x(e,[`functionCall`]);c!=null&&b(n,[`functionCall`],c);let l=x(e,[`functionResponse`]);l!=null&&b(n,[`functionResponse`],l);let u=x(e,[`inlineData`]);u!=null&&b(n,[`inlineData`],u);let d=x(e,[`text`]);d!=null&&b(n,[`text`],d);let f=x(e,[`thought`]);f!=null&&b(n,[`thought`],f);let p=x(e,[`thoughtSignature`]);p!=null&&b(n,[`thoughtSignature`],p);let m=x(e,[`videoMetadata`]);if(m!=null&&b(n,[`videoMetadata`],m),x(e,[`partMetadata`])!==void 0)throw Error(`partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let h=x(e,[`mediaProcessing`]);return h!=null&&b(n,[`mediaProcessing`],h),n}function as(e,t){let n={},r=x(e,[`productImage`]);return r!=null&&b(n,[`image`],L(r)),n}function os(e,t,n){let r={},i=x(e,[`numberOfImages`]);t!==void 0&&i!=null&&b(t,[`parameters`,`sampleCount`],i);let a=x(e,[`baseSteps`]);t!==void 0&&a!=null&&b(t,[`parameters`,`baseSteps`],a);let o=x(e,[`outputGcsUri`]);t!==void 0&&o!=null&&b(t,[`parameters`,`storageUri`],o);let s=x(e,[`seed`]);t!==void 0&&s!=null&&b(t,[`parameters`,`seed`],s);let c=x(e,[`safetyFilterLevel`]);t!==void 0&&c!=null&&b(t,[`parameters`,`safetySetting`],c);let l=x(e,[`personGeneration`]);t!==void 0&&l!=null&&b(t,[`parameters`,`personGeneration`],l);let u=x(e,[`addWatermark`]);t!==void 0&&u!=null&&b(t,[`parameters`,`addWatermark`],u);let d=x(e,[`outputMimeType`]);t!==void 0&&d!=null&&b(t,[`parameters`,`outputOptions`,`mimeType`],d);let f=x(e,[`outputCompressionQuality`]);t!==void 0&&f!=null&&b(t,[`parameters`,`outputOptions`,`compressionQuality`],f);let p=x(e,[`enhancePrompt`]);t!==void 0&&p!=null&&b(t,[`parameters`,`enhancePrompt`],p);let m=x(e,[`labels`]);return t!==void 0&&m!=null&&b(t,[`labels`],m),r}function ss(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`source`]);a!=null&&ls(a,r);let o=x(t,[`config`]);return o!=null&&os(o,r),r}function cs(e,t){let n={},r=x(e,[`predictions`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>No(e))),b(n,[`generatedImages`],e)}return n}function ls(e,t,n){let r={},i=x(e,[`prompt`]);t!==void 0&&i!=null&&b(t,[`instances[0]`,`prompt`],i);let a=x(e,[`personImage`]);t!==void 0&&a!=null&&b(t,[`instances[0]`,`personImage`,`image`],L(a));let o=x(e,[`productImages`]);if(t!==void 0&&o!=null){let e=o;Array.isArray(e)&&(e=e.map(e=>as(e))),b(t,[`instances[0]`,`productImages`],e)}return r}function us(e,t){let n={},r=x(e,[`referenceImage`]);r!=null&&b(n,[`referenceImage`],L(r));let i=x(e,[`referenceId`]);i!=null&&b(n,[`referenceId`],i);let a=x(e,[`referenceType`]);a!=null&&b(n,[`referenceType`],a);let o=x(e,[`maskImageConfig`]);o!=null&&b(n,[`maskImageConfig`],Qo(o));let s=x(e,[`controlImageConfig`]);s!=null&&b(n,[`controlImageConfig`],Ua(s));let c=x(e,[`styleImageConfig`]);c!=null&&b(n,[`styleImageConfig`],c);let l=x(e,[`subjectImageConfig`]);return l!=null&&b(n,[`subjectImageConfig`],l),n}function ds(e,t){let n={},r=x(e,[`mimeType`]);r!=null&&b(n,[`mimeType`],r);let i=x(e,[`voiceSampleAudio`]);if(i!=null&&b(n,[`voiceSampleAudio`],i),x(e,[`consentAudio`])!==void 0)throw Error(`consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`voiceConsentSignature`])!==void 0)throw Error(`voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function fs(e,t){let n={},r=x(e,[`safetyAttributes`,`categories`]);r!=null&&b(n,[`categories`],r);let i=x(e,[`safetyAttributes`,`scores`]);i!=null&&b(n,[`scores`],i);let a=x(e,[`contentType`]);return a!=null&&b(n,[`contentType`],a),n}function ps(e,t){let n={},r=x(e,[`category`]);if(r!=null&&b(n,[`category`],r),x(e,[`method`])!==void 0)throw Error(`method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let i=x(e,[`threshold`]);return i!=null&&b(n,[`threshold`],i),n}function ms(e,t){let n={},r=x(e,[`image`]);return r!=null&&b(n,[`image`],L(r)),n}function hs(e,t,n){let r={},i=x(e,[`mode`]);t!==void 0&&i!=null&&b(t,[`parameters`,`mode`],i);let a=x(e,[`maxPredictions`]);t!==void 0&&a!=null&&b(t,[`parameters`,`maxPredictions`],a);let o=x(e,[`confidenceThreshold`]);t!==void 0&&o!=null&&b(t,[`parameters`,`confidenceThreshold`],o);let s=x(e,[`maskDilation`]);t!==void 0&&s!=null&&b(t,[`parameters`,`maskDilation`],s);let c=x(e,[`binaryColorThreshold`]);t!==void 0&&c!=null&&b(t,[`parameters`,`binaryColorThreshold`],c);let l=x(e,[`labels`]);return t!==void 0&&l!=null&&b(t,[`labels`],l),r}function gs(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`source`]);a!=null&&vs(a,r);let o=x(t,[`config`]);return o!=null&&hs(o,r),r}function _s(e,t){let n={},r=x(e,[`predictions`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>Po(e))),b(n,[`generatedMasks`],e)}return n}function vs(e,t,n){let r={},i=x(e,[`prompt`]);t!==void 0&&i!=null&&b(t,[`instances[0]`,`prompt`],i);let a=x(e,[`image`]);t!==void 0&&a!=null&&b(t,[`instances[0]`,`image`],L(a));let o=x(e,[`scribbleImage`]);return t!==void 0&&o!=null&&b(t,[`instances[0]`,`scribble`],ms(o)),r}function ys(e,t){let n={},r=x(e,[`speaker`]);r!=null&&b(n,[`speaker`],r);let i=x(e,[`voiceConfig`]);return i!=null&&b(n,[`voiceConfig`],Vs(i)),n}function bs(e,t){let n={},r=x(e,[`voiceConfig`]);r!=null&&b(n,[`voiceConfig`],Vs(r));let i=x(e,[`languageCode`]);i!=null&&b(n,[`languageCode`],i);let a=x(e,[`multiSpeakerVoiceConfig`]);return a!=null&&b(n,[`multiSpeakerVoiceConfig`],ns(a)),n}function xs(e,t){let n={},r=x(e,[`functionCallingConfig`]);r!=null&&b(n,[`functionCallingConfig`],po(r));let i=x(e,[`retrievalConfig`]);i!=null&&b(n,[`retrievalConfig`],i);let a=x(e,[`includeServerSideToolInvocations`]);return a!=null&&b(n,[`includeServerSideToolInvocations`],a),n}function Ss(e,t){let n={},r=x(e,[`functionCallingConfig`]);r!=null&&b(n,[`functionCallingConfig`],r);let i=x(e,[`retrievalConfig`]);if(i!=null&&b(n,[`retrievalConfig`],i),x(e,[`includeServerSideToolInvocations`])!==void 0)throw Error(`includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function Cs(e,t){let n={};if(x(e,[`retrieval`])!==void 0)throw Error(`retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`googleMaps`]);r!=null&&b(n,[`googleMaps`],Bo(r));let i=x(e,[`mcpServers`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`mcpServers`],e)}let a=x(e,[`codeExecution`]);a!=null&&b(n,[`codeExecution`],a);let o=x(e,[`computerUse`]);if(o!=null&&b(n,[`computerUse`],o),x(e,[`enterpriseWebSearch`])!==void 0)throw Error(`enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`exaAiSearch`])!==void 0)throw Error(`exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let s=x(e,[`functionDeclarations`]);if(s!=null){let e=s;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`functionDeclarations`],e)}let c=x(e,[`googleSearch`]);c!=null&&b(n,[`googleSearch`],Vo(c));let l=x(e,[`googleSearchRetrieval`]);if(l!=null&&b(n,[`googleSearchRetrieval`],l),x(e,[`parallelAiSearch`])!==void 0)throw Error(`parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let u=x(e,[`urlContext`]);u!=null&&b(n,[`urlContext`],u);let d=x(e,[`fileSearch`]);return d!=null&&b(n,[`fileSearch`],d),n}function ws(e,t){let n={},r=x(e,[`retrieval`]);r!=null&&b(n,[`retrieval`],r);let i=x(e,[`googleMaps`]);i!=null&&b(n,[`googleMaps`],i);let a=x(e,[`mcpServers`]);if(a!=null){let e=a;Array.isArray(e)&&(e=e.map(e=>$o(e))),b(n,[`mcpServers`],e)}let o=x(e,[`codeExecution`]);o!=null&&b(n,[`codeExecution`],o);let s=x(e,[`computerUse`]);s!=null&&b(n,[`computerUse`],Ra(s));let c=x(e,[`enterpriseWebSearch`]);c!=null&&b(n,[`enterpriseWebSearch`],c);let l=x(e,[`exaAiSearch`]);l!=null&&b(n,[`exaAiSearch`],l);let u=x(e,[`functionDeclarations`]);if(u!=null){let e=u;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`functionDeclarations`],e)}let d=x(e,[`googleSearch`]);d!=null&&b(n,[`googleSearch`],d);let f=x(e,[`googleSearchRetrieval`]);f!=null&&b(n,[`googleSearchRetrieval`],f);let p=x(e,[`parallelAiSearch`]);p!=null&&b(n,[`parallelAiSearch`],p);let m=x(e,[`urlContext`]);if(m!=null&&b(n,[`urlContext`],m),x(e,[`fileSearch`])!==void 0)throw Error(`fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function Ts(e,t){let n={},r=x(e,[`baseModel`]);r!=null&&b(n,[`baseModel`],r);let i=x(e,[`createTime`]);i!=null&&b(n,[`createTime`],i);let a=x(e,[`updateTime`]);return a!=null&&b(n,[`updateTime`],a),n}function Es(e,t){let n={},r=x(e,[`labels`,`google-vertex-llm-tuning-base-model-id`]);r!=null&&b(n,[`baseModel`],r);let i=x(e,[`createTime`]);i!=null&&b(n,[`createTime`],i);let a=x(e,[`updateTime`]);return a!=null&&b(n,[`updateTime`],a),n}function Ds(e,t,n){let r={},i=x(e,[`displayName`]);t!==void 0&&i!=null&&b(t,[`displayName`],i);let a=x(e,[`description`]);t!==void 0&&a!=null&&b(t,[`description`],a);let o=x(e,[`defaultCheckpointId`]);return t!==void 0&&o!=null&&b(t,[`defaultCheckpointId`],o),r}function Os(e,t,n){let r={},i=x(e,[`displayName`]);t!==void 0&&i!=null&&b(t,[`displayName`],i);let a=x(e,[`description`]);t!==void 0&&a!=null&&b(t,[`description`],a);let o=x(e,[`defaultCheckpointId`]);return t!==void 0&&o!=null&&b(t,[`defaultCheckpointId`],o),r}function ks(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`name`],M(e,i));let a=x(t,[`config`]);return a!=null&&Ds(a,r),r}function As(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`config`]);return a!=null&&Os(a,r),r}function js(e,t,n){let r={},i=x(e,[`outputGcsUri`]);t!==void 0&&i!=null&&b(t,[`parameters`,`storageUri`],i);let a=x(e,[`safetyFilterLevel`]);t!==void 0&&a!=null&&b(t,[`parameters`,`safetySetting`],a);let o=x(e,[`personGeneration`]);t!==void 0&&o!=null&&b(t,[`parameters`,`personGeneration`],o);let s=x(e,[`includeRaiReason`]);t!==void 0&&s!=null&&b(t,[`parameters`,`includeRaiReason`],s);let c=x(e,[`outputMimeType`]);t!==void 0&&c!=null&&b(t,[`parameters`,`outputOptions`,`mimeType`],c);let l=x(e,[`outputCompressionQuality`]);t!==void 0&&l!=null&&b(t,[`parameters`,`outputOptions`,`compressionQuality`],l);let u=x(e,[`enhanceInputImage`]);t!==void 0&&u!=null&&b(t,[`parameters`,`upscaleConfig`,`enhanceInputImage`],u);let d=x(e,[`imagePreservationFactor`]);t!==void 0&&d!=null&&b(t,[`parameters`,`upscaleConfig`,`imagePreservationFactor`],d);let f=x(e,[`labels`]);t!==void 0&&f!=null&&b(t,[`labels`],f);let p=x(e,[`numberOfImages`]);t!==void 0&&p!=null&&b(t,[`parameters`,`sampleCount`],p);let m=x(e,[`mode`]);return t!==void 0&&m!=null&&b(t,[`parameters`,`mode`],m),r}function Ms(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`image`]);a!=null&&b(r,[`instances[0]`,`image`],L(a));let o=x(t,[`upscaleFactor`]);o!=null&&b(r,[`parameters`,`upscaleConfig`,`upscaleFactor`],o);let s=x(t,[`config`]);return s!=null&&js(s,r),r}function Ns(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`predictions`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>No(e))),b(n,[`generatedImages`],e)}return n}function Ps(e,t){let n={},r=x(e,[`uri`]);r!=null&&b(n,[`uri`],r);let i=x(e,[`encodedVideo`]);i!=null&&b(n,[`videoBytes`],jn(i));let a=x(e,[`encoding`]);return a!=null&&b(n,[`mimeType`],a),n}function Fs(e,t){let n={},r=x(e,[`gcsUri`]);r!=null&&b(n,[`uri`],r);let i=x(e,[`bytesBase64Encoded`]);i!=null&&b(n,[`videoBytes`],jn(i));let a=x(e,[`mimeType`]);return a!=null&&b(n,[`mimeType`],a),n}function Is(e,t){let n={},r=x(e,[`image`]);r!=null&&b(n,[`_self`],L(r));let i=x(e,[`maskMode`]);return i!=null&&b(n,[`maskMode`],i),n}function Ls(e,t){let n={},r=x(e,[`image`]);r!=null&&b(n,[`image`],Go(r));let i=x(e,[`referenceType`]);return i!=null&&b(n,[`referenceType`],i),n}function Rs(e,t){let n={},r=x(e,[`image`]);r!=null&&b(n,[`image`],L(r));let i=x(e,[`referenceType`]);return i!=null&&b(n,[`referenceType`],i),n}function zs(e,t){let n={},r=x(e,[`uri`]);r!=null&&b(n,[`uri`],r);let i=x(e,[`videoBytes`]);i!=null&&b(n,[`encodedVideo`],jn(i));let a=x(e,[`mimeType`]);return a!=null&&b(n,[`encoding`],a),n}function Bs(e,t){let n={},r=x(e,[`uri`]);r!=null&&b(n,[`gcsUri`],r);let i=x(e,[`videoBytes`]);i!=null&&b(n,[`bytesBase64Encoded`],jn(i));let a=x(e,[`mimeType`]);return a!=null&&b(n,[`mimeType`],a),n}function Vs(e,t){let n={},r=x(e,[`replicatedVoiceConfig`]);r!=null&&b(n,[`replicatedVoiceConfig`],ds(r));let i=x(e,[`prebuiltVoiceConfig`]);return i!=null&&b(n,[`prebuiltVoiceConfig`],i),n}function Hs(e,t,n){let r={},i=x(t,[`displayName`]);n!==void 0&&i!=null&&b(n,[`displayName`],i);let a=x(t,[`embeddingModel`]);return n!==void 0&&a!=null&&b(n,[`embeddingModel`],M(e,a)),r}function Us(e,t){let n={},r=x(t,[`config`]);return r!=null&&Hs(e,r,n),n}function Ws(e,t){let n={},r=x(e,[`force`]);return t!==void 0&&r!=null&&b(t,[`_query`,`force`],r),n}function Gs(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`_url`,`name`],n);let r=x(e,[`config`]);return r!=null&&Ws(r,t),t}function Ks(e){let t={},n=x(e,[`name`]);return n!=null&&b(t,[`_url`,`name`],n),t}function qs(e,t){let n={},r=x(e,[`customMetadata`]);if(t!==void 0&&r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`customMetadata`],e)}let i=x(e,[`chunkingConfig`]);return t!==void 0&&i!=null&&b(t,[`chunkingConfig`],i),n}function Js(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`metadata`]);r!=null&&b(t,[`metadata`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);a!=null&&b(t,[`error`],a);let o=x(e,[`response`]);return o!=null&&b(t,[`response`],Xs(o)),t}function Ys(e){let t={},n=x(e,[`fileSearchStoreName`]);n!=null&&b(t,[`_url`,`file_search_store_name`],n);let r=x(e,[`fileName`]);r!=null&&b(t,[`fileName`],r);let i=x(e,[`config`]);return i!=null&&qs(i,t),t}function Xs(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`parent`]);r!=null&&b(t,[`parent`],r);let i=x(e,[`documentName`]);return i!=null&&b(t,[`documentName`],i),t}function Zs(e,t){let n={},r=x(e,[`pageSize`]);t!==void 0&&r!=null&&b(t,[`_query`,`pageSize`],r);let i=x(e,[`pageToken`]);return t!==void 0&&i!=null&&b(t,[`_query`,`pageToken`],i),n}function Qs(e){let t={},n=x(e,[`config`]);return n!=null&&Zs(n,t),t}function $s(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`nextPageToken`]);r!=null&&b(t,[`nextPageToken`],r);let i=x(e,[`fileSearchStores`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`fileSearchStores`],e)}return t}function ec(e,t){let n={},r=x(e,[`mimeType`]);t!==void 0&&r!=null&&b(t,[`mimeType`],r);let i=x(e,[`displayName`]);t!==void 0&&i!=null&&b(t,[`displayName`],i);let a=x(e,[`customMetadata`]);if(t!==void 0&&a!=null){let e=a;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`customMetadata`],e)}let o=x(e,[`chunkingConfig`]);return t!==void 0&&o!=null&&b(t,[`chunkingConfig`],o),n}function tc(e){let t={},n=x(e,[`fileSearchStoreName`]);n!=null&&b(t,[`_url`,`file_search_store_name`],n);let r=x(e,[`config`]);return r!=null&&ec(r,t),t}function nc(e){let t={},n=x(e,[`sdkHttpResponse`]);return n!=null&&b(t,[`sdkHttpResponse`],n),t}var rc=`Content-Type`,ic=`X-Server-Timeout`,ac=`User-Agent`,oc=`x-goog-api-client`,sc=`google-genai-sdk/2.21.0`,cc=`v1beta1`,lc=`v1beta`,uc=new Set([`us`,`eu`]);function dc(e){let t=globalThis[Symbol.for(`undici.globalDispatcher.1`)];if(t)for(let n of Object.getOwnPropertySymbols(t)){let r=n.description;if(r?.includes(`headers timeout`)||r?.includes(`body timeout`)){let r=t[n];typeof r==`number`&&(t[n]=Math.max(r,e))}}}function fc(e,t){let n=()=>{};if(!(e&&e>0)&&!t)return{signal:void 0,dispose:n};let r=new AbortController,i;e&&e>0&&(i=setTimeout(()=>r.abort(),e),i&&typeof i.unref==`function`&&i.unref());let a=()=>r.abort();return t&&(t.aborted?r.abort():t.addEventListener(`abort`,a)),{signal:r.signal,dispose:()=>{i!==void 0&&clearTimeout(i),t?.removeEventListener(`abort`,a)}}}var pc=5,mc=1,hc=60,gc=2,_c=1,vc=[408,429,500,502,503,504],yc=class{constructor(e){this.clientOptions=Object.assign({},e),this.customBaseUrl=e.httpOptions?.baseUrl;let t={};if(this.clientOptions.vertexai){if(!this.clientOptions.location&&!this.clientOptions.apiKey&&!this.customBaseUrl&&(this.clientOptions.location=`global`),!(this.clientOptions.project&&this.clientOptions.location||this.clientOptions.apiKey)&&!this.customBaseUrl)throw Error(`Authentication is not set up. Please provide either a project and location, or an API key, or a custom base URL.`);let n=e.project&&e.location||!!e.apiKey;this.customBaseUrl&&!n?(t.baseUrl=this.customBaseUrl,this.clientOptions.project=void 0,this.clientOptions.location=void 0):this.clientOptions.apiKey&&!this.clientOptions.project||this.clientOptions.location===`global`?t.baseUrl=`https://aiplatform.googleapis.com/`:this.clientOptions.project&&this.clientOptions.location&&uc.has(this.clientOptions.location)?t.baseUrl=`https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`:this.clientOptions.project&&this.clientOptions.location&&(t.baseUrl=`https://${this.clientOptions.location}-aiplatform.googleapis.com/`),t.apiVersion=this.clientOptions.apiVersion??cc}else this.clientOptions.apiKey||console.warn(`API key should be set when using the Gemini API.`),t.apiVersion=this.clientOptions.apiVersion??lc,t.baseUrl=`https://generativelanguage.googleapis.com/`;t.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=t,e.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(t,e.httpOptions))}isVertexAI(){return this.clientOptions.vertexai??!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}getCustomBaseUrl(){return this.customBaseUrl}async getAuthHeaders(){let e=new Headers;return await this.clientOptions.auth.addAuthHeaders(e),e}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw Error(`API version is not set.`)}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw Error(`Base URL is not set.`)}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw Error(`Headers are not set.`)}getRequestUrlInternal(e){if(!e||e.baseUrl===void 0||e.apiVersion===void 0)throw Error(`HTTP options are not correctly set.`);let t=[e.baseUrl.endsWith(`/`)?e.baseUrl.slice(0,-1):e.baseUrl];return e.apiVersion&&e.apiVersion!==``&&t.push(e.apiVersion),t.join(`/`)}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){let e=this.getBaseUrl(),t=new URL(e);return t.protocol=t.protocol==`http:`?`ws`:`wss`,t.toString()}setBaseUrl(e){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=e;else throw Error(`HTTP options are not correctly set.`)}constructUrl(e,t,n){let r=[this.getRequestUrlInternal(t)];return n&&r.push(this.getBaseResourcePath()),e!==``&&r.push(e),new URL(`${r.join(`/`)}`)}shouldPrependVertexProjectPath(e,t){return!(t.baseUrl&&t.baseUrlResourceScope===rt.COLLECTION||!this.clientOptions.vertexai||!this.clientOptions.project||!this.clientOptions.location||e.path.startsWith(`projects/`)||e.httpMethod===`GET`&&e.path.startsWith(`publishers/google/models`))}async request(e){let t=this.clientOptions.httpOptions;e.httpOptions&&(t=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));let n=this.shouldPrependVertexProjectPath(e,t),r=this.constructUrl(e.path,t,n);if(e.queryParams)for(let[t,n]of Object.entries(e.queryParams))r.searchParams.append(t,String(n));let i={};if(e.httpMethod===`GET`){if(e.body&&e.body!==`{}`)throw Error(`Request body should be empty for GET request, but got non empty request body`)}else i.body=e.body;return i=await this.includeExtraHttpOptionsToRequestInit(i,t,r.toString()),this.unaryApiCall(r,i,e.httpMethod,t.retryOptions,t.timeout,e.abortSignal)}patchHttpOptions(e,t){let n=JSON.parse(JSON.stringify(e));for(let[e,r]of Object.entries(t))typeof r==`object`?n[e]=Object.assign(Object.assign({},n[e]),r):r!==void 0&&(n[e]=r);return n}async requestStream(e){let t=this.clientOptions.httpOptions;e.httpOptions&&(t=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));let n=this.shouldPrependVertexProjectPath(e,t),r=this.constructUrl(e.path,t,n);(!r.searchParams.has(`alt`)||r.searchParams.get(`alt`)!==`sse`)&&r.searchParams.set(`alt`,`sse`);let i={};return i.body=e.body,i=await this.includeExtraHttpOptionsToRequestInit(i,t,r.toString()),this.streamApiCall(r,i,e.httpMethod,t.retryOptions,t.timeout,e.abortSignal)}async includeExtraHttpOptionsToRequestInit(e,t,n){return t?.timeout&&t.timeout>0&&dc(t.timeout),t&&t.extraBody!==null&&xc(e,t.extraBody),e.headers=await this.getHeadersInternal(t,n),e}async unaryApiCall(e,t,n,r,i,a){return this.apiCall(e.toString(),Object.assign(Object.assign({},t),{method:n}),r,i,a).then(async e=>(await bc(e),new Mt(e))).catch(e=>{throw e instanceof Error?e:Error(`exception ${e} sending request`,{cause:e})})}async streamApiCall(e,t,n,r,i,a){return this.apiCall(e.toString(),Object.assign(Object.assign({},t),{method:n}),r,i,a).then(async e=>(await bc(e),this.processStreamResponse(e))).catch(e=>{throw e instanceof Error?e:Error(`exception ${e} sending request`,{cause:e})})}processStreamResponse(e){return Ni(this,arguments,function*(){let t=(e?.body)?.getReader(),n=new TextDecoder(`utf-8`);if(!t)throw Error(`Response body is empty`);try{let r=``,i=[`
|
|
1
|
+
import{i as e,t}from"./rolldown-runtime-Dd_uD5pT.js";import{m as n,n as r,o as i}from"./models-DuCVW_cU.js";import{i as a,o}from"./constrained-sampling-DA0j0g9I.js";import{t as s}from"./provider-retry-RVfYd5Vz.js";import{t as c}from"./sanitize-unicode-DmIE6hZJ.js";import{t as l}from"./transform-messages-HTSSP3zz.js";var u=t(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0){if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1}var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),d=t((e=>{var t=u();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),f=t(((e,t)=>{t.exports=d()})),p=e(t(((e,t)=>{var n=f(),r=[`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`],i=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}},a=(e,t,n)=>{let r=n.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e},o=e=>r.includes(e),s=(e,t)=>new Promise((r,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};let c=n.operation(t);c.attempt(async n=>{try{r(await e(n))}catch(e){if(!(e instanceof Error)){s(TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));return}if(e instanceof i)c.stop(),s(e.originalError);else if(e instanceof TypeError&&!o(e.message))c.stop(),s(e);else{a(e,n,t);try{await t.onFailedAttempt(e)}catch(e){s(e);return}c.retry(e)||s(c.mainError())}}})});t.exports=s,t.exports.default=s,t.exports.AbortError=i}))(),1),m=void 0,h=void 0;function g(){return{geminiUrl:m,vertexUrl:h}}function _(e,t,n,r){if(!e?.baseUrl){let e=g();return t?e.vertexUrl??n:e.geminiUrl??r}return e.baseUrl}var v=class{};function y(e,t){return e.replace(/\{([^}]+)\}/g,(e,n)=>{if(Object.prototype.hasOwnProperty.call(t,n)){let e=t[n];return e==null?``:String(e)}throw Error(`Key '${n}' not found in valueMap.`)})}function b(e,t,n){for(let r=0;r<t.length-1;r++){let i=t[r];if(i.endsWith(`[]`)){let a=i.slice(0,-2);if(!(a in e)){if(Array.isArray(n))e[a]=Array.from({length:n.length},()=>({}));else throw Error(`Value must be a list given an array path ${i}`)}if(Array.isArray(e[a])){let i=e[a];if(Array.isArray(n))for(let e=0;e<i.length;e++){let a=i[e];b(a,t.slice(r+1),n[e])}else for(let e of i)b(e,t.slice(r+1),n)}return}if(i.endsWith(`[0]`)){let a=i.slice(0,-3);a in e||(e[a]=[{}]);let o=e[a];b(o[0],t.slice(r+1),n);return}(!e[i]||typeof e[i]!=`object`)&&(e[i]={}),e=e[i]}let r=t[t.length-1],i=e[r];if(i!==void 0){if(!n||typeof n==`object`&&Object.keys(n).length===0||n===i)return;if(typeof i==`object`&&typeof n==`object`&&i!==null&&n!==null)Object.assign(i,n);else throw Error(`Cannot set value for an existing key. Key: ${r}`)}else r===`_self`&&typeof n==`object`&&n&&!Array.isArray(n)?Object.assign(e,n):e[r]=n}function x(e,t,n=void 0){try{if(t.length===1&&t[0]===`_self`)return e;for(let r=0;r<t.length;r++){if(typeof e!=`object`||!e)return n;let i=t[r];if(i.endsWith(`[]`)){let a=i.slice(0,-2);if(a in e){let i=e[a];return Array.isArray(i)?i.map(e=>x(e,t.slice(r+1),n)):n}return n}e=e[i]}return e}catch(e){if(e instanceof TypeError)return n;throw e}}function S(e,t){for(let[n,r]of Object.entries(t)){let t=n.split(`.`),i=r.split(`.`),a=new Set,o=-1;for(let e=0;e<t.length;e++)if(t[e]===`*`){o=e;break}if(o!==-1&&i.length>o)for(let e=o;e<i.length;e++){let t=i[e];t!==`*`&&!t.endsWith(`[]`)&&!t.endsWith(`[0]`)&&a.add(t)}C(e,t,i,0,a)}}function C(e,t,n,r,i){if(r>=t.length||typeof e!=`object`||!e)return;let a=t[r];if(a.endsWith(`[]`)){let o=a.slice(0,-2),s=e;if(o in s&&Array.isArray(s[o]))for(let e of s[o])C(e,t,n,r+1,i)}else if(a===`*`){if(typeof e==`object`&&e&&!Array.isArray(e)){let t=e,a=Object.keys(t).filter(e=>!e.startsWith(`_`)&&!i.has(e)),o={};for(let e of a)o[e]=t[e];for(let[e,i]of Object.entries(o)){let a=[];for(let t of n.slice(r))t===`*`?a.push(e):a.push(t);b(t,a,i)}for(let e of a)delete t[e]}}else{let o=e;a in o&&C(o[a],t,n,r+1,i)}}function w(e){if(typeof e!=`string`)throw Error(`fromImageBytes must be a string`);return e}function T(e){let t={},n=x(e,[`operationName`]);n!=null&&b(t,[`operationName`],n);let r=x(e,[`resourceName`]);return r!=null&&b(t,[`_url`,`resourceName`],r),t}function E(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`metadata`]);r!=null&&b(t,[`metadata`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);a!=null&&b(t,[`error`],a);let o=x(e,[`response`,`generateVideoResponse`]);return o!=null&&b(t,[`response`],O(o)),t}function D(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`metadata`]);r!=null&&b(t,[`metadata`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);a!=null&&b(t,[`error`],a);let o=x(e,[`response`]);return o!=null&&b(t,[`response`],k(o)),t}function O(e){let t={},n=x(e,[`generatedSamples`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>A(e))),b(t,[`generatedVideos`],e)}let r=x(e,[`raiMediaFilteredCount`]);r!=null&&b(t,[`raiMediaFilteredCount`],r);let i=x(e,[`raiMediaFilteredReasons`]);return i!=null&&b(t,[`raiMediaFilteredReasons`],i),t}function k(e){let t={},n=x(e,[`videos`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>ee(e))),b(t,[`generatedVideos`],e)}let r=x(e,[`raiMediaFilteredCount`]);r!=null&&b(t,[`raiMediaFilteredCount`],r);let i=x(e,[`raiMediaFilteredReasons`]);return i!=null&&b(t,[`raiMediaFilteredReasons`],i),t}function A(e){let t={},n=x(e,[`video`]);return n!=null&&b(t,[`video`],se(n)),t}function ee(e){let t={},n=x(e,[`_self`]);return n!=null&&b(t,[`video`],ce(n)),t}function te(e){let t={},n=x(e,[`operationName`]);return n!=null&&b(t,[`_url`,`operationName`],n),t}function ne(e){let t={},n=x(e,[`operationName`]);return n!=null&&b(t,[`_url`,`operationName`],n),t}function re(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`metadata`]);r!=null&&b(t,[`metadata`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);a!=null&&b(t,[`error`],a);let o=x(e,[`response`]);return o!=null&&b(t,[`response`],ie(o)),t}function ie(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`parent`]);r!=null&&b(t,[`parent`],r);let i=x(e,[`documentName`]);return i!=null&&b(t,[`documentName`],i),t}function ae(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`metadata`]);r!=null&&b(t,[`metadata`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);a!=null&&b(t,[`error`],a);let o=x(e,[`response`]);return o!=null&&b(t,[`response`],oe(o)),t}function oe(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`parent`]);r!=null&&b(t,[`parent`],r);let i=x(e,[`documentName`]);return i!=null&&b(t,[`documentName`],i),t}function se(e){let t={},n=x(e,[`uri`]);n!=null&&b(t,[`uri`],n);let r=x(e,[`encodedVideo`]);r!=null&&b(t,[`videoBytes`],w(r));let i=x(e,[`encoding`]);return i!=null&&b(t,[`mimeType`],i),t}function ce(e){let t={},n=x(e,[`gcsUri`]);n!=null&&b(t,[`uri`],n);let r=x(e,[`bytesBase64Encoded`]);r!=null&&b(t,[`videoBytes`],w(r));let i=x(e,[`mimeType`]);return i!=null&&b(t,[`mimeType`],i),t}var le;(function(e){e.OUTCOME_UNSPECIFIED=`OUTCOME_UNSPECIFIED`,e.OUTCOME_OK=`OUTCOME_OK`,e.OUTCOME_FAILED=`OUTCOME_FAILED`,e.OUTCOME_DEADLINE_EXCEEDED=`OUTCOME_DEADLINE_EXCEEDED`})(le||={});var ue;(function(e){e.LANGUAGE_UNSPECIFIED=`LANGUAGE_UNSPECIFIED`,e.PYTHON=`PYTHON`})(ue||={});var de;(function(e){e.SCHEDULING_UNSPECIFIED=`SCHEDULING_UNSPECIFIED`,e.SILENT=`SILENT`,e.WHEN_IDLE=`WHEN_IDLE`,e.INTERRUPT=`INTERRUPT`})(de||={});var fe;(function(e){e.TYPE_UNSPECIFIED=`TYPE_UNSPECIFIED`,e.STRING=`STRING`,e.NUMBER=`NUMBER`,e.INTEGER=`INTEGER`,e.BOOLEAN=`BOOLEAN`,e.ARRAY=`ARRAY`,e.OBJECT=`OBJECT`,e.NULL=`NULL`})(fe||={});var pe;(function(e){e.AUTH_TYPE_UNSPECIFIED=`AUTH_TYPE_UNSPECIFIED`,e.NO_AUTH=`NO_AUTH`,e.API_KEY_AUTH=`API_KEY_AUTH`,e.HTTP_BASIC_AUTH=`HTTP_BASIC_AUTH`,e.GOOGLE_SERVICE_ACCOUNT_AUTH=`GOOGLE_SERVICE_ACCOUNT_AUTH`,e.OAUTH=`OAUTH`,e.OIDC_AUTH=`OIDC_AUTH`})(pe||={});var me;(function(e){e.HTTP_IN_UNSPECIFIED=`HTTP_IN_UNSPECIFIED`,e.HTTP_IN_QUERY=`HTTP_IN_QUERY`,e.HTTP_IN_HEADER=`HTTP_IN_HEADER`,e.HTTP_IN_PATH=`HTTP_IN_PATH`,e.HTTP_IN_BODY=`HTTP_IN_BODY`,e.HTTP_IN_COOKIE=`HTTP_IN_COOKIE`})(me||={});var he;(function(e){e.API_SPEC_UNSPECIFIED=`API_SPEC_UNSPECIFIED`,e.SIMPLE_SEARCH=`SIMPLE_SEARCH`,e.ELASTIC_SEARCH=`ELASTIC_SEARCH`})(he||={});var ge;(function(e){e.ENVIRONMENT_UNSPECIFIED=`ENVIRONMENT_UNSPECIFIED`,e.ENVIRONMENT_BROWSER=`ENVIRONMENT_BROWSER`,e.ENVIRONMENT_MOBILE=`ENVIRONMENT_MOBILE`,e.ENVIRONMENT_DESKTOP=`ENVIRONMENT_DESKTOP`})(ge||={});var _e;(function(e){e.SAFETY_POLICY_UNSPECIFIED=`SAFETY_POLICY_UNSPECIFIED`,e.FINANCIAL_TRANSACTIONS=`FINANCIAL_TRANSACTIONS`,e.SENSITIVE_DATA_MODIFICATION=`SENSITIVE_DATA_MODIFICATION`,e.COMMUNICATION_TOOL=`COMMUNICATION_TOOL`,e.ACCOUNT_CREATION=`ACCOUNT_CREATION`,e.DATA_MODIFICATION=`DATA_MODIFICATION`,e.USER_CONSENT_MANAGEMENT=`USER_CONSENT_MANAGEMENT`,e.LEGAL_TERMS_AND_AGREEMENTS=`LEGAL_TERMS_AND_AGREEMENTS`})(_e||={});var ve;(function(e){e.PHISH_BLOCK_THRESHOLD_UNSPECIFIED=`PHISH_BLOCK_THRESHOLD_UNSPECIFIED`,e.BLOCK_LOW_AND_ABOVE=`BLOCK_LOW_AND_ABOVE`,e.BLOCK_MEDIUM_AND_ABOVE=`BLOCK_MEDIUM_AND_ABOVE`,e.BLOCK_HIGH_AND_ABOVE=`BLOCK_HIGH_AND_ABOVE`,e.BLOCK_HIGHER_AND_ABOVE=`BLOCK_HIGHER_AND_ABOVE`,e.BLOCK_VERY_HIGH_AND_ABOVE=`BLOCK_VERY_HIGH_AND_ABOVE`,e.BLOCK_ONLY_EXTREMELY_HIGH=`BLOCK_ONLY_EXTREMELY_HIGH`})(ve||={});var ye;(function(e){e.UNSPECIFIED=`UNSPECIFIED`,e.BLOCKING=`BLOCKING`,e.NON_BLOCKING=`NON_BLOCKING`})(ye||={});var be;(function(e){e.MODE_UNSPECIFIED=`MODE_UNSPECIFIED`,e.MODE_DYNAMIC=`MODE_DYNAMIC`})(be||={});var xe;(function(e){e.THINKING_LEVEL_UNSPECIFIED=`THINKING_LEVEL_UNSPECIFIED`,e.MINIMAL=`MINIMAL`,e.LOW=`LOW`,e.MEDIUM=`MEDIUM`,e.HIGH=`HIGH`})(xe||={});var Se;(function(e){e.DONT_ALLOW=`DONT_ALLOW`,e.ALLOW_ADULT=`ALLOW_ADULT`,e.ALLOW_ALL=`ALLOW_ALL`})(Se||={});var Ce;(function(e){e.PROMINENT_PEOPLE_UNSPECIFIED=`PROMINENT_PEOPLE_UNSPECIFIED`,e.ALLOW_PROMINENT_PEOPLE=`ALLOW_PROMINENT_PEOPLE`,e.BLOCK_PROMINENT_PEOPLE=`BLOCK_PROMINENT_PEOPLE`})(Ce||={});var we;(function(e){e.HARM_CATEGORY_UNSPECIFIED=`HARM_CATEGORY_UNSPECIFIED`,e.HARM_CATEGORY_HARASSMENT=`HARM_CATEGORY_HARASSMENT`,e.HARM_CATEGORY_HATE_SPEECH=`HARM_CATEGORY_HATE_SPEECH`,e.HARM_CATEGORY_SEXUALLY_EXPLICIT=`HARM_CATEGORY_SEXUALLY_EXPLICIT`,e.HARM_CATEGORY_DANGEROUS_CONTENT=`HARM_CATEGORY_DANGEROUS_CONTENT`,e.HARM_CATEGORY_CIVIC_INTEGRITY=`HARM_CATEGORY_CIVIC_INTEGRITY`,e.HARM_CATEGORY_JAILBREAK=`HARM_CATEGORY_JAILBREAK`,e.HARM_CATEGORY_IMAGE_HATE=`HARM_CATEGORY_IMAGE_HATE`,e.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT=`HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT`,e.HARM_CATEGORY_IMAGE_HARASSMENT=`HARM_CATEGORY_IMAGE_HARASSMENT`,e.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT=`HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT`})(we||={});var Te;(function(e){e.HARM_BLOCK_METHOD_UNSPECIFIED=`HARM_BLOCK_METHOD_UNSPECIFIED`,e.SEVERITY=`SEVERITY`,e.PROBABILITY=`PROBABILITY`})(Te||={});var Ee;(function(e){e.HARM_BLOCK_THRESHOLD_UNSPECIFIED=`HARM_BLOCK_THRESHOLD_UNSPECIFIED`,e.BLOCK_LOW_AND_ABOVE=`BLOCK_LOW_AND_ABOVE`,e.BLOCK_MEDIUM_AND_ABOVE=`BLOCK_MEDIUM_AND_ABOVE`,e.BLOCK_ONLY_HIGH=`BLOCK_ONLY_HIGH`,e.BLOCK_NONE=`BLOCK_NONE`,e.OFF=`OFF`})(Ee||={});var De;(function(e){e.MODE_UNSPECIFIED=`MODE_UNSPECIFIED`,e.AUTO=`AUTO`,e.ANY=`ANY`,e.NONE=`NONE`,e.VALIDATED=`VALIDATED`})(De||={});var j;(function(e){e.FINISH_REASON_UNSPECIFIED=`FINISH_REASON_UNSPECIFIED`,e.STOP=`STOP`,e.MAX_TOKENS=`MAX_TOKENS`,e.SAFETY=`SAFETY`,e.RECITATION=`RECITATION`,e.LANGUAGE=`LANGUAGE`,e.OTHER=`OTHER`,e.BLOCKLIST=`BLOCKLIST`,e.PROHIBITED_CONTENT=`PROHIBITED_CONTENT`,e.SPII=`SPII`,e.MALFORMED_FUNCTION_CALL=`MALFORMED_FUNCTION_CALL`,e.IMAGE_SAFETY=`IMAGE_SAFETY`,e.UNEXPECTED_TOOL_CALL=`UNEXPECTED_TOOL_CALL`,e.TOO_MANY_TOOL_CALLS=`TOO_MANY_TOOL_CALLS`,e.IMAGE_PROHIBITED_CONTENT=`IMAGE_PROHIBITED_CONTENT`,e.NO_IMAGE=`NO_IMAGE`,e.IMAGE_RECITATION=`IMAGE_RECITATION`,e.IMAGE_OTHER=`IMAGE_OTHER`})(j||={});var Oe;(function(e){e.HARM_PROBABILITY_UNSPECIFIED=`HARM_PROBABILITY_UNSPECIFIED`,e.NEGLIGIBLE=`NEGLIGIBLE`,e.LOW=`LOW`,e.MEDIUM=`MEDIUM`,e.HIGH=`HIGH`})(Oe||={});var ke;(function(e){e.HARM_SEVERITY_UNSPECIFIED=`HARM_SEVERITY_UNSPECIFIED`,e.HARM_SEVERITY_NEGLIGIBLE=`HARM_SEVERITY_NEGLIGIBLE`,e.HARM_SEVERITY_LOW=`HARM_SEVERITY_LOW`,e.HARM_SEVERITY_MEDIUM=`HARM_SEVERITY_MEDIUM`,e.HARM_SEVERITY_HIGH=`HARM_SEVERITY_HIGH`})(ke||={});var Ae;(function(e){e.URL_RETRIEVAL_STATUS_UNSPECIFIED=`URL_RETRIEVAL_STATUS_UNSPECIFIED`,e.URL_RETRIEVAL_STATUS_SUCCESS=`URL_RETRIEVAL_STATUS_SUCCESS`,e.URL_RETRIEVAL_STATUS_ERROR=`URL_RETRIEVAL_STATUS_ERROR`,e.URL_RETRIEVAL_STATUS_PAYWALL=`URL_RETRIEVAL_STATUS_PAYWALL`,e.URL_RETRIEVAL_STATUS_UNSAFE=`URL_RETRIEVAL_STATUS_UNSAFE`})(Ae||={});var je;(function(e){e.BLOCKED_REASON_UNSPECIFIED=`BLOCKED_REASON_UNSPECIFIED`,e.SAFETY=`SAFETY`,e.OTHER=`OTHER`,e.BLOCKLIST=`BLOCKLIST`,e.PROHIBITED_CONTENT=`PROHIBITED_CONTENT`,e.IMAGE_SAFETY=`IMAGE_SAFETY`,e.MODEL_ARMOR=`MODEL_ARMOR`,e.JAILBREAK=`JAILBREAK`})(je||={});var Me;(function(e){e.TRAFFIC_TYPE_UNSPECIFIED=`TRAFFIC_TYPE_UNSPECIFIED`,e.ON_DEMAND=`ON_DEMAND`,e.ON_DEMAND_PRIORITY=`ON_DEMAND_PRIORITY`,e.ON_DEMAND_FLEX=`ON_DEMAND_FLEX`,e.PROVISIONED_THROUGHPUT=`PROVISIONED_THROUGHPUT`})(Me||={});var Ne;(function(e){e.MODALITY_UNSPECIFIED=`MODALITY_UNSPECIFIED`,e.TEXT=`TEXT`,e.IMAGE=`IMAGE`,e.VIDEO=`VIDEO`,e.AUDIO=`AUDIO`,e.DOCUMENT=`DOCUMENT`})(Ne||={});var Pe;(function(e){e.MODEL_STAGE_UNSPECIFIED=`MODEL_STAGE_UNSPECIFIED`,e.UNSTABLE_EXPERIMENTAL=`UNSTABLE_EXPERIMENTAL`,e.EXPERIMENTAL=`EXPERIMENTAL`,e.PREVIEW=`PREVIEW`,e.STABLE=`STABLE`,e.LEGACY=`LEGACY`,e.DEPRECATED=`DEPRECATED`,e.RETIRED=`RETIRED`})(Pe||={});var Fe;(function(e){e.MEDIA_RESOLUTION_UNSPECIFIED=`MEDIA_RESOLUTION_UNSPECIFIED`,e.MEDIA_RESOLUTION_LOW=`MEDIA_RESOLUTION_LOW`,e.MEDIA_RESOLUTION_MEDIUM=`MEDIA_RESOLUTION_MEDIUM`,e.MEDIA_RESOLUTION_HIGH=`MEDIA_RESOLUTION_HIGH`})(Fe||={});var Ie;(function(e){e.MODALITY_UNSPECIFIED=`MODALITY_UNSPECIFIED`,e.TEXT=`TEXT`,e.IMAGE=`IMAGE`,e.AUDIO=`AUDIO`,e.VIDEO=`VIDEO`})(Ie||={});var Le;(function(e){e.DELIVERY_UNSPECIFIED=`DELIVERY_UNSPECIFIED`,e.INLINE=`INLINE`,e.URI=`URI`})(Le||={});var Re;(function(e){e.ASPECT_RATIO_UNSPECIFIED=`ASPECT_RATIO_UNSPECIFIED`,e.ASPECT_RATIO_ONE_BY_ONE=`ASPECT_RATIO_ONE_BY_ONE`,e.ASPECT_RATIO_TWO_BY_THREE=`ASPECT_RATIO_TWO_BY_THREE`,e.ASPECT_RATIO_THREE_BY_TWO=`ASPECT_RATIO_THREE_BY_TWO`,e.ASPECT_RATIO_THREE_BY_FOUR=`ASPECT_RATIO_THREE_BY_FOUR`,e.ASPECT_RATIO_FOUR_BY_THREE=`ASPECT_RATIO_FOUR_BY_THREE`,e.ASPECT_RATIO_FOUR_BY_FIVE=`ASPECT_RATIO_FOUR_BY_FIVE`,e.ASPECT_RATIO_FIVE_BY_FOUR=`ASPECT_RATIO_FIVE_BY_FOUR`,e.ASPECT_RATIO_NINE_BY_SIXTEEN=`ASPECT_RATIO_NINE_BY_SIXTEEN`,e.ASPECT_RATIO_SIXTEEN_BY_NINE=`ASPECT_RATIO_SIXTEEN_BY_NINE`,e.ASPECT_RATIO_TWENTY_ONE_BY_NINE=`ASPECT_RATIO_TWENTY_ONE_BY_NINE`,e.ASPECT_RATIO_ONE_BY_EIGHT=`ASPECT_RATIO_ONE_BY_EIGHT`,e.ASPECT_RATIO_EIGHT_BY_ONE=`ASPECT_RATIO_EIGHT_BY_ONE`,e.ASPECT_RATIO_ONE_BY_FOUR=`ASPECT_RATIO_ONE_BY_FOUR`,e.ASPECT_RATIO_FOUR_BY_ONE=`ASPECT_RATIO_FOUR_BY_ONE`})(Re||={});var ze;(function(e){e.IMAGE_SIZE_UNSPECIFIED=`IMAGE_SIZE_UNSPECIFIED`,e.IMAGE_SIZE_FIVE_TWELVE=`IMAGE_SIZE_FIVE_TWELVE`,e.IMAGE_SIZE_ONE_K=`IMAGE_SIZE_ONE_K`,e.IMAGE_SIZE_TWO_K=`IMAGE_SIZE_TWO_K`,e.IMAGE_SIZE_FOUR_K=`IMAGE_SIZE_FOUR_K`})(ze||={});var Be;(function(e){e.TUNING_MODE_UNSPECIFIED=`TUNING_MODE_UNSPECIFIED`,e.TUNING_MODE_FULL=`TUNING_MODE_FULL`,e.TUNING_MODE_PEFT_ADAPTER=`TUNING_MODE_PEFT_ADAPTER`})(Be||={});var Ve;(function(e){e.ADAPTER_SIZE_UNSPECIFIED=`ADAPTER_SIZE_UNSPECIFIED`,e.ADAPTER_SIZE_ONE=`ADAPTER_SIZE_ONE`,e.ADAPTER_SIZE_TWO=`ADAPTER_SIZE_TWO`,e.ADAPTER_SIZE_FOUR=`ADAPTER_SIZE_FOUR`,e.ADAPTER_SIZE_EIGHT=`ADAPTER_SIZE_EIGHT`,e.ADAPTER_SIZE_SIXTEEN=`ADAPTER_SIZE_SIXTEEN`,e.ADAPTER_SIZE_THIRTY_TWO=`ADAPTER_SIZE_THIRTY_TWO`})(Ve||={});var He;(function(e){e.RESPONSE_PARSE_TYPE_UNSPECIFIED=`RESPONSE_PARSE_TYPE_UNSPECIFIED`,e.IDENTITY=`IDENTITY`,e.REGEX_EXTRACT=`REGEX_EXTRACT`})(He||={});var Ue;(function(e){e.MATCH_OPERATION_UNSPECIFIED=`MATCH_OPERATION_UNSPECIFIED`,e.REGEX_CONTAINS=`REGEX_CONTAINS`,e.PARTIAL_MATCH=`PARTIAL_MATCH`,e.EXACT_MATCH=`EXACT_MATCH`})(Ue||={});var We;(function(e){e.REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED=`REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED`,e.MINIMAL=`MINIMAL`,e.HIGH=`HIGH`})(We||={});var Ge;(function(e){e.JOB_STATE_UNSPECIFIED=`JOB_STATE_UNSPECIFIED`,e.JOB_STATE_QUEUED=`JOB_STATE_QUEUED`,e.JOB_STATE_PENDING=`JOB_STATE_PENDING`,e.JOB_STATE_RUNNING=`JOB_STATE_RUNNING`,e.JOB_STATE_SUCCEEDED=`JOB_STATE_SUCCEEDED`,e.JOB_STATE_FAILED=`JOB_STATE_FAILED`,e.JOB_STATE_CANCELLING=`JOB_STATE_CANCELLING`,e.JOB_STATE_CANCELLED=`JOB_STATE_CANCELLED`,e.JOB_STATE_PAUSED=`JOB_STATE_PAUSED`,e.JOB_STATE_EXPIRED=`JOB_STATE_EXPIRED`,e.JOB_STATE_UPDATING=`JOB_STATE_UPDATING`,e.JOB_STATE_PARTIALLY_SUCCEEDED=`JOB_STATE_PARTIALLY_SUCCEEDED`})(Ge||={});var Ke;(function(e){e.TUNING_JOB_STATE_UNSPECIFIED=`TUNING_JOB_STATE_UNSPECIFIED`,e.TUNING_JOB_STATE_WAITING_FOR_QUOTA=`TUNING_JOB_STATE_WAITING_FOR_QUOTA`,e.TUNING_JOB_STATE_PROCESSING_DATASET=`TUNING_JOB_STATE_PROCESSING_DATASET`,e.TUNING_JOB_STATE_WAITING_FOR_CAPACITY=`TUNING_JOB_STATE_WAITING_FOR_CAPACITY`,e.TUNING_JOB_STATE_TUNING=`TUNING_JOB_STATE_TUNING`,e.TUNING_JOB_STATE_POST_PROCESSING=`TUNING_JOB_STATE_POST_PROCESSING`})(Ke||={});var qe;(function(e){e.AGGREGATION_METRIC_UNSPECIFIED=`AGGREGATION_METRIC_UNSPECIFIED`,e.AVERAGE=`AVERAGE`,e.MODE=`MODE`,e.STANDARD_DEVIATION=`STANDARD_DEVIATION`,e.VARIANCE=`VARIANCE`,e.MINIMUM=`MINIMUM`,e.MAXIMUM=`MAXIMUM`,e.MEDIAN=`MEDIAN`,e.PERCENTILE_P90=`PERCENTILE_P90`,e.PERCENTILE_P95=`PERCENTILE_P95`,e.PERCENTILE_P99=`PERCENTILE_P99`})(qe||={});var Je;(function(e){e.PAIRWISE_CHOICE_UNSPECIFIED=`PAIRWISE_CHOICE_UNSPECIFIED`,e.BASELINE=`BASELINE`,e.CANDIDATE=`CANDIDATE`,e.TIE=`TIE`})(Je||={});var Ye;(function(e){e.VIDEO_ORIENTATION_UNSPECIFIED=`VIDEO_ORIENTATION_UNSPECIFIED`,e.LANDSCAPE=`LANDSCAPE`,e.PORTRAIT=`PORTRAIT`})(Ye||={});var Xe;(function(e){e.TUNING_SPEED_UNSPECIFIED=`TUNING_SPEED_UNSPECIFIED`,e.REGULAR=`REGULAR`,e.FAST=`FAST`})(Xe||={});var Ze;(function(e){e.TUNING_TASK_UNSPECIFIED=`TUNING_TASK_UNSPECIFIED`,e.TUNING_TASK_I2V=`TUNING_TASK_I2V`,e.TUNING_TASK_T2V=`TUNING_TASK_T2V`,e.TUNING_TASK_R2V=`TUNING_TASK_R2V`})(Ze||={});var Qe;(function(e){e.STATE_UNSPECIFIED=`STATE_UNSPECIFIED`,e.STATE_PENDING=`STATE_PENDING`,e.STATE_ACTIVE=`STATE_ACTIVE`,e.STATE_FAILED=`STATE_FAILED`})(Qe||={});var $e;(function(e){e.UNSPECIFIED=`unspecified`,e.FLEX=`flex`,e.STANDARD=`standard`,e.PRIORITY=`priority`})($e||={});var et;(function(e){e.MEDIA_PROCESSING_UNSPECIFIED=`MEDIA_PROCESSING_UNSPECIFIED`,e.STATIC=`STATIC`,e.AGENTIC=`AGENTIC`})(et||={});var tt;(function(e){e.MEDIA_RESOLUTION_UNSPECIFIED=`MEDIA_RESOLUTION_UNSPECIFIED`,e.MEDIA_RESOLUTION_LOW=`MEDIA_RESOLUTION_LOW`,e.MEDIA_RESOLUTION_MEDIUM=`MEDIA_RESOLUTION_MEDIUM`,e.MEDIA_RESOLUTION_HIGH=`MEDIA_RESOLUTION_HIGH`,e.MEDIA_RESOLUTION_ULTRA_HIGH=`MEDIA_RESOLUTION_ULTRA_HIGH`})(tt||={});var nt;(function(e){e.TOOL_TYPE_UNSPECIFIED=`TOOL_TYPE_UNSPECIFIED`,e.GOOGLE_SEARCH_WEB=`GOOGLE_SEARCH_WEB`,e.GOOGLE_SEARCH_IMAGE=`GOOGLE_SEARCH_IMAGE`,e.URL_CONTEXT=`URL_CONTEXT`,e.GOOGLE_MAPS=`GOOGLE_MAPS`,e.FILE_SEARCH=`FILE_SEARCH`,e.MEDIA_PROCESSING=`MEDIA_PROCESSING`})(nt||={});var rt;(function(e){e.COLLECTION=`COLLECTION`})(rt||={});var it;(function(e){e.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED=`FEATURE_SELECTION_PREFERENCE_UNSPECIFIED`,e.PRIORITIZE_QUALITY=`PRIORITIZE_QUALITY`,e.BALANCED=`BALANCED`,e.PRIORITIZE_COST=`PRIORITIZE_COST`})(it||={});var at;(function(e){e.PREDICT=`PREDICT`,e.EMBED_CONTENT=`EMBED_CONTENT`})(at||={});var ot;(function(e){e.BLOCK_LOW_AND_ABOVE=`BLOCK_LOW_AND_ABOVE`,e.BLOCK_MEDIUM_AND_ABOVE=`BLOCK_MEDIUM_AND_ABOVE`,e.BLOCK_ONLY_HIGH=`BLOCK_ONLY_HIGH`,e.BLOCK_NONE=`BLOCK_NONE`})(ot||={});var st;(function(e){e.auto=`auto`,e.en=`en`,e.ja=`ja`,e.ko=`ko`,e.hi=`hi`,e.zh=`zh`,e.pt=`pt`,e.es=`es`})(st||={});var ct;(function(e){e.MASK_MODE_DEFAULT=`MASK_MODE_DEFAULT`,e.MASK_MODE_USER_PROVIDED=`MASK_MODE_USER_PROVIDED`,e.MASK_MODE_BACKGROUND=`MASK_MODE_BACKGROUND`,e.MASK_MODE_FOREGROUND=`MASK_MODE_FOREGROUND`,e.MASK_MODE_SEMANTIC=`MASK_MODE_SEMANTIC`})(ct||={});var lt;(function(e){e.CONTROL_TYPE_DEFAULT=`CONTROL_TYPE_DEFAULT`,e.CONTROL_TYPE_CANNY=`CONTROL_TYPE_CANNY`,e.CONTROL_TYPE_SCRIBBLE=`CONTROL_TYPE_SCRIBBLE`,e.CONTROL_TYPE_FACE_MESH=`CONTROL_TYPE_FACE_MESH`})(lt||={});var ut;(function(e){e.SUBJECT_TYPE_DEFAULT=`SUBJECT_TYPE_DEFAULT`,e.SUBJECT_TYPE_PERSON=`SUBJECT_TYPE_PERSON`,e.SUBJECT_TYPE_ANIMAL=`SUBJECT_TYPE_ANIMAL`,e.SUBJECT_TYPE_PRODUCT=`SUBJECT_TYPE_PRODUCT`})(ut||={});var dt;(function(e){e.EDIT_MODE_DEFAULT=`EDIT_MODE_DEFAULT`,e.EDIT_MODE_INPAINT_REMOVAL=`EDIT_MODE_INPAINT_REMOVAL`,e.EDIT_MODE_INPAINT_INSERTION=`EDIT_MODE_INPAINT_INSERTION`,e.EDIT_MODE_OUTPAINT=`EDIT_MODE_OUTPAINT`,e.EDIT_MODE_CONTROLLED_EDITING=`EDIT_MODE_CONTROLLED_EDITING`,e.EDIT_MODE_STYLE=`EDIT_MODE_STYLE`,e.EDIT_MODE_BGSWAP=`EDIT_MODE_BGSWAP`,e.EDIT_MODE_PRODUCT_IMAGE=`EDIT_MODE_PRODUCT_IMAGE`})(dt||={});var ft;(function(e){e.FOREGROUND=`FOREGROUND`,e.BACKGROUND=`BACKGROUND`,e.PROMPT=`PROMPT`,e.SEMANTIC=`SEMANTIC`,e.INTERACTIVE=`INTERACTIVE`})(ft||={});var pt;(function(e){e.ASSET=`ASSET`,e.STYLE=`STYLE`})(pt||={});var mt;(function(e){e.INSERT=`INSERT`,e.REMOVE=`REMOVE`,e.REMOVE_STATIC=`REMOVE_STATIC`,e.OUTPAINT=`OUTPAINT`})(mt||={});var ht;(function(e){e.OPTIMIZED=`OPTIMIZED`,e.LOSSLESS=`LOSSLESS`})(ht||={});var gt;(function(e){e.CROP=`CROP`,e.PAD=`PAD`})(gt||={});var _t;(function(e){e.SUPERVISED_FINE_TUNING=`SUPERVISED_FINE_TUNING`,e.PREFERENCE_TUNING=`PREFERENCE_TUNING`,e.DISTILLATION=`DISTILLATION`,e.REINFORCEMENT_TUNING=`REINFORCEMENT_TUNING`})(_t||={});var vt;(function(e){e.STATE_UNSPECIFIED=`STATE_UNSPECIFIED`,e.PROCESSING=`PROCESSING`,e.ACTIVE=`ACTIVE`,e.FAILED=`FAILED`})(vt||={});var yt;(function(e){e.SOURCE_UNSPECIFIED=`SOURCE_UNSPECIFIED`,e.UPLOADED=`UPLOADED`,e.GENERATED=`GENERATED`,e.REGISTERED=`REGISTERED`})(yt||={});var bt;(function(e){e.TURN_COMPLETE_REASON_UNSPECIFIED=`TURN_COMPLETE_REASON_UNSPECIFIED`,e.MALFORMED_FUNCTION_CALL=`MALFORMED_FUNCTION_CALL`,e.RESPONSE_REJECTED=`RESPONSE_REJECTED`,e.NEED_MORE_INPUT=`NEED_MORE_INPUT`,e.PROHIBITED_INPUT_CONTENT=`PROHIBITED_INPUT_CONTENT`,e.IMAGE_PROHIBITED_INPUT_CONTENT=`IMAGE_PROHIBITED_INPUT_CONTENT`,e.INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED=`INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED`,e.INPUT_IMAGE_CELEBRITY=`INPUT_IMAGE_CELEBRITY`,e.INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED=`INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED`,e.INPUT_TEXT_NCII_PROHIBITED=`INPUT_TEXT_NCII_PROHIBITED`,e.INPUT_OTHER=`INPUT_OTHER`,e.INPUT_IP_PROHIBITED=`INPUT_IP_PROHIBITED`,e.BLOCKLIST=`BLOCKLIST`,e.UNSAFE_PROMPT_FOR_IMAGE_GENERATION=`UNSAFE_PROMPT_FOR_IMAGE_GENERATION`,e.GENERATED_IMAGE_SAFETY=`GENERATED_IMAGE_SAFETY`,e.GENERATED_CONTENT_SAFETY=`GENERATED_CONTENT_SAFETY`,e.GENERATED_AUDIO_SAFETY=`GENERATED_AUDIO_SAFETY`,e.GENERATED_VIDEO_SAFETY=`GENERATED_VIDEO_SAFETY`,e.GENERATED_CONTENT_PROHIBITED=`GENERATED_CONTENT_PROHIBITED`,e.GENERATED_CONTENT_BLOCKLIST=`GENERATED_CONTENT_BLOCKLIST`,e.GENERATED_IMAGE_PROHIBITED=`GENERATED_IMAGE_PROHIBITED`,e.GENERATED_IMAGE_CELEBRITY=`GENERATED_IMAGE_CELEBRITY`,e.GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER=`GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER`,e.GENERATED_IMAGE_IDENTIFIABLE_PEOPLE=`GENERATED_IMAGE_IDENTIFIABLE_PEOPLE`,e.GENERATED_IMAGE_MINORS=`GENERATED_IMAGE_MINORS`,e.OUTPUT_IMAGE_IP_PROHIBITED=`OUTPUT_IMAGE_IP_PROHIBITED`,e.GENERATED_OTHER=`GENERATED_OTHER`,e.MAX_REGENERATION_REACHED=`MAX_REGENERATION_REACHED`})(bt||={});var xt;(function(e){e.INTERACTION_STATUS_UNSPECIFIED=`INTERACTION_STATUS_UNSPECIFIED`,e.IN_PROGRESS=`IN_PROGRESS`,e.REQUIRES_ACTION=`REQUIRES_ACTION`,e.IDLE=`IDLE`})(xt||={});var St;(function(e){e.VAD_SIGNAL_TYPE_UNSPECIFIED=`VAD_SIGNAL_TYPE_UNSPECIFIED`,e.VAD_SIGNAL_TYPE_SOS=`VAD_SIGNAL_TYPE_SOS`,e.VAD_SIGNAL_TYPE_EOS=`VAD_SIGNAL_TYPE_EOS`})(St||={});var Ct;(function(e){e.TYPE_UNSPECIFIED=`TYPE_UNSPECIFIED`,e.ACTIVITY_START=`ACTIVITY_START`,e.ACTIVITY_END=`ACTIVITY_END`})(Ct||={});var wt;(function(e){e.START_SENSITIVITY_UNSPECIFIED=`START_SENSITIVITY_UNSPECIFIED`,e.START_SENSITIVITY_HIGH=`START_SENSITIVITY_HIGH`,e.START_SENSITIVITY_LOW=`START_SENSITIVITY_LOW`})(wt||={});var Tt;(function(e){e.END_SENSITIVITY_UNSPECIFIED=`END_SENSITIVITY_UNSPECIFIED`,e.END_SENSITIVITY_HIGH=`END_SENSITIVITY_HIGH`,e.END_SENSITIVITY_LOW=`END_SENSITIVITY_LOW`})(Tt||={});var Et;(function(e){e.ACTIVITY_HANDLING_UNSPECIFIED=`ACTIVITY_HANDLING_UNSPECIFIED`,e.START_OF_ACTIVITY_INTERRUPTS=`START_OF_ACTIVITY_INTERRUPTS`,e.NO_INTERRUPTION=`NO_INTERRUPTION`})(Et||={});var Dt;(function(e){e.TURN_COVERAGE_UNSPECIFIED=`TURN_COVERAGE_UNSPECIFIED`,e.TURN_INCLUDES_ONLY_ACTIVITY=`TURN_INCLUDES_ONLY_ACTIVITY`,e.TURN_INCLUDES_ALL_INPUT=`TURN_INCLUDES_ALL_INPUT`,e.TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO=`TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO`})(Dt||={});var Ot;(function(e){e.MODE_UNSPECIFIED=`MODE_UNSPECIFIED`,e.VERBATIM=`VERBATIM`,e.SMART=`SMART`})(Ot||={});var kt;(function(e){e.SCALE_UNSPECIFIED=`SCALE_UNSPECIFIED`,e.C_MAJOR_A_MINOR=`C_MAJOR_A_MINOR`,e.D_FLAT_MAJOR_B_FLAT_MINOR=`D_FLAT_MAJOR_B_FLAT_MINOR`,e.D_MAJOR_B_MINOR=`D_MAJOR_B_MINOR`,e.E_FLAT_MAJOR_C_MINOR=`E_FLAT_MAJOR_C_MINOR`,e.E_MAJOR_D_FLAT_MINOR=`E_MAJOR_D_FLAT_MINOR`,e.F_MAJOR_D_MINOR=`F_MAJOR_D_MINOR`,e.G_FLAT_MAJOR_E_FLAT_MINOR=`G_FLAT_MAJOR_E_FLAT_MINOR`,e.G_MAJOR_E_MINOR=`G_MAJOR_E_MINOR`,e.A_FLAT_MAJOR_F_MINOR=`A_FLAT_MAJOR_F_MINOR`,e.A_MAJOR_G_FLAT_MINOR=`A_MAJOR_G_FLAT_MINOR`,e.B_FLAT_MAJOR_G_MINOR=`B_FLAT_MAJOR_G_MINOR`,e.B_MAJOR_A_FLAT_MINOR=`B_MAJOR_A_FLAT_MINOR`})(kt||={});var At;(function(e){e.MUSIC_GENERATION_MODE_UNSPECIFIED=`MUSIC_GENERATION_MODE_UNSPECIFIED`,e.QUALITY=`QUALITY`,e.DIVERSITY=`DIVERSITY`,e.VOCALIZATION=`VOCALIZATION`})(At||={});var jt;(function(e){e.PLAYBACK_CONTROL_UNSPECIFIED=`PLAYBACK_CONTROL_UNSPECIFIED`,e.PLAY=`PLAY`,e.PAUSE=`PAUSE`,e.STOP=`STOP`,e.RESET_CONTEXT=`RESET_CONTEXT`})(jt||={});var Mt=class{constructor(e){let t={};for(let n of e.headers.entries())t[n[0]]=n[1];this.headers=t,this.responseInternal=e}json(){return this.responseInternal.json()}},Nt=class{get text(){if(this.candidates?.[0]?.content?.parts?.length===0)return;this.candidates&&this.candidates.length>1&&console.warn(`there are multiple candidates in the response, returning text from the first one.`);let e=``,t=!1,n=[];for(let r of this.candidates?.[0]?.content?.parts??[]){for(let[e,t]of Object.entries(r))e!==`text`&&e!==`thought`&&e!==`thoughtSignature`&&(t!==null||t!==void 0)&&n.push(e);if(typeof r.text==`string`){if(typeof r.thought==`boolean`&&r.thought)continue;t=!0,e+=r.text}}return n.length>0&&console.warn(`there are non-text parts ${n} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),t?e:void 0}get data(){if(this.candidates?.[0]?.content?.parts?.length===0)return;this.candidates&&this.candidates.length>1&&console.warn(`there are multiple candidates in the response, returning data from the first one.`);let e=``,t=[];for(let n of this.candidates?.[0]?.content?.parts??[]){for(let[e,r]of Object.entries(n))e!==`inlineData`&&(r!==null||r!==void 0)&&t.push(e);n.inlineData&&typeof n.inlineData.data==`string`&&(e+=atob(n.inlineData.data))}return t.length>0&&console.warn(`there are non-data parts ${t} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),e.length>0?btoa(e):void 0}get functionCalls(){if(this.candidates?.[0]?.content?.parts?.length===0)return;this.candidates&&this.candidates.length>1&&console.warn(`there are multiple candidates in the response, returning function calls from the first one.`);let e=(this.candidates?.[0]?.content?.parts)?.filter(e=>e.functionCall).map(e=>e.functionCall).filter(e=>e!==void 0);if(e?.length!==0)return e}get executableCode(){if(this.candidates?.[0]?.content?.parts?.length===0)return;this.candidates&&this.candidates.length>1&&console.warn(`there are multiple candidates in the response, returning executable code from the first one.`);let e=(this.candidates?.[0]?.content?.parts)?.filter(e=>e.executableCode).map(e=>e.executableCode).filter(e=>e!==void 0);if(e?.length!==0)return e?.[0]?.code}get codeExecutionResult(){if(this.candidates?.[0]?.content?.parts?.length===0)return;this.candidates&&this.candidates.length>1&&console.warn(`there are multiple candidates in the response, returning code execution result from the first one.`);let e=(this.candidates?.[0]?.content?.parts)?.filter(e=>e.codeExecutionResult).map(e=>e.codeExecutionResult).filter(e=>e!==void 0);if(e?.length!==0)return e?.[0]?.output}},Pt=class{},Ft=class{},It=class{},Lt=class{},Rt=class{},zt=class{},Bt=class{},Vt=class{},Ht=class{},Ut=class{},Wt=class e{_fromAPIResponse({apiResponse:t,_isVertexAI:n}){let r=new e,i,a=t;return i=n?D(a):E(a),Object.assign(r,i),r}},Gt=class{},Kt=class{},qt=class{},Jt=class{},Yt=class{},Xt=class{},Zt=class{},Qt=class{},$t=class e{_fromAPIResponse({apiResponse:t,_isVertexAI:n}){let r=new e,i=re(t);return Object.assign(r,i),r}},en=class{},tn=class{},nn=class{},rn=class{},an=class{},on=class{get text(){let e=``,t=!1,n=[];for(let r of this.serverContent?.modelTurn?.parts??[]){for(let[e,t]of Object.entries(r))e!==`text`&&e!==`thought`&&t!==null&&n.push(e);if(typeof r.text==`string`){if(typeof r.thought==`boolean`&&r.thought)continue;t=!0,e+=r.text}}return n.length>0&&console.warn(`there are non-text parts ${n} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),t?e:void 0}get data(){let e=``,t=[];for(let n of this.serverContent?.modelTurn?.parts??[]){for(let[e,r]of Object.entries(n))e!==`inlineData`&&r!==null&&t.push(e);n.inlineData&&typeof n.inlineData.data==`string`&&(e+=atob(n.inlineData.data))}return t.length>0&&console.warn(`there are non-data parts ${t} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),e.length>0?btoa(e):void 0}},sn=class{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}},cn=class e{_fromAPIResponse({apiResponse:t,_isVertexAI:n}){let r=new e,i=ae(t);return Object.assign(r,i),r}};function M(e,t){if(!t||typeof t!=`string`)throw Error(`model is required and must be a string`);if(t.includes(`..`)||t.includes(`?`)||t.includes(`&`))throw Error(`invalid model parameter`);if(e.isVertexAI()){if(t.startsWith(`publishers/`)||t.startsWith(`projects/`)||t.startsWith(`models/`))return t;if(t.indexOf(`/`)>=0){let e=t.split(`/`,2);return`publishers/${e[0]}/models/${e[1]}`}return`publishers/google/models/${t}`}return t.startsWith(`models/`)||t.startsWith(`tunedModels/`)?t:`models/${t}`}function ln(e,t){let n=M(e,t);return n?n.startsWith(`publishers/`)&&e.isVertexAI()?`projects/${e.getProject()}/locations/${e.getLocation()}/${n}`:n.startsWith(`models/`)&&e.isVertexAI()?`projects/${e.getProject()}/locations/${e.getLocation()}/publishers/google/${n}`:n:``}function un(e){return Array.isArray(e)?e.map(e=>dn(e)):[dn(e)]}function dn(e){if(typeof e==`object`&&e)return e;throw Error(`Could not parse input as Blob. Unsupported blob type: ${typeof e}`)}function fn(e){let t=dn(e);if(t.mimeType&&t.mimeType.startsWith(`image/`))return t;throw Error(`Unsupported mime type: ${t.mimeType}`)}function pn(e){let t=dn(e);if(t.mimeType&&t.mimeType.startsWith(`audio/`))return t;throw Error(`Unsupported mime type: ${t.mimeType}`)}function mn(e){if(e==null)throw Error(`PartUnion is required`);if(typeof e==`object`)return e;if(typeof e==`string`)return{text:e};throw Error(`Unsupported part type: ${typeof e}`)}function hn(e){if(e==null||Array.isArray(e)&&e.length===0)throw Error(`PartListUnion is required`);return Array.isArray(e)?e.map(e=>mn(e)):[mn(e)]}function gn(e){return typeof e==`object`&&!!e&&`parts`in e&&Array.isArray(e.parts)}function _n(e){return typeof e==`object`&&!!e&&`functionCall`in e}function vn(e){return typeof e==`object`&&!!e&&`functionResponse`in e}function N(e){if(e==null)throw Error(`ContentUnion is required`);return gn(e)?e:{role:`user`,parts:hn(e)}}function yn(e,t){if(!t)return[];if(e.isVertexAI()&&Array.isArray(t))return t.flatMap(e=>{let t=N(e);return t.parts&&t.parts.length>0&&t.parts[0].text!==void 0?[t.parts[0].text]:[]});if(e.isVertexAI()){let e=N(t);return e.parts&&e.parts.length>0&&e.parts[0].text!==void 0?[e.parts[0].text]:[]}return Array.isArray(t)?t.map(e=>N(e)):[N(t)]}function P(e){if(e==null||Array.isArray(e)&&e.length===0)throw Error(`contents are required`);if(!Array.isArray(e)){if(_n(e)||vn(e))throw Error(`To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them`);return[N(e)]}let t=[],n=[],r=gn(e[0]);for(let i of e){let e=gn(i);if(e!=r)throw Error(`Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them`);if(e)t.push(i);else if(_n(i)||vn(i))throw Error(`To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them`);else n.push(i)}return r||t.push({role:`user`,parts:hn(n)}),t}function bn(e,t){e.includes(`null`)&&(t.nullable=!0);let n=e.filter(e=>e!==`null`);if(n.length===1)t.type=Object.values(fe).includes(n[0].toUpperCase())?n[0].toUpperCase():fe.TYPE_UNSPECIFIED;else{t.anyOf=[];for(let e of n)t.anyOf.push({type:Object.values(fe).includes(e.toUpperCase())?e.toUpperCase():fe.TYPE_UNSPECIFIED})}}function xn(e){let t={},n=[`items`],r=[`anyOf`],i=[`properties`];if(e.type&&e.anyOf)throw Error(`type and anyOf cannot be both populated.`);let a=e.anyOf;a!=null&&a.length==2&&(a[0].type===`null`?(t.nullable=!0,e=a[1]):a[1].type===`null`&&(t.nullable=!0,e=a[0])),e.type instanceof Array&&bn(e.type,t);for(let[a,o]of Object.entries(e))if(o!=null){if(a==`type`){if(o===`null`)throw Error(`type: null can not be the only possible type for the field.`);if(o instanceof Array)continue;t.type=Object.values(fe).includes(o.toUpperCase())?o.toUpperCase():fe.TYPE_UNSPECIFIED}else if(n.includes(a))t[a]=xn(o);else if(r.includes(a)){let e=[];for(let n of o){if(n.type==`null`){t.nullable=!0;continue}e.push(xn(n))}t[a]=e}else if(i.includes(a)){let e={};for(let[t,n]of Object.entries(o))e[t]=xn(n);t[a]=e}else{if(a===`additionalProperties`)continue;t[a]=o}}return t}function Sn(e){return xn(e)}function Cn(e){return e}function wn(e){if(typeof e==`object`)return e;if(typeof e==`string`)return{voiceConfig:{prebuiltVoiceConfig:{voiceName:e}}};throw Error(`Unsupported speechConfig type: ${typeof e}`)}function Tn(e){if(`multiSpeakerVoiceConfig`in e)throw Error(`multiSpeakerVoiceConfig is not supported in the live API.`);return e}function En(e){if(e.functionDeclarations)for(let t of e.functionDeclarations)t.parameters&&(Object.keys(t.parameters).includes(`$schema`)?t.parametersJsonSchema||(t.parametersJsonSchema=t.parameters,delete t.parameters):t.parameters=xn(t.parameters)),t.response&&(Object.keys(t.response).includes(`$schema`)?t.responseJsonSchema||(t.responseJsonSchema=t.response,delete t.response):t.response=xn(t.response));return e}function Dn(e){if(e==null)throw Error(`tools is required`);if(!Array.isArray(e))throw Error(`tools is required and must be an array of Tools`);let t=[];for(let n of e)t.push(n);return t}function On(e,t,n,r=1){let i=!t.startsWith(`${n}/`)&&t.split(`/`).length===r;return e.isVertexAI()?t.startsWith(`projects/`)?t:t.startsWith(`locations/`)?`projects/${e.getProject()}/${t}`:t.startsWith(`${n}/`)?`projects/${e.getProject()}/locations/${e.getLocation()}/${t}`:i?`projects/${e.getProject()}/locations/${e.getLocation()}/${n}/${t}`:t:i?`${n}/${t}`:t}function kn(e,t){if(typeof t!=`string`)throw Error(`name must be a string`);return On(e,t,`cachedContents`)}function An(e){switch(e){case`STATE_UNSPECIFIED`:return`JOB_STATE_UNSPECIFIED`;case`CREATING`:return`JOB_STATE_RUNNING`;case`ACTIVE`:return`JOB_STATE_SUCCEEDED`;case`FAILED`:return`JOB_STATE_FAILED`;default:return e}}function jn(e){return w(e)}function Mn(e){return typeof e==`object`&&!!e&&`name`in e}function Nn(e){return typeof e==`object`&&!!e&&`video`in e}function Pn(e){return typeof e==`object`&&!!e&&`uri`in e}function Fn(e){let t;if(Mn(e)&&(t=e.name),!(Pn(e)&&(t=e.uri,t===void 0))&&!(Nn(e)&&(t=e.video?.uri,t===void 0))){if(typeof e==`string`&&(t=e),t===void 0)throw Error(`Could not extract file name from the provided input.`);if(t.startsWith(`https://`)){let e=t.split(`files/`)[1].match(/[a-z0-9]+/);if(e===null)throw Error(`Could not extract file name from URI ${t}`);t=e[0]}else t.startsWith(`files/`)&&(t=t.split(`files/`)[1]);return t}}function In(e,t){let n;return n=e.isVertexAI()?t?`publishers/google/models`:`models`:t?`models`:`tunedModels`,n}function Ln(e){for(let t of[`models`,`tunedModels`,`publisherModels`])if(Rn(e,t))return e[t];return[]}function Rn(e,t){return typeof e==`object`&&!!e&&t in e}function zn(e,t={}){let n=e,r={name:n.name,description:n.description,parametersJsonSchema:n.inputSchema};return n.outputSchema&&(r.responseJsonSchema=n.outputSchema),t.behavior&&(r.behavior=t.behavior),{functionDeclarations:[r]}}function Bn(e,t={}){let n=[],r=new Set;for(let i of e){let e=i.name;if(r.has(e))throw Error(`Duplicate function name ${e} found in MCP tools. Please ensure function names are unique.`);r.add(e);let a=zn(i,t);a.functionDeclarations&&n.push(...a.functionDeclarations)}return{functionDeclarations:n}}function Vn(e,t){let n;if(typeof t==`string`){if(e.isVertexAI()){if(t.startsWith(`gs://`))n={format:`jsonl`,gcsUri:[t]};else if(t.startsWith(`bq://`))n={format:`bigquery`,bigqueryUri:t};else if(/^projects\/[^/]+\/locations\/[^/]+\/datasets\/[^/]+$/.test(t))n={format:`vertex-dataset`,vertexDatasetName:t};else throw Error(`Unsupported string source for Vertex AI: ${t}`)}else if(t.startsWith(`files/`))n={fileName:t};else throw Error(`Unsupported string source for Gemini API: ${t}`)}else if(Array.isArray(t)){if(e.isVertexAI())throw Error(`InlinedRequest[] is not supported in Vertex AI.`);n={inlinedRequests:t}}else n=t;let r=[n.gcsUri,n.bigqueryUri,n.vertexDatasetName].filter(Boolean).length,i=[n.inlinedRequests,n.fileName].filter(Boolean).length;if(e.isVertexAI()){if(i>0||r!==1)throw Error("Exactly one of `gcsUri`, `bigqueryUri`, or `vertexDatasetName` must be set for Vertex AI.")}else if(r>0||i!==1)throw Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return n}function Hn(e){if(typeof e!=`string`)return e;let t=e;if(t.startsWith(`gs://`))return{format:`jsonl`,gcsUri:t};if(t.startsWith(`bq://`))return{format:`bigquery`,bigqueryUri:t};throw Error(`Unsupported destination: ${t}`)}function Un(e){if(typeof e!=`object`||!e)return{};let t=e,n=t.inlinedResponses;if(typeof n!=`object`||!n)return e;let r=n.inlinedResponses;if(!Array.isArray(r)||r.length===0)return e;let i=!1;for(let e of r){if(typeof e!=`object`||!e)continue;let t=e.response;if(typeof t==`object`&&t&&t.embedding!==void 0){i=!0;break}}return i&&(t.inlinedEmbedContentResponses=t.inlinedResponses,delete t.inlinedResponses),e}function Wn(e,t){let n=t;if(!e.isVertexAI()){if(/batches\/[^/]+$/.test(n))return n.split(`/`).pop();throw Error(`Invalid batch job name: ${n}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(n))return n.split(`/`).pop();if(/^\d+$/.test(n))return n;throw Error(`Invalid batch job name: ${n}.`)}function Gn(e){let t=e;return t===`BATCH_STATE_UNSPECIFIED`?`JOB_STATE_UNSPECIFIED`:t===`BATCH_STATE_PENDING`?`JOB_STATE_PENDING`:t===`BATCH_STATE_RUNNING`?`JOB_STATE_RUNNING`:t===`BATCH_STATE_SUCCEEDED`?`JOB_STATE_SUCCEEDED`:t===`BATCH_STATE_FAILED`?`JOB_STATE_FAILED`:t===`BATCH_STATE_CANCELLED`?`JOB_STATE_CANCELLED`:t===`BATCH_STATE_EXPIRED`?`JOB_STATE_EXPIRED`:t}function Kn(e){return e.includes(`gemini`)&&e!==`gemini-embedding-001`||e.includes(`maas`)}function qn(e){let t={},n=x(e,[`apiKey`]);if(n!=null&&b(t,[`apiKey`],n),x(e,[`apiKeyConfig`])!==void 0)throw Error(`apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`authType`])!==void 0)throw Error(`authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`googleServiceAccountConfig`])!==void 0)throw Error(`googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`httpBasicAuthConfig`])!==void 0)throw Error(`httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oauthConfig`])!==void 0)throw Error(`oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oidcConfig`])!==void 0)throw Error(`oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function Jn(e){let t={},n=x(e,[`responsesFile`]);n!=null&&b(t,[`fileName`],n);let r=x(e,[`inlinedResponses`,`inlinedResponses`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>Mr(e))),b(t,[`inlinedResponses`],e)}let i=x(e,[`inlinedEmbedContentResponses`,`inlinedResponses`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`inlinedEmbedContentResponses`],e)}return t}function Yn(e){let t={},n=x(e,[`predictionsFormat`]);n!=null&&b(t,[`format`],n);let r=x(e,[`gcsDestination`,`outputUriPrefix`]);r!=null&&b(t,[`gcsUri`],r);let i=x(e,[`bigqueryDestination`,`outputUri`]);i!=null&&b(t,[`bigqueryUri`],i);let a=x(e,[`vertexMultimodalDatasetDestination`]);return a!=null&&b(t,[`vertexDataset`],Ur(a)),t}function Xn(e){let t={},n=x(e,[`format`]);n!=null&&b(t,[`predictionsFormat`],n);let r=x(e,[`gcsUri`]);r!=null&&b(t,[`gcsDestination`,`outputUriPrefix`],r);let i=x(e,[`bigqueryUri`]);i!=null&&b(t,[`bigqueryDestination`,`outputUri`],i);let a=x(e,[`vertexDataset`]);if(a!=null&&b(t,[`vertexMultimodalDatasetDestination`],Wr(a)),x(e,[`fileName`])!==void 0)throw Error(`fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`inlinedResponses`])!==void 0)throw Error(`inlinedResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`inlinedEmbedContentResponses`])!==void 0)throw Error(`inlinedEmbedContentResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function Zn(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`metadata`,`displayName`]);r!=null&&b(t,[`displayName`],r);let i=x(e,[`metadata`,`state`]);i!=null&&b(t,[`state`],Gn(i));let a=x(e,[`metadata`,`createTime`]);a!=null&&b(t,[`createTime`],a);let o=x(e,[`metadata`,`endTime`]);o!=null&&b(t,[`endTime`],o);let s=x(e,[`metadata`,`updateTime`]);s!=null&&b(t,[`updateTime`],s);let c=x(e,[`metadata`,`model`]);c!=null&&b(t,[`model`],c);let l=x(e,[`metadata`,`output`]);return l!=null&&b(t,[`dest`],Jn(Un(l))),t}function Qn(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`displayName`]);r!=null&&b(t,[`displayName`],r);let i=x(e,[`state`]);i!=null&&b(t,[`state`],Gn(i));let a=x(e,[`error`]);a!=null&&b(t,[`error`],a);let o=x(e,[`createTime`]);o!=null&&b(t,[`createTime`],o);let s=x(e,[`startTime`]);s!=null&&b(t,[`startTime`],s);let c=x(e,[`endTime`]);c!=null&&b(t,[`endTime`],c);let l=x(e,[`updateTime`]);l!=null&&b(t,[`updateTime`],l);let u=x(e,[`model`]);u!=null&&b(t,[`model`],u);let d=x(e,[`inputConfig`]);d!=null&&b(t,[`src`],$n(d));let f=x(e,[`outputConfig`]);f!=null&&b(t,[`dest`],Yn(Un(f)));let p=x(e,[`outputInfo`]);p!=null&&b(t,[`outputInfo`],p);let m=x(e,[`completionStats`]);return m!=null&&b(t,[`completionStats`],m),t}function $n(e){let t={},n=x(e,[`instancesFormat`]);n!=null&&b(t,[`format`],n);let r=x(e,[`gcsSource`,`uris`]);r!=null&&b(t,[`gcsUri`],r);let i=x(e,[`bigquerySource`,`inputUri`]);i!=null&&b(t,[`bigqueryUri`],i);let a=x(e,[`vertexMultimodalDatasetSource`,`datasetName`]);return a!=null&&b(t,[`vertexDatasetName`],a),t}function er(e,t){let n={};if(x(t,[`format`])!==void 0)throw Error(`format parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(t,[`gcsUri`])!==void 0)throw Error(`gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(t,[`bigqueryUri`])!==void 0)throw Error(`bigqueryUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(t,[`vertexDatasetName`])!==void 0)throw Error(`vertexDatasetName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(t,[`fileName`]);r!=null&&b(n,[`fileName`],r);let i=x(t,[`inlinedRequests`]);if(i!=null){let t=i;Array.isArray(t)&&(t=t.map(t=>jr(e,t))),b(n,[`requests`,`requests`],t)}return n}function tr(e){let t={},n=x(e,[`format`]);n!=null&&b(t,[`instancesFormat`],n);let r=x(e,[`gcsUri`]);r!=null&&b(t,[`gcsSource`,`uris`],r);let i=x(e,[`bigqueryUri`]);i!=null&&b(t,[`bigquerySource`,`inputUri`],i);let a=x(e,[`vertexDatasetName`]);if(a!=null&&b(t,[`vertexMultimodalDatasetSource`,`datasetName`],a),x(e,[`fileName`])!==void 0)throw Error(`fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`inlinedRequests`])!==void 0)throw Error(`inlinedRequests parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function nr(e){let t={},n=x(e,[`data`]);if(n!=null&&b(t,[`data`],n),x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`mimeType`]);return r!=null&&b(t,[`mimeType`],r),t}function rr(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],Wn(e,r)),n}function ir(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],Wn(e,r)),n}function ar(e){let t={},n=x(e,[`content`]);n!=null&&b(t,[`content`],n);let r=x(e,[`citationMetadata`]);r!=null&&b(t,[`citationMetadata`],or(r));let i=x(e,[`tokenCount`]);i!=null&&b(t,[`tokenCount`],i);let a=x(e,[`finishReason`]);a!=null&&b(t,[`finishReason`],a);let o=x(e,[`groundingMetadata`]);o!=null&&b(t,[`groundingMetadata`],o);let s=x(e,[`avgLogprobs`]);s!=null&&b(t,[`avgLogprobs`],s);let c=x(e,[`index`]);c!=null&&b(t,[`index`],c);let l=x(e,[`logprobsResult`]);l!=null&&b(t,[`logprobsResult`],l);let u=x(e,[`safetyRatings`]);if(u!=null){let e=u;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`safetyRatings`],e)}let d=x(e,[`urlContextMetadata`]);return d!=null&&b(t,[`urlContextMetadata`],d),t}function or(e){let t={},n=x(e,[`citationSources`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`citations`],e)}return t}function sr(e){let t={},n=x(e,[`parts`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>zr(e))),b(t,[`parts`],e)}let r=x(e,[`role`]);return r!=null&&b(t,[`role`],r),t}function cr(e,t){let n={},r=x(e,[`displayName`]);if(t!==void 0&&r!=null&&b(t,[`batch`,`displayName`],r),x(e,[`dest`])!==void 0)throw Error(`dest parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let i=x(e,[`webhookConfig`]);return t!==void 0&&i!=null&&b(t,[`batch`,`webhookConfig`],i),n}function lr(e,t){let n={},r=x(e,[`displayName`]);t!==void 0&&r!=null&&b(t,[`displayName`],r);let i=x(e,[`dest`]);if(t!==void 0&&i!=null&&b(t,[`outputConfig`],Xn(Hn(i))),x(e,[`webhookConfig`])!==void 0)throw Error(`webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function ur(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`_url`,`model`],M(e,r));let i=x(t,[`src`]);i!=null&&b(n,[`batch`,`inputConfig`],er(e,Vn(e,i)));let a=x(t,[`config`]);return a!=null&&cr(a,n),n}function dr(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`model`],M(e,r));let i=x(t,[`src`]);i!=null&&b(n,[`inputConfig`],tr(Vn(e,i)));let a=x(t,[`config`]);return a!=null&&lr(a,n),n}function fr(e,t){let n={},r=x(e,[`displayName`]);return t!==void 0&&r!=null&&b(t,[`batch`,`displayName`],r),n}function pr(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`_url`,`model`],M(e,r));let i=x(t,[`src`]);i!=null&&b(n,[`batch`,`inputConfig`],br(e,i));let a=x(t,[`config`]);return a!=null&&fr(a,n),n}function mr(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],Wn(e,r)),n}function hr(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],Wn(e,r)),n}function gr(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`name`]);r!=null&&b(t,[`name`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);return a!=null&&b(t,[`error`],a),t}function _r(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`name`]);r!=null&&b(t,[`name`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);return a!=null&&b(t,[`error`],a),t}function vr(e,t){let n={},r=x(t,[`contents`]);if(r!=null){let t=yn(e,r);Array.isArray(t)&&(t=t.map(e=>e)),b(n,[`requests[]`,`request`,`content`],t)}let i=x(t,[`config`]);return i!=null&&(b(n,[`_self`],yr(i,n)),S(n,{"requests[].*":`requests[].request.*`})),n}function yr(e,t){let n={},r=x(e,[`taskType`]);t!==void 0&&r!=null&&b(t,[`requests[]`,`taskType`],r);let i=x(e,[`title`]);t!==void 0&&i!=null&&b(t,[`requests[]`,`title`],i);let a=x(e,[`outputDimensionality`]);if(t!==void 0&&a!=null&&b(t,[`requests[]`,`outputDimensionality`],a),x(e,[`mimeType`])!==void 0)throw Error(`mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`autoTruncate`])!==void 0)throw Error(`autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`documentOcr`])!==void 0)throw Error(`documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`audioTrackExtraction`])!==void 0)throw Error(`audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function br(e,t){let n={},r=x(t,[`fileName`]);r!=null&&b(n,[`file_name`],r);let i=x(t,[`inlinedRequests`]);return i!=null&&b(n,[`requests`],vr(e,i)),n}function xr(e){let t={};if(x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`fileUri`]);n!=null&&b(t,[`fileUri`],n);let r=x(e,[`mimeType`]);return r!=null&&b(t,[`mimeType`],r),t}function Sr(e){let t={},n=x(e,[`args`]);n!=null&&b(t,[`args`],n);let r=x(e,[`id`]);r!=null&&b(t,[`id`],r);let i=x(e,[`name`]);if(i!=null&&b(t,[`name`],i),x(e,[`partialArgs`])!==void 0)throw Error(`partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`willContinue`])!==void 0)throw Error(`willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function Cr(e){let t={},n=x(e,[`allowedFunctionNames`]);n!=null&&b(t,[`allowedFunctionNames`],n);let r=x(e,[`mode`]);if(r!=null&&b(t,[`mode`],r),x(e,[`streamFunctionCallArguments`])!==void 0)throw Error(`streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function wr(e,t,n){let r={},i=x(t,[`serviceTier`]);n!==void 0&&i!=null&&b(n,[`serviceTier`],i);let a=x(t,[`systemInstruction`]);n!==void 0&&a!=null&&b(n,[`systemInstruction`],sr(N(a)));let o=x(t,[`temperature`]);o!=null&&b(r,[`temperature`],o);let s=x(t,[`topP`]);s!=null&&b(r,[`topP`],s);let c=x(t,[`topK`]);c!=null&&b(r,[`topK`],c);let l=x(t,[`candidateCount`]);l!=null&&b(r,[`candidateCount`],l);let u=x(t,[`maxOutputTokens`]);u!=null&&b(r,[`maxOutputTokens`],u);let d=x(t,[`stopSequences`]);d!=null&&b(r,[`stopSequences`],d);let f=x(t,[`responseLogprobs`]);f!=null&&b(r,[`responseLogprobs`],f);let p=x(t,[`logprobs`]);p!=null&&b(r,[`logprobs`],p);let m=x(t,[`presencePenalty`]);m!=null&&b(r,[`presencePenalty`],m);let h=x(t,[`frequencyPenalty`]);h!=null&&b(r,[`frequencyPenalty`],h);let g=x(t,[`seed`]);g!=null&&b(r,[`seed`],g);let _=x(t,[`responseMimeType`]);_!=null&&b(r,[`responseMimeType`],_);let v=x(t,[`responseSchema`]);v!=null&&b(r,[`responseSchema`],Sn(v));let y=x(t,[`responseJsonSchema`]);if(y!=null&&b(r,[`responseJsonSchema`],Cn(y)),x(t,[`routingConfig`])!==void 0)throw Error(`routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(t,[`modelSelectionConfig`])!==void 0)throw Error(`modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let S=x(t,[`safetySettings`]);if(n!==void 0&&S!=null){let e=S;Array.isArray(e)&&(e=e.map(e=>Br(e))),b(n,[`safetySettings`],e)}let C=x(t,[`tools`]);if(n!==void 0&&C!=null){let e=Dn(C);Array.isArray(e)&&(e=e.map(e=>Hr(En(e)))),b(n,[`tools`],e)}let w=x(t,[`toolConfig`]);if(n!==void 0&&w!=null&&b(n,[`toolConfig`],Vr(w)),x(t,[`labels`])!==void 0)throw Error(`labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let T=x(t,[`cachedContent`]);n!==void 0&&T!=null&&b(n,[`cachedContent`],kn(e,T));let E=x(t,[`responseModalities`]);E!=null&&b(r,[`responseModalities`],E);let D=x(t,[`mediaResolution`]);D!=null&&b(r,[`mediaResolution`],D);let O=x(t,[`speechConfig`]);if(O!=null&&b(r,[`speechConfig`],wn(O)),x(t,[`audioTimestamp`])!==void 0)throw Error(`audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let k=x(t,[`thinkingConfig`]);k!=null&&b(r,[`thinkingConfig`],k);let A=x(t,[`audioTranscriptionConfig`]);A!=null&&b(r,[`audioTranscriptionConfig`],A);let ee=x(t,[`imageConfig`]);ee!=null&&b(r,[`imageConfig`],Ar(ee));let te=x(t,[`enableEnhancedCivicAnswers`]);if(te!=null&&b(r,[`enableEnhancedCivicAnswers`],te),x(t,[`modelArmorConfig`])!==void 0)throw Error(`modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return r}function Tr(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`candidates`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>ar(e))),b(t,[`candidates`],e)}let i=x(e,[`modelVersion`]);i!=null&&b(t,[`modelVersion`],i);let a=x(e,[`promptFeedback`]);a!=null&&b(t,[`promptFeedback`],a);let o=x(e,[`responseId`]);o!=null&&b(t,[`responseId`],o);let s=x(e,[`usageMetadata`]);s!=null&&b(t,[`usageMetadata`],s);let c=x(e,[`modelStatus`]);return c!=null&&b(t,[`modelStatus`],c),t}function Er(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],Wn(e,r)),n}function Dr(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],Wn(e,r)),n}function Or(e){let t={},n=x(e,[`authConfig`]);n!=null&&b(t,[`authConfig`],qn(n));let r=x(e,[`enableWidget`]);if(r!=null&&b(t,[`enableWidget`],r),x(e,[`groundingTypes`])!==void 0)throw Error(`groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function kr(e){let t={};if(x(e,[`blockingConfidence`])!==void 0)throw Error(`blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`excludeDomains`])!==void 0)throw Error(`excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`searchTypes`]);n!=null&&b(t,[`searchTypes`],n);let r=x(e,[`timeRangeFilter`]);return r!=null&&b(t,[`timeRangeFilter`],r),t}function Ar(e){let t={},n=x(e,[`aspectRatio`]);n!=null&&b(t,[`aspectRatio`],n);let r=x(e,[`imageSize`]);if(r!=null&&b(t,[`imageSize`],r),x(e,[`personGeneration`])!==void 0)throw Error(`personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`outputMimeType`])!==void 0)throw Error(`outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`outputCompressionQuality`])!==void 0)throw Error(`outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`imageOutputOptions`])!==void 0)throw Error(`imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`prominentPeople`])!==void 0)throw Error(`prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function jr(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`request`,`model`],M(e,r));let i=x(t,[`contents`]);if(i!=null){let e=P(i);Array.isArray(e)&&(e=e.map(e=>sr(e))),b(n,[`request`,`contents`],e)}let a=x(t,[`metadata`]);a!=null&&b(n,[`metadata`],a);let o=x(t,[`config`]);return o!=null&&b(n,[`request`,`generationConfig`],wr(e,o,x(n,[`request`],{}))),n}function Mr(e){let t={},n=x(e,[`response`]);n!=null&&b(t,[`response`],Tr(n));let r=x(e,[`metadata`]);r!=null&&b(t,[`metadata`],r);let i=x(e,[`error`]);return i!=null&&b(t,[`error`],i),t}function Nr(e,t){let n={},r=x(e,[`pageSize`]);t!==void 0&&r!=null&&b(t,[`_query`,`pageSize`],r);let i=x(e,[`pageToken`]);if(t!==void 0&&i!=null&&b(t,[`_query`,`pageToken`],i),x(e,[`filter`])!==void 0)throw Error(`filter parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function Pr(e,t){let n={},r=x(e,[`pageSize`]);t!==void 0&&r!=null&&b(t,[`_query`,`pageSize`],r);let i=x(e,[`pageToken`]);t!==void 0&&i!=null&&b(t,[`_query`,`pageToken`],i);let a=x(e,[`filter`]);return t!==void 0&&a!=null&&b(t,[`_query`,`filter`],a),n}function Fr(e){let t={},n=x(e,[`config`]);return n!=null&&Nr(n,t),t}function Ir(e){let t={},n=x(e,[`config`]);return n!=null&&Pr(n,t),t}function Lr(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`nextPageToken`]);r!=null&&b(t,[`nextPageToken`],r);let i=x(e,[`operations`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>Zn(e))),b(t,[`batchJobs`],e)}return t}function Rr(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`nextPageToken`]);r!=null&&b(t,[`nextPageToken`],r);let i=x(e,[`batchPredictionJobs`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>Qn(e))),b(t,[`batchJobs`],e)}return t}function zr(e){let t={},n=x(e,[`mediaResolution`]);n!=null&&b(t,[`mediaResolution`],n);let r=x(e,[`toolCall`]);r!=null&&b(t,[`toolCall`],r);let i=x(e,[`toolResponse`]);i!=null&&b(t,[`toolResponse`],i);let a=x(e,[`audioTranscription`]);a!=null&&b(t,[`audioTranscription`],a);let o=x(e,[`codeExecutionResult`]);o!=null&&b(t,[`codeExecutionResult`],o);let s=x(e,[`executableCode`]);s!=null&&b(t,[`executableCode`],s);let c=x(e,[`fileData`]);c!=null&&b(t,[`fileData`],xr(c));let l=x(e,[`functionCall`]);l!=null&&b(t,[`functionCall`],Sr(l));let u=x(e,[`functionResponse`]);u!=null&&b(t,[`functionResponse`],u);let d=x(e,[`inlineData`]);d!=null&&b(t,[`inlineData`],nr(d));let f=x(e,[`text`]);f!=null&&b(t,[`text`],f);let p=x(e,[`thought`]);p!=null&&b(t,[`thought`],p);let m=x(e,[`thoughtSignature`]);m!=null&&b(t,[`thoughtSignature`],m);let h=x(e,[`videoMetadata`]);h!=null&&b(t,[`videoMetadata`],h);let g=x(e,[`partMetadata`]);g!=null&&b(t,[`partMetadata`],g);let _=x(e,[`mediaProcessing`]);return _!=null&&b(t,[`mediaProcessing`],_),t}function Br(e){let t={},n=x(e,[`category`]);if(n!=null&&b(t,[`category`],n),x(e,[`method`])!==void 0)throw Error(`method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`threshold`]);return r!=null&&b(t,[`threshold`],r),t}function Vr(e){let t={},n=x(e,[`functionCallingConfig`]);n!=null&&b(t,[`functionCallingConfig`],Cr(n));let r=x(e,[`retrievalConfig`]);r!=null&&b(t,[`retrievalConfig`],r);let i=x(e,[`includeServerSideToolInvocations`]);return i!=null&&b(t,[`includeServerSideToolInvocations`],i),t}function Hr(e){let t={};if(x(e,[`retrieval`])!==void 0)throw Error(`retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`googleMaps`]);n!=null&&b(t,[`googleMaps`],Or(n));let r=x(e,[`mcpServers`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`mcpServers`],e)}let i=x(e,[`codeExecution`]);i!=null&&b(t,[`codeExecution`],i);let a=x(e,[`computerUse`]);if(a!=null&&b(t,[`computerUse`],a),x(e,[`enterpriseWebSearch`])!==void 0)throw Error(`enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`exaAiSearch`])!==void 0)throw Error(`exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let o=x(e,[`functionDeclarations`]);if(o!=null){let e=o;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`functionDeclarations`],e)}let s=x(e,[`googleSearch`]);s!=null&&b(t,[`googleSearch`],kr(s));let c=x(e,[`googleSearchRetrieval`]);if(c!=null&&b(t,[`googleSearchRetrieval`],c),x(e,[`parallelAiSearch`])!==void 0)throw Error(`parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let l=x(e,[`urlContext`]);l!=null&&b(t,[`urlContext`],l);let u=x(e,[`fileSearch`]);return u!=null&&b(t,[`fileSearch`],u),t}function Ur(e){let t={},n=x(e,[`bigqueryDestination`,`outputUri`]);n!=null&&b(t,[`bigqueryDestination`],n);let r=x(e,[`displayName`]);return r!=null&&b(t,[`displayName`],r),t}function Wr(e){let t={},n=x(e,[`bigqueryDestination`]);n!=null&&b(t,[`bigqueryDestination`,`outputUri`],n);let r=x(e,[`displayName`]);return r!=null&&b(t,[`displayName`],r),t}var Gr;(function(e){e.PAGED_ITEM_BATCH_JOBS=`batchJobs`,e.PAGED_ITEM_MODELS=`models`,e.PAGED_ITEM_TUNING_JOBS=`tuningJobs`,e.PAGED_ITEM_FILES=`files`,e.PAGED_ITEM_CACHED_CONTENTS=`cachedContents`,e.PAGED_ITEM_FILE_SEARCH_STORES=`fileSearchStores`,e.PAGED_ITEM_DOCUMENTS=`documents`,e.PAGED_ITEM_SKILLS=`skills`})(Gr||={});var Kr=class{constructor(e,t,n,r){this.pageInternal=[],this.paramsInternal={},this.requestInternal=t,this.init(e,n,r)}init(e,t,n){this.nameInternal=e,this.pageInternal=t[this.nameInternal]||[],this.sdkHttpResponseInternal=t?.sdkHttpResponse,this.idxInternal=0;let r={config:{}};r=!n||Object.keys(n).length===0?{config:{}}:typeof n==`object`?Object.assign({},n):n,r.config&&(r.config.pageToken=t.nextPageToken),this.paramsInternal=r,this.pageInternalSize=r.config?.pageSize??this.pageInternal.length}initNextPage(e){this.init(this.nameInternal,e,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get sdkHttpResponse(){return this.sdkHttpResponseInternal}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(e){return this.pageInternal[e]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength){if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0}}let e=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:e,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw Error(`No more pages to fetch.`);let e=await this.requestInternal(this.params);return this.initNextPage(e),this.page}hasNextPage(){return this.params.config?.pageToken!==void 0}},qr=class extends v{constructor(e){super(),this.apiClient=e,this.list=async(e={})=>new Kr(Gr.PAGED_ITEM_BATCH_JOBS,e=>this.listInternal(e),await this.listInternal(e),e),this.create=async e=>(this.apiClient.isVertexAI()&&(e.config=this.formatDestination(e.src,e.config)),this.createInternal(e)),this.createEmbeddings=async e=>{if(console.warn(`batches.createEmbeddings() is experimental and may change without notice.`),this.apiClient.isVertexAI())throw Error(`Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support batches.createEmbeddings.`);return this.createEmbeddingsInternal(e)}}createInlinedGenerateContentRequest(e){let t=ur(this.apiClient,e),n=t._url,r=y(`{model}:batchGenerateContent`,n),i=t.batch.inputConfig.requests,a=i.requests,o=[];for(let e of a){let t=Object.assign({},e);if(t.systemInstruction){let e=t.systemInstruction;delete t.systemInstruction;let n=t.request;n.systemInstruction=e,t.request=n}o.push(t)}return i.requests=o,delete t.config,delete t._url,delete t._query,{path:r,body:t}}getGcsUri(e){if(typeof e==`string`)return e.startsWith(`gs://`)?e:void 0;if(!Array.isArray(e)&&e.gcsUri&&e.gcsUri.length>0)return e.gcsUri[0]}getBigqueryUri(e){if(typeof e==`string`)return e.startsWith(`bq://`)?e:void 0;if(!Array.isArray(e))return e.bigqueryUri}formatDestination(e,t){let n=t?Object.assign({},t):{},r=Date.now().toString();if(n.displayName||=`genaiBatchJob_${r}`,n.dest===void 0){let t=this.getGcsUri(e),i=this.getBigqueryUri(e);if(t)n.dest=t.endsWith(`.jsonl`)?`${t.slice(0,-6)}/dest`:`${t}_dest_${r}`;else if(i)n.dest=`${i}_dest_${r}`;else throw Error(`Unsupported source for Gemini Enterprise Agent Platform (previously known as Vertex AI): No GCS or BigQuery URI found.`)}return n}async createInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=dr(this.apiClient,e);return n=y(`batchPredictionJobs`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>Qn(e))}{let i=ur(this.apiClient,e);return n=y(`{model}:batchGenerateContent`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>Zn(e))}}async createEmbeddingsInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=pr(this.apiClient,e);return n=y(`{model}:asyncBatchEmbedContent`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>Zn(e))}}async get(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=Dr(this.apiClient,e);return n=y(`batchPredictionJobs/{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>Qn(e))}{let i=Er(this.apiClient,e);return n=y(`batches/{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>Zn(e))}}async cancel(e){let t=``,n={};if(this.apiClient.isVertexAI()){let r=ir(this.apiClient,e);t=y(`batchPredictionJobs/{name}:cancel`,r._url),n=r._query,delete r._url,delete r._query,await this.apiClient.request({path:t,queryParams:n,body:JSON.stringify(r),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal})}else{let r=rr(this.apiClient,e);t=y(`batches/{name}:cancel`,r._url),n=r._query,delete r._url,delete r._query,await this.apiClient.request({path:t,queryParams:n,body:JSON.stringify(r),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal})}}async listInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=Ir(e);return n=y(`batchPredictionJobs`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=Rr(e),n=new an;return Object.assign(n,t),n})}{let i=Fr(e);return n=y(`batches`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=Lr(e),n=new an;return Object.assign(n,t),n})}}async delete(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=hr(this.apiClient,e);return n=y(`batchPredictionJobs/{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`DELETE`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>_r(e))}{let i=mr(this.apiClient,e);return n=y(`batches/{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`DELETE`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>gr(e))}}};function Jr(e){let t={},n=x(e,[`apiKey`]);if(n!=null&&b(t,[`apiKey`],n),x(e,[`apiKeyConfig`])!==void 0)throw Error(`apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`authType`])!==void 0)throw Error(`authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`googleServiceAccountConfig`])!==void 0)throw Error(`googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`httpBasicAuthConfig`])!==void 0)throw Error(`httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oauthConfig`])!==void 0)throw Error(`oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oidcConfig`])!==void 0)throw Error(`oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function Yr(e){let t={},n=x(e,[`data`]);if(n!=null&&b(t,[`data`],n),x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`mimeType`]);return r!=null&&b(t,[`mimeType`],r),t}function Xr(e){let t={},n=x(e,[`enablePromptInjectionDetection`]);n!=null&&b(t,[`enablePromptInjectionDetection`],n);let r=x(e,[`environment`]);r!=null&&b(t,[`environment`],r);let i=x(e,[`excludedPredefinedFunctions`]);if(i!=null&&b(t,[`excludedPredefinedFunctions`],i),x(e,[`disabledSafetyPolicies`])!==void 0)throw Error(`disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function Zr(e){let t={},n=x(e,[`parts`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>xi(e))),b(t,[`parts`],e)}let r=x(e,[`role`]);return r!=null&&b(t,[`role`],r),t}function Qr(e){let t={},n=x(e,[`parts`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>Si(e))),b(t,[`parts`],e)}let r=x(e,[`role`]);return r!=null&&b(t,[`role`],r),t}function $r(e,t){let n={},r=x(e,[`ttl`]);t!==void 0&&r!=null&&b(t,[`ttl`],r);let i=x(e,[`expireTime`]);t!==void 0&&i!=null&&b(t,[`expireTime`],i);let a=x(e,[`displayName`]);t!==void 0&&a!=null&&b(t,[`displayName`],a);let o=x(e,[`contents`]);if(t!==void 0&&o!=null){let e=P(o);Array.isArray(e)&&(e=e.map(e=>Zr(e))),b(t,[`contents`],e)}let s=x(e,[`systemInstruction`]);t!==void 0&&s!=null&&b(t,[`systemInstruction`],Zr(N(s)));let c=x(e,[`tools`]);if(t!==void 0&&c!=null){let e=c;Array.isArray(e)&&(e=e.map(e=>Ti(e))),b(t,[`tools`],e)}let l=x(e,[`toolConfig`]);if(t!==void 0&&l!=null&&b(t,[`toolConfig`],Ci(l)),x(e,[`kmsKeyName`])!==void 0)throw Error(`kmsKeyName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function ei(e,t){let n={},r=x(e,[`ttl`]);t!==void 0&&r!=null&&b(t,[`ttl`],r);let i=x(e,[`expireTime`]);t!==void 0&&i!=null&&b(t,[`expireTime`],i);let a=x(e,[`displayName`]);t!==void 0&&a!=null&&b(t,[`displayName`],a);let o=x(e,[`contents`]);if(t!==void 0&&o!=null){let e=P(o);Array.isArray(e)&&(e=e.map(e=>Qr(e))),b(t,[`contents`],e)}let s=x(e,[`systemInstruction`]);t!==void 0&&s!=null&&b(t,[`systemInstruction`],Qr(N(s)));let c=x(e,[`tools`]);if(t!==void 0&&c!=null){let e=c;Array.isArray(e)&&(e=e.map(e=>Ei(e))),b(t,[`tools`],e)}let l=x(e,[`toolConfig`]);t!==void 0&&l!=null&&b(t,[`toolConfig`],wi(l));let u=x(e,[`kmsKeyName`]);return t!==void 0&&u!=null&&b(t,[`encryption_spec`,`kmsKeyName`],u),n}function ti(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`model`],ln(e,r));let i=x(t,[`config`]);return i!=null&&$r(i,n),n}function ni(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`model`],ln(e,r));let i=x(t,[`config`]);return i!=null&&ei(i,n),n}function ri(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],kn(e,r)),n}function ii(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],kn(e,r)),n}function ai(e){let t={},n=x(e,[`sdkHttpResponse`]);return n!=null&&b(t,[`sdkHttpResponse`],n),t}function oi(e){let t={},n=x(e,[`sdkHttpResponse`]);return n!=null&&b(t,[`sdkHttpResponse`],n),t}function si(e){let t={};if(x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`fileUri`]);n!=null&&b(t,[`fileUri`],n);let r=x(e,[`mimeType`]);return r!=null&&b(t,[`mimeType`],r),t}function ci(e){let t={},n=x(e,[`args`]);n!=null&&b(t,[`args`],n);let r=x(e,[`id`]);r!=null&&b(t,[`id`],r);let i=x(e,[`name`]);if(i!=null&&b(t,[`name`],i),x(e,[`partialArgs`])!==void 0)throw Error(`partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`willContinue`])!==void 0)throw Error(`willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function li(e){let t={},n=x(e,[`allowedFunctionNames`]);n!=null&&b(t,[`allowedFunctionNames`],n);let r=x(e,[`mode`]);if(r!=null&&b(t,[`mode`],r),x(e,[`streamFunctionCallArguments`])!==void 0)throw Error(`streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function ui(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],kn(e,r)),n}function di(e,t){let n={},r=x(t,[`name`]);return r!=null&&b(n,[`_url`,`name`],kn(e,r)),n}function fi(e){let t={},n=x(e,[`authConfig`]);n!=null&&b(t,[`authConfig`],Jr(n));let r=x(e,[`enableWidget`]);if(r!=null&&b(t,[`enableWidget`],r),x(e,[`groundingTypes`])!==void 0)throw Error(`groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function pi(e){let t={};if(x(e,[`blockingConfidence`])!==void 0)throw Error(`blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`excludeDomains`])!==void 0)throw Error(`excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`searchTypes`]);n!=null&&b(t,[`searchTypes`],n);let r=x(e,[`timeRangeFilter`]);return r!=null&&b(t,[`timeRangeFilter`],r),t}function mi(e,t){let n={},r=x(e,[`pageSize`]);t!==void 0&&r!=null&&b(t,[`_query`,`pageSize`],r);let i=x(e,[`pageToken`]);return t!==void 0&&i!=null&&b(t,[`_query`,`pageToken`],i),n}function hi(e,t){let n={},r=x(e,[`pageSize`]);t!==void 0&&r!=null&&b(t,[`_query`,`pageSize`],r);let i=x(e,[`pageToken`]);return t!==void 0&&i!=null&&b(t,[`_query`,`pageToken`],i),n}function gi(e){let t={},n=x(e,[`config`]);return n!=null&&mi(n,t),t}function _i(e){let t={},n=x(e,[`config`]);return n!=null&&hi(n,t),t}function vi(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`nextPageToken`]);r!=null&&b(t,[`nextPageToken`],r);let i=x(e,[`cachedContents`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`cachedContents`],e)}return t}function yi(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`nextPageToken`]);r!=null&&b(t,[`nextPageToken`],r);let i=x(e,[`cachedContents`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`cachedContents`],e)}return t}function bi(e){let t={};if(x(e,[`name`])!==void 0)throw Error(`name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`streamableHttpTransport`])!==void 0)throw Error(`streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function xi(e){let t={},n=x(e,[`mediaResolution`]);n!=null&&b(t,[`mediaResolution`],n);let r=x(e,[`toolCall`]);r!=null&&b(t,[`toolCall`],r);let i=x(e,[`toolResponse`]);i!=null&&b(t,[`toolResponse`],i);let a=x(e,[`audioTranscription`]);a!=null&&b(t,[`audioTranscription`],a);let o=x(e,[`codeExecutionResult`]);o!=null&&b(t,[`codeExecutionResult`],o);let s=x(e,[`executableCode`]);s!=null&&b(t,[`executableCode`],s);let c=x(e,[`fileData`]);c!=null&&b(t,[`fileData`],si(c));let l=x(e,[`functionCall`]);l!=null&&b(t,[`functionCall`],ci(l));let u=x(e,[`functionResponse`]);u!=null&&b(t,[`functionResponse`],u);let d=x(e,[`inlineData`]);d!=null&&b(t,[`inlineData`],Yr(d));let f=x(e,[`text`]);f!=null&&b(t,[`text`],f);let p=x(e,[`thought`]);p!=null&&b(t,[`thought`],p);let m=x(e,[`thoughtSignature`]);m!=null&&b(t,[`thoughtSignature`],m);let h=x(e,[`videoMetadata`]);h!=null&&b(t,[`videoMetadata`],h);let g=x(e,[`partMetadata`]);g!=null&&b(t,[`partMetadata`],g);let _=x(e,[`mediaProcessing`]);return _!=null&&b(t,[`mediaProcessing`],_),t}function Si(e){let t={},n=x(e,[`mediaResolution`]);if(n!=null&&b(t,[`mediaResolution`],n),x(e,[`toolCall`])!==void 0)throw Error(`toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`toolResponse`])!==void 0)throw Error(`toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let r=x(e,[`audioTranscription`]);r!=null&&b(t,[`audioTranscription`],r);let i=x(e,[`codeExecutionResult`]);i!=null&&b(t,[`codeExecutionResult`],i);let a=x(e,[`executableCode`]);a!=null&&b(t,[`executableCode`],a);let o=x(e,[`fileData`]);o!=null&&b(t,[`fileData`],o);let s=x(e,[`functionCall`]);s!=null&&b(t,[`functionCall`],s);let c=x(e,[`functionResponse`]);c!=null&&b(t,[`functionResponse`],c);let l=x(e,[`inlineData`]);l!=null&&b(t,[`inlineData`],l);let u=x(e,[`text`]);u!=null&&b(t,[`text`],u);let d=x(e,[`thought`]);d!=null&&b(t,[`thought`],d);let f=x(e,[`thoughtSignature`]);f!=null&&b(t,[`thoughtSignature`],f);let p=x(e,[`videoMetadata`]);if(p!=null&&b(t,[`videoMetadata`],p),x(e,[`partMetadata`])!==void 0)throw Error(`partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let m=x(e,[`mediaProcessing`]);return m!=null&&b(t,[`mediaProcessing`],m),t}function Ci(e){let t={},n=x(e,[`functionCallingConfig`]);n!=null&&b(t,[`functionCallingConfig`],li(n));let r=x(e,[`retrievalConfig`]);r!=null&&b(t,[`retrievalConfig`],r);let i=x(e,[`includeServerSideToolInvocations`]);return i!=null&&b(t,[`includeServerSideToolInvocations`],i),t}function wi(e){let t={},n=x(e,[`functionCallingConfig`]);n!=null&&b(t,[`functionCallingConfig`],n);let r=x(e,[`retrievalConfig`]);if(r!=null&&b(t,[`retrievalConfig`],r),x(e,[`includeServerSideToolInvocations`])!==void 0)throw Error(`includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function Ti(e){let t={};if(x(e,[`retrieval`])!==void 0)throw Error(`retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`googleMaps`]);n!=null&&b(t,[`googleMaps`],fi(n));let r=x(e,[`mcpServers`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`mcpServers`],e)}let i=x(e,[`codeExecution`]);i!=null&&b(t,[`codeExecution`],i);let a=x(e,[`computerUse`]);if(a!=null&&b(t,[`computerUse`],a),x(e,[`enterpriseWebSearch`])!==void 0)throw Error(`enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`exaAiSearch`])!==void 0)throw Error(`exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let o=x(e,[`functionDeclarations`]);if(o!=null){let e=o;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`functionDeclarations`],e)}let s=x(e,[`googleSearch`]);s!=null&&b(t,[`googleSearch`],pi(s));let c=x(e,[`googleSearchRetrieval`]);if(c!=null&&b(t,[`googleSearchRetrieval`],c),x(e,[`parallelAiSearch`])!==void 0)throw Error(`parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let l=x(e,[`urlContext`]);l!=null&&b(t,[`urlContext`],l);let u=x(e,[`fileSearch`]);return u!=null&&b(t,[`fileSearch`],u),t}function Ei(e){let t={},n=x(e,[`retrieval`]);n!=null&&b(t,[`retrieval`],n);let r=x(e,[`googleMaps`]);r!=null&&b(t,[`googleMaps`],r);let i=x(e,[`mcpServers`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>bi(e))),b(t,[`mcpServers`],e)}let a=x(e,[`codeExecution`]);a!=null&&b(t,[`codeExecution`],a);let o=x(e,[`computerUse`]);o!=null&&b(t,[`computerUse`],Xr(o));let s=x(e,[`enterpriseWebSearch`]);s!=null&&b(t,[`enterpriseWebSearch`],s);let c=x(e,[`exaAiSearch`]);c!=null&&b(t,[`exaAiSearch`],c);let l=x(e,[`functionDeclarations`]);if(l!=null){let e=l;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`functionDeclarations`],e)}let u=x(e,[`googleSearch`]);u!=null&&b(t,[`googleSearch`],u);let d=x(e,[`googleSearchRetrieval`]);d!=null&&b(t,[`googleSearchRetrieval`],d);let f=x(e,[`parallelAiSearch`]);f!=null&&b(t,[`parallelAiSearch`],f);let p=x(e,[`urlContext`]);if(p!=null&&b(t,[`urlContext`],p),x(e,[`fileSearch`])!==void 0)throw Error(`fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function Di(e,t){let n={},r=x(e,[`ttl`]);t!==void 0&&r!=null&&b(t,[`ttl`],r);let i=x(e,[`expireTime`]);return t!==void 0&&i!=null&&b(t,[`expireTime`],i),n}function Oi(e,t){let n={},r=x(e,[`ttl`]);t!==void 0&&r!=null&&b(t,[`ttl`],r);let i=x(e,[`expireTime`]);return t!==void 0&&i!=null&&b(t,[`expireTime`],i),n}function ki(e,t){let n={},r=x(t,[`name`]);r!=null&&b(n,[`_url`,`name`],kn(e,r));let i=x(t,[`config`]);return i!=null&&Di(i,n),n}function Ai(e,t){let n={},r=x(t,[`name`]);r!=null&&b(n,[`_url`,`name`],kn(e,r));let i=x(t,[`config`]);return i!=null&&Oi(i,n),n}var ji=class extends v{constructor(e){super(),this.apiClient=e,this.list=async(e={})=>new Kr(Gr.PAGED_ITEM_CACHED_CONTENTS,e=>this.listInternal(e),await this.listInternal(e),e)}async create(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=ni(this.apiClient,e);return n=y(`cachedContents`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}{let i=ti(this.apiClient,e);return n=y(`cachedContents`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}}async get(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=di(this.apiClient,e);return n=y(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}{let i=ui(this.apiClient,e);return n=y(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}}async delete(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=ii(this.apiClient,e);return n=y(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`DELETE`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=oi(e),n=new Jt;return Object.assign(n,t),n})}{let i=ri(this.apiClient,e);return n=y(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`DELETE`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=ai(e),n=new Jt;return Object.assign(n,t),n})}}async update(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=Ai(this.apiClient,e);return n=y(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`PATCH`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}{let i=ki(this.apiClient,e);return n=y(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`PATCH`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}}async listInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=_i(e);return n=y(`cachedContents`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=yi(e),n=new Yt;return Object.assign(n,t),n})}{let i=gi(e);return n=y(`cachedContents`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=vi(e),n=new Yt;return Object.assign(n,t),n})}}};function F(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Mi(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function I(e){return this instanceof I?(this.v=e,this):new I(e)}function Ni(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof I?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Pi(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Mi==`function`?Mi(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function Fi(e){if(e.candidates==null||e.candidates.length===0)return!1;let t=e.candidates[0]?.content;return t!==void 0&&Ii(t)}function Ii(e){if(e.parts===void 0||e.parts.length===0)return!1;for(let t of e.parts)if(t===void 0||Object.keys(t).length===0)return!1;return!0}function Li(e){if(e.length!==0){for(let t of e)if(t.role!==`user`&&t.role!==`model`)throw Error(`Role must be user or model, but got ${t.role}.`)}}function Ri(e){if(e===void 0||e.length===0)return[];let t=[],n=e.length,r=0;for(;r<n;)if(e[r].role===`user`)t.push(e[r]),r++;else{let i=[],a=!0;for(;r<n&&e[r].role===`model`;)i.push(e[r]),a&&!Ii(e[r])&&(a=!1),r++;a?t.push(...i):t.pop()}return t}var zi=class{constructor(e,t){this.modelsModule=e,this.apiClient=t}create(e){return new Bi(this.apiClient,this.modelsModule,e.model,e.config,structuredClone(e.history))}},Bi=class{constructor(e,t,n,r={},i=[]){this.apiClient=e,this.modelsModule=t,this.model=n,this.config=r,this.history=i,this.sendPromise=Promise.resolve(),Li(i)}async sendMessage(e){await this.sendPromise;let t=N(e.message),n=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(t),config:e.config??this.config});return this.sendPromise=(async()=>{let e=await n,r=e.candidates?.[0]?.content,i=e.automaticFunctionCallingHistory,a=this.getHistory(!0).length,o=[];i!=null&&(o=i.slice(a)??[]);let s=r?[r]:[];this.recordHistory(t,s,o)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),n}async sendMessageStream(e){await this.sendPromise;let t=N(e.message),n=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(t),config:e.config??this.config});this.sendPromise=n.then(()=>void 0).catch(()=>void 0);let r=await n;return this.processStreamResponse(r,t)}getHistory(e=!1){let t=e?Ri(this.history):this.history;return structuredClone(t)}processStreamResponse(e,t){return Ni(this,arguments,function*(){var n,r,i,a;let o=[];try{for(var s=!0,c=Pi(e),l;l=yield I(c.next()),n=l.done,!n;s=!0){a=l.value,s=!1;let e=a;if(Fi(e)){let t=e.candidates?.[0]?.content;t!==void 0&&o.push(t)}yield yield I(e)}}catch(e){r={error:e}}finally{try{!s&&!n&&(i=c.return)&&(yield I(i.call(c)))}finally{if(r)throw r.error}}this.recordHistory(t,o)})}recordHistory(e,t,n){let r=[];t.length>0&&t.every(e=>e.role!==void 0)?r=t:r.push({role:`model`,parts:[]}),n&&n.length>0?this.history.push(...Ri(n)):this.history.push(e),this.history.push(...r)}},Vi=class e extends Error{constructor(t){super(t.message),this.name=`ApiError`,this.status=t.status,Object.setPrototypeOf(this,e.prototype)}};function Hi(e){let t={},n=x(e,[`file`]);return n!=null&&b(t,[`file`],n),t}function Ui(e){let t={},n=x(e,[`sdkHttpResponse`]);return n!=null&&b(t,[`sdkHttpResponse`],n),t}function Wi(e){let t={},n=x(e,[`name`]);return n!=null&&b(t,[`_url`,`file`],Fn(n)),t}function Gi(e){let t={},n=x(e,[`sdkHttpResponse`]);return n!=null&&b(t,[`sdkHttpResponse`],n),t}function Ki(e){let t={},n=x(e,[`name`]);return n!=null&&b(t,[`_url`,`file`],Fn(n)),t}function qi(e){let t={},n=x(e,[`uris`]);return n!=null&&b(t,[`uris`],n),t}function Ji(e,t){let n={},r=x(e,[`pageSize`]);t!==void 0&&r!=null&&b(t,[`_query`,`pageSize`],r);let i=x(e,[`pageToken`]);return t!==void 0&&i!=null&&b(t,[`_query`,`pageToken`],i),n}function Yi(e){let t={},n=x(e,[`config`]);return n!=null&&Ji(n,t),t}function Xi(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`nextPageToken`]);r!=null&&b(t,[`nextPageToken`],r);let i=x(e,[`files`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`files`],e)}return t}function Zi(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`files`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`files`],e)}return t}var Qi=class extends v{constructor(e){super(),this.apiClient=e,this.list=async(e={})=>new Kr(Gr.PAGED_ITEM_FILES,e=>this.listInternal(e),await this.listInternal(e),e)}async upload(e){if(this.apiClient.isVertexAI())throw Error(`Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support uploading files. You can share files through a GCS bucket.`);return this.apiClient.uploadFile(e.file,e.config).then(e=>e)}async download(e){await this.apiClient.downloadFile(e)}async registerFiles(e){throw Error(`registerFiles is only supported in Node.js environments.`)}async _registerFiles(e){return this.registerFilesInternal(e)}async listInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=Yi(e);return n=y(`files`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=Xi(e),n=new en;return Object.assign(n,t),n})}}async createInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=Hi(e);return n=y(`upload/v1beta/files`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>{let t=Ui(e),n=new tn;return Object.assign(n,t),n})}}async get(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=Ki(e);return n=y(`files/{file}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>e)}}async delete(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=Wi(e);return n=y(`files/{file}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`DELETE`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=Gi(e),n=new nn;return Object.assign(n,t),n})}}async registerFilesInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=qi(e);return n=y(`files:register`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json()),t.then(e=>{let t=Zi(e),n=new rn;return Object.assign(n,t),n})}}};function $i(e){let t={},n=x(e,[`apiKey`]);if(n!=null&&b(t,[`apiKey`],n),x(e,[`apiKeyConfig`])!==void 0)throw Error(`apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`authType`])!==void 0)throw Error(`authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`googleServiceAccountConfig`])!==void 0)throw Error(`googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`httpBasicAuthConfig`])!==void 0)throw Error(`httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oauthConfig`])!==void 0)throw Error(`oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oidcConfig`])!==void 0)throw Error(`oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function ea(e){let t={},n=x(e,[`data`]);if(n!=null&&b(t,[`data`],n),x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`mimeType`]);return r!=null&&b(t,[`mimeType`],r),t}function ta(e){let t={},n=x(e,[`enablePromptInjectionDetection`]);n!=null&&b(t,[`enablePromptInjectionDetection`],n);let r=x(e,[`environment`]);r!=null&&b(t,[`environment`],r);let i=x(e,[`excludedPredefinedFunctions`]);if(i!=null&&b(t,[`excludedPredefinedFunctions`],i),x(e,[`disabledSafetyPolicies`])!==void 0)throw Error(`disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function na(e){let t={},n=x(e,[`parts`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>ba(e))),b(t,[`parts`],e)}let r=x(e,[`role`]);return r!=null&&b(t,[`role`],r),t}function ra(e){let t={},n=x(e,[`parts`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>xa(e))),b(t,[`parts`],e)}let r=x(e,[`role`]);return r!=null&&b(t,[`role`],r),t}function ia(e){let t={};if(x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`fileUri`]);n!=null&&b(t,[`fileUri`],n);let r=x(e,[`mimeType`]);return r!=null&&b(t,[`mimeType`],r),t}function aa(e){let t={},n=x(e,[`args`]);n!=null&&b(t,[`args`],n);let r=x(e,[`id`]);r!=null&&b(t,[`id`],r);let i=x(e,[`name`]);if(i!=null&&b(t,[`name`],i),x(e,[`partialArgs`])!==void 0)throw Error(`partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`willContinue`])!==void 0)throw Error(`willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function oa(e){let t={},n=x(e,[`modelSelectionConfig`]);n!=null&&b(t,[`modelConfig`],n);let r=x(e,[`responseJsonSchema`]);r!=null&&b(t,[`responseJsonSchema`],Cn(r));let i=x(e,[`audioTranscriptionConfig`]);i!=null&&b(t,[`audioTranscriptionConfig`],i);let a=x(e,[`audioTimestamp`]);a!=null&&b(t,[`audioTimestamp`],a);let o=x(e,[`candidateCount`]);o!=null&&b(t,[`candidateCount`],o);let s=x(e,[`enableAffectiveDialog`]);s!=null&&b(t,[`enableAffectiveDialog`],s);let c=x(e,[`frequencyPenalty`]);c!=null&&b(t,[`frequencyPenalty`],c);let l=x(e,[`logprobs`]);l!=null&&b(t,[`logprobs`],l);let u=x(e,[`maxOutputTokens`]);u!=null&&b(t,[`maxOutputTokens`],u);let d=x(e,[`mediaResolution`]);d!=null&&b(t,[`mediaResolution`],d);let f=x(e,[`presencePenalty`]);f!=null&&b(t,[`presencePenalty`],f);let p=x(e,[`responseFormat`]);if(p!=null){let e=p;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`responseFormat`],e)}let m=x(e,[`responseLogprobs`]);m!=null&&b(t,[`responseLogprobs`],m);let h=x(e,[`responseMimeType`]);h!=null&&b(t,[`responseMimeType`],h);let g=x(e,[`responseModalities`]);g!=null&&b(t,[`responseModalities`],g);let _=x(e,[`responseSchema`]);_!=null&&b(t,[`responseSchema`],_);let v=x(e,[`routingConfig`]);v!=null&&b(t,[`routingConfig`],v);let y=x(e,[`seed`]);y!=null&&b(t,[`seed`],y);let S=x(e,[`speechConfig`]);S!=null&&b(t,[`speechConfig`],Ea(S));let C=x(e,[`stopSequences`]);C!=null&&b(t,[`stopSequences`],C);let w=x(e,[`temperature`]);w!=null&&b(t,[`temperature`],w);let T=x(e,[`thinkingConfig`]);T!=null&&b(t,[`thinkingConfig`],T);let E=x(e,[`topK`]);E!=null&&b(t,[`topK`],E);let D=x(e,[`topP`]);if(D!=null&&b(t,[`topP`],D),x(e,[`enableEnhancedCivicAnswers`])!==void 0)throw Error(`enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`translationConfig`])!==void 0)throw Error(`translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function sa(e){let t={},n=x(e,[`authConfig`]);n!=null&&b(t,[`authConfig`],$i(n));let r=x(e,[`enableWidget`]);if(r!=null&&b(t,[`enableWidget`],r),x(e,[`groundingTypes`])!==void 0)throw Error(`groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function ca(e){let t={};if(x(e,[`blockingConfidence`])!==void 0)throw Error(`blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`excludeDomains`])!==void 0)throw Error(`excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`searchTypes`]);n!=null&&b(t,[`searchTypes`],n);let r=x(e,[`timeRangeFilter`]);return r!=null&&b(t,[`timeRangeFilter`],r),t}function la(e,t){let n={},r=x(e,[`generationConfig`]);t!==void 0&&r!=null&&b(t,[`setup`,`generationConfig`],r);let i=x(e,[`responseModalities`]);t!==void 0&&i!=null&&b(t,[`setup`,`generationConfig`,`responseModalities`],i);let a=x(e,[`temperature`]);t!==void 0&&a!=null&&b(t,[`setup`,`generationConfig`,`temperature`],a);let o=x(e,[`topP`]);t!==void 0&&o!=null&&b(t,[`setup`,`generationConfig`,`topP`],o);let s=x(e,[`topK`]);t!==void 0&&s!=null&&b(t,[`setup`,`generationConfig`,`topK`],s);let c=x(e,[`maxOutputTokens`]);t!==void 0&&c!=null&&b(t,[`setup`,`generationConfig`,`maxOutputTokens`],c);let l=x(e,[`mediaResolution`]);t!==void 0&&l!=null&&b(t,[`setup`,`generationConfig`,`mediaResolution`],l);let u=x(e,[`seed`]);t!==void 0&&u!=null&&b(t,[`setup`,`generationConfig`,`seed`],u);let d=x(e,[`speechConfig`]);t!==void 0&&d!=null&&b(t,[`setup`,`generationConfig`,`speechConfig`],Tn(d));let f=x(e,[`thinkingConfig`]);t!==void 0&&f!=null&&b(t,[`setup`,`generationConfig`,`thinkingConfig`],f);let p=x(e,[`enableAffectiveDialog`]);t!==void 0&&p!=null&&b(t,[`setup`,`generationConfig`,`enableAffectiveDialog`],p);let m=x(e,[`systemInstruction`]);t!==void 0&&m!=null&&b(t,[`setup`,`systemInstruction`],na(N(m)));let h=x(e,[`tools`]);if(t!==void 0&&h!=null){let e=Dn(h);Array.isArray(e)&&(e=e.map(e=>Da(En(e)))),b(t,[`setup`,`tools`],e)}let g=x(e,[`sessionResumption`]);t!==void 0&&g!=null&&b(t,[`setup`,`sessionResumption`],wa(g));let _=x(e,[`inputAudioTranscription`]);t!==void 0&&_!=null&&b(t,[`setup`,`inputAudioTranscription`],_);let v=x(e,[`outputAudioTranscription`]);t!==void 0&&v!=null&&b(t,[`setup`,`outputAudioTranscription`],v);let y=x(e,[`realtimeInputConfig`]);t!==void 0&&y!=null&&b(t,[`setup`,`realtimeInputConfig`],y);let S=x(e,[`contextWindowCompression`]);t!==void 0&&S!=null&&b(t,[`setup`,`contextWindowCompression`],S);let C=x(e,[`proactivity`]);if(t!==void 0&&C!=null&&b(t,[`setup`,`proactivity`],C),x(e,[`explicitVadSignal`])!==void 0)throw Error(`explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let w=x(e,[`avatarConfig`]);t!==void 0&&w!=null&&b(t,[`setup`,`avatarConfig`],w);let T=x(e,[`safetySettings`]);if(t!==void 0&&T!=null){let e=T;Array.isArray(e)&&(e=e.map(e=>Ca(e))),b(t,[`setup`,`safetySettings`],e)}let E=x(e,[`translationConfig`]);return t!==void 0&&E!=null&&b(t,[`setup`,`generationConfig`,`translationConfig`],E),n}function ua(e,t){let n={},r=x(e,[`generationConfig`]);t!==void 0&&r!=null&&b(t,[`setup`,`generationConfig`],oa(r));let i=x(e,[`responseModalities`]);t!==void 0&&i!=null&&b(t,[`setup`,`generationConfig`,`responseModalities`],i);let a=x(e,[`temperature`]);t!==void 0&&a!=null&&b(t,[`setup`,`generationConfig`,`temperature`],a);let o=x(e,[`topP`]);t!==void 0&&o!=null&&b(t,[`setup`,`generationConfig`,`topP`],o);let s=x(e,[`topK`]);t!==void 0&&s!=null&&b(t,[`setup`,`generationConfig`,`topK`],s);let c=x(e,[`maxOutputTokens`]);t!==void 0&&c!=null&&b(t,[`setup`,`generationConfig`,`maxOutputTokens`],c);let l=x(e,[`mediaResolution`]);t!==void 0&&l!=null&&b(t,[`setup`,`generationConfig`,`mediaResolution`],l);let u=x(e,[`seed`]);t!==void 0&&u!=null&&b(t,[`setup`,`generationConfig`,`seed`],u);let d=x(e,[`speechConfig`]);t!==void 0&&d!=null&&b(t,[`setup`,`generationConfig`,`speechConfig`],Ea(Tn(d)));let f=x(e,[`thinkingConfig`]);t!==void 0&&f!=null&&b(t,[`setup`,`generationConfig`,`thinkingConfig`],f);let p=x(e,[`enableAffectiveDialog`]);t!==void 0&&p!=null&&b(t,[`setup`,`generationConfig`,`enableAffectiveDialog`],p);let m=x(e,[`systemInstruction`]);t!==void 0&&m!=null&&b(t,[`setup`,`systemInstruction`],ra(N(m)));let h=x(e,[`tools`]);if(t!==void 0&&h!=null){let e=Dn(h);Array.isArray(e)&&(e=e.map(e=>Oa(En(e)))),b(t,[`setup`,`tools`],e)}let g=x(e,[`sessionResumption`]);t!==void 0&&g!=null&&b(t,[`setup`,`sessionResumption`],g);let _=x(e,[`inputAudioTranscription`]);t!==void 0&&_!=null&&b(t,[`setup`,`inputAudioTranscription`],_);let v=x(e,[`outputAudioTranscription`]);t!==void 0&&v!=null&&b(t,[`setup`,`outputAudioTranscription`],v);let y=x(e,[`realtimeInputConfig`]);t!==void 0&&y!=null&&b(t,[`setup`,`realtimeInputConfig`],y);let S=x(e,[`contextWindowCompression`]);t!==void 0&&S!=null&&b(t,[`setup`,`contextWindowCompression`],S);let C=x(e,[`proactivity`]);t!==void 0&&C!=null&&b(t,[`setup`,`proactivity`],C);let w=x(e,[`explicitVadSignal`]);t!==void 0&&w!=null&&b(t,[`setup`,`explicitVadSignal`],w);let T=x(e,[`avatarConfig`]);t!==void 0&&T!=null&&b(t,[`setup`,`avatarConfig`],T);let E=x(e,[`safetySettings`]);if(t!==void 0&&E!=null){let e=E;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`setup`,`safetySettings`],e)}let D=x(e,[`translationConfig`]);return t!==void 0&&D!=null&&b(t,[`setup`,`generationConfig`,`translationConfig`],D),n}function da(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`setup`,`model`],M(e,r));let i=x(t,[`config`]);return i!=null&&b(n,[`config`],la(i,n)),n}function fa(e,t){let n={},r=x(t,[`model`]);r!=null&&b(n,[`setup`,`model`],M(e,r));let i=x(t,[`config`]);return i!=null&&b(n,[`config`],ua(i,n)),n}function pa(e){let t={},n=x(e,[`musicGenerationConfig`]);return n!=null&&b(t,[`musicGenerationConfig`],n),t}function ma(e){let t={},n=x(e,[`weightedPrompts`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`weightedPrompts`],e)}return t}function ha(e){let t={},n=x(e,[`media`]);if(n!=null){let e=un(n);Array.isArray(e)&&(e=e.map(e=>ea(e))),b(t,[`mediaChunks`],e)}let r=x(e,[`audio`]);r!=null&&b(t,[`audio`],ea(pn(r)));let i=x(e,[`audioStreamEnd`]);i!=null&&b(t,[`audioStreamEnd`],i);let a=x(e,[`video`]);a!=null&&b(t,[`video`],ea(fn(a)));let o=x(e,[`text`]);o!=null&&b(t,[`text`],o);let s=x(e,[`activityStart`]);s!=null&&b(t,[`activityStart`],s);let c=x(e,[`activityEnd`]);return c!=null&&b(t,[`activityEnd`],c),t}function ga(e){let t={},n=x(e,[`media`]);if(n!=null){let e=un(n);Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`mediaChunks`],e)}let r=x(e,[`audio`]);r!=null&&b(t,[`audio`],pn(r));let i=x(e,[`audioStreamEnd`]);i!=null&&b(t,[`audioStreamEnd`],i);let a=x(e,[`video`]);a!=null&&b(t,[`video`],fn(a));let o=x(e,[`text`]);o!=null&&b(t,[`text`],o);let s=x(e,[`activityStart`]);s!=null&&b(t,[`activityStart`],s);let c=x(e,[`activityEnd`]);return c!=null&&b(t,[`activityEnd`],c),t}function _a(e){let t={},n=x(e,[`setupComplete`]);n!=null&&b(t,[`setupComplete`],n);let r=x(e,[`serverContent`]);r!=null&&b(t,[`serverContent`],r);let i=x(e,[`toolCall`]);i!=null&&b(t,[`toolCall`],i);let a=x(e,[`toolCallCancellation`]);a!=null&&b(t,[`toolCallCancellation`],a);let o=x(e,[`usageMetadata`]);o!=null&&b(t,[`usageMetadata`],ka(o));let s=x(e,[`goAway`]);s!=null&&b(t,[`goAway`],s);let c=x(e,[`sessionResumptionUpdate`]);c!=null&&b(t,[`sessionResumptionUpdate`],c);let l=x(e,[`voiceActivityDetectionSignal`]);l!=null&&b(t,[`voiceActivityDetectionSignal`],l);let u=x(e,[`voiceActivity`]);return u!=null&&b(t,[`voiceActivity`],Aa(u)),t}function va(e){let t={};if(x(e,[`name`])!==void 0)throw Error(`name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`streamableHttpTransport`])!==void 0)throw Error(`streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function ya(e){let t={},n=x(e,[`speakerVoiceConfigs`]);if(n!=null){let e=n;Array.isArray(e)&&(e=e.map(e=>Ta(e))),b(t,[`speakerVoiceConfigs`],e)}return t}function ba(e){let t={},n=x(e,[`mediaResolution`]);n!=null&&b(t,[`mediaResolution`],n);let r=x(e,[`toolCall`]);r!=null&&b(t,[`toolCall`],r);let i=x(e,[`toolResponse`]);i!=null&&b(t,[`toolResponse`],i);let a=x(e,[`audioTranscription`]);a!=null&&b(t,[`audioTranscription`],a);let o=x(e,[`codeExecutionResult`]);o!=null&&b(t,[`codeExecutionResult`],o);let s=x(e,[`executableCode`]);s!=null&&b(t,[`executableCode`],s);let c=x(e,[`fileData`]);c!=null&&b(t,[`fileData`],ia(c));let l=x(e,[`functionCall`]);l!=null&&b(t,[`functionCall`],aa(l));let u=x(e,[`functionResponse`]);u!=null&&b(t,[`functionResponse`],u);let d=x(e,[`inlineData`]);d!=null&&b(t,[`inlineData`],ea(d));let f=x(e,[`text`]);f!=null&&b(t,[`text`],f);let p=x(e,[`thought`]);p!=null&&b(t,[`thought`],p);let m=x(e,[`thoughtSignature`]);m!=null&&b(t,[`thoughtSignature`],m);let h=x(e,[`videoMetadata`]);h!=null&&b(t,[`videoMetadata`],h);let g=x(e,[`partMetadata`]);g!=null&&b(t,[`partMetadata`],g);let _=x(e,[`mediaProcessing`]);return _!=null&&b(t,[`mediaProcessing`],_),t}function xa(e){let t={},n=x(e,[`mediaResolution`]);if(n!=null&&b(t,[`mediaResolution`],n),x(e,[`toolCall`])!==void 0)throw Error(`toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`toolResponse`])!==void 0)throw Error(`toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let r=x(e,[`audioTranscription`]);r!=null&&b(t,[`audioTranscription`],r);let i=x(e,[`codeExecutionResult`]);i!=null&&b(t,[`codeExecutionResult`],i);let a=x(e,[`executableCode`]);a!=null&&b(t,[`executableCode`],a);let o=x(e,[`fileData`]);o!=null&&b(t,[`fileData`],o);let s=x(e,[`functionCall`]);s!=null&&b(t,[`functionCall`],s);let c=x(e,[`functionResponse`]);c!=null&&b(t,[`functionResponse`],c);let l=x(e,[`inlineData`]);l!=null&&b(t,[`inlineData`],l);let u=x(e,[`text`]);u!=null&&b(t,[`text`],u);let d=x(e,[`thought`]);d!=null&&b(t,[`thought`],d);let f=x(e,[`thoughtSignature`]);f!=null&&b(t,[`thoughtSignature`],f);let p=x(e,[`videoMetadata`]);if(p!=null&&b(t,[`videoMetadata`],p),x(e,[`partMetadata`])!==void 0)throw Error(`partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let m=x(e,[`mediaProcessing`]);return m!=null&&b(t,[`mediaProcessing`],m),t}function Sa(e){let t={},n=x(e,[`mimeType`]);n!=null&&b(t,[`mimeType`],n);let r=x(e,[`voiceSampleAudio`]);if(r!=null&&b(t,[`voiceSampleAudio`],r),x(e,[`consentAudio`])!==void 0)throw Error(`consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`voiceConsentSignature`])!==void 0)throw Error(`voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function Ca(e){let t={},n=x(e,[`category`]);if(n!=null&&b(t,[`category`],n),x(e,[`method`])!==void 0)throw Error(`method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`threshold`]);return r!=null&&b(t,[`threshold`],r),t}function wa(e){let t={},n=x(e,[`handle`]);if(n!=null&&b(t,[`handle`],n),x(e,[`transparent`])!==void 0)throw Error(`transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return t}function Ta(e){let t={},n=x(e,[`speaker`]);n!=null&&b(t,[`speaker`],n);let r=x(e,[`voiceConfig`]);return r!=null&&b(t,[`voiceConfig`],ja(r)),t}function Ea(e){let t={},n=x(e,[`voiceConfig`]);n!=null&&b(t,[`voiceConfig`],ja(n));let r=x(e,[`languageCode`]);r!=null&&b(t,[`languageCode`],r);let i=x(e,[`multiSpeakerVoiceConfig`]);return i!=null&&b(t,[`multiSpeakerVoiceConfig`],ya(i)),t}function Da(e){let t={};if(x(e,[`retrieval`])!==void 0)throw Error(`retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let n=x(e,[`googleMaps`]);n!=null&&b(t,[`googleMaps`],sa(n));let r=x(e,[`mcpServers`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`mcpServers`],e)}let i=x(e,[`codeExecution`]);i!=null&&b(t,[`codeExecution`],i);let a=x(e,[`computerUse`]);if(a!=null&&b(t,[`computerUse`],a),x(e,[`enterpriseWebSearch`])!==void 0)throw Error(`enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`exaAiSearch`])!==void 0)throw Error(`exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let o=x(e,[`functionDeclarations`]);if(o!=null){let e=o;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`functionDeclarations`],e)}let s=x(e,[`googleSearch`]);s!=null&&b(t,[`googleSearch`],ca(s));let c=x(e,[`googleSearchRetrieval`]);if(c!=null&&b(t,[`googleSearchRetrieval`],c),x(e,[`parallelAiSearch`])!==void 0)throw Error(`parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let l=x(e,[`urlContext`]);l!=null&&b(t,[`urlContext`],l);let u=x(e,[`fileSearch`]);return u!=null&&b(t,[`fileSearch`],u),t}function Oa(e){let t={},n=x(e,[`retrieval`]);n!=null&&b(t,[`retrieval`],n);let r=x(e,[`googleMaps`]);r!=null&&b(t,[`googleMaps`],r);let i=x(e,[`mcpServers`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>va(e))),b(t,[`mcpServers`],e)}let a=x(e,[`codeExecution`]);a!=null&&b(t,[`codeExecution`],a);let o=x(e,[`computerUse`]);o!=null&&b(t,[`computerUse`],ta(o));let s=x(e,[`enterpriseWebSearch`]);s!=null&&b(t,[`enterpriseWebSearch`],s);let c=x(e,[`exaAiSearch`]);c!=null&&b(t,[`exaAiSearch`],c);let l=x(e,[`functionDeclarations`]);if(l!=null){let e=l;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`functionDeclarations`],e)}let u=x(e,[`googleSearch`]);u!=null&&b(t,[`googleSearch`],u);let d=x(e,[`googleSearchRetrieval`]);d!=null&&b(t,[`googleSearchRetrieval`],d);let f=x(e,[`parallelAiSearch`]);f!=null&&b(t,[`parallelAiSearch`],f);let p=x(e,[`urlContext`]);if(p!=null&&b(t,[`urlContext`],p),x(e,[`fileSearch`])!==void 0)throw Error(`fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return t}function ka(e){let t={},n=x(e,[`candidatesTokenCount`]);n!=null&&b(t,[`responseTokenCount`],n);let r=x(e,[`candidatesTokensDetails`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`responseTokensDetails`],e)}let i=x(e,[`cacheTokensDetails`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`cacheTokensDetails`],e)}let a=x(e,[`cachedContentTokenCount`]);a!=null&&b(t,[`cachedContentTokenCount`],a);let o=x(e,[`promptTokenCount`]);o!=null&&b(t,[`promptTokenCount`],o);let s=x(e,[`promptTokensDetails`]);if(s!=null){let e=s;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`promptTokensDetails`],e)}let c=x(e,[`thoughtsTokenCount`]);c!=null&&b(t,[`thoughtsTokenCount`],c);let l=x(e,[`toolUsePromptTokenCount`]);l!=null&&b(t,[`toolUsePromptTokenCount`],l);let u=x(e,[`toolUsePromptTokensDetails`]);if(u!=null){let e=u;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`toolUsePromptTokensDetails`],e)}let d=x(e,[`totalTokenCount`]);d!=null&&b(t,[`totalTokenCount`],d);let f=x(e,[`trafficType`]);return f!=null&&b(t,[`trafficType`],f),t}function Aa(e){let t={},n=x(e,[`type`]);n!=null&&b(t,[`voiceActivityType`],n);let r=x(e,[`audioOffset`]);return r!=null&&b(t,[`audioOffset`],r),t}function ja(e){let t={},n=x(e,[`replicatedVoiceConfig`]);n!=null&&b(t,[`replicatedVoiceConfig`],Sa(n));let r=x(e,[`prebuiltVoiceConfig`]);return r!=null&&b(t,[`prebuiltVoiceConfig`],r),t}function Ma(e,t){let n={},r=x(e,[`apiKey`]);if(r!=null&&b(n,[`apiKey`],r),x(e,[`apiKeyConfig`])!==void 0)throw Error(`apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`authType`])!==void 0)throw Error(`authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`googleServiceAccountConfig`])!==void 0)throw Error(`googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`httpBasicAuthConfig`])!==void 0)throw Error(`httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oauthConfig`])!==void 0)throw Error(`oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`oidcConfig`])!==void 0)throw Error(`oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function Na(e,t){let n={},r=x(e,[`data`]);if(r!=null&&b(n,[`data`],r),x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let i=x(e,[`mimeType`]);return i!=null&&b(n,[`mimeType`],i),n}function Pa(e,t){let n={},r=x(e,[`content`]);r!=null&&b(n,[`content`],r);let i=x(e,[`citationMetadata`]);i!=null&&b(n,[`citationMetadata`],Fa(i));let a=x(e,[`tokenCount`]);a!=null&&b(n,[`tokenCount`],a);let o=x(e,[`finishReason`]);o!=null&&b(n,[`finishReason`],o);let s=x(e,[`groundingMetadata`]);s!=null&&b(n,[`groundingMetadata`],s);let c=x(e,[`avgLogprobs`]);c!=null&&b(n,[`avgLogprobs`],c);let l=x(e,[`index`]);l!=null&&b(n,[`index`],l);let u=x(e,[`logprobsResult`]);u!=null&&b(n,[`logprobsResult`],u);let d=x(e,[`safetyRatings`]);if(d!=null){let e=d;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`safetyRatings`],e)}let f=x(e,[`urlContextMetadata`]);return f!=null&&b(n,[`urlContextMetadata`],f),n}function Fa(e,t){let n={},r=x(e,[`citationSources`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`citations`],e)}return n}function Ia(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`contents`]);if(a!=null){let e=P(a);Array.isArray(e)&&(e=e.map(e=>Ha(e))),b(r,[`contents`],e)}return r}function La(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`tokensInfo`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`tokensInfo`],e)}return n}function Ra(e,t){let n={},r=x(e,[`enablePromptInjectionDetection`]);r!=null&&b(n,[`enablePromptInjectionDetection`],r);let i=x(e,[`environment`]);i!=null&&b(n,[`environment`],i);let a=x(e,[`excludedPredefinedFunctions`]);if(a!=null&&b(n,[`excludedPredefinedFunctions`],a),x(e,[`disabledSafetyPolicies`])!==void 0)throw Error(`disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function za(e,t){let n={},r=x(e,[`values`]);r!=null&&b(n,[`values`],r);let i=x(e,[`statistics`]);return i!=null&&b(n,[`statistics`],Ba(i)),n}function Ba(e,t){let n={},r=x(e,[`truncated`]);r!=null&&b(n,[`truncated`],r);let i=x(e,[`token_count`]);i!=null&&b(n,[`tokenCount`],i);let a=x(e,[`tokensDetails`]);if(a!=null){let e=a;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`tokensDetails`],e)}return n}function Va(e,t){let n={},r=x(e,[`parts`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>rs(e))),b(n,[`parts`],e)}let i=x(e,[`role`]);return i!=null&&b(n,[`role`],i),n}function Ha(e,t){let n={},r=x(e,[`parts`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>is(e))),b(n,[`parts`],e)}let i=x(e,[`role`]);return i!=null&&b(n,[`role`],i),n}function Ua(e,t){let n={},r=x(e,[`controlType`]);r!=null&&b(n,[`controlType`],r);let i=x(e,[`enableControlImageComputation`]);return i!=null&&b(n,[`computeControl`],i),n}function Wa(e,t){let n={};if(x(e,[`systemInstruction`])!==void 0)throw Error(`systemInstruction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`tools`])!==void 0)throw Error(`tools parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`generationConfig`])!==void 0)throw Error(`generationConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function Ga(e,t,n){let r={},i=x(e,[`systemInstruction`]);t!==void 0&&i!=null&&b(t,[`systemInstruction`],Ha(N(i)));let a=x(e,[`tools`]);if(t!==void 0&&a!=null){let e=a;Array.isArray(e)&&(e=e.map(e=>ws(e))),b(t,[`tools`],e)}let o=x(e,[`generationConfig`]);return t!==void 0&&o!=null&&b(t,[`generationConfig`],Lo(o)),r}function Ka(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`contents`]);if(a!=null){let e=P(a);Array.isArray(e)&&(e=e.map(e=>Va(e))),b(r,[`contents`],e)}let o=x(t,[`config`]);return o!=null&&Wa(o),r}function qa(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`contents`]);if(a!=null){let e=P(a);Array.isArray(e)&&(e=e.map(e=>Ha(e))),b(r,[`contents`],e)}let o=x(t,[`config`]);return o!=null&&Ga(o,r),r}function Ja(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`totalTokens`]);i!=null&&b(n,[`totalTokens`],i);let a=x(e,[`cachedContentTokenCount`]);return a!=null&&b(n,[`cachedContentTokenCount`],a),n}function Ya(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`totalTokens`]);return i!=null&&b(n,[`totalTokens`],i),n}function Xa(e,t,n){let r={},i=x(t,[`model`]);return i!=null&&b(r,[`_url`,`name`],M(e,i)),r}function Za(e,t,n){let r={},i=x(t,[`model`]);return i!=null&&b(r,[`_url`,`name`],M(e,i)),r}function Qa(e,t){let n={},r=x(e,[`sdkHttpResponse`]);return r!=null&&b(n,[`sdkHttpResponse`],r),n}function $a(e,t){let n={},r=x(e,[`sdkHttpResponse`]);return r!=null&&b(n,[`sdkHttpResponse`],r),n}function eo(e,t,n){let r={},i=x(e,[`outputGcsUri`]);t!==void 0&&i!=null&&b(t,[`parameters`,`storageUri`],i);let a=x(e,[`negativePrompt`]);t!==void 0&&a!=null&&b(t,[`parameters`,`negativePrompt`],a);let o=x(e,[`numberOfImages`]);t!==void 0&&o!=null&&b(t,[`parameters`,`sampleCount`],o);let s=x(e,[`aspectRatio`]);t!==void 0&&s!=null&&b(t,[`parameters`,`aspectRatio`],s);let c=x(e,[`guidanceScale`]);t!==void 0&&c!=null&&b(t,[`parameters`,`guidanceScale`],c);let l=x(e,[`seed`]);t!==void 0&&l!=null&&b(t,[`parameters`,`seed`],l);let u=x(e,[`safetyFilterLevel`]);t!==void 0&&u!=null&&b(t,[`parameters`,`safetySetting`],u);let d=x(e,[`personGeneration`]);t!==void 0&&d!=null&&b(t,[`parameters`,`personGeneration`],d);let f=x(e,[`includeSafetyAttributes`]);t!==void 0&&f!=null&&b(t,[`parameters`,`includeSafetyAttributes`],f);let p=x(e,[`includeRaiReason`]);t!==void 0&&p!=null&&b(t,[`parameters`,`includeRaiReason`],p);let m=x(e,[`language`]);t!==void 0&&m!=null&&b(t,[`parameters`,`language`],m);let h=x(e,[`outputMimeType`]);t!==void 0&&h!=null&&b(t,[`parameters`,`outputOptions`,`mimeType`],h);let g=x(e,[`outputCompressionQuality`]);t!==void 0&&g!=null&&b(t,[`parameters`,`outputOptions`,`compressionQuality`],g);let _=x(e,[`addWatermark`]);t!==void 0&&_!=null&&b(t,[`parameters`,`addWatermark`],_);let v=x(e,[`labels`]);t!==void 0&&v!=null&&b(t,[`labels`],v);let y=x(e,[`editMode`]);t!==void 0&&y!=null&&b(t,[`parameters`,`editMode`],y);let S=x(e,[`baseSteps`]);return t!==void 0&&S!=null&&b(t,[`parameters`,`editConfig`,`baseSteps`],S),r}function to(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`prompt`]);a!=null&&b(r,[`instances[0]`,`prompt`],a);let o=x(t,[`referenceImages`]);if(o!=null){let e=o;Array.isArray(e)&&(e=e.map(e=>us(e))),b(r,[`instances[0]`,`referenceImages`],e)}let s=x(t,[`config`]);return s!=null&&eo(s,r),r}function no(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`predictions`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>No(e))),b(n,[`generatedImages`],e)}return n}function ro(e,t,n){let r={},i=x(e,[`taskType`]);t!==void 0&&i!=null&&b(t,[`requests[]`,`taskType`],i);let a=x(e,[`title`]);t!==void 0&&a!=null&&b(t,[`requests[]`,`title`],a);let o=x(e,[`outputDimensionality`]);if(t!==void 0&&o!=null&&b(t,[`requests[]`,`outputDimensionality`],o),x(e,[`mimeType`])!==void 0)throw Error(`mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`autoTruncate`])!==void 0)throw Error(`autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`documentOcr`])!==void 0)throw Error(`documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`audioTrackExtraction`])!==void 0)throw Error(`audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return r}function io(e,t,n){let r={},i=x(n,[`embeddingApiType`]);if(i===void 0&&(i=`PREDICT`),i===`PREDICT`){let n=x(e,[`taskType`]);t!==void 0&&n!=null&&b(t,[`instances[]`,`task_type`],n)}else if(i===`EMBED_CONTENT`){let n=x(e,[`taskType`]);t!==void 0&&n!=null&&b(t,[`embedContentConfig`,`taskType`],n)}let a=x(n,[`embeddingApiType`]);if(a===void 0&&(a=`PREDICT`),a===`PREDICT`){let n=x(e,[`title`]);t!==void 0&&n!=null&&b(t,[`instances[]`,`title`],n)}else if(a===`EMBED_CONTENT`){let n=x(e,[`title`]);t!==void 0&&n!=null&&b(t,[`embedContentConfig`,`title`],n)}let o=x(n,[`embeddingApiType`]);if(o===void 0&&(o=`PREDICT`),o===`PREDICT`){let n=x(e,[`outputDimensionality`]);t!==void 0&&n!=null&&b(t,[`parameters`,`outputDimensionality`],n)}else if(o===`EMBED_CONTENT`){let n=x(e,[`outputDimensionality`]);t!==void 0&&n!=null&&b(t,[`embedContentConfig`,`outputDimensionality`],n)}let s=x(n,[`embeddingApiType`]);if(s===void 0&&(s=`PREDICT`),s===`PREDICT`){let n=x(e,[`mimeType`]);t!==void 0&&n!=null&&b(t,[`instances[]`,`mimeType`],n)}let c=x(n,[`embeddingApiType`]);if(c===void 0&&(c=`PREDICT`),c===`PREDICT`){let n=x(e,[`autoTruncate`]);t!==void 0&&n!=null&&b(t,[`parameters`,`autoTruncate`],n)}else if(c===`EMBED_CONTENT`){let n=x(e,[`autoTruncate`]);t!==void 0&&n!=null&&b(t,[`embedContentConfig`,`autoTruncate`],n)}let l=x(n,[`embeddingApiType`]);if(l===void 0&&(l=`PREDICT`),l===`EMBED_CONTENT`){let n=x(e,[`documentOcr`]);t!==void 0&&n!=null&&b(t,[`embedContentConfig`,`documentOcr`],n)}let u=x(n,[`embeddingApiType`]);if(u===void 0&&(u=`PREDICT`),u===`EMBED_CONTENT`){let n=x(e,[`audioTrackExtraction`]);t!==void 0&&n!=null&&b(t,[`embedContentConfig`,`audioTrackExtraction`],n)}return r}function ao(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`contents`]);if(a!=null){let t=yn(e,a);Array.isArray(t)&&(t=t.map(e=>e)),b(r,[`requests[]`,`content`],t)}let o=x(t,[`content`]);o!=null&&Va(N(o));let s=x(t,[`config`]);s!=null&&ro(s,r);let c=x(t,[`model`]);return c!==void 0&&b(r,[`requests[]`,`model`],M(e,c)),r}function oo(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(n,[`embeddingApiType`]);if(a===void 0&&(a=`PREDICT`),a===`PREDICT`){let n=x(t,[`contents`]);if(n!=null){let t=yn(e,n);Array.isArray(t)&&(t=t.map(e=>e)),b(r,[`instances[]`,`content`],t)}}let o=x(n,[`embeddingApiType`]);if(o===void 0&&(o=`PREDICT`),o===`EMBED_CONTENT`){let e=x(t,[`content`]);e!=null&&b(r,[`content`],Ha(N(e)))}let s=x(t,[`config`]);return s!=null&&io(s,r,n),r}function so(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`embeddings`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`embeddings`],e)}let a=x(e,[`metadata`]);return a!=null&&b(n,[`metadata`],a),n}function co(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`predictions[]`,`embeddings`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>za(e))),b(n,[`embeddings`],e)}let a=x(e,[`metadata`]);if(a!=null&&b(n,[`metadata`],a),t&&x(t,[`embeddingApiType`])===`EMBED_CONTENT`){let t=x(e,[`embedding`]),r=x(e,[`usageMetadata`]),i=x(e,[`truncated`]);if(t){let e={};r&&r.promptTokenCount&&(e.tokenCount=r.promptTokenCount),r&&r.promptTokensDetails&&(e.tokensDetails=r.promptTokensDetails),i&&(e.truncated=i),t.statistics=e,b(n,[`embeddings`],[t])}}return n}function lo(e,t){let n={},r=x(e,[`endpoint`]);r!=null&&b(n,[`name`],r);let i=x(e,[`deployedModelId`]);return i!=null&&b(n,[`deployedModelId`],i),n}function uo(e,t){let n={};if(x(e,[`displayName`])!==void 0)throw Error(`displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`fileUri`]);r!=null&&b(n,[`fileUri`],r);let i=x(e,[`mimeType`]);return i!=null&&b(n,[`mimeType`],i),n}function fo(e,t){let n={},r=x(e,[`args`]);r!=null&&b(n,[`args`],r);let i=x(e,[`id`]);i!=null&&b(n,[`id`],i);let a=x(e,[`name`]);if(a!=null&&b(n,[`name`],a),x(e,[`partialArgs`])!==void 0)throw Error(`partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`willContinue`])!==void 0)throw Error(`willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function po(e,t){let n={},r=x(e,[`allowedFunctionNames`]);r!=null&&b(n,[`allowedFunctionNames`],r);let i=x(e,[`mode`]);if(i!=null&&b(n,[`mode`],i),x(e,[`streamFunctionCallArguments`])!==void 0)throw Error(`streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function mo(e,t,n,r){let i={},a=x(t,[`serviceTier`]);n!==void 0&&a!=null&&b(n,[`serviceTier`],a);let o=x(t,[`systemInstruction`]);n!==void 0&&o!=null&&b(n,[`systemInstruction`],Va(N(o)));let s=x(t,[`temperature`]);s!=null&&b(i,[`temperature`],s);let c=x(t,[`topP`]);c!=null&&b(i,[`topP`],c);let l=x(t,[`topK`]);l!=null&&b(i,[`topK`],l);let u=x(t,[`candidateCount`]);u!=null&&b(i,[`candidateCount`],u);let d=x(t,[`maxOutputTokens`]);d!=null&&b(i,[`maxOutputTokens`],d);let f=x(t,[`stopSequences`]);f!=null&&b(i,[`stopSequences`],f);let p=x(t,[`responseLogprobs`]);p!=null&&b(i,[`responseLogprobs`],p);let m=x(t,[`logprobs`]);m!=null&&b(i,[`logprobs`],m);let h=x(t,[`presencePenalty`]);h!=null&&b(i,[`presencePenalty`],h);let g=x(t,[`frequencyPenalty`]);g!=null&&b(i,[`frequencyPenalty`],g);let _=x(t,[`seed`]);_!=null&&b(i,[`seed`],_);let v=x(t,[`responseMimeType`]);v!=null&&b(i,[`responseMimeType`],v);let y=x(t,[`responseSchema`]);y!=null&&b(i,[`responseSchema`],Sn(y));let S=x(t,[`responseJsonSchema`]);if(S!=null&&b(i,[`responseJsonSchema`],Cn(S)),x(t,[`routingConfig`])!==void 0)throw Error(`routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(t,[`modelSelectionConfig`])!==void 0)throw Error(`modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let C=x(t,[`safetySettings`]);if(n!==void 0&&C!=null){let e=C;Array.isArray(e)&&(e=e.map(e=>ps(e))),b(n,[`safetySettings`],e)}let w=x(t,[`tools`]);if(n!==void 0&&w!=null){let e=Dn(w);Array.isArray(e)&&(e=e.map(e=>Cs(En(e)))),b(n,[`tools`],e)}let T=x(t,[`toolConfig`]);if(n!==void 0&&T!=null&&b(n,[`toolConfig`],xs(T)),x(t,[`labels`])!==void 0)throw Error(`labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let E=x(t,[`cachedContent`]);n!==void 0&&E!=null&&b(n,[`cachedContent`],kn(e,E));let D=x(t,[`responseModalities`]);D!=null&&b(i,[`responseModalities`],D);let O=x(t,[`mediaResolution`]);O!=null&&b(i,[`mediaResolution`],O);let k=x(t,[`speechConfig`]);if(k!=null&&b(i,[`speechConfig`],wn(k)),x(t,[`audioTimestamp`])!==void 0)throw Error(`audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let A=x(t,[`thinkingConfig`]);A!=null&&b(i,[`thinkingConfig`],A);let ee=x(t,[`audioTranscriptionConfig`]);ee!=null&&b(i,[`audioTranscriptionConfig`],ee);let te=x(t,[`imageConfig`]);te!=null&&b(i,[`imageConfig`],Ho(te));let ne=x(t,[`enableEnhancedCivicAnswers`]);if(ne!=null&&b(i,[`enableEnhancedCivicAnswers`],ne),x(t,[`modelArmorConfig`])!==void 0)throw Error(`modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return i}function ho(e,t,n,r){let i={},a=x(t,[`serviceTier`]);n!==void 0&&a!=null&&b(n,[`serviceTier`],a);let o=x(t,[`systemInstruction`]);n!==void 0&&o!=null&&b(n,[`systemInstruction`],Ha(N(o)));let s=x(t,[`temperature`]);s!=null&&b(i,[`temperature`],s);let c=x(t,[`topP`]);c!=null&&b(i,[`topP`],c);let l=x(t,[`topK`]);l!=null&&b(i,[`topK`],l);let u=x(t,[`candidateCount`]);u!=null&&b(i,[`candidateCount`],u);let d=x(t,[`maxOutputTokens`]);d!=null&&b(i,[`maxOutputTokens`],d);let f=x(t,[`stopSequences`]);f!=null&&b(i,[`stopSequences`],f);let p=x(t,[`responseLogprobs`]);p!=null&&b(i,[`responseLogprobs`],p);let m=x(t,[`logprobs`]);m!=null&&b(i,[`logprobs`],m);let h=x(t,[`presencePenalty`]);h!=null&&b(i,[`presencePenalty`],h);let g=x(t,[`frequencyPenalty`]);g!=null&&b(i,[`frequencyPenalty`],g);let _=x(t,[`seed`]);_!=null&&b(i,[`seed`],_);let v=x(t,[`responseMimeType`]);v!=null&&b(i,[`responseMimeType`],v);let y=x(t,[`responseSchema`]);y!=null&&b(i,[`responseSchema`],Sn(y));let S=x(t,[`responseJsonSchema`]);S!=null&&b(i,[`responseJsonSchema`],Cn(S));let C=x(t,[`routingConfig`]);C!=null&&b(i,[`routingConfig`],C);let w=x(t,[`modelSelectionConfig`]);w!=null&&b(i,[`modelConfig`],w);let T=x(t,[`safetySettings`]);if(n!==void 0&&T!=null){let e=T;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`safetySettings`],e)}let E=x(t,[`tools`]);if(n!==void 0&&E!=null){let e=Dn(E);Array.isArray(e)&&(e=e.map(e=>ws(En(e)))),b(n,[`tools`],e)}let D=x(t,[`toolConfig`]);n!==void 0&&D!=null&&b(n,[`toolConfig`],Ss(D));let O=x(t,[`labels`]);n!==void 0&&O!=null&&b(n,[`labels`],O);let k=x(t,[`cachedContent`]);n!==void 0&&k!=null&&b(n,[`cachedContent`],kn(e,k));let A=x(t,[`responseModalities`]);A!=null&&b(i,[`responseModalities`],A);let ee=x(t,[`mediaResolution`]);ee!=null&&b(i,[`mediaResolution`],ee);let te=x(t,[`speechConfig`]);te!=null&&b(i,[`speechConfig`],bs(wn(te)));let ne=x(t,[`audioTimestamp`]);ne!=null&&b(i,[`audioTimestamp`],ne);let re=x(t,[`thinkingConfig`]);re!=null&&b(i,[`thinkingConfig`],re);let ie=x(t,[`audioTranscriptionConfig`]);ie!=null&&b(i,[`audioTranscriptionConfig`],ie);let ae=x(t,[`imageConfig`]);if(ae!=null&&b(i,[`imageConfig`],Uo(ae)),x(t,[`enableEnhancedCivicAnswers`])!==void 0)throw Error(`enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let oe=x(t,[`modelArmorConfig`]);return n!==void 0&&oe!=null&&b(n,[`modelArmorConfig`],oe),i}function go(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`contents`]);if(a!=null){let e=P(a);Array.isArray(e)&&(e=e.map(e=>Va(e))),b(r,[`contents`],e)}let o=x(t,[`config`]);return o!=null&&b(r,[`generationConfig`],mo(e,o,r)),r}function _o(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`contents`]);if(a!=null){let e=P(a);Array.isArray(e)&&(e=e.map(e=>Ha(e))),b(r,[`contents`],e)}let o=x(t,[`config`]);return o!=null&&b(r,[`generationConfig`],ho(e,o,r)),r}function vo(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`candidates`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>Pa(e))),b(n,[`candidates`],e)}let a=x(e,[`modelVersion`]);a!=null&&b(n,[`modelVersion`],a);let o=x(e,[`promptFeedback`]);o!=null&&b(n,[`promptFeedback`],o);let s=x(e,[`responseId`]);s!=null&&b(n,[`responseId`],s);let c=x(e,[`usageMetadata`]);c!=null&&b(n,[`usageMetadata`],c);let l=x(e,[`modelStatus`]);return l!=null&&b(n,[`modelStatus`],l),n}function yo(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`candidates`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`candidates`],e)}let a=x(e,[`createTime`]);a!=null&&b(n,[`createTime`],a);let o=x(e,[`modelVersion`]);o!=null&&b(n,[`modelVersion`],o);let s=x(e,[`promptFeedback`]);s!=null&&b(n,[`promptFeedback`],s);let c=x(e,[`responseId`]);c!=null&&b(n,[`responseId`],c);let l=x(e,[`usageMetadata`]);return l!=null&&b(n,[`usageMetadata`],l),n}function bo(e,t,n){let r={},i=x(e,[`outputGcsUri`]);t!==void 0&&i!=null&&b(t,[`parameters`,`storageUri`],i);let a=x(e,[`negativePrompt`]);t!==void 0&&a!=null&&b(t,[`parameters`,`negativePrompt`],a);let o=x(e,[`numberOfImages`]);t!==void 0&&o!=null&&b(t,[`parameters`,`sampleCount`],o);let s=x(e,[`aspectRatio`]);t!==void 0&&s!=null&&b(t,[`parameters`,`aspectRatio`],s);let c=x(e,[`guidanceScale`]);t!==void 0&&c!=null&&b(t,[`parameters`,`guidanceScale`],c);let l=x(e,[`seed`]);t!==void 0&&l!=null&&b(t,[`parameters`,`seed`],l);let u=x(e,[`safetyFilterLevel`]);t!==void 0&&u!=null&&b(t,[`parameters`,`safetySetting`],u);let d=x(e,[`personGeneration`]);t!==void 0&&d!=null&&b(t,[`parameters`,`personGeneration`],d);let f=x(e,[`includeSafetyAttributes`]);t!==void 0&&f!=null&&b(t,[`parameters`,`includeSafetyAttributes`],f);let p=x(e,[`includeRaiReason`]);t!==void 0&&p!=null&&b(t,[`parameters`,`includeRaiReason`],p);let m=x(e,[`language`]);t!==void 0&&m!=null&&b(t,[`parameters`,`language`],m);let h=x(e,[`outputMimeType`]);t!==void 0&&h!=null&&b(t,[`parameters`,`outputOptions`,`mimeType`],h);let g=x(e,[`outputCompressionQuality`]);t!==void 0&&g!=null&&b(t,[`parameters`,`outputOptions`,`compressionQuality`],g);let _=x(e,[`addWatermark`]);t!==void 0&&_!=null&&b(t,[`parameters`,`addWatermark`],_);let v=x(e,[`labels`]);t!==void 0&&v!=null&&b(t,[`labels`],v);let y=x(e,[`imageSize`]);t!==void 0&&y!=null&&b(t,[`parameters`,`sampleImageSize`],y);let S=x(e,[`enhancePrompt`]);return t!==void 0&&S!=null&&b(t,[`parameters`,`enhancePrompt`],S),r}function xo(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`prompt`]);a!=null&&b(r,[`instances[0]`,`prompt`],a);let o=x(t,[`config`]);return o!=null&&bo(o,r),r}function So(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`predictions`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>No(e))),b(n,[`generatedImages`],e)}let a=x(e,[`positivePromptSafetyAttributes`]);return a!=null&&b(n,[`positivePromptSafetyAttributes`],fs(a)),n}function Co(e,t,n){let r={},i=x(e,[`numberOfVideos`]);if(t!==void 0&&i!=null&&b(t,[`parameters`,`sampleCount`],i),x(e,[`outputGcsUri`])!==void 0)throw Error(`outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`fps`])!==void 0)throw Error(`fps parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let a=x(e,[`durationSeconds`]);if(t!==void 0&&a!=null&&b(t,[`parameters`,`durationSeconds`],a),x(e,[`seed`])!==void 0)throw Error(`seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let o=x(e,[`aspectRatio`]);t!==void 0&&o!=null&&b(t,[`parameters`,`aspectRatio`],o);let s=x(e,[`resolution`]);t!==void 0&&s!=null&&b(t,[`parameters`,`resolution`],s);let c=x(e,[`personGeneration`]);if(t!==void 0&&c!=null&&b(t,[`parameters`,`personGeneration`],c),x(e,[`pubsubTopic`])!==void 0)throw Error(`pubsubTopic parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let l=x(e,[`negativePrompt`]);t!==void 0&&l!=null&&b(t,[`parameters`,`negativePrompt`],l);let u=x(e,[`enhancePrompt`]);if(t!==void 0&&u!=null&&b(t,[`parameters`,`enhancePrompt`],u),x(e,[`generateAudio`])!==void 0)throw Error(`generateAudio parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let d=x(e,[`lastFrame`]);t!==void 0&&d!=null&&b(t,[`instances[0]`,`lastFrame`],Go(d));let f=x(e,[`referenceImages`]);if(t!==void 0&&f!=null){let e=f;Array.isArray(e)&&(e=e.map(e=>Ls(e))),b(t,[`instances[0]`,`referenceImages`],e)}if(x(e,[`mask`])!==void 0)throw Error(`mask parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`compressionQuality`])!==void 0)throw Error(`compressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`labels`])!==void 0)throw Error(`labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let p=x(e,[`webhookConfig`]);if(t!==void 0&&p!=null&&b(t,[`webhookConfig`],p),x(e,[`resizeMode`])!==void 0)throw Error(`resizeMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return r}function wo(e,t,n){let r={},i=x(e,[`numberOfVideos`]);t!==void 0&&i!=null&&b(t,[`parameters`,`sampleCount`],i);let a=x(e,[`outputGcsUri`]);t!==void 0&&a!=null&&b(t,[`parameters`,`storageUri`],a);let o=x(e,[`fps`]);t!==void 0&&o!=null&&b(t,[`parameters`,`fps`],o);let s=x(e,[`durationSeconds`]);t!==void 0&&s!=null&&b(t,[`parameters`,`durationSeconds`],s);let c=x(e,[`seed`]);t!==void 0&&c!=null&&b(t,[`parameters`,`seed`],c);let l=x(e,[`aspectRatio`]);t!==void 0&&l!=null&&b(t,[`parameters`,`aspectRatio`],l);let u=x(e,[`resolution`]);t!==void 0&&u!=null&&b(t,[`parameters`,`resolution`],u);let d=x(e,[`personGeneration`]);t!==void 0&&d!=null&&b(t,[`parameters`,`personGeneration`],d);let f=x(e,[`pubsubTopic`]);t!==void 0&&f!=null&&b(t,[`parameters`,`pubsubTopic`],f);let p=x(e,[`negativePrompt`]);t!==void 0&&p!=null&&b(t,[`parameters`,`negativePrompt`],p);let m=x(e,[`enhancePrompt`]);t!==void 0&&m!=null&&b(t,[`parameters`,`enhancePrompt`],m);let h=x(e,[`generateAudio`]);t!==void 0&&h!=null&&b(t,[`parameters`,`generateAudio`],h);let g=x(e,[`lastFrame`]);t!==void 0&&g!=null&&b(t,[`instances[0]`,`lastFrame`],L(g));let _=x(e,[`referenceImages`]);if(t!==void 0&&_!=null){let e=_;Array.isArray(e)&&(e=e.map(e=>Rs(e))),b(t,[`instances[0]`,`referenceImages`],e)}let v=x(e,[`mask`]);t!==void 0&&v!=null&&b(t,[`instances[0]`,`mask`],Is(v));let y=x(e,[`compressionQuality`]);t!==void 0&&y!=null&&b(t,[`parameters`,`compressionQuality`],y);let S=x(e,[`labels`]);if(t!==void 0&&S!=null&&b(t,[`labels`],S),x(e,[`webhookConfig`])!==void 0)throw Error(`webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let C=x(e,[`resizeMode`]);return t!==void 0&&C!=null&&b(t,[`parameters`,`resizeMode`],C),r}function To(e,t){let n={},r=x(e,[`name`]);r!=null&&b(n,[`name`],r);let i=x(e,[`metadata`]);i!=null&&b(n,[`metadata`],i);let a=x(e,[`done`]);a!=null&&b(n,[`done`],a);let o=x(e,[`error`]);o!=null&&b(n,[`error`],o);let s=x(e,[`response`,`generateVideoResponse`]);return s!=null&&b(n,[`response`],ko(s)),n}function Eo(e,t){let n={},r=x(e,[`name`]);r!=null&&b(n,[`name`],r);let i=x(e,[`metadata`]);i!=null&&b(n,[`metadata`],i);let a=x(e,[`done`]);a!=null&&b(n,[`done`],a);let o=x(e,[`error`]);o!=null&&b(n,[`error`],o);let s=x(e,[`response`]);return s!=null&&b(n,[`response`],Ao(s)),n}function Do(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`prompt`]);a!=null&&b(r,[`instances[0]`,`prompt`],a);let o=x(t,[`image`]);o!=null&&b(r,[`instances[0]`,`image`],Go(o));let s=x(t,[`video`]);s!=null&&b(r,[`instances[0]`,`video`],zs(s));let c=x(t,[`source`]);c!=null&&jo(c,r);let l=x(t,[`config`]);return l!=null&&Co(l,r),r}function Oo(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`prompt`]);a!=null&&b(r,[`instances[0]`,`prompt`],a);let o=x(t,[`image`]);o!=null&&b(r,[`instances[0]`,`image`],L(o));let s=x(t,[`video`]);s!=null&&b(r,[`instances[0]`,`video`],Bs(s));let c=x(t,[`source`]);c!=null&&Mo(c,r);let l=x(t,[`config`]);return l!=null&&wo(l,r),r}function ko(e,t){let n={},r=x(e,[`generatedSamples`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>Fo(e))),b(n,[`generatedVideos`],e)}let i=x(e,[`raiMediaFilteredCount`]);i!=null&&b(n,[`raiMediaFilteredCount`],i);let a=x(e,[`raiMediaFilteredReasons`]);return a!=null&&b(n,[`raiMediaFilteredReasons`],a),n}function Ao(e,t){let n={},r=x(e,[`videos`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>Io(e))),b(n,[`generatedVideos`],e)}let i=x(e,[`raiMediaFilteredCount`]);i!=null&&b(n,[`raiMediaFilteredCount`],i);let a=x(e,[`raiMediaFilteredReasons`]);return a!=null&&b(n,[`raiMediaFilteredReasons`],a),n}function jo(e,t,n){let r={},i=x(e,[`prompt`]);t!==void 0&&i!=null&&b(t,[`instances[0]`,`prompt`],i);let a=x(e,[`image`]);t!==void 0&&a!=null&&b(t,[`instances[0]`,`image`],Go(a));let o=x(e,[`video`]);return t!==void 0&&o!=null&&b(t,[`instances[0]`,`video`],zs(o)),r}function Mo(e,t,n){let r={},i=x(e,[`prompt`]);t!==void 0&&i!=null&&b(t,[`instances[0]`,`prompt`],i);let a=x(e,[`image`]);t!==void 0&&a!=null&&b(t,[`instances[0]`,`image`],L(a));let o=x(e,[`video`]);return t!==void 0&&o!=null&&b(t,[`instances[0]`,`video`],Bs(o)),r}function No(e,t){let n={},r=x(e,[`_self`]);r!=null&&b(n,[`image`],Wo(r));let i=x(e,[`raiFilteredReason`]);i!=null&&b(n,[`raiFilteredReason`],i);let a=x(e,[`_self`]);a!=null&&b(n,[`safetyAttributes`],fs(a));let o=x(e,[`prompt`]);return o!=null&&b(n,[`enhancedPrompt`],o),n}function Po(e,t){let n={},r=x(e,[`_self`]);r!=null&&b(n,[`mask`],Wo(r));let i=x(e,[`labels`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`labels`],e)}return n}function Fo(e,t){let n={},r=x(e,[`video`]);return r!=null&&b(n,[`video`],Ps(r)),n}function Io(e,t){let n={},r=x(e,[`_self`]);return r!=null&&b(n,[`video`],Fs(r)),n}function Lo(e,t){let n={},r=x(e,[`modelSelectionConfig`]);r!=null&&b(n,[`modelConfig`],r);let i=x(e,[`responseJsonSchema`]);i!=null&&b(n,[`responseJsonSchema`],Cn(i));let a=x(e,[`audioTranscriptionConfig`]);a!=null&&b(n,[`audioTranscriptionConfig`],a);let o=x(e,[`audioTimestamp`]);o!=null&&b(n,[`audioTimestamp`],o);let s=x(e,[`candidateCount`]);s!=null&&b(n,[`candidateCount`],s);let c=x(e,[`enableAffectiveDialog`]);c!=null&&b(n,[`enableAffectiveDialog`],c);let l=x(e,[`frequencyPenalty`]);l!=null&&b(n,[`frequencyPenalty`],l);let u=x(e,[`logprobs`]);u!=null&&b(n,[`logprobs`],u);let d=x(e,[`maxOutputTokens`]);d!=null&&b(n,[`maxOutputTokens`],d);let f=x(e,[`mediaResolution`]);f!=null&&b(n,[`mediaResolution`],f);let p=x(e,[`presencePenalty`]);p!=null&&b(n,[`presencePenalty`],p);let m=x(e,[`responseFormat`]);if(m!=null){let e=m;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`responseFormat`],e)}let h=x(e,[`responseLogprobs`]);h!=null&&b(n,[`responseLogprobs`],h);let g=x(e,[`responseMimeType`]);g!=null&&b(n,[`responseMimeType`],g);let _=x(e,[`responseModalities`]);_!=null&&b(n,[`responseModalities`],_);let v=x(e,[`responseSchema`]);v!=null&&b(n,[`responseSchema`],v);let y=x(e,[`routingConfig`]);y!=null&&b(n,[`routingConfig`],y);let S=x(e,[`seed`]);S!=null&&b(n,[`seed`],S);let C=x(e,[`speechConfig`]);C!=null&&b(n,[`speechConfig`],bs(C));let w=x(e,[`stopSequences`]);w!=null&&b(n,[`stopSequences`],w);let T=x(e,[`temperature`]);T!=null&&b(n,[`temperature`],T);let E=x(e,[`thinkingConfig`]);E!=null&&b(n,[`thinkingConfig`],E);let D=x(e,[`topK`]);D!=null&&b(n,[`topK`],D);let O=x(e,[`topP`]);if(O!=null&&b(n,[`topP`],O),x(e,[`enableEnhancedCivicAnswers`])!==void 0)throw Error(`enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`translationConfig`])!==void 0)throw Error(`translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function Ro(e,t,n){let r={},i=x(t,[`model`]);return i!=null&&b(r,[`_url`,`name`],M(e,i)),r}function zo(e,t,n){let r={},i=x(t,[`model`]);return i!=null&&b(r,[`_url`,`name`],M(e,i)),r}function Bo(e,t){let n={},r=x(e,[`authConfig`]);r!=null&&b(n,[`authConfig`],Ma(r));let i=x(e,[`enableWidget`]);if(i!=null&&b(n,[`enableWidget`],i),x(e,[`groundingTypes`])!==void 0)throw Error(`groundingTypes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function Vo(e,t){let n={};if(x(e,[`blockingConfidence`])!==void 0)throw Error(`blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`excludeDomains`])!==void 0)throw Error(`excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`searchTypes`]);r!=null&&b(n,[`searchTypes`],r);let i=x(e,[`timeRangeFilter`]);return i!=null&&b(n,[`timeRangeFilter`],i),n}function Ho(e,t){let n={},r=x(e,[`aspectRatio`]);r!=null&&b(n,[`aspectRatio`],r);let i=x(e,[`imageSize`]);if(i!=null&&b(n,[`imageSize`],i),x(e,[`personGeneration`])!==void 0)throw Error(`personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`outputMimeType`])!==void 0)throw Error(`outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`outputCompressionQuality`])!==void 0)throw Error(`outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`imageOutputOptions`])!==void 0)throw Error(`imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`prominentPeople`])!==void 0)throw Error(`prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);return n}function Uo(e,t){let n={},r=x(e,[`aspectRatio`]);r!=null&&b(n,[`aspectRatio`],r);let i=x(e,[`imageSize`]);i!=null&&b(n,[`imageSize`],i);let a=x(e,[`personGeneration`]);a!=null&&b(n,[`personGeneration`],a);let o=x(e,[`outputMimeType`]);o!=null&&b(n,[`imageOutputOptions`,`mimeType`],o);let s=x(e,[`outputCompressionQuality`]);s!=null&&b(n,[`imageOutputOptions`,`compressionQuality`],s);let c=x(e,[`imageOutputOptions`]);c!=null&&b(n,[`imageOutputOptions`],c);let l=x(e,[`prominentPeople`]);return l!=null&&b(n,[`prominentPeople`],l),n}function Wo(e,t){let n={},r=x(e,[`gcsUri`]);r!=null&&b(n,[`gcsUri`],r);let i=x(e,[`bytesBase64Encoded`]);i!=null&&b(n,[`imageBytes`],jn(i));let a=x(e,[`mimeType`]);return a!=null&&b(n,[`mimeType`],a),n}function Go(e,t){let n={};if(x(e,[`gcsUri`])!==void 0)throw Error(`gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`imageBytes`]);r!=null&&b(n,[`bytesBase64Encoded`],jn(r));let i=x(e,[`mimeType`]);return i!=null&&b(n,[`mimeType`],i),n}function L(e,t){let n={},r=x(e,[`gcsUri`]);r!=null&&b(n,[`gcsUri`],r);let i=x(e,[`imageBytes`]);i!=null&&b(n,[`bytesBase64Encoded`],jn(i));let a=x(e,[`mimeType`]);return a!=null&&b(n,[`mimeType`],a),n}function Ko(e,t,n,r){let i={},a=x(t,[`pageSize`]);n!==void 0&&a!=null&&b(n,[`_query`,`pageSize`],a);let o=x(t,[`pageToken`]);n!==void 0&&o!=null&&b(n,[`_query`,`pageToken`],o);let s=x(t,[`filter`]);n!==void 0&&s!=null&&b(n,[`_query`,`filter`],s);let c=x(t,[`queryBase`]);return n!==void 0&&c!=null&&b(n,[`_url`,`models_url`],In(e,c)),i}function qo(e,t,n,r){let i={},a=x(t,[`pageSize`]);n!==void 0&&a!=null&&b(n,[`_query`,`pageSize`],a);let o=x(t,[`pageToken`]);n!==void 0&&o!=null&&b(n,[`_query`,`pageToken`],o);let s=x(t,[`filter`]);n!==void 0&&s!=null&&b(n,[`_query`,`filter`],s);let c=x(t,[`queryBase`]);return n!==void 0&&c!=null&&b(n,[`_url`,`models_url`],In(e,c)),i}function Jo(e,t,n){let r={},i=x(t,[`config`]);return i!=null&&Ko(e,i,r),r}function Yo(e,t,n){let r={},i=x(t,[`config`]);return i!=null&&qo(e,i,r),r}function Xo(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`nextPageToken`]);i!=null&&b(n,[`nextPageToken`],i);let a=x(e,[`_self`]);if(a!=null){let e=Ln(a);Array.isArray(e)&&(e=e.map(e=>es(e))),b(n,[`models`],e)}return n}function Zo(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`nextPageToken`]);i!=null&&b(n,[`nextPageToken`],i);let a=x(e,[`_self`]);if(a!=null){let e=Ln(a);Array.isArray(e)&&(e=e.map(e=>ts(e))),b(n,[`models`],e)}return n}function Qo(e,t){let n={},r=x(e,[`maskMode`]);r!=null&&b(n,[`maskMode`],r);let i=x(e,[`segmentationClasses`]);i!=null&&b(n,[`maskClasses`],i);let a=x(e,[`maskDilation`]);return a!=null&&b(n,[`dilation`],a),n}function $o(e,t){let n={};if(x(e,[`name`])!==void 0)throw Error(`name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`streamableHttpTransport`])!==void 0)throw Error(`streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function es(e,t){let n={},r=x(e,[`name`]);r!=null&&b(n,[`name`],r);let i=x(e,[`displayName`]);i!=null&&b(n,[`displayName`],i);let a=x(e,[`description`]);a!=null&&b(n,[`description`],a);let o=x(e,[`version`]);o!=null&&b(n,[`version`],o);let s=x(e,[`_self`]);s!=null&&b(n,[`tunedModelInfo`],Ts(s));let c=x(e,[`inputTokenLimit`]);c!=null&&b(n,[`inputTokenLimit`],c);let l=x(e,[`outputTokenLimit`]);l!=null&&b(n,[`outputTokenLimit`],l);let u=x(e,[`supportedGenerationMethods`]);u!=null&&b(n,[`supportedActions`],u);let d=x(e,[`temperature`]);d!=null&&b(n,[`temperature`],d);let f=x(e,[`maxTemperature`]);f!=null&&b(n,[`maxTemperature`],f);let p=x(e,[`topP`]);p!=null&&b(n,[`topP`],p);let m=x(e,[`topK`]);m!=null&&b(n,[`topK`],m);let h=x(e,[`thinking`]);return h!=null&&b(n,[`thinking`],h),n}function ts(e,t){let n={},r=x(e,[`name`]);r!=null&&b(n,[`name`],r);let i=x(e,[`displayName`]);i!=null&&b(n,[`displayName`],i);let a=x(e,[`description`]);a!=null&&b(n,[`description`],a);let o=x(e,[`versionId`]);o!=null&&b(n,[`version`],o);let s=x(e,[`deployedModels`]);if(s!=null){let e=s;Array.isArray(e)&&(e=e.map(e=>lo(e))),b(n,[`endpoints`],e)}let c=x(e,[`labels`]);c!=null&&b(n,[`labels`],c);let l=x(e,[`_self`]);l!=null&&b(n,[`tunedModelInfo`],Es(l));let u=x(e,[`defaultCheckpointId`]);u!=null&&b(n,[`defaultCheckpointId`],u);let d=x(e,[`checkpoints`]);if(d!=null){let e=d;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`checkpoints`],e)}return n}function ns(e,t){let n={},r=x(e,[`speakerVoiceConfigs`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>ys(e))),b(n,[`speakerVoiceConfigs`],e)}return n}function rs(e,t){let n={},r=x(e,[`mediaResolution`]);r!=null&&b(n,[`mediaResolution`],r);let i=x(e,[`toolCall`]);i!=null&&b(n,[`toolCall`],i);let a=x(e,[`toolResponse`]);a!=null&&b(n,[`toolResponse`],a);let o=x(e,[`audioTranscription`]);o!=null&&b(n,[`audioTranscription`],o);let s=x(e,[`codeExecutionResult`]);s!=null&&b(n,[`codeExecutionResult`],s);let c=x(e,[`executableCode`]);c!=null&&b(n,[`executableCode`],c);let l=x(e,[`fileData`]);l!=null&&b(n,[`fileData`],uo(l));let u=x(e,[`functionCall`]);u!=null&&b(n,[`functionCall`],fo(u));let d=x(e,[`functionResponse`]);d!=null&&b(n,[`functionResponse`],d);let f=x(e,[`inlineData`]);f!=null&&b(n,[`inlineData`],Na(f));let p=x(e,[`text`]);p!=null&&b(n,[`text`],p);let m=x(e,[`thought`]);m!=null&&b(n,[`thought`],m);let h=x(e,[`thoughtSignature`]);h!=null&&b(n,[`thoughtSignature`],h);let g=x(e,[`videoMetadata`]);g!=null&&b(n,[`videoMetadata`],g);let _=x(e,[`partMetadata`]);_!=null&&b(n,[`partMetadata`],_);let v=x(e,[`mediaProcessing`]);return v!=null&&b(n,[`mediaProcessing`],v),n}function is(e,t){let n={},r=x(e,[`mediaResolution`]);if(r!=null&&b(n,[`mediaResolution`],r),x(e,[`toolCall`])!==void 0)throw Error(`toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`toolResponse`])!==void 0)throw Error(`toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let i=x(e,[`audioTranscription`]);i!=null&&b(n,[`audioTranscription`],i);let a=x(e,[`codeExecutionResult`]);a!=null&&b(n,[`codeExecutionResult`],a);let o=x(e,[`executableCode`]);o!=null&&b(n,[`executableCode`],o);let s=x(e,[`fileData`]);s!=null&&b(n,[`fileData`],s);let c=x(e,[`functionCall`]);c!=null&&b(n,[`functionCall`],c);let l=x(e,[`functionResponse`]);l!=null&&b(n,[`functionResponse`],l);let u=x(e,[`inlineData`]);u!=null&&b(n,[`inlineData`],u);let d=x(e,[`text`]);d!=null&&b(n,[`text`],d);let f=x(e,[`thought`]);f!=null&&b(n,[`thought`],f);let p=x(e,[`thoughtSignature`]);p!=null&&b(n,[`thoughtSignature`],p);let m=x(e,[`videoMetadata`]);if(m!=null&&b(n,[`videoMetadata`],m),x(e,[`partMetadata`])!==void 0)throw Error(`partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);let h=x(e,[`mediaProcessing`]);return h!=null&&b(n,[`mediaProcessing`],h),n}function as(e,t){let n={},r=x(e,[`productImage`]);return r!=null&&b(n,[`image`],L(r)),n}function os(e,t,n){let r={},i=x(e,[`numberOfImages`]);t!==void 0&&i!=null&&b(t,[`parameters`,`sampleCount`],i);let a=x(e,[`baseSteps`]);t!==void 0&&a!=null&&b(t,[`parameters`,`baseSteps`],a);let o=x(e,[`outputGcsUri`]);t!==void 0&&o!=null&&b(t,[`parameters`,`storageUri`],o);let s=x(e,[`seed`]);t!==void 0&&s!=null&&b(t,[`parameters`,`seed`],s);let c=x(e,[`safetyFilterLevel`]);t!==void 0&&c!=null&&b(t,[`parameters`,`safetySetting`],c);let l=x(e,[`personGeneration`]);t!==void 0&&l!=null&&b(t,[`parameters`,`personGeneration`],l);let u=x(e,[`addWatermark`]);t!==void 0&&u!=null&&b(t,[`parameters`,`addWatermark`],u);let d=x(e,[`outputMimeType`]);t!==void 0&&d!=null&&b(t,[`parameters`,`outputOptions`,`mimeType`],d);let f=x(e,[`outputCompressionQuality`]);t!==void 0&&f!=null&&b(t,[`parameters`,`outputOptions`,`compressionQuality`],f);let p=x(e,[`enhancePrompt`]);t!==void 0&&p!=null&&b(t,[`parameters`,`enhancePrompt`],p);let m=x(e,[`labels`]);return t!==void 0&&m!=null&&b(t,[`labels`],m),r}function ss(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`source`]);a!=null&&ls(a,r);let o=x(t,[`config`]);return o!=null&&os(o,r),r}function cs(e,t){let n={},r=x(e,[`predictions`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>No(e))),b(n,[`generatedImages`],e)}return n}function ls(e,t,n){let r={},i=x(e,[`prompt`]);t!==void 0&&i!=null&&b(t,[`instances[0]`,`prompt`],i);let a=x(e,[`personImage`]);t!==void 0&&a!=null&&b(t,[`instances[0]`,`personImage`,`image`],L(a));let o=x(e,[`productImages`]);if(t!==void 0&&o!=null){let e=o;Array.isArray(e)&&(e=e.map(e=>as(e))),b(t,[`instances[0]`,`productImages`],e)}return r}function us(e,t){let n={},r=x(e,[`referenceImage`]);r!=null&&b(n,[`referenceImage`],L(r));let i=x(e,[`referenceId`]);i!=null&&b(n,[`referenceId`],i);let a=x(e,[`referenceType`]);a!=null&&b(n,[`referenceType`],a);let o=x(e,[`maskImageConfig`]);o!=null&&b(n,[`maskImageConfig`],Qo(o));let s=x(e,[`controlImageConfig`]);s!=null&&b(n,[`controlImageConfig`],Ua(s));let c=x(e,[`styleImageConfig`]);c!=null&&b(n,[`styleImageConfig`],c);let l=x(e,[`subjectImageConfig`]);return l!=null&&b(n,[`subjectImageConfig`],l),n}function ds(e,t){let n={},r=x(e,[`mimeType`]);r!=null&&b(n,[`mimeType`],r);let i=x(e,[`voiceSampleAudio`]);if(i!=null&&b(n,[`voiceSampleAudio`],i),x(e,[`consentAudio`])!==void 0)throw Error(`consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);if(x(e,[`voiceConsentSignature`])!==void 0)throw Error(`voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function fs(e,t){let n={},r=x(e,[`safetyAttributes`,`categories`]);r!=null&&b(n,[`categories`],r);let i=x(e,[`safetyAttributes`,`scores`]);i!=null&&b(n,[`scores`],i);let a=x(e,[`contentType`]);return a!=null&&b(n,[`contentType`],a),n}function ps(e,t){let n={},r=x(e,[`category`]);if(r!=null&&b(n,[`category`],r),x(e,[`method`])!==void 0)throw Error(`method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let i=x(e,[`threshold`]);return i!=null&&b(n,[`threshold`],i),n}function ms(e,t){let n={},r=x(e,[`image`]);return r!=null&&b(n,[`image`],L(r)),n}function hs(e,t,n){let r={},i=x(e,[`mode`]);t!==void 0&&i!=null&&b(t,[`parameters`,`mode`],i);let a=x(e,[`maxPredictions`]);t!==void 0&&a!=null&&b(t,[`parameters`,`maxPredictions`],a);let o=x(e,[`confidenceThreshold`]);t!==void 0&&o!=null&&b(t,[`parameters`,`confidenceThreshold`],o);let s=x(e,[`maskDilation`]);t!==void 0&&s!=null&&b(t,[`parameters`,`maskDilation`],s);let c=x(e,[`binaryColorThreshold`]);t!==void 0&&c!=null&&b(t,[`parameters`,`binaryColorThreshold`],c);let l=x(e,[`labels`]);return t!==void 0&&l!=null&&b(t,[`labels`],l),r}function gs(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`source`]);a!=null&&vs(a,r);let o=x(t,[`config`]);return o!=null&&hs(o,r),r}function _s(e,t){let n={},r=x(e,[`predictions`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>Po(e))),b(n,[`generatedMasks`],e)}return n}function vs(e,t,n){let r={},i=x(e,[`prompt`]);t!==void 0&&i!=null&&b(t,[`instances[0]`,`prompt`],i);let a=x(e,[`image`]);t!==void 0&&a!=null&&b(t,[`instances[0]`,`image`],L(a));let o=x(e,[`scribbleImage`]);return t!==void 0&&o!=null&&b(t,[`instances[0]`,`scribble`],ms(o)),r}function ys(e,t){let n={},r=x(e,[`speaker`]);r!=null&&b(n,[`speaker`],r);let i=x(e,[`voiceConfig`]);return i!=null&&b(n,[`voiceConfig`],Vs(i)),n}function bs(e,t){let n={},r=x(e,[`voiceConfig`]);r!=null&&b(n,[`voiceConfig`],Vs(r));let i=x(e,[`languageCode`]);i!=null&&b(n,[`languageCode`],i);let a=x(e,[`multiSpeakerVoiceConfig`]);return a!=null&&b(n,[`multiSpeakerVoiceConfig`],ns(a)),n}function xs(e,t){let n={},r=x(e,[`functionCallingConfig`]);r!=null&&b(n,[`functionCallingConfig`],po(r));let i=x(e,[`retrievalConfig`]);i!=null&&b(n,[`retrievalConfig`],i);let a=x(e,[`includeServerSideToolInvocations`]);return a!=null&&b(n,[`includeServerSideToolInvocations`],a),n}function Ss(e,t){let n={},r=x(e,[`functionCallingConfig`]);r!=null&&b(n,[`functionCallingConfig`],r);let i=x(e,[`retrievalConfig`]);if(i!=null&&b(n,[`retrievalConfig`],i),x(e,[`includeServerSideToolInvocations`])!==void 0)throw Error(`includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function Cs(e,t){let n={};if(x(e,[`retrieval`])!==void 0)throw Error(`retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let r=x(e,[`googleMaps`]);r!=null&&b(n,[`googleMaps`],Bo(r));let i=x(e,[`mcpServers`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`mcpServers`],e)}let a=x(e,[`codeExecution`]);a!=null&&b(n,[`codeExecution`],a);let o=x(e,[`computerUse`]);if(o!=null&&b(n,[`computerUse`],o),x(e,[`enterpriseWebSearch`])!==void 0)throw Error(`enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);if(x(e,[`exaAiSearch`])!==void 0)throw Error(`exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let s=x(e,[`functionDeclarations`]);if(s!=null){let e=s;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`functionDeclarations`],e)}let c=x(e,[`googleSearch`]);c!=null&&b(n,[`googleSearch`],Vo(c));let l=x(e,[`googleSearchRetrieval`]);if(l!=null&&b(n,[`googleSearchRetrieval`],l),x(e,[`parallelAiSearch`])!==void 0)throw Error(`parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.`);let u=x(e,[`urlContext`]);u!=null&&b(n,[`urlContext`],u);let d=x(e,[`fileSearch`]);return d!=null&&b(n,[`fileSearch`],d),n}function ws(e,t){let n={},r=x(e,[`retrieval`]);r!=null&&b(n,[`retrieval`],r);let i=x(e,[`googleMaps`]);i!=null&&b(n,[`googleMaps`],i);let a=x(e,[`mcpServers`]);if(a!=null){let e=a;Array.isArray(e)&&(e=e.map(e=>$o(e))),b(n,[`mcpServers`],e)}let o=x(e,[`codeExecution`]);o!=null&&b(n,[`codeExecution`],o);let s=x(e,[`computerUse`]);s!=null&&b(n,[`computerUse`],Ra(s));let c=x(e,[`enterpriseWebSearch`]);c!=null&&b(n,[`enterpriseWebSearch`],c);let l=x(e,[`exaAiSearch`]);l!=null&&b(n,[`exaAiSearch`],l);let u=x(e,[`functionDeclarations`]);if(u!=null){let e=u;Array.isArray(e)&&(e=e.map(e=>e)),b(n,[`functionDeclarations`],e)}let d=x(e,[`googleSearch`]);d!=null&&b(n,[`googleSearch`],d);let f=x(e,[`googleSearchRetrieval`]);f!=null&&b(n,[`googleSearchRetrieval`],f);let p=x(e,[`parallelAiSearch`]);p!=null&&b(n,[`parallelAiSearch`],p);let m=x(e,[`urlContext`]);if(m!=null&&b(n,[`urlContext`],m),x(e,[`fileSearch`])!==void 0)throw Error(`fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.`);return n}function Ts(e,t){let n={},r=x(e,[`baseModel`]);r!=null&&b(n,[`baseModel`],r);let i=x(e,[`createTime`]);i!=null&&b(n,[`createTime`],i);let a=x(e,[`updateTime`]);return a!=null&&b(n,[`updateTime`],a),n}function Es(e,t){let n={},r=x(e,[`labels`,`google-vertex-llm-tuning-base-model-id`]);r!=null&&b(n,[`baseModel`],r);let i=x(e,[`createTime`]);i!=null&&b(n,[`createTime`],i);let a=x(e,[`updateTime`]);return a!=null&&b(n,[`updateTime`],a),n}function Ds(e,t,n){let r={},i=x(e,[`displayName`]);t!==void 0&&i!=null&&b(t,[`displayName`],i);let a=x(e,[`description`]);t!==void 0&&a!=null&&b(t,[`description`],a);let o=x(e,[`defaultCheckpointId`]);return t!==void 0&&o!=null&&b(t,[`defaultCheckpointId`],o),r}function Os(e,t,n){let r={},i=x(e,[`displayName`]);t!==void 0&&i!=null&&b(t,[`displayName`],i);let a=x(e,[`description`]);t!==void 0&&a!=null&&b(t,[`description`],a);let o=x(e,[`defaultCheckpointId`]);return t!==void 0&&o!=null&&b(t,[`defaultCheckpointId`],o),r}function ks(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`name`],M(e,i));let a=x(t,[`config`]);return a!=null&&Ds(a,r),r}function As(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`config`]);return a!=null&&Os(a,r),r}function js(e,t,n){let r={},i=x(e,[`outputGcsUri`]);t!==void 0&&i!=null&&b(t,[`parameters`,`storageUri`],i);let a=x(e,[`safetyFilterLevel`]);t!==void 0&&a!=null&&b(t,[`parameters`,`safetySetting`],a);let o=x(e,[`personGeneration`]);t!==void 0&&o!=null&&b(t,[`parameters`,`personGeneration`],o);let s=x(e,[`includeRaiReason`]);t!==void 0&&s!=null&&b(t,[`parameters`,`includeRaiReason`],s);let c=x(e,[`outputMimeType`]);t!==void 0&&c!=null&&b(t,[`parameters`,`outputOptions`,`mimeType`],c);let l=x(e,[`outputCompressionQuality`]);t!==void 0&&l!=null&&b(t,[`parameters`,`outputOptions`,`compressionQuality`],l);let u=x(e,[`enhanceInputImage`]);t!==void 0&&u!=null&&b(t,[`parameters`,`upscaleConfig`,`enhanceInputImage`],u);let d=x(e,[`imagePreservationFactor`]);t!==void 0&&d!=null&&b(t,[`parameters`,`upscaleConfig`,`imagePreservationFactor`],d);let f=x(e,[`labels`]);t!==void 0&&f!=null&&b(t,[`labels`],f);let p=x(e,[`numberOfImages`]);t!==void 0&&p!=null&&b(t,[`parameters`,`sampleCount`],p);let m=x(e,[`mode`]);return t!==void 0&&m!=null&&b(t,[`parameters`,`mode`],m),r}function Ms(e,t,n){let r={},i=x(t,[`model`]);i!=null&&b(r,[`_url`,`model`],M(e,i));let a=x(t,[`image`]);a!=null&&b(r,[`instances[0]`,`image`],L(a));let o=x(t,[`upscaleFactor`]);o!=null&&b(r,[`parameters`,`upscaleConfig`,`upscaleFactor`],o);let s=x(t,[`config`]);return s!=null&&js(s,r),r}function Ns(e,t){let n={},r=x(e,[`sdkHttpResponse`]);r!=null&&b(n,[`sdkHttpResponse`],r);let i=x(e,[`predictions`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>No(e))),b(n,[`generatedImages`],e)}return n}function Ps(e,t){let n={},r=x(e,[`uri`]);r!=null&&b(n,[`uri`],r);let i=x(e,[`encodedVideo`]);i!=null&&b(n,[`videoBytes`],jn(i));let a=x(e,[`encoding`]);return a!=null&&b(n,[`mimeType`],a),n}function Fs(e,t){let n={},r=x(e,[`gcsUri`]);r!=null&&b(n,[`uri`],r);let i=x(e,[`bytesBase64Encoded`]);i!=null&&b(n,[`videoBytes`],jn(i));let a=x(e,[`mimeType`]);return a!=null&&b(n,[`mimeType`],a),n}function Is(e,t){let n={},r=x(e,[`image`]);r!=null&&b(n,[`_self`],L(r));let i=x(e,[`maskMode`]);return i!=null&&b(n,[`maskMode`],i),n}function Ls(e,t){let n={},r=x(e,[`image`]);r!=null&&b(n,[`image`],Go(r));let i=x(e,[`referenceType`]);return i!=null&&b(n,[`referenceType`],i),n}function Rs(e,t){let n={},r=x(e,[`image`]);r!=null&&b(n,[`image`],L(r));let i=x(e,[`referenceType`]);return i!=null&&b(n,[`referenceType`],i),n}function zs(e,t){let n={},r=x(e,[`uri`]);r!=null&&b(n,[`uri`],r);let i=x(e,[`videoBytes`]);i!=null&&b(n,[`encodedVideo`],jn(i));let a=x(e,[`mimeType`]);return a!=null&&b(n,[`encoding`],a),n}function Bs(e,t){let n={},r=x(e,[`uri`]);r!=null&&b(n,[`gcsUri`],r);let i=x(e,[`videoBytes`]);i!=null&&b(n,[`bytesBase64Encoded`],jn(i));let a=x(e,[`mimeType`]);return a!=null&&b(n,[`mimeType`],a),n}function Vs(e,t){let n={},r=x(e,[`replicatedVoiceConfig`]);r!=null&&b(n,[`replicatedVoiceConfig`],ds(r));let i=x(e,[`prebuiltVoiceConfig`]);return i!=null&&b(n,[`prebuiltVoiceConfig`],i),n}function Hs(e,t,n){let r={},i=x(t,[`displayName`]);n!==void 0&&i!=null&&b(n,[`displayName`],i);let a=x(t,[`embeddingModel`]);return n!==void 0&&a!=null&&b(n,[`embeddingModel`],M(e,a)),r}function Us(e,t){let n={},r=x(t,[`config`]);return r!=null&&Hs(e,r,n),n}function Ws(e,t){let n={},r=x(e,[`force`]);return t!==void 0&&r!=null&&b(t,[`_query`,`force`],r),n}function Gs(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`_url`,`name`],n);let r=x(e,[`config`]);return r!=null&&Ws(r,t),t}function Ks(e){let t={},n=x(e,[`name`]);return n!=null&&b(t,[`_url`,`name`],n),t}function qs(e,t){let n={},r=x(e,[`customMetadata`]);if(t!==void 0&&r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`customMetadata`],e)}let i=x(e,[`chunkingConfig`]);return t!==void 0&&i!=null&&b(t,[`chunkingConfig`],i),n}function Js(e){let t={},n=x(e,[`name`]);n!=null&&b(t,[`name`],n);let r=x(e,[`metadata`]);r!=null&&b(t,[`metadata`],r);let i=x(e,[`done`]);i!=null&&b(t,[`done`],i);let a=x(e,[`error`]);a!=null&&b(t,[`error`],a);let o=x(e,[`response`]);return o!=null&&b(t,[`response`],Xs(o)),t}function Ys(e){let t={},n=x(e,[`fileSearchStoreName`]);n!=null&&b(t,[`_url`,`file_search_store_name`],n);let r=x(e,[`fileName`]);r!=null&&b(t,[`fileName`],r);let i=x(e,[`config`]);return i!=null&&qs(i,t),t}function Xs(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`parent`]);r!=null&&b(t,[`parent`],r);let i=x(e,[`documentName`]);return i!=null&&b(t,[`documentName`],i),t}function Zs(e,t){let n={},r=x(e,[`pageSize`]);t!==void 0&&r!=null&&b(t,[`_query`,`pageSize`],r);let i=x(e,[`pageToken`]);return t!==void 0&&i!=null&&b(t,[`_query`,`pageToken`],i),n}function Qs(e){let t={},n=x(e,[`config`]);return n!=null&&Zs(n,t),t}function $s(e){let t={},n=x(e,[`sdkHttpResponse`]);n!=null&&b(t,[`sdkHttpResponse`],n);let r=x(e,[`nextPageToken`]);r!=null&&b(t,[`nextPageToken`],r);let i=x(e,[`fileSearchStores`]);if(i!=null){let e=i;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`fileSearchStores`],e)}return t}function ec(e,t){let n={},r=x(e,[`mimeType`]);t!==void 0&&r!=null&&b(t,[`mimeType`],r);let i=x(e,[`displayName`]);t!==void 0&&i!=null&&b(t,[`displayName`],i);let a=x(e,[`customMetadata`]);if(t!==void 0&&a!=null){let e=a;Array.isArray(e)&&(e=e.map(e=>e)),b(t,[`customMetadata`],e)}let o=x(e,[`chunkingConfig`]);return t!==void 0&&o!=null&&b(t,[`chunkingConfig`],o),n}function tc(e){let t={},n=x(e,[`fileSearchStoreName`]);n!=null&&b(t,[`_url`,`file_search_store_name`],n);let r=x(e,[`config`]);return r!=null&&ec(r,t),t}function nc(e){let t={},n=x(e,[`sdkHttpResponse`]);return n!=null&&b(t,[`sdkHttpResponse`],n),t}var rc=`Content-Type`,ic=`X-Server-Timeout`,ac=`User-Agent`,oc=`x-goog-api-client`,sc=`google-genai-sdk/2.21.0`,cc=`v1beta1`,lc=`v1beta`,uc=new Set([`us`,`eu`]);function dc(e){let t=globalThis[Symbol.for(`undici.globalDispatcher.1`)];if(t)for(let n of Object.getOwnPropertySymbols(t)){let r=n.description;if(r?.includes(`headers timeout`)||r?.includes(`body timeout`)){let r=t[n];typeof r==`number`&&(t[n]=Math.max(r,e))}}}function fc(e,t){let n=()=>{};if(!(e&&e>0)&&!t)return{signal:void 0,dispose:n};let r=new AbortController,i;e&&e>0&&(i=setTimeout(()=>r.abort(),e),i&&typeof i.unref==`function`&&i.unref());let a=()=>r.abort();return t&&(t.aborted?r.abort():t.addEventListener(`abort`,a)),{signal:r.signal,dispose:()=>{i!==void 0&&clearTimeout(i),t?.removeEventListener(`abort`,a)}}}var pc=5,mc=1,hc=60,gc=2,_c=1,vc=[408,429,500,502,503,504],yc=class{constructor(e){this.clientOptions=Object.assign({},e),this.customBaseUrl=e.httpOptions?.baseUrl;let t={};if(this.clientOptions.vertexai){if(!this.clientOptions.location&&!this.clientOptions.apiKey&&!this.customBaseUrl&&(this.clientOptions.location=`global`),!(this.clientOptions.project&&this.clientOptions.location||this.clientOptions.apiKey)&&!this.customBaseUrl)throw Error(`Authentication is not set up. Please provide either a project and location, or an API key, or a custom base URL.`);let n=e.project&&e.location||!!e.apiKey;this.customBaseUrl&&!n?(t.baseUrl=this.customBaseUrl,this.clientOptions.project=void 0,this.clientOptions.location=void 0):this.clientOptions.apiKey&&!this.clientOptions.project||this.clientOptions.location===`global`?t.baseUrl=`https://aiplatform.googleapis.com/`:this.clientOptions.project&&this.clientOptions.location&&uc.has(this.clientOptions.location)?t.baseUrl=`https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`:this.clientOptions.project&&this.clientOptions.location&&(t.baseUrl=`https://${this.clientOptions.location}-aiplatform.googleapis.com/`),t.apiVersion=this.clientOptions.apiVersion??cc}else this.clientOptions.apiKey||console.warn(`API key should be set when using the Gemini API.`),t.apiVersion=this.clientOptions.apiVersion??lc,t.baseUrl=`https://generativelanguage.googleapis.com/`;t.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=t,e.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(t,e.httpOptions))}isVertexAI(){return this.clientOptions.vertexai??!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}getCustomBaseUrl(){return this.customBaseUrl}async getAuthHeaders(){let e=new Headers;return await this.clientOptions.auth.addAuthHeaders(e),e}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw Error(`API version is not set.`)}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw Error(`Base URL is not set.`)}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw Error(`Headers are not set.`)}getRequestUrlInternal(e){if(!e||e.baseUrl===void 0||e.apiVersion===void 0)throw Error(`HTTP options are not correctly set.`);let t=[e.baseUrl.endsWith(`/`)?e.baseUrl.slice(0,-1):e.baseUrl];return e.apiVersion&&e.apiVersion!==``&&t.push(e.apiVersion),t.join(`/`)}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){let e=this.getBaseUrl(),t=new URL(e);return t.protocol=t.protocol==`http:`?`ws`:`wss`,t.toString()}setBaseUrl(e){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=e;else throw Error(`HTTP options are not correctly set.`)}constructUrl(e,t,n){let r=[this.getRequestUrlInternal(t)];return n&&r.push(this.getBaseResourcePath()),e!==``&&r.push(e),new URL(`${r.join(`/`)}`)}shouldPrependVertexProjectPath(e,t){return!(t.baseUrl&&t.baseUrlResourceScope===rt.COLLECTION||!this.clientOptions.vertexai||!this.clientOptions.project||!this.clientOptions.location||e.path.startsWith(`projects/`)||e.httpMethod===`GET`&&e.path.startsWith(`publishers/google/models`))}async request(e){let t=this.clientOptions.httpOptions;e.httpOptions&&(t=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));let n=this.shouldPrependVertexProjectPath(e,t),r=this.constructUrl(e.path,t,n);if(e.queryParams)for(let[t,n]of Object.entries(e.queryParams))r.searchParams.append(t,String(n));let i={};if(e.httpMethod===`GET`){if(e.body&&e.body!==`{}`)throw Error(`Request body should be empty for GET request, but got non empty request body`)}else i.body=e.body;return i=await this.includeExtraHttpOptionsToRequestInit(i,t,r.toString()),this.unaryApiCall(r,i,e.httpMethod,t.retryOptions,t.timeout,e.abortSignal)}patchHttpOptions(e,t){let n=JSON.parse(JSON.stringify(e));for(let[e,r]of Object.entries(t))typeof r==`object`?n[e]=Object.assign(Object.assign({},n[e]),r):r!==void 0&&(n[e]=r);return n}async requestStream(e){let t=this.clientOptions.httpOptions;e.httpOptions&&(t=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));let n=this.shouldPrependVertexProjectPath(e,t),r=this.constructUrl(e.path,t,n);(!r.searchParams.has(`alt`)||r.searchParams.get(`alt`)!==`sse`)&&r.searchParams.set(`alt`,`sse`);let i={};return i.body=e.body,i=await this.includeExtraHttpOptionsToRequestInit(i,t,r.toString()),this.streamApiCall(r,i,e.httpMethod,t.retryOptions,t.timeout,e.abortSignal)}async includeExtraHttpOptionsToRequestInit(e,t,n){return t?.timeout&&t.timeout>0&&dc(t.timeout),t&&t.extraBody!==null&&xc(e,t.extraBody),e.headers=await this.getHeadersInternal(t,n),e}async unaryApiCall(e,t,n,r,i,a){return this.apiCall(e.toString(),Object.assign(Object.assign({},t),{method:n}),r,i,a).then(async e=>(await bc(e),new Mt(e))).catch(e=>{throw e instanceof Error?e:Error(`exception ${e} sending request`,{cause:e})})}async streamApiCall(e,t,n,r,i,a){return this.apiCall(e.toString(),Object.assign(Object.assign({},t),{method:n}),r,i,a).then(async e=>(await bc(e),this.processStreamResponse(e))).catch(e=>{throw e instanceof Error?e:Error(`exception ${e} sending request`,{cause:e})})}processStreamResponse(e){return Ni(this,arguments,function*(){let t=(e?.body)?.getReader(),n=new TextDecoder(`utf-8`);if(!t)throw Error(`Response body is empty`);try{let r=``,i=[`
|
|
2
2
|
|
|
3
3
|
`,`\r\r`,`\r
|
|
4
4
|
\r
|