CINXE.COM

Quickstart: Generate text using the Vertex AI Gemini API  |  Generative AI on Vertex AI  |  Google Cloud

<!doctype html> <html lang="en" dir="ltr"> <head> <meta name="google-signin-client-id" content="721724668570-nbkv1cfusk7kk4eni4pjvepaus73b13t.apps.googleusercontent.com"> <meta name="google-signin-scope" content="profile email https://www.googleapis.com/auth/developerprofiles https://www.googleapis.com/auth/developerprofiles.award https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/webhistory"> <meta property="og:site_name" content="Google Cloud"> <meta property="og:type" content="website"><meta name="theme-color" content="#039be5"><meta charset="utf-8"> <meta content="IE=Edge" http-equiv="X-UA-Compatible"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="manifest" href="/_pwa/cloud/manifest.json" crossorigin="use-credentials"> <link rel="preconnect" href="//www.gstatic.com" crossorigin> <link rel="preconnect" href="//fonts.gstatic.com" crossorigin> <link rel="preconnect" href="//fonts.googleapis.com" crossorigin> <link rel="preconnect" href="//apis.google.com" crossorigin> <link rel="preconnect" href="//www.google-analytics.com" crossorigin><link rel="stylesheet" href="//fonts.googleapis.com/css?family=Google+Sans:400,500,700|Google+Sans+Text:400,400italic,500,500italic,700,700italic|Roboto:400,400italic,500,500italic,700,700italic|Roboto+Mono:400,500,700&display=swap"> <link rel="stylesheet" href="//fonts.googleapis.com/css2?family=Material+Icons&family=Material+Symbols+Outlined&display=block"><link rel="stylesheet" href="https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/cloud/css/app.css"> <link rel="shortcut icon" href="https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/cloud/images/favicons/onecloud/favicon.ico"> <link rel="apple-touch-icon" href="https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/cloud/images/favicons/onecloud/super_cloud.png"><link rel="canonical" href="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal"><link rel="search" type="application/opensearchdescription+xml" title="Google Cloud" href="https://cloud.google.com/s/opensearch.xml"> <link rel="alternate" hreflang="en" href="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal" /><link rel="alternate" hreflang="x-default" href="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal" /><link rel="alternate" hreflang="zh-Hans" href="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal?hl=zh-cn" /><link rel="alternate" hreflang="fr" href="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal?hl=fr" /><link rel="alternate" hreflang="de" href="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal?hl=de" /><link rel="alternate" hreflang="id" href="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal?hl=id" /><link rel="alternate" hreflang="it" href="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal?hl=it" /><link rel="alternate" hreflang="ja" href="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal?hl=ja" /><link rel="alternate" hreflang="ko" href="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal?hl=ko" /><link rel="alternate" hreflang="pt-BR" href="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal?hl=pt-br" /><link rel="alternate" hreflang="es-419" href="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal?hl=es-419" /><title>Quickstart: Generate text using the Vertex AI Gemini API &nbsp;|&nbsp; Generative AI on Vertex AI &nbsp;|&nbsp; Google Cloud</title> <meta property="og:title" content="Quickstart: Generate text using the Vertex AI Gemini API &nbsp;|&nbsp; Generative AI on Vertex AI &nbsp;|&nbsp; Google Cloud"><meta name="description" content="Get started by sending a prompt to the Vertex AI Gemini API in Vertex AI."> <meta property="og:description" content="Get started by sending a prompt to the Vertex AI Gemini API in Vertex AI."><meta property="og:url" content="https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal"><meta property="og:image" content="https://cloud.google.com/_static/cloud/images/social-icon-google-cloud-1200-630.png"> <meta property="og:image:width" content="1200"> <meta property="og:image:height" content="630"><meta property="og:locale" content="en"><meta name="twitter:card" content="summary_large_image"><script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Article", "headline": "Quickstart: Generate text using the Vertex AI Gemini API" } </script><script type="application/ld+json"> { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{ "@type": "ListItem", "position": 1, "name": "Generative AI on Vertex AI", "item": "https://cloud.google.com/vertex-ai/generative-ai/docs/overview" },{ "@type": "ListItem", "position": 2, "name": "Documentation", "item": "https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview" },{ "@type": "ListItem", "position": 3, "name": "Quickstart: Generate text using the Vertex AI Gemini API", "item": "https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal" }] } </script> <link rel="stylesheet" href="/extras.css"></head> <body class="" template="page" theme="cloud-theme" type="article" layout="docs" free-trial display-toc pending> <devsite-progress type="indeterminate" id="app-progress"></devsite-progress> <section class="devsite-wrapper"> <devsite-cookie-notification-bar></devsite-cookie-notification-bar><cloudx-track userCountry="SG"></cloudx-track> <cloudx-utils-init></cloudx-utils-init> <devsite-header keep-tabs-visible> <div class="devsite-header--inner nocontent"> <div class="devsite-top-logo-row-wrapper-wrapper"> <div class="devsite-top-logo-row-wrapper"> <div class="devsite-top-logo-row"> <button type="button" id="devsite-hamburger-menu" class="devsite-header-icon-button button-flat material-icons gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Navigation menu button" visually-hidden aria-label="Open menu"> </button> <div class="devsite-product-name-wrapper"> <a href="/" class="devsite-site-logo-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Site logo" track-type="globalNav" track-name="googleCloud" track-metadata-position="nav" track-metadata-eventDetail="nav"> <picture> <img src="https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/cloud/images/cloud-logo.svg" class="devsite-site-logo" alt="Google Cloud"> </picture> </a> <span class="devsite-product-name"> <ul class="devsite-breadcrumb-list" > <li class="devsite-breadcrumb-item devsite-has-google-wordmark"> </li> </ul> </span> </div> <div class="devsite-top-logo-row-middle"> <div class="devsite-header-upper-tabs"> <cloudx-tabs-nav class="upper-tabs"> <nav class="devsite-tabs-wrapper" aria-label="Upper tabs"> <tab class="devsite-active"> <a href="https://cloud.google.com/docs" track-metadata-eventdetail="https://cloud.google.com/docs" class="devsite-tabs-content gc-analytics-event " track-type="nav" track-metadata-position="nav - docs-home" track-metadata-module="primary nav" aria-label="Documentation, selected" data-category="Site-Wide Custom Events" data-label="Tab: Documentation" track-name="docs-home" track-link-column-type="single-column" > Documentation </a> </tab> <tab class="devsite-dropdown devsite-clickable "> <a href="https://cloud.google.com/docs/tech-area-overviews" track-metadata-eventdetail="https://cloud.google.com/docs/tech-area-overviews" class="devsite-tabs-content gc-analytics-event " track-type="nav" track-metadata-position="nav - technology-areas" track-metadata-module="primary nav" data-category="Site-Wide Custom Events" data-label="Tab: Technology areas" track-name="technology-areas" track-link-column-type="single-column" > Technology areas </a> <a href="#" role="button" aria-haspopup="true" aria-expanded="false" aria-label="Dropdown menu for Technology areas" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/tech-area-overviews" track-metadata-position="nav - technology-areas" track-metadata-module="primary nav" data-category="Site-Wide Custom Events" data-label="Tab: Technology areas" track-name="technology-areas" track-link-column-type="single-column" class="devsite-tabs-dropdown-toggle devsite-icon devsite-icon-arrow-drop-down"></a> <div class="devsite-tabs-dropdown" aria-label="submenu" hidden> <button class="devsite-tabs-close-button material-icons button-flat gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Close dropdown menu" aria-label="Close dropdown menu" track-type="nav" track-name="close" track-metadata-eventdetail="#" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav">close</button> <div class="devsite-tabs-dropdown-content"> <div class="devsite-tabs-dropdown-column "> <ul class="devsite-tabs-dropdown-section "> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/ai-ml" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/ai-ml" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> AI and ML </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/application-development" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/application-development" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Application development </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/application-hosting" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/application-hosting" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Application hosting </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/compute-area" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/compute-area" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Compute </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/data" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/data" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Data analytics and pipelines </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/databases" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/databases" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Databases </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/dhm-cloud" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/dhm-cloud" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Distributed, hybrid, and multicloud </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/generative-ai" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/generative-ai" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Generative AI </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/industry" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/industry" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Industry solutions </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/networking" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/networking" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Networking </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/observability" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/observability" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Observability and monitoring </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/security" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/security" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Security </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/storage" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/storage" track-metadata-position="nav - technology-areas" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Storage </div> </a> </li> </ul> </div> </div> </div> </tab> <tab class="devsite-dropdown devsite-clickable "> <a href="https://cloud.google.com/docs/cross-product-overviews" track-metadata-eventdetail="https://cloud.google.com/docs/cross-product-overviews" class="devsite-tabs-content gc-analytics-event " track-type="nav" track-metadata-position="nav - crossproduct" track-metadata-module="primary nav" data-category="Site-Wide Custom Events" data-label="Tab: Cross-product tools" track-name="crossproduct" track-link-column-type="single-column" > Cross-product tools </a> <a href="#" role="button" aria-haspopup="true" aria-expanded="false" aria-label="Dropdown menu for Cross-product tools" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/cross-product-overviews" track-metadata-position="nav - crossproduct" track-metadata-module="primary nav" data-category="Site-Wide Custom Events" data-label="Tab: Cross-product tools" track-name="crossproduct" track-link-column-type="single-column" class="devsite-tabs-dropdown-toggle devsite-icon devsite-icon-arrow-drop-down"></a> <div class="devsite-tabs-dropdown" aria-label="submenu" hidden> <button class="devsite-tabs-close-button material-icons button-flat gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Close dropdown menu" aria-label="Close dropdown menu" track-type="nav" track-name="close" track-metadata-eventdetail="#" track-metadata-position="nav - crossproduct" track-metadata-module="tertiary nav">close</button> <div class="devsite-tabs-dropdown-content"> <div class="devsite-tabs-dropdown-column "> <ul class="devsite-tabs-dropdown-section "> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/access-resources" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/access-resources" track-metadata-position="nav - crossproduct" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Access and resources management </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/costs-usage" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/costs-usage" track-metadata-position="nav - crossproduct" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Costs and usage management </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/devtools" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/devtools" track-metadata-position="nav - crossproduct" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Google Cloud SDK, languages, frameworks, and tools </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/iac" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/iac" track-metadata-position="nav - crossproduct" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Infrastructure as code </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/docs/migration" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/docs/migration" track-metadata-position="nav - crossproduct" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Migration </div> </a> </li> </ul> </div> </div> </div> </tab> <tab class="devsite-dropdown devsite-clickable "> <a href="https://cloud.google.com/" track-metadata-eventdetail="https://cloud.google.com/" class="devsite-tabs-content gc-analytics-event " track-type="nav" track-metadata-position="nav - related-sites" track-metadata-module="primary nav" data-category="Site-Wide Custom Events" data-label="Tab: Related sites" track-name="related-sites" track-link-column-type="single-column" > Related sites </a> <a href="#" role="button" aria-haspopup="true" aria-expanded="false" aria-label="Dropdown menu for Related sites" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/" track-metadata-position="nav - related-sites" track-metadata-module="primary nav" data-category="Site-Wide Custom Events" data-label="Tab: Related sites" track-name="related-sites" track-link-column-type="single-column" class="devsite-tabs-dropdown-toggle devsite-icon devsite-icon-arrow-drop-down"></a> <div class="devsite-tabs-dropdown" aria-label="submenu" hidden> <button class="devsite-tabs-close-button material-icons button-flat gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Close dropdown menu" aria-label="Close dropdown menu" track-type="nav" track-name="close" track-metadata-eventdetail="#" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav">close</button> <div class="devsite-tabs-dropdown-content"> <div class="devsite-tabs-dropdown-column "> <ul class="devsite-tabs-dropdown-section "> <li class="devsite-nav-item"> <a href="https://cloud.google.com/" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Google Cloud Home </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/free" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/free" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Free Trial and Free Tier </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/architecture" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/architecture" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Architecture Center </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/blog" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/blog" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Blog </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/contact" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/contact" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Contact Sales </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/developers" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/developers" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Google Cloud Developer Center </div> </a> </li> <li class="devsite-nav-item"> <a href="https://developers.google.com/" track-type="nav" track-metadata-eventdetail="https://developers.google.com/" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Google Developer Center </div> </a> </li> <li class="devsite-nav-item"> <a href="https://console.cloud.google.com/marketplace" track-type="nav" track-metadata-eventdetail="https://console.cloud.google.com/marketplace" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Google Cloud Marketplace </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/marketplace/docs" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/marketplace/docs" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Google Cloud Marketplace Documentation </div> </a> </li> <li class="devsite-nav-item"> <a href="https://www.cloudskillsboost.google/paths" track-type="nav" track-metadata-eventdetail="https://www.cloudskillsboost.google/paths" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Google Cloud Skills Boost </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/solutions" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/solutions" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Google Cloud Solution Center </div> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/support-hub" track-type="nav" track-metadata-eventdetail="https://cloud.google.com/support-hub" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Google Cloud Support </div> </a> </li> <li class="devsite-nav-item"> <a href="https://www.youtube.com/@googlecloudtech" track-type="nav" track-metadata-eventdetail="https://www.youtube.com/@googlecloudtech" track-metadata-position="nav - related-sites" track-metadata-module="tertiary nav" tooltip > <div class="devsite-nav-item-title"> Google Cloud Tech Youtube Channel </div> </a> </li> </ul> </div> </div> </div> </tab> </nav> </cloudx-tabs-nav> </div> <devsite-search enable-signin enable-search enable-suggestions project-name="Generative AI on Vertex AI" tenant-name="Google Cloud" project-scope="/vertex-ai/generative-ai/docs/learn/overview" url-scoped="https://cloud.google.com/s/results/vertex-ai/generative-ai/docs/learn/overview" > <form class="devsite-search-form" action="https://cloud.google.com/s/results" method="GET"> <div class="devsite-search-container"> <button type="button" search-open class="devsite-search-button devsite-header-icon-button button-flat material-icons" aria-label="Open search"></button> <div class="devsite-searchbox"> <input aria-activedescendant="" aria-autocomplete="list" aria-label="Search" aria-expanded="false" aria-haspopup="listbox" autocomplete="off" class="devsite-search-field devsite-search-query" name="q" placeholder="Search" role="combobox" type="text" value="" > <div class="devsite-search-image material-icons" aria-hidden="true"> </div> <div class="devsite-search-shortcut-icon-container" aria-hidden="true"> <kbd class="devsite-search-shortcut-icon">/</kbd> </div> </div> </div> </form> <button type="button" search-close class="devsite-search-button devsite-header-icon-button button-flat material-icons" aria-label="Close search"></button> </devsite-search> </div> <devsite-language-selector> <ul role="presentation"> <li role="presentation"> <a role="menuitem" lang="en" >English</a> </li> <li role="presentation"> <a role="menuitem" lang="de" >Deutsch</a> </li> <li role="presentation"> <a role="menuitem" lang="es_419" >Español – América Latina</a> </li> <li role="presentation"> <a role="menuitem" lang="fr" >Français</a> </li> <li role="presentation"> <a role="menuitem" lang="id" >Indonesia</a> </li> <li role="presentation"> <a role="menuitem" lang="it" >Italiano</a> </li> <li role="presentation"> <a role="menuitem" lang="pt_br" >Português – Brasil</a> </li> <li role="presentation"> <a role="menuitem" lang="zh_cn" >中文 – 简体</a> </li> <li role="presentation"> <a role="menuitem" lang="ja" >日本語</a> </li> <li role="presentation"> <a role="menuitem" lang="ko" >한국어</a> </li> </ul> </devsite-language-selector> <devsite-user enable-profiles fp-auth id="devsite-user"> <span class="button devsite-top-button" aria-hidden="true" visually-hidden>Sign in</span> </devsite-user> </div> </div> </div> <div class="devsite-collapsible-section "> <div class="devsite-header-background"> <div class="devsite-product-id-row" hidden> <div class="devsite-product-description-row"> </div> </div> <div class="devsite-doc-set-nav-row"> <ul class="devsite-breadcrumb-list" > <li class="devsite-breadcrumb-item "> <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/overview" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Lower Header" data-value="1" track-type="globalNav" track-name="breadcrumb" track-metadata-position="1" track-metadata-eventdetail="Generative AI on Vertex AI" > Generative AI on Vertex AI </a> </li> </ul> <cloudx-tabs-nav class="lower-tabs"> <nav class="devsite-tabs-wrapper" aria-label="Lower tabs"> <tab class="devsite-active"> <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/overview" track-metadata-eventdetail="https://cloud.google.com/vertex-ai/generative-ai/docs/overview" class="devsite-tabs-content gc-analytics-event " track-type="nav" track-metadata-position="nav - guides" track-metadata-module="primary nav" aria-label="Guides, selected" data-category="Site-Wide Custom Events" data-label="Tab: Guides" track-name="guides" > Guides </a> </tab> <tab > <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference" track-metadata-eventdetail="https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference" class="devsite-tabs-content gc-analytics-event " track-type="nav" track-metadata-position="nav - api reference" track-metadata-module="primary nav" data-category="Site-Wide Custom Events" data-label="Tab: API reference" track-name="api reference" > API reference </a> </tab> <tab > <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/samples?text=Gemini" track-metadata-eventdetail="https://cloud.google.com/vertex-ai/generative-ai/docs/samples?text=Gemini" class="devsite-tabs-content gc-analytics-event " track-type="nav" track-metadata-position="nav - samples and notebooks" track-metadata-module="primary nav" data-category="Site-Wide Custom Events" data-label="Tab: Samples and notebooks" track-name="samples and notebooks" > Samples and notebooks </a> </tab> <tab > <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/prompt-gallery" track-metadata-eventdetail="https://cloud.google.com/vertex-ai/generative-ai/docs/prompt-gallery" class="devsite-tabs-content gc-analytics-event " track-type="nav" track-metadata-position="nav - prompt gallery" track-metadata-module="primary nav" data-category="Site-Wide Custom Events" data-label="Tab: Prompt gallery" track-name="prompt gallery" > Prompt gallery </a> </tab> </nav> </cloudx-tabs-nav> <div class="devsite-product-button-row"> <a href="https://cloud.google.com/contact" class="cta-button-secondary button " track-type="contact" data-overflow="devsite-tabs-wrapper" track-metadata-position="nav" data-overflow-container="left" track-name="sales" track-metadata-eventDetail="nav" data-overflow-wrapper="tab" >Contact Us</a> <a href="//console.cloud.google.com/freetrial" class="cloud-free-trial-button cta-button-primary button-primary button cloud-button cloud-button--primary " track-metadata-eventDetail="nav" referrerpolicy="no-referrer-when-downgrade" track-name="gcpCta" data-overflow-class="devsite-header-link devsite-top-button button cloud-free-trial-button cloud-free-trial-enabled cloud-button cloud-button--primary" data-overflow-container="right" track-metadata-position="nav" data-overflow="devsite-top-logo-row" track-type="freeTrial" >Start free</a> </div> </div> </div> </div> </div> </devsite-header> <devsite-book-nav scrollbars > <div class="devsite-book-nav-filter" hidden> <span class="filter-list-icon material-icons" aria-hidden="true"></span> <input type="text" placeholder="Filter" aria-label="Type to filter" role="searchbox"> <span class="filter-clear-button hidden" data-title="Clear filter" aria-label="Clear filter" role="button" tabindex="0"></span> </div> <nav class="devsite-book-nav devsite-nav nocontent" aria-label="Side menu"> <div class="devsite-mobile-header"> <button type="button" id="devsite-close-nav" class="devsite-header-icon-button button-flat material-icons gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Close navigation" aria-label="Close navigation"> </button> <div class="devsite-product-name-wrapper"> <a href="/" class="devsite-site-logo-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Site logo" track-type="globalNav" track-name="googleCloud" track-metadata-position="nav" track-metadata-eventDetail="nav"> <picture> <img src="https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/cloud/images/cloud-logo.svg" class="devsite-site-logo" alt="Google Cloud"> </picture> </a> <span class="devsite-product-name"> <ul class="devsite-breadcrumb-list" > <li class="devsite-breadcrumb-item devsite-has-google-wordmark"> </li> </ul> </span> </div> </div> <div class="devsite-book-nav-wrapper"> <div class="devsite-mobile-nav-top"> <ul class="devsite-nav-list"> <li class="devsite-nav-item"> <a href="/docs" class="devsite-nav-title gc-analytics-event devsite-nav-active" data-category="Site-Wide Custom Events" data-label="Tab: Documentation" track-name="docs-home" track-link-column-type="single-column" data-category="Site-Wide Custom Events" data-label="Responsive Tab: Documentation" track-type="globalNav" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Documentation </span> </a> <ul class="devsite-nav-responsive-tabs"> <li class="devsite-nav-item"> <a href="/vertex-ai/generative-ai/docs/overview" class="devsite-nav-title gc-analytics-event devsite-nav-has-children devsite-nav-active" data-category="Site-Wide Custom Events" data-label="Tab: Guides" track-name="guides" data-category="Site-Wide Custom Events" data-label="Responsive Tab: Guides" track-type="globalNav" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip menu="_book"> Guides </span> <span class="devsite-nav-icon material-icons" data-icon="forward" menu="_book"> </span> </a> </li> <li class="devsite-nav-item"> <a href="/vertex-ai/generative-ai/docs/model-reference/inference" class="devsite-nav-title gc-analytics-event devsite-nav-has-children " data-category="Site-Wide Custom Events" data-label="Tab: API reference" track-name="api reference" data-category="Site-Wide Custom Events" data-label="Responsive Tab: API reference" track-type="globalNav" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > API reference </span> <span class="devsite-nav-icon material-icons" data-icon="forward" > </span> </a> </li> <li class="devsite-nav-item"> <a href="/vertex-ai/generative-ai/docs/samples?text=Gemini" class="devsite-nav-title gc-analytics-event devsite-nav-has-children " data-category="Site-Wide Custom Events" data-label="Tab: Samples and notebooks" track-name="samples and notebooks" data-category="Site-Wide Custom Events" data-label="Responsive Tab: Samples and notebooks" track-type="globalNav" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Samples and notebooks </span> <span class="devsite-nav-icon material-icons" data-icon="forward" > </span> </a> </li> <li class="devsite-nav-item"> <a href="/vertex-ai/generative-ai/docs/prompt-gallery" class="devsite-nav-title gc-analytics-event devsite-nav-has-children " data-category="Site-Wide Custom Events" data-label="Tab: Prompt gallery" track-name="prompt gallery" data-category="Site-Wide Custom Events" data-label="Responsive Tab: Prompt gallery" track-type="globalNav" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Prompt gallery </span> <span class="devsite-nav-icon material-icons" data-icon="forward" > </span> </a> </li> </ul> </li> <li class="devsite-nav-item"> <a href="/docs/tech-area-overviews" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Tab: Technology areas" track-name="technology-areas" track-link-column-type="single-column" data-category="Site-Wide Custom Events" data-label="Responsive Tab: Technology areas" track-type="globalNav" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Technology areas </span> </a> <ul class="devsite-nav-responsive-tabs devsite-nav-has-menu "> <li class="devsite-nav-item"> <span class="devsite-nav-title" tooltip data-category="Site-Wide Custom Events" data-label="Tab: Technology areas" track-name="technology-areas" track-link-column-type="single-column" > <span class="devsite-nav-text" tooltip menu="Technology areas"> More </span> <span class="devsite-nav-icon material-icons" data-icon="forward" menu="Technology areas"> </span> </span> </li> </ul> </li> <li class="devsite-nav-item"> <a href="/docs/cross-product-overviews" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Tab: Cross-product tools" track-name="crossproduct" track-link-column-type="single-column" data-category="Site-Wide Custom Events" data-label="Responsive Tab: Cross-product tools" track-type="globalNav" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Cross-product tools </span> </a> <ul class="devsite-nav-responsive-tabs devsite-nav-has-menu "> <li class="devsite-nav-item"> <span class="devsite-nav-title" tooltip data-category="Site-Wide Custom Events" data-label="Tab: Cross-product tools" track-name="crossproduct" track-link-column-type="single-column" > <span class="devsite-nav-text" tooltip menu="Cross-product tools"> More </span> <span class="devsite-nav-icon material-icons" data-icon="forward" menu="Cross-product tools"> </span> </span> </li> </ul> </li> <li class="devsite-nav-item"> <a href="/" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Tab: Related sites" track-name="related-sites" track-link-column-type="single-column" data-category="Site-Wide Custom Events" data-label="Responsive Tab: Related sites" track-type="globalNav" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Related sites </span> </a> <ul class="devsite-nav-responsive-tabs devsite-nav-has-menu "> <li class="devsite-nav-item"> <span class="devsite-nav-title" tooltip data-category="Site-Wide Custom Events" data-label="Tab: Related sites" track-name="related-sites" track-link-column-type="single-column" > <span class="devsite-nav-text" tooltip menu="Related sites"> More </span> <span class="devsite-nav-icon material-icons" data-icon="forward" menu="Related sites"> </span> </span> </li> </ul> </li> <li class="devsite-nav-item"> <a href="//console.cloud.google.com/" class="devsite-nav-title gc-analytics-event " track-type="globalNav" referrerpolicy="no-referrer-when-downgrade" track-metadata-eventDetail="nav" track-metadata-position="nav" track-name="console" data-category="Site-Wide Custom Events" data-label="Responsive Tab: Console" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Console </span> </a> </li> <li class="devsite-nav-item"> <a href="/contact" class="cta-button-secondary button" track-type="contact" data-overflow="devsite-tabs-wrapper" track-metadata-position="nav" data-overflow-container="left" track-name="sales" track-metadata-eventDetail="nav" data-overflow-wrapper="tab" data-category="Site-Wide Custom Events" data-label="Responsive Tab: Contact Us" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Contact Us </span> </a> </li> <li class="devsite-nav-item"> <a href="//console.cloud.google.com/freetrial" class="cloud-free-trial-button cta-button-primary button-primary button cloud-button cloud-button--primary" track-metadata-eventDetail="nav" referrerpolicy="no-referrer-when-downgrade" track-name="gcpCta" data-overflow-class="devsite-header-link devsite-top-button button cloud-free-trial-button cloud-free-trial-enabled cloud-button cloud-button--primary" data-overflow-container="right" track-metadata-position="nav" data-overflow="devsite-top-logo-row" track-type="freeTrial" data-category="Site-Wide Custom Events" data-label="Responsive Tab: Start free" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Start free </span> </a> </li> </ul> </div> <div class="devsite-mobile-nav-bottom"> <ul class="devsite-nav-list" menu="_book"> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Discover</span> </div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/overview" ><span class="devsite-nav-text" tooltip>Overview of Generative AI on Vertex AI</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/overview" ><span class="devsite-nav-text" tooltip>Generative AI beginner&#39;s guide</span></a></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Get started</span> </div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/start/quickstarts/try-gen-ai" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/start/quickstarts/try-gen-ai" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/start/quickstarts/try-gen-ai" ><span class="devsite-nav-text" tooltip>Try it: Send a text prompt to the Gemini API without an account</span></a></li> <li class="devsite-nav-item devsite-nav-limited"><a href="/vertex-ai/generative-ai/docs/image/quickstart-image-generate-console" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/quickstart-image-generate-console" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/quickstart-image-generate-console" ><span class="devsite-nav-text" tooltip>Try it: Generate an image and verify its watermark using Imagen</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal" ><span class="devsite-nav-text" tooltip>Quickstart: Generate text using the Gemini API</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/start/quickstarts/quickstart" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/start/quickstarts/quickstart" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/start/quickstarts/quickstart" ><span class="devsite-nav-text" tooltip>Quickstart: Send text prompts to Gemini using Vertex AI Studio</span></a></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Explore and use models in Model Garden</span> </div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/model-garden/quickstart" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/model-garden/quickstart" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/model-garden/quickstart" ><span class="devsite-nav-text" tooltip>Try it: Test model capabilities using Playspaces</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/model-garden/explore-models" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/model-garden/explore-models" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/model-garden/explore-models" ><span class="devsite-nav-text" tooltip>Overview of Model Garden</span></a></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Available models</span> </div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/models" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/models" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/models" ><span class="devsite-nav-text" tooltip>Google models</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/gemini-experimental" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/gemini-experimental" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/gemini-experimental" ><span class="devsite-nav-text" tooltip>Experimental models</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/model-versions" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/model-versions" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/model-versions" ><span class="devsite-nav-text" tooltip>Model versions</span></a></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Open models</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/open-models/use-open-models" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/open-models/use-open-models" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/open-models/use-open-models" ><span class="devsite-nav-text" tooltip>Use open models</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/open-models/use-gemma" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/open-models/use-gemma" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/open-models/use-gemma" ><span class="devsite-nav-text" tooltip>Google Gemma</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/model-garden/deploy-and-inference-tutorial" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/model-garden/deploy-and-inference-tutorial" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/model-garden/deploy-and-inference-tutorial" ><span class="devsite-nav-text" tooltip>Tutorial: Deploy and inference Gemma (GPU)</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/model-garden/deploy-and-inference-tutorial-tpu" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/model-garden/deploy-and-inference-tutorial-tpu" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/model-garden/deploy-and-inference-tutorial-tpu" ><span class="devsite-nav-text" tooltip>Tutorial: Deploy and inference Gemma (TPU)</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/open-models/use-llama" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/open-models/use-llama" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/open-models/use-llama" ><span class="devsite-nav-text" tooltip>Open LLaMa</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/open-models/use-hugging-face-models" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/open-models/use-hugging-face-models" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/open-models/use-hugging-face-models" ><span class="devsite-nav-text" tooltip>Hugging Face text generation models</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/open-models/use-hex-llm" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/open-models/use-hex-llm" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/open-models/use-hex-llm" ><span class="devsite-nav-text" tooltip>Hex-LLM</span></a></li></ul></div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Partner models</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/partner-models/use-partner-models" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/partner-models/use-partner-models" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/partner-models/use-partner-models" ><span class="devsite-nav-text" tooltip>Model as a Service (MaaS) overview</span></a></li><li class="devsite-nav-item devsite-nav-preview"><a href="/vertex-ai/generative-ai/docs/partner-models/ai21" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/partner-models/ai21" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/partner-models/ai21" ><span class="devsite-nav-text" tooltip>AI21 Labs</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/partner-models/use-claude" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/partner-models/use-claude" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/partner-models/use-claude" ><span class="devsite-nav-text" tooltip>Anthropic&#39;s Claude</span></a></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Llama</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/partner-models/llama" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/partner-models/llama" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/partner-models/llama" ><span class="devsite-nav-text" tooltip>Llama models</span></a></li><li class="devsite-nav-item devsite-nav-preview"><a href="/vertex-ai/generative-ai/docs/partner-models/llama-batch" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/partner-models/llama-batch" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/partner-models/llama-batch" ><span class="devsite-nav-text" tooltip>Batch predictions</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span></a></li></ul></div></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/partner-models/mistral" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/partner-models/mistral" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/partner-models/mistral" ><span class="devsite-nav-text" tooltip>Mistral AI</span></a></li></ul></div></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Capabilities</span> </div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/send-chat-prompts-gemini" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/send-chat-prompts-gemini" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/send-chat-prompts-gemini" ><span class="devsite-nav-text" tooltip>Text generation</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/batch-prediction-gemini" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/batch-prediction-gemini" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/batch-prediction-gemini" ><span class="devsite-nav-text" tooltip>Batch prediction</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/image-understanding" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/image-understanding" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/image-understanding" ><span class="devsite-nav-text" tooltip>Image understanding</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/video-understanding" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/video-understanding" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/video-understanding" ><span class="devsite-nav-text" tooltip>Video understanding</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/audio-understanding" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/audio-understanding" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/audio-understanding" ><span class="devsite-nav-text" tooltip>Audio understanding</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/document-understanding" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/document-understanding" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/document-understanding" ><span class="devsite-nav-text" tooltip>Document understanding</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/system-instruction-introduction" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/system-instruction-introduction" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/system-instruction-introduction" ><span class="devsite-nav-text" tooltip>System instructions</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/function-calling" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/function-calling" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/function-calling" ><span class="devsite-nav-text" tooltip>Function calling</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/control-generated-output" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/control-generated-output" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/control-generated-output" ><span class="devsite-nav-text" tooltip>Controlled generation</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/content-generation-parameters" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters" ><span class="devsite-nav-text" tooltip>Content generation parameters</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/long-context" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/long-context" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/long-context" ><span class="devsite-nav-text" tooltip>Long context</span></a></li> <li class="devsite-nav-item devsite-nav-expandable devsite-nav-preview"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Context caching</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/context-cache/context-cache-overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/context-cache/context-cache-overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/context-cache/context-cache-overview" ><span class="devsite-nav-text" tooltip>Overview</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/context-cache/context-cache-create" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/context-cache/context-cache-create" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/context-cache/context-cache-create" ><span class="devsite-nav-text" tooltip>Create a context cache</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/context-cache/context-cache-use" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/context-cache/context-cache-use" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/context-cache/context-cache-use" ><span class="devsite-nav-text" tooltip>Use a context cache</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/context-cache/context-cache-getinfo" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/context-cache/context-cache-getinfo" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/context-cache/context-cache-getinfo" ><span class="devsite-nav-text" tooltip>Get context cache information</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/context-cache/context-cache-update" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/context-cache/context-cache-update" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/context-cache/context-cache-update" ><span class="devsite-nav-text" tooltip>Update a context cache</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/context-cache/context-cache-delete" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/context-cache/context-cache-delete" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/context-cache/context-cache-delete" ><span class="devsite-nav-text" tooltip>Delete a context cache</span></a></li></ul></div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Fine-tuning</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/tune-models" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/tune-models" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/tune-models" ><span class="devsite-nav-text" tooltip>Introduction to tuning</span></a></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Gemini models</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Supervised fine-tuning</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/gemini-supervised-tuning" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/gemini-supervised-tuning" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/gemini-supervised-tuning" ><span class="devsite-nav-text" tooltip>About supervised fine-tuning</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/gemini-supervised-tuning-prepare" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/gemini-supervised-tuning-prepare" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/gemini-supervised-tuning-prepare" ><span class="devsite-nav-text" tooltip>Prepare your data</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/gemini-use-supervised-tuning" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/gemini-use-supervised-tuning" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/gemini-use-supervised-tuning" ><span class="devsite-nav-text" tooltip>Use supervised fine-tuning</span></a></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Supported modalities</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/tune_gemini/text_tune" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/tune_gemini/text_tune" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/tune_gemini/text_tune" ><span class="devsite-nav-text" tooltip>Text tuning</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/tune_gemini/doc_tune" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/tune_gemini/doc_tune" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/tune_gemini/doc_tune" ><span class="devsite-nav-text" tooltip>Document tuning</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/tune_gemini/image_tune" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/tune_gemini/image_tune" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/tune_gemini/image_tune" ><span class="devsite-nav-text" tooltip>Image tuning</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/tune_gemini/audio_tune" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/tune_gemini/audio_tune" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/tune_gemini/audio_tune" ><span class="devsite-nav-text" tooltip>Audio tuning</span></a></li></ul></div></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/tune_gemini/tune-gemini-learn" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/tune_gemini/tune-gemini-learn" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/tune_gemini/tune-gemini-learn" ><span class="devsite-nav-text" tooltip>Examples for tuning Gemini text models</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/gemini-tuning-migrate-from-palm-api" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/gemini-tuning-migrate-from-palm-api" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/gemini-tuning-migrate-from-palm-api" ><span class="devsite-nav-text" tooltip>Migrate tuning from PaLM to Gemini</span></a></li></ul></div></li></ul></div></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Embeddings models</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/tune-embeddings" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/tune-embeddings" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/tune-embeddings" ><span class="devsite-nav-text" tooltip>Tune text embeddings models</span></a></li></ul></div></li><li class="devsite-nav-item devsite-nav-expandable devsite-nav-limited"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Imagen models</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-limited"><a href="/vertex-ai/generative-ai/docs/image/fine-tune-model" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/fine-tune-model" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/fine-tune-model" ><span class="devsite-nav-text" tooltip>Tune a subject model</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-limited"><a href="/vertex-ai/generative-ai/docs/image/fine-tune-style" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/fine-tune-style" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/fine-tune-style" ><span class="devsite-nav-text" tooltip>Create a custom style model</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span></a></li></ul></div></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/model-garden/lora-qlora" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/model-garden/lora-qlora" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/model-garden/lora-qlora" ><span class="devsite-nav-text" tooltip>Tuning recommendations with LoRA and QLoRA</span></a></li></ul></div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Evaluation</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/evaluation-overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/evaluation-overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/evaluation-overview" ><span class="devsite-nav-text" tooltip>Overview</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/evaluation-quickstart" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/evaluation-quickstart" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/evaluation-quickstart" ><span class="devsite-nav-text" tooltip>Quickstart: Gen AI evaluation workflow</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/determine-eval" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/determine-eval" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/determine-eval" ><span class="devsite-nav-text" tooltip>Define your evaluation metrics</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/evaluation-dataset" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/evaluation-dataset" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/evaluation-dataset" ><span class="devsite-nav-text" tooltip>Prepare your evaluation dataset</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/run-evaluation" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/run-evaluation" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/run-evaluation" ><span class="devsite-nav-text" tooltip>Run an evaluation</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/view-evaluation" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/view-evaluation" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/view-evaluation" ><span class="devsite-nav-text" tooltip>View and interpret your evaluation results</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/metrics-templates" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/metrics-templates" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/metrics-templates" ><span class="devsite-nav-text" tooltip>Reference: Model-based metrics templates</span></a></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Other evaluation documentation</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/side-by-side-eval" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/side-by-side-eval" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/side-by-side-eval" ><span class="devsite-nav-text" tooltip>Run AutoSxS pipeline</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/models/computation-based-eval-pipeline" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/computation-based-eval-pipeline" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/computation-based-eval-pipeline" ><span class="devsite-nav-text" tooltip>Run a computation-based evaluation pipeline</span></a></li></ul></div></li></ul></div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Grounding</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/grounding/overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/grounding/overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/grounding/overview" ><span class="devsite-nav-text" tooltip>Overview</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/ground-gemini" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/ground-gemini" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/ground-gemini" ><span class="devsite-nav-text" tooltip>Ground Gemini responses</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/grounding-search-suggestions" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/grounding-search-suggestions" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/grounding-search-suggestions" ><span class="devsite-nav-text" tooltip>Use Google Search Suggestions</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/ground-responses-using-rag" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/ground-responses-using-rag" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/ground-responses-using-rag" ><span class="devsite-nav-text" tooltip>Ground responses using RAG</span></a></li></ul></div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Safety</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/responsible-ai" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/responsible-ai" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/responsible-ai" ><span class="devsite-nav-text" tooltip>Responsible AI</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/safety-system-instructions" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/safety-system-instructions" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/safety-system-instructions" ><span class="devsite-nav-text" tooltip>System instructions for safety</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/configure-safety-filters" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters" ><span class="devsite-nav-text" tooltip>Configure safety filters</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/responsible-ai" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/responsible-ai" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/responsible-ai" ><span class="devsite-nav-text" tooltip>Responsible AI</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/abuse-monitoring" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/abuse-monitoring" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/abuse-monitoring" ><span class="devsite-nav-text" tooltip>Abuse monitoring</span></a></li></ul></div></li> <li class="devsite-nav-item devsite-nav-expandable devsite-nav-preview"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Extensions</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/extensions/overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/extensions/overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/extensions/overview" ><span class="devsite-nav-text" tooltip>Overview</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/extensions/create-extension" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/extensions/create-extension" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/extensions/create-extension" ><span class="devsite-nav-text" tooltip>Create and run extension </span></a></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Extensions by Google</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/extensions/code-interpreter" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/extensions/code-interpreter" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/extensions/code-interpreter" ><span class="devsite-nav-text" tooltip>Code Interpreter extension</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/extensions/vertex-ai-search" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/extensions/vertex-ai-search" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/extensions/vertex-ai-search" ><span class="devsite-nav-text" tooltip>Vertex AI Search extension</span></a></li></ul></div></li></ul></div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Image generation</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/image/overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/overview" ><span class="devsite-nav-text" tooltip>Imagen on Vertex AI overview</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/image/responsible-ai-imagen" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/responsible-ai-imagen" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/responsible-ai-imagen" ><span class="devsite-nav-text" tooltip>Responsible AI and usage guidelines for Imagen</span></a></li><li class="devsite-nav-item devsite-nav-limited"><a href="/vertex-ai/generative-ai/docs/image/model-versioning" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/model-versioning" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/model-versioning" ><span class="devsite-nav-text" tooltip>Imagen model versions and lifecycle</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-limited"><a href="/vertex-ai/generative-ai/docs/image/img-gen-prompt-guide" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/img-gen-prompt-guide" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/img-gen-prompt-guide" ><span class="devsite-nav-text" tooltip>Prompt and image attribute guide</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-expandable devsite-nav-limited"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Create images</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-limited"><a href="/vertex-ai/generative-ai/docs/image/generate-images" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/generate-images" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/generate-images" ><span class="devsite-nav-text" tooltip>Generate images using text prompts</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span></a></li></ul></div></li><li class="devsite-nav-item devsite-nav-expandable devsite-nav-limited"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Edit images</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-limited"><a href="/vertex-ai/generative-ai/docs/image/edit-inpainting" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/edit-inpainting" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/edit-inpainting" ><span class="devsite-nav-text" tooltip>Edit using inpainting (insert or remove objects)</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-limited"><a href="/vertex-ai/generative-ai/docs/image/edit-outpainting" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/edit-outpainting" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/edit-outpainting" ><span class="devsite-nav-text" tooltip>Edit using outpainting</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-limited"><a href="/vertex-ai/generative-ai/docs/image/edit-product-image" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/edit-product-image" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/edit-product-image" ><span class="devsite-nav-text" tooltip>Use product image editing</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-preview"><a href="/vertex-ai/generative-ai/docs/image/edit-controlled" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/edit-controlled" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/edit-controlled" ><span class="devsite-nav-text" tooltip>Edit using Controlled Editing</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-preview"><a href="/vertex-ai/generative-ai/docs/image/edit-personalization" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/edit-personalization" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/edit-personalization" ><span class="devsite-nav-text" tooltip>Edit using Personalization</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-limited"><a href="/vertex-ai/generative-ai/docs/image/edit-images" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/edit-images" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/edit-images" ><span class="devsite-nav-text" tooltip>Edit images (mask-free)</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span></a></li></ul></div></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Get image information</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/image/image-captioning" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/image-captioning" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/image-captioning" ><span class="devsite-nav-text" tooltip>Get image descriptions using visual captioning</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/image/visual-question-answering" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/visual-question-answering" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/visual-question-answering" ><span class="devsite-nav-text" tooltip>Use Visual Question Answering</span></a></li></ul></div></li><li class="devsite-nav-item devsite-nav-expandable devsite-nav-preview"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Text-to-live images</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-preview"><a href="/vertex-ai/generative-ai/docs/image/ttli-prompt-guide" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/ttli-prompt-guide" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/ttli-prompt-guide" ><span class="devsite-nav-text" tooltip>Text-to-Live images prompt guide</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-preview"><a href="/vertex-ai/generative-ai/docs/image/text-to-live-images" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/text-to-live-images" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/text-to-live-images" ><span class="devsite-nav-text" tooltip>Create live images from text</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span></a></li></ul></div></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/image/upscale-image" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/upscale-image" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/upscale-image" ><span class="devsite-nav-text" tooltip>Upscale an image</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/image/base64-encode" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/base64-encode" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/base64-encode" ><span class="devsite-nav-text" tooltip>Base64 encode and decode files</span></a></li><li class="devsite-nav-item devsite-nav-expandable devsite-nav-preview"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Use video models</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-preview"><a href="/vertex-ai/generative-ai/docs/video/video-descriptions" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/video/video-descriptions" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/video/video-descriptions" ><span class="devsite-nav-text" tooltip>Get video descriptions</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span></a></li></ul></div></li></ul></div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Embeddings</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/embeddings" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/embeddings" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/embeddings" ><span class="devsite-nav-text" tooltip>Overview</span></a></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Text embeddings</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/embeddings/task-types" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/embeddings/task-types" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/embeddings/task-types" ><span class="devsite-nav-text" tooltip>Choose an embeddings task type</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/embeddings/get-text-embeddings" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings" ><span class="devsite-nav-text" tooltip>Get text embeddings</span></a></li></ul></div></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/embeddings/get-multimodal-embeddings" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/embeddings/get-multimodal-embeddings" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/embeddings/get-multimodal-embeddings" ><span class="devsite-nav-text" tooltip>Get multimodal embeddings</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/embeddings/batch-prediction-genai-embeddings" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/embeddings/batch-prediction-genai-embeddings" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/embeddings/batch-prediction-genai-embeddings" ><span class="devsite-nav-text" tooltip>Get batch embeddings predictions</span></a></li></ul></div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/code/test-code-completion-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/code/test-code-completion-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/code/test-code-completion-prompts" ><span class="devsite-nav-text" tooltip>Code completion</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/translate/translate-text" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/translate/translate-text" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/translate/translate-text" ><span class="devsite-nav-text" tooltip>Translation</span></a></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Prompting tools</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/ai-powered-prompt-writing" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/ai-powered-prompt-writing" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/ai-powered-prompt-writing" ><span class="devsite-nav-text" tooltip>Use AI-powered prompt writing tools</span></a></li><li class="devsite-nav-item devsite-nav-preview"><a href="/vertex-ai/generative-ai/docs/learn/prompts/prompt-optimizer" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/prompt-optimizer" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/prompt-optimizer" ><span class="devsite-nav-text" tooltip>Optimize prompts</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-preview"><a href="/vertex-ai/generative-ai/docs/learn/prompts/prompt-templates" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/prompt-templates" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/prompt-templates" ><span class="devsite-nav-text" tooltip>Use prompt templates</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span></a></li></ul></div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/medlm/overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/medlm/overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/medlm/overview" ><span class="devsite-nav-text" tooltip>Medical text</span></a></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Guides</span> </div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Tokens</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-preview"><a href="/vertex-ai/generative-ai/docs/multimodal/list-token" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/list-token" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/list-token" ><span class="devsite-nav-text" tooltip>List and count tokens</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/get-token-count" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/get-token-count" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/get-token-count" ><span class="devsite-nav-text" tooltip>Use the countTokens API</span></a></li></ul></div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Deployment best practices</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/deploy/overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/deploy/overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/deploy/overview" ><span class="devsite-nav-text" tooltip>Overview</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompt-best-practices" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompt-best-practices" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompt-best-practices" ><span class="devsite-nav-text" tooltip>Best practices</span></a></li></ul></div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Prompting</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/introduction-prompt-design" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/introduction-prompt-design" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/introduction-prompt-design" ><span class="devsite-nav-text" tooltip>Introduction to prompting</span></a></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Prompting strategies</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/prompt-design-strategies" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/prompt-design-strategies" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/prompt-design-strategies" ><span class="devsite-nav-text" tooltip>Overview</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/clear-instructions" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/clear-instructions" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/clear-instructions" ><span class="devsite-nav-text" tooltip>Give clear and specific instructions</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/system-instructions" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/system-instructions" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/system-instructions" ><span class="devsite-nav-text" tooltip>Use system instructions</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/assign-role" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/assign-role" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/assign-role" ><span class="devsite-nav-text" tooltip>Assign a role</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/few-shot-examples" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/few-shot-examples" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/few-shot-examples" ><span class="devsite-nav-text" tooltip>Include few-shot examples</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/contextual-information" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/contextual-information" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/contextual-information" ><span class="devsite-nav-text" tooltip>Add contextual information</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/structure-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/structure-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/structure-prompts" ><span class="devsite-nav-text" tooltip>Structure prompts</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/explain-reasoning" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/explain-reasoning" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/explain-reasoning" ><span class="devsite-nav-text" tooltip>Instruct the model to explain its reasoning</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/break-down-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/break-down-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/break-down-prompts" ><span class="devsite-nav-text" tooltip>Break down complex tasks</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/adjust-parameter-values" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/adjust-parameter-values" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/adjust-parameter-values" ><span class="devsite-nav-text" tooltip>Experiment with parameter values</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/prompts/prompt-iteration" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/prompts/prompt-iteration" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/prompts/prompt-iteration" ><span class="devsite-nav-text" tooltip>Prompt iteration strategies</span></a></li></ul></div></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Task-specific prompt guidance</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/design-multimodal-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/design-multimodal-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/design-multimodal-prompts" ><span class="devsite-nav-text" tooltip>Design multimodal prompts</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/text/text-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/text/text-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/text/text-prompts" ><span class="devsite-nav-text" tooltip>Design text prompts</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/chat/chat-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/chat/chat-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/chat/chat-prompts" ><span class="devsite-nav-text" tooltip>Design chat prompts</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/code/code-chat-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/code/code-chat-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/code/code-chat-prompts" ><span class="devsite-nav-text" tooltip>Design code chat prompts</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/code/code-completion-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/code/code-completion-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/code/code-completion-prompts" ><span class="devsite-nav-text" tooltip>Design code completion prompts</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/code/code-generation-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/code/code-generation-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/code/code-generation-prompts" ><span class="devsite-nav-text" tooltip>Design code generation prompts</span></a></li><li class="devsite-nav-item devsite-nav-limited"><a href="/vertex-ai/generative-ai/docs/image/img-gen-prompt-guide" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/image/img-gen-prompt-guide" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/image/img-gen-prompt-guide" ><span class="devsite-nav-text" tooltip>Design image generation prompts</span><span class="devsite-nav-icon material-icons" data-icon="limited" data-title="Limited Access" aria-hidden="true"></span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/medlm/medlm-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/medlm/medlm-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/medlm/medlm-prompts" ><span class="devsite-nav-text" tooltip>Design medical text prompts</span></a></li></ul></div></li></ul></div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Migration</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-preview"><a href="/vertex-ai/generative-ai/docs/multimodal/call-vertex-using-openai-library" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/call-vertex-using-openai-library" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/call-vertex-using-openai-library" ><span class="devsite-nav-text" tooltip>Call Vertex AI models by using the OpenAI library</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/migrate/migrate-from-azure-to-gemini" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/migrate/migrate-from-azure-to-gemini" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/migrate/migrate-from-azure-to-gemini" ><span class="devsite-nav-text" tooltip>Migrate from Azure OpenAI to Gemini</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/migrate/migrate-google-ai" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/migrate/migrate-google-ai" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/migrate/migrate-google-ai" ><span class="devsite-nav-text" tooltip>Migrate from Google AI to Vertex AI</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/migrate/migrate-palm-to-gemini" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/migrate/migrate-palm-to-gemini" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/migrate/migrate-palm-to-gemini" ><span class="devsite-nav-text" tooltip>Migrate from PaLM 2 to Gemini</span></a></li></ul></div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls" ><span class="devsite-nav-text" tooltip>Custom metadata labels</span></a></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Troubleshoot</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-expandable devsite-nav-preview"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Troubleshoot LangChain on Vertex AI</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/set-up" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/set-up" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/set-up" ><span class="devsite-nav-text" tooltip>Troubleshoot setting up the environment</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/develop" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/develop" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/develop" ><span class="devsite-nav-text" tooltip>Troubleshoot developing an application</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/deploy" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/deploy" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/deploy" ><span class="devsite-nav-text" tooltip>Troubleshoot deploying an application</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/use" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/use" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/use" ><span class="devsite-nav-text" tooltip>Troubleshoot using an application</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/manage" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/manage" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/reasoning-engine/troubleshooting/manage" ><span class="devsite-nav-text" tooltip>Troubleshoot managing deployed applications</span></a></li></ul></div></li></ul></div></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Tools/integrations</span> </div></li> <li class="devsite-nav-item devsite-nav-expandable devsite-nav-preview"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>RAG Engine</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/rag-overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/rag-overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/rag-overview" ><span class="devsite-nav-text" tooltip>RAG Overview</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/rag-quickstart" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/rag-quickstart" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/rag-quickstart" ><span class="devsite-nav-text" tooltip>RAG quickstart for Python</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/use-data-connectors" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/use-data-connectors" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/use-data-connectors" ><span class="devsite-nav-text" tooltip>Data connectors</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/use-advanced-pdf-parsing" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/use-advanced-pdf-parsing" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/use-advanced-pdf-parsing" ><span class="devsite-nav-text" tooltip>Advanced PDF parsing</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/use-embedding-models" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/use-embedding-models" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/use-embedding-models" ><span class="devsite-nav-text" tooltip>Embedding models</span></a></li><li class="devsite-nav-item devsite-nav-expandable devsite-nav-preview"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Vector database choices in RAG</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/vector-db-choices" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/vector-db-choices" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/vector-db-choices" ><span class="devsite-nav-text" tooltip>Overview of vector database choices</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/use-feature-store-with-rag" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/use-feature-store-with-rag" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/use-feature-store-with-rag" ><span class="devsite-nav-text" tooltip>Use Feature Store with RAG</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/use-weaviate-db" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/use-weaviate-db" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/use-weaviate-db" ><span class="devsite-nav-text" tooltip>Use Weaviate with RAG</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/use-pinecone" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/use-pinecone" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/use-pinecone" ><span class="devsite-nav-text" tooltip>Use Pinecone with RAG</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/use-vertexai-vector-search" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/use-vertexai-vector-search" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/use-vertexai-vector-search" ><span class="devsite-nav-text" tooltip>Use Vertex AI Vector Search with RAG</span></a></li></ul></div></li></ul></div></li> <li class="devsite-nav-item devsite-nav-expandable devsite-nav-preview"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>LangChain on Vertex AI</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/reasoning-engine/overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/reasoning-engine/overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/reasoning-engine/overview" ><span class="devsite-nav-text" tooltip>Overview</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/reasoning-engine/set-up" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/reasoning-engine/set-up" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/reasoning-engine/set-up" ><span class="devsite-nav-text" tooltip>Set up the environment</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/reasoning-engine/develop" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/reasoning-engine/develop" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/reasoning-engine/develop" ><span class="devsite-nav-text" tooltip>Develop an application</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/reasoning-engine/deploy" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/reasoning-engine/deploy" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/reasoning-engine/deploy" ><span class="devsite-nav-text" tooltip>Deploy the application</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/reasoning-engine/use" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/reasoning-engine/use" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/reasoning-engine/use" ><span class="devsite-nav-text" tooltip>Use the application</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/reasoning-engine/manage" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/reasoning-engine/manage" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/reasoning-engine/manage" ><span class="devsite-nav-text" tooltip>Manage the deployed application</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/reasoning-engine/customize" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/reasoning-engine/customize" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/reasoning-engine/customize" ><span class="devsite-nav-text" tooltip>Customize an application template</span></a></li></ul></div></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Tutorials and code samples</span> </div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Generative AI on Vertex AI code samples</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples" ><span class="devsite-nav-text" tooltip>Sample browser</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-token-count-multimodal" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-token-count-multimodal" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-token-count-multimodal" ><span class="devsite-nav-text" tooltip> Count tokens for Gemini</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-generate-from-text-input" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-generate-from-text-input" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-generate-from-text-input" ><span class="devsite-nav-text" tooltip> Generate text using Generative AI Model</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-inpainting-insert-mask-mode" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-inpainting-insert-mask-mode" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-inpainting-insert-mask-mode" ><span class="devsite-nav-text" tooltip>Add image content using automatic mask detection and inpainting with Imagen</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-inpainting-insert-mask" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-inpainting-insert-mask" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-inpainting-insert-mask" ><span class="devsite-nav-text" tooltip>Add image content using mask-based inpainting with Imagen</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-pro-config-example" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-pro-config-example" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-pro-config-example" ><span class="devsite-nav-text" tooltip>Configure Gemini model parameters</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-token-count" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-token-count" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-token-count" ><span class="devsite-nav-text" tooltip>Count tokens in a prompt</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-sdk-embedding" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-sdk-embedding" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-sdk-embedding" ><span class="devsite-nav-text" tooltip>Create an embedding using Generative AI on Vertex AI</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-create-corpus" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-create-corpus" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-create-corpus" ><span class="devsite-nav-text" tooltip>Create an index</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-delete-file" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-delete-file" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-delete-file" ><span class="devsite-nav-text" tooltip>Delete a RAG file from an index</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-delete-corpus" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-delete-corpus" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-delete-corpus" ><span class="devsite-nav-text" tooltip>Delete an index</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-mask" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-mask" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-mask" ><span class="devsite-nav-text" tooltip>Edit image content using a mask with Imagen v.002</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-mask-free" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-mask-free" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-mask-free" ><span class="devsite-nav-text" tooltip>Edit image content using mask-free editing with Imagen v.002</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-product-image" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-product-image" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-product-image" ><span class="devsite-nav-text" tooltip>Enhance a product image by modifying the background content with Imagen</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-outpainting-mask" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-outpainting-mask" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-outpainting-mask" ><span class="devsite-nav-text" tooltip>Expand image content using mask-based outpainting with Imagen</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-function-calling-advanced" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-function-calling-advanced" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-function-calling-advanced" ><span class="devsite-nav-text" tooltip>Function calling with Gemini AI Model</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-function-calling-advanced" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-function-calling-advanced" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-function-calling-advanced" ><span class="devsite-nav-text" tooltip>Function calling with Gemini AI Model</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-generate-image" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-generate-image" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-generate-image" ><span class="devsite-nav-text" tooltip>Generate an image from text</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-non-stream-multimodality-basic" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-non-stream-multimodality-basic" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-non-stream-multimodality-basic" ><span class="devsite-nav-text" tooltip>Generate content from multimodal data using Generative AI</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-stream-multimodality-basic" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-stream-multimodality-basic" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-stream-multimodality-basic" ><span class="devsite-nav-text" tooltip>Generate content stream with Multimodal AI Model</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-function-calling" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-function-calling" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-function-calling" ><span class="devsite-nav-text" tooltip>Generate content with function calls</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-generate-content" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-generate-content" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-generate-content" ><span class="devsite-nav-text" tooltip>Generate responses using the RAG file</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-stream-text-basic" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-stream-text-basic" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-stream-text-basic" ><span class="devsite-nav-text" tooltip>Generate steaming text content with Generative Model</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-single-turn-video" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-single-turn-video" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-single-turn-video" ><span class="devsite-nav-text" tooltip>Generate text from a video</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-get-started" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-get-started" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-get-started" ><span class="devsite-nav-text" tooltip>Generate text from an image</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-pro-example" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-pro-example" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-pro-example" ><span class="devsite-nav-text" tooltip>Generate text from an image</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-safety-settings" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-safety-settings" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-safety-settings" ><span class="devsite-nav-text" tooltip>Generate text from an image with safety settings</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-single-turn-multi-image" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-single-turn-multi-image" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-single-turn-multi-image" ><span class="devsite-nav-text" tooltip>Generate text from multimodal prompt</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-function-calling-chat" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-function-calling-chat" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-function-calling-chat" ><span class="devsite-nav-text" tooltip>Generate text responses using Gemini API with external function calls in a chat scenario</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-non-stream-text-basic" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-non-stream-text-basic" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-non-stream-text-basic" ><span class="devsite-nav-text" tooltip>Generate Text With a Generative Model</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-get-file" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-get-file" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-get-file" ><span class="devsite-nav-text" tooltip>Get a RAG file</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-get-corpus" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-get-corpus" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-get-corpus" ><span class="devsite-nav-text" tooltip>Get information about an index</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-get-short-form-image-captions" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-get-short-form-image-captions" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-get-short-form-image-captions" ><span class="devsite-nav-text" tooltip>Get short-form image captions</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-get-short-form-image-responses" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-get-short-form-image-responses" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-get-short-form-image-responses" ><span class="devsite-nav-text" tooltip>Get short-form image responses</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-grounding-with-web" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-grounding-with-web" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-grounding-with-web" ><span class="devsite-nav-text" tooltip>Ground Gemini model responses to Google Search</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-grounding-with-vais" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-grounding-with-vais" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-grounding-with-vais" ><span class="devsite-nav-text" tooltip>Ground Gemini to a Vertex AI Search data store</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-import-files" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-import-files" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-import-files" ><span class="devsite-nav-text" tooltip>Import a set of RAG files</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-import-files-async" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-import-files-async" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-import-files-async" ><span class="devsite-nav-text" tooltip>Import RAG files from Google Drive or Cloud Storage</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-multiturn-chat" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-multiturn-chat" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-multiturn-chat" ><span class="devsite-nav-text" tooltip>Interactive text generation with a chatbot</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-multiturn-chat-stream" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-multiturn-chat-stream" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-multiturn-chat-stream" ><span class="devsite-nav-text" tooltip>Interactive text stream generation with a chatbot</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-list-corpora" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-list-corpora" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-list-corpora" ><span class="devsite-nav-text" tooltip>List indexes in a project</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-list-files" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-list-files" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-list-files" ><span class="devsite-nav-text" tooltip>List RAG files in an index</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-pdf" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-pdf" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-pdf" ><span class="devsite-nav-text" tooltip>Process a PDF file with Gemini</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-all-modalities" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-all-modalities" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-all-modalities" ><span class="devsite-nav-text" tooltip>Process images, video, audio, and text with Gemini 1.5 Pro</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-inpainting-remove-mask-mode" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-inpainting-remove-mask-mode" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-inpainting-remove-mask-mode" ><span class="devsite-nav-text" tooltip>Remove image content using automatic mask detection and inpainting with Imagen</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-inpainting-remove-mask" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-inpainting-remove-mask" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-edit-image-inpainting-remove-mask" ><span class="devsite-nav-text" tooltip>Remove image content using mask-based inpainting with Imagen</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-retrieval-query" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-retrieval-query" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-retrieval-query" ><span class="devsite-nav-text" tooltip>Return the response from the LLM</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-system-instruction" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-system-instruction" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-system-instruction" ><span class="devsite-nav-text" tooltip>Set system instructions to Gemini 1.5 Pro</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-controlled-generation-response-schema" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-controlled-generation-response-schema" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-controlled-generation-response-schema" ><span class="devsite-nav-text" tooltip>Specify a MIME response type for the Gemini API</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-video-with-audio" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-video-with-audio" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-video-with-audio" ><span class="devsite-nav-text" tooltip>Summarize a video file with audio with Gemini 1.5 Pro</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-audio-summarization" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-audio-summarization" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-audio-summarization" ><span class="devsite-nav-text" tooltip>Summarize an audio file with Gemini 1.5 Pro</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-audio-transcription" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-audio-transcription" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-gemini-audio-transcription" ><span class="devsite-nav-text" tooltip>Transcript an audio file with Gemini 1.5 Pro</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-upload-file" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-upload-file" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-upload-file" ><span class="devsite-nav-text" tooltip>Upload a RAG file</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-quickstart" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-quickstart" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-rag-quickstart" ><span class="devsite-nav-text" tooltip>Use the quickstart to get familiar with RAG</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-verify-image-watermark" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-verify-image-watermark" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/samples/generativeaionvertexai-imagen-verify-image-watermark" ><span class="devsite-nav-text" tooltip>Verify an image&#39;s digital watermark</span></a></li></ul></div></li> <li class="devsite-nav-item"><a href="/docs/samples" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /docs/samples" track-type="bookNav" track-name="click" track-metadata-eventdetail="/docs/samples" ><span class="devsite-nav-text" tooltip>Code samples for all products</span></a></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Jump Start Solutions</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-external"><a href="/architecture/ai-ml/generative-ai-document-summarization" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /architecture/ai-ml/generative-ai-document-summarization" track-type="bookNav" track-name="click" track-metadata-eventdetail="/architecture/ai-ml/generative-ai-document-summarization" ><span class="devsite-nav-text" tooltip>Generative AI Document Summarization</span><span class="devsite-nav-icon material-icons" data-icon="external" data-title="External" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-external"><a href="/architecture/ai-ml/generative-ai-rag" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /architecture/ai-ml/generative-ai-rag" track-type="bookNav" track-name="click" track-metadata-eventdetail="/architecture/ai-ml/generative-ai-rag" ><span class="devsite-nav-text" tooltip>Generative AI RAG with Cloud SQL</span><span class="devsite-nav-icon material-icons" data-icon="external" data-title="External" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-external"><a href="/architecture/ai-ml/generative-ai-knowledge-base" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /architecture/ai-ml/generative-ai-knowledge-base" track-type="bookNav" track-name="click" track-metadata-eventdetail="/architecture/ai-ml/generative-ai-knowledge-base" ><span class="devsite-nav-text" tooltip>Generative AI Knowledge Base</span><span class="devsite-nav-icon material-icons" data-icon="external" data-title="External" aria-hidden="true"></span></a></li></ul></div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/tutorials" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/tutorials" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/tutorials" ><span class="devsite-nav-text" tooltip>GenAI notebook tutorials</span></a></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Secure a generative AI app by using IAP</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/streamlit/streamlit-genai-iap" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/streamlit/streamlit-genai-iap" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/streamlit/streamlit-genai-iap" ><span class="devsite-nav-text" tooltip>Overview</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/streamlit/setup-environment" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/streamlit/setup-environment" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/streamlit/setup-environment" ><span class="devsite-nav-text" tooltip>Set up your project and source repository</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/streamlit/create-cloudrun-service" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/streamlit/create-cloudrun-service" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/streamlit/create-cloudrun-service" ><span class="devsite-nav-text" tooltip>Create a Cloud Run service</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/streamlit/create-loadbalancer" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/streamlit/create-loadbalancer" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/streamlit/create-loadbalancer" ><span class="devsite-nav-text" tooltip>Create a load balancer</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/streamlit/configure-iap" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/streamlit/configure-iap" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/streamlit/configure-iap" ><span class="devsite-nav-text" tooltip>Configure IAP</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/streamlit/view-app" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/streamlit/view-app" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/streamlit/view-app" ><span class="devsite-nav-text" tooltip>Test your IAP-secured app</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/streamlit/clean-up" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/streamlit/clean-up" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/streamlit/clean-up" ><span class="devsite-nav-text" tooltip>Clean up your project</span></a></li></ul></div></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Resources</span> </div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/pricing" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/pricing" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/pricing" ><span class="devsite-nav-text" tooltip>Pricing</span></a></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Release notes</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/release-notes" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/release-notes" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/release-notes" ><span class="devsite-nav-text" tooltip>Current</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/release-notes-archive" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/release-notes-archive" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/release-notes-archive" ><span class="devsite-nav-text" tooltip>Archive</span></a></li></ul></div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/learn/locations" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/locations" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/locations" ><span class="devsite-nav-text" tooltip>Locations</span></a></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Quotas and limits</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/quotas" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/quotas" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/quotas" ><span class="devsite-nav-text" tooltip>Rate limits</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/dsq" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/dsq" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/dsq" ><span class="devsite-nav-text" tooltip>Dynamic shared quota</span></a></li><li class="devsite-nav-item devsite-nav-preview"><a href="/vertex-ai/generative-ai/docs/provisioned-throughput" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/provisioned-throughput" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/provisioned-throughput" ><span class="devsite-nav-text" tooltip>Provisioned Throughput</span><span class="devsite-nav-icon material-icons" data-icon="preview" data-title="Preview" aria-hidden="true"></span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/error-code-429" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/error-code-429" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/error-code-429" ><span class="devsite-nav-text" tooltip>Error code 429</span></a></li></ul></div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/compliance" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/compliance" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/compliance" ><span class="devsite-nav-text" tooltip>Certifications</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/data-governance" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/data-governance" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/data-governance" ><span class="devsite-nav-text" tooltip>Data governance</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/getting-help" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/getting-help" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/getting-help" ><span class="devsite-nav-text" tooltip>Getting help</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/sla" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/sla" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/sla" ><span class="devsite-nav-text" tooltip>Service Level Agreement</span></a></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Deprecations</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/deprecations" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/deprecations" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/deprecations" ><span class="devsite-nav-text" tooltip>Deprecations</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/deprecations/gemini-1.0-pro" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/deprecations/gemini-1.0-pro" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/deprecations/gemini-1.0-pro" ><span class="devsite-nav-text" tooltip>Gemini 1.0 Pro and Gemini 1.0 Pro Vision</span></a></li><li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/deprecations/palm" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/deprecations/palm" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/deprecations/palm" ><span class="devsite-nav-text" tooltip>Pathways Language Model (PaLM)</span></a></li></ul></div></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Administer</span> </div></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/access-control" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/access-control" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/access-control" ><span class="devsite-nav-text" tooltip>Access control</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/security-controls" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/security-controls" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/security-controls" ><span class="devsite-nav-text" tooltip>Security controls</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/control-model-access" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/control-model-access" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/control-model-access" ><span class="devsite-nav-text" tooltip>Control access to Model Garden models</span></a></li> <li class="devsite-nav-item"><a href="/vertex-ai/generative-ai/docs/enable-audit-logs" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/enable-audit-logs" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/enable-audit-logs" ><span class="devsite-nav-text" tooltip>Enable Data Access audit logs</span></a></li> <li class="devsite-nav-item devsite-nav-heading"><div class="devsite-nav-title devsite-nav-title-no-path"> <span class="devsite-nav-text" tooltip>Legacy</span> </div></li> <li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Legacy docs</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/legacy/legacy-models" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/legacy/legacy-models" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/legacy/legacy-models" ><span class="devsite-nav-text" tooltip>About legacy models</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>PaLM 2 API (text/chat)</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/language-model-overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/language-model-overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/language-model-overview" ><span class="devsite-nav-text" tooltip>Overview</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/text/test-text-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/text/test-text-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/text/test-text-prompts" ><span class="devsite-nav-text" tooltip>Send text prompt requests</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/text/batch-prediction-genai" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/text/batch-prediction-genai" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/text/batch-prediction-genai" ><span class="devsite-nav-text" tooltip>Get batch responses for text</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/grounding/ground-language-models" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/grounding/ground-language-models" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/grounding/ground-language-models" ><span class="devsite-nav-text" tooltip>Ground responses</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/chat/test-chat-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/chat/test-chat-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/chat/test-chat-prompts" ><span class="devsite-nav-text" tooltip>Send chat prompt requests</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Tune PaLM 2 models</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/models/tune-text-models" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/tune-text-models" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/tune-text-models" ><span class="devsite-nav-text" tooltip>Tune and distill PaLM models</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/models/tune-text-models-supervised" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/tune-text-models-supervised" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/tune-text-models-supervised" ><span class="devsite-nav-text" tooltip>Use supervised tuning</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/models/tune-text-models-rlhf" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/tune-text-models-rlhf" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/tune-text-models-rlhf" ><span class="devsite-nav-text" tooltip>Use RLHF tuning</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/models/distill-text-models" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/distill-text-models" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/distill-text-models" ><span class="devsite-nav-text" tooltip>Distill text models</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li></ul></div></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/compute-token" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/compute-token" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/compute-token" ><span class="devsite-nav-text" tooltip>Get a list of tokens</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/get-token-count" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/get-token-count" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/get-token-count" ><span class="devsite-nav-text" tooltip>Get token count</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/learn/streaming" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/learn/streaming" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/learn/streaming" ><span class="devsite-nav-text" tooltip>Stream responses</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/configure-safety-attributes-palm" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/configure-safety-attributes-palm" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/configure-safety-attributes-palm" ><span class="devsite-nav-text" tooltip>Configure safety attributes</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li></ul></div></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Codey API (code)</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/code/code-models-overview" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/code/code-models-overview" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/code/code-models-overview" ><span class="devsite-nav-text" tooltip>Overview of code models</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/code/test-code-chat-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/code/test-code-chat-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/code/test-code-chat-prompts" ><span class="devsite-nav-text" tooltip>Send code chat requests</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/code/test-code-generation-prompts" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/code/test-code-generation-prompts" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/code/test-code-generation-prompts" ><span class="devsite-nav-text" tooltip>Send code generation requests</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/models/tune-code-models" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/models/tune-code-models" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/models/tune-code-models" ><span class="devsite-nav-text" tooltip>Tune Codey models</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/code/batch-prediction-genai-code" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/code/batch-prediction-genai-code" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/code/batch-prediction-genai-code" ><span class="devsite-nav-text" tooltip>Get batch code predictions</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li></ul></div></li><li class="devsite-nav-item devsite-nav-expandable"><div class="devsite-expandable-nav"> <a class="devsite-nav-toggle" aria-hidden="true"></a><div class="devsite-nav-title devsite-nav-title-no-path" tabindex="0" role="button"> <span class="devsite-nav-text" tooltip>Reference</span> </div><ul class="devsite-nav-section"><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/model-reference/code-generation" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/model-reference/code-generation" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/model-reference/code-generation" ><span class="devsite-nav-text" tooltip>Codey for code generation</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/model-reference/code-chat" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/model-reference/code-chat" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/model-reference/code-chat" ><span class="devsite-nav-text" tooltip>Codey for code chat</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/model-reference/text" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/model-reference/text" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/model-reference/text" ><span class="devsite-nav-text" tooltip>PaLM 2 for text</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/model-reference/text-chat" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/model-reference/text-chat" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/model-reference/text-chat" ><span class="devsite-nav-text" tooltip>PaLM 2 for chat</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li></ul></div></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/legacy/legacy-quotas" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/legacy/legacy-quotas" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/legacy/legacy-quotas" ><span class="devsite-nav-text" tooltip>Quotas and limits</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/legacy/legacy-security" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/legacy/legacy-security" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/legacy/legacy-security" ><span class="devsite-nav-text" tooltip>Security controls</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li><li class="devsite-nav-item devsite-nav-deprecated"><a href="/vertex-ai/generative-ai/docs/legacy/legacy-pricing" class="devsite-nav-title gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Book nav link, pathname: /vertex-ai/generative-ai/docs/legacy/legacy-pricing" track-type="bookNav" track-name="click" track-metadata-eventdetail="/vertex-ai/generative-ai/docs/legacy/legacy-pricing" ><span class="devsite-nav-text" tooltip>Pricing</span><span class="devsite-nav-icon material-icons" data-icon="deprecated" data-title="Deprecated" aria-hidden="true"></span></a></li></ul></div></li> </ul> <ul class="devsite-nav-list" menu="Technology areas" aria-label="Side menu" hidden> <li class="devsite-nav-item"> <a href="/docs/ai-ml" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: AI and ML" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > AI and ML </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/application-development" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Application development" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Application development </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/application-hosting" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Application hosting" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Application hosting </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/compute-area" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Compute" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Compute </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/data" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Data analytics and pipelines" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Data analytics and pipelines </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/databases" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Databases" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Databases </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/dhm-cloud" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Distributed, hybrid, and multicloud" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Distributed, hybrid, and multicloud </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/generative-ai" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Generative AI" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Generative AI </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/industry" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Industry solutions" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Industry solutions </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/networking" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Networking" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Networking </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/observability" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Observability and monitoring" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Observability and monitoring </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/security" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Security" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Security </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/storage" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Storage" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Storage </span> </a> </li> </ul> <ul class="devsite-nav-list" menu="Cross-product tools" aria-label="Side menu" hidden> <li class="devsite-nav-item"> <a href="/docs/access-resources" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Access and resources management" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Access and resources management </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/costs-usage" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Costs and usage management" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Costs and usage management </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/devtools" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Google Cloud SDK, languages, frameworks, and tools" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Google Cloud SDK, languages, frameworks, and tools </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/iac" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Infrastructure as code" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Infrastructure as code </span> </a> </li> <li class="devsite-nav-item"> <a href="/docs/migration" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Migration" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Migration </span> </a> </li> </ul> <ul class="devsite-nav-list" menu="Related sites" aria-label="Side menu" hidden> <li class="devsite-nav-item"> <a href="/" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Google Cloud Home" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Google Cloud Home </span> </a> </li> <li class="devsite-nav-item"> <a href="/free" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Free Trial and Free Tier" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Free Trial and Free Tier </span> </a> </li> <li class="devsite-nav-item"> <a href="/architecture" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Architecture Center" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Architecture Center </span> </a> </li> <li class="devsite-nav-item"> <a href="https://cloud.google.com/blog" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Blog" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Blog </span> </a> </li> <li class="devsite-nav-item"> <a href="/contact" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Contact Sales" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Contact Sales </span> </a> </li> <li class="devsite-nav-item"> <a href="/developers" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Google Cloud Developer Center" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Google Cloud Developer Center </span> </a> </li> <li class="devsite-nav-item"> <a href="https://developers.google.com/" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Google Developer Center" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Google Developer Center </span> </a> </li> <li class="devsite-nav-item"> <a href="https://console.cloud.google.com/marketplace" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Google Cloud Marketplace" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Google Cloud Marketplace </span> </a> </li> <li class="devsite-nav-item"> <a href="/marketplace/docs" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Google Cloud Marketplace Documentation" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Google Cloud Marketplace Documentation </span> </a> </li> <li class="devsite-nav-item"> <a href="https://www.cloudskillsboost.google/paths" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Google Cloud Skills Boost" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Google Cloud Skills Boost </span> </a> </li> <li class="devsite-nav-item"> <a href="/solutions" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Google Cloud Solution Center" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Google Cloud Solution Center </span> </a> </li> <li class="devsite-nav-item"> <a href="/support-hub" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Google Cloud Support" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Google Cloud Support </span> </a> </li> <li class="devsite-nav-item"> <a href="https://www.youtube.com/@googlecloudtech" class="devsite-nav-title gc-analytics-event " data-category="Site-Wide Custom Events" data-label="Responsive Tab: Google Cloud Tech Youtube Channel" track-type="navMenu" track-metadata-eventDetail="globalMenu" track-metadata-position="nav"> <span class="devsite-nav-text" tooltip > Google Cloud Tech Youtube Channel </span> </a> </li> </ul> </div> </div> </nav> </devsite-book-nav> <section id="gc-wrapper"> <main role="main" class="devsite-main-content" has-book-nav has-sidebar > <div class="devsite-sidebar"> <div class="devsite-sidebar-content"> <devsite-toc class="devsite-nav" role="navigation" aria-label="On this page" depth="2" scrollbars ></devsite-toc> <devsite-recommendations-sidebar class="nocontent devsite-nav"> </devsite-recommendations-sidebar> </div> </div> <devsite-content> <article class="devsite-article"> <div class="devsite-article-meta nocontent" role="navigation"> <ul class="devsite-breadcrumb-list" aria-label="Breadcrumb"> <li class="devsite-breadcrumb-item "> <a href="https://cloud.google.com/" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Breadcrumbs" data-value="1" track-type="globalNav" track-name="breadcrumb" track-metadata-position="1" track-metadata-eventdetail="Google Cloud" > Home </a> </li> <li class="devsite-breadcrumb-item "> <div class="devsite-breadcrumb-guillemet material-icons" aria-hidden="true"></div> <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/overview" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Breadcrumbs" data-value="2" track-type="globalNav" track-name="breadcrumb" track-metadata-position="2" track-metadata-eventdetail="Generative AI on Vertex AI" > Generative AI on Vertex AI </a> </li> <li class="devsite-breadcrumb-item "> <div class="devsite-breadcrumb-guillemet material-icons" aria-hidden="true"></div> <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview" class="devsite-breadcrumb-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Breadcrumbs" data-value="3" track-type="globalNav" track-name="breadcrumb" track-metadata-position="3" track-metadata-eventdetail="Generative AI on Vertex AI" > Documentation </a> </li> </ul> <devsite-thumb-rating position="header"> </devsite-thumb-rating> </div> <devsite-feedback position="header" project-name="Generative AI on Vertex AI" product-id="5164350" bucket="Documentation" context="" version="t-devsite-webserver-20241114-r00-rc02.464922260396498922" data-label="Send Feedback Button" track-type="feedback" track-name="sendFeedbackLink" track-metadata-position="header" class="nocontent" project-feedback-url="https://issuetracker.google.com/issues/new?component=1130925" project-icon="https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/cloud/images/favicons/onecloud/super_cloud.png" project-support-url="https://cloud.google.com/support-hub" > <button> Send feedback </button> </devsite-feedback> <devsite-feature-tooltip ack-key="AckCollectionsBookmarkTooltipDismiss" analytics-category="Site-Wide Custom Events" analytics-action-show="Callout Profile displayed" analytics-action-close="Callout Profile dismissed" analytics-label="Create Collection Callout" class="devsite-page-bookmark-tooltip nocontent" dismiss-button="true" id="devsite-collections-dropdown" dismiss-button-text="Dismiss" close-button-text="Got it"> <devsite-bookmark></devsite-bookmark> <span slot="popout-heading"> Stay organized with collections </span> <span slot="popout-contents"> Save and categorize content based on your preferences. </span> </devsite-feature-tooltip> <devsite-toc class="devsite-nav" depth="2" devsite-toc-embedded > </devsite-toc> <div class="devsite-article-body clearfix devsite-no-page-title"> <h1 id="quickstart_generate_text_using_the" class="page-title" data-text="Quickstart: Generate text using the Vertex AI Gemini API" tabindex="-1">Quickstart: Generate text using the Vertex AI Gemini API</h1> <p>In this quickstart, you send the following multimodal requests to the Vertex AI Gemini API and view the responses:</p> <ul> <li>A text prompt</li> <li>A prompt and an image</li> <li>A prompt and a video file (with an audio track)</li> </ul> <p>You can complete this quickstart by using a programming language SDK in your local environment or the REST API.</p> <h2 id="prerequisites" data-text="Prerequisites" tabindex="-1">Prerequisites</h2> <p>Completing this quickstart requires you to:</p> <ul> <li>Set up a Google Cloud project and enable the Vertex AI API</li> <li>On your local machine: <ul> <li>Install, initialize, and authenticate with the Google Cloud CLI</li> <li>Install the SDK for your language</li> </ul></li> </ul> <h3 id="setup-gcp" data-text="Set up a Google Cloud project" tabindex="-1">Set up a Google Cloud project</h3> <p>Set up your Google Cloud project and enable the Vertex AI API.</p> <ol> <cloudx-free-trial-eligible-content> <slot slot="eligible"> <li> Sign in to your Google Cloud account. If you're new to Google Cloud, <a href="https://console.cloud.google.com/freetrial" target="console" track-type="commonIncludes" track-name="createAnAccount" track-metadata-position="prereqs" track-metadata-eventdetail="https://console.cloud.google.com/freetrial" track-metadata-link-destination="https://console.cloud.google.com/freetrial"> create an account</a> to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads. </li> <li> <p>In the Google Cloud console, on the project selector page, select or create a Google Cloud project.</p> <aside class="note"><b>Note</b>: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.</aside> <p><a href="https://console.cloud.google.com/projectselector2/home/dashboard" target="console" track-type="commonIncludes" track-name="consoleLink" track-metadata-end-goal="createProject" class="button button-primary">Go to project selector</a></p> </li> <li> <p> <a href="/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project" target="_blank" track-type="commonIncludes" track-name="supportLink" track-metadata-end-goal="enableBilling" >Make sure that billing is enabled for your Google Cloud project</a>. </p> </li> <li> <p> Enable the Vertex AI API. </p><p><a href="https://console.cloud.google.com/flows/enableapi?apiid=aiplatform.googleapis.com" target="console" track-type="commonIncludes" track-name="consoleLink" track-metadata-end-goal="enableAPI" class="button button-primary">Enable the API</a></p> </li> <style> .henhouse-text { font-size:85%; padding:2px 4px; line-height:1; } </style> </slot> <slot slot="ineligible"> <li> <p>In the Google Cloud console, on the project selector page, select or create a Google Cloud project.</p> <aside class="note"><b>Note</b>: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.</aside> <p><a href="https://console.cloud.google.com/projectselector2/home/dashboard" target="console" track-type="commonIncludes" track-name="consoleLink" track-metadata-end-goal="createProject" class="button button-primary">Go to project selector</a></p> </li> <li> <p> <a href="/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project" target="_blank" track-type="commonIncludes" track-name="supportLink" track-metadata-end-goal="enableBilling" >Make sure that billing is enabled for your Google Cloud project</a>. </p> </li> <li> <p> Enable the Vertex AI API. </p><p><a href="https://console.cloud.google.com/flows/enableapi?apiid=aiplatform.googleapis.com" target="console" track-type="commonIncludes" track-name="consoleLink" track-metadata-end-goal="enableAPI" class="button button-primary">Enable the API</a></p> </li> <style> .henhouse-text { font-size:85%; padding:2px 4px; line-height:1; } </style> </slot> </cloudx-free-trial-eligible-content> </ol></p> <h3 id="setup-local" data-text="Set up the Google Cloud CLI" tabindex="-1">Set up the Google Cloud CLI</h3> <p>On your local machine, set up and authenticate with the Google Cloud CLI. If you are familiar with the Gemini API in Google AI Studio, note that the Vertex AI Gemini API uses Identity and Access Management instead of API keys to manage access.</p> <ol> <li> <p><a href="/sdk/docs/install" track-type="commonIncludes" track-name="sdkLink" target="_blank">Install and initialize</a> the Google Cloud CLI.</p> </li> <li> <p>If you previously installed the gcloud CLI, ensure your <code translate="no" dir="ltr">gcloud</code> components are updated by running this command.</p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="Bash">gcloud<span class="devsite-syntax-w"> </span>components<span class="devsite-syntax-w"> </span>update</pre></devsite-code> </li> <li> <p>To authenticate with the gcloud CLI, generate a local Application Default Credentials (ADC) file by running this command. The web flow launched by the command is used to provide your user credentials.</p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="Bash">gcloud<span class="devsite-syntax-w"> </span>auth<span class="devsite-syntax-w"> </span>application-default<span class="devsite-syntax-w"> </span>login</pre></devsite-code> <p>For more information, see <a href="/docs/authentication/provide-credentials-adc">Set up Application Default Credentials</a>.</p> </li> </ol> <aside class="note"><strong>Note:</strong><span> To avoid providing your project ID and region to the Google Cloud CLI, you can use the <a href="/sdk/gcloud/reference/config/set"><code translate="no" dir="ltr">gcloud config set</code></a> command to set a default project and region.</span></aside> <h3 id="setup-sdk" data-text="Set up the SDK for your programming language" tabindex="-1">Set up the SDK for your programming language</h3> <p>On your local machine, click one of the following tabs to install the SDK for your programming language.</p> <div class="ds-selector-tabs" data-ds-scope="code-sample"> <section><h3 id="python" data-text="Python" tabindex="-1">Python</h3><p>Install and update the Vertex AI SDK for Python by running this command.</p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="Bash">pip3<span class="devsite-syntax-w"> </span>install<span class="devsite-syntax-w"> </span>--upgrade<span class="devsite-syntax-w"> </span><span class="devsite-syntax-s2">"google-cloud-aiplatform>=1.64"</span></pre></devsite-code></section> <section><h3 id="node.js" data-text="Node.js" tabindex="-1">Node.js</h3><p>Install or update the <code translate="no" dir="ltr">aiplatform</code> SDK for Node.js by running this command.</p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="Bash">npm<span class="devsite-syntax-w"> </span>install<span class="devsite-syntax-w"> </span>@google-cloud/vertexai</pre></devsite-code></section> <section><h3 id="java" data-text="Java" tabindex="-1">Java</h3><p>To add <code translate="no" dir="ltr">google-cloud-vertexai</code> as a dependency, add the appropriate code for your environment.</p> <div class="ds-selector-tabs" data-ds-scope="code-sample"> <section><h3 id="maven-with-bom" data-text="Maven with BOM" tabindex="-1">Maven with BOM</h3><p>Add the following HTML to your <a href="https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/aiplatform/pom.xml"><code translate="no" dir="ltr">pom.xml</code></a>:</p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="XML">&lt;dependencyManagement&gt; &lt;dependencies&gt; <span class="devsite-syntax-w"> </span>&lt;dependency&gt; <span class="devsite-syntax-w"> </span>&lt;artifactId&gt;libraries-bom&lt;/artifactId&gt; <span class="devsite-syntax-w"> </span>&lt;groupId&gt;com.google.cloud&lt;/groupId&gt; <span class="devsite-syntax-w"> </span>&lt;scope&gt;import&lt;/scope&gt; <span class="devsite-syntax-w"> </span>&lt;type&gt;pom&lt;/type&gt; <span class="devsite-syntax-w"> </span>&lt;version&gt;26.34.0&lt;/version&gt; <span class="devsite-syntax-w"> </span>&lt;/dependency&gt; &lt;/dependencies&gt; &lt;/dependencyManagement&gt; &lt;dependencies&gt; &lt;dependency&gt; <span class="devsite-syntax-w"> </span>&lt;groupId&gt;com.google.cloud&lt;/groupId&gt; <span class="devsite-syntax-w"> </span>&lt;artifactId&gt;google-cloud-vertexai&lt;/artifactId&gt; &lt;/dependency&gt; &lt;/dependencies&gt;</pre></devsite-code></section> <section><h3 id="maven-without-bom" data-text="Maven without BOM" tabindex="-1">Maven without BOM</h3><p>Add the following to your <a href="https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/aiplatform/pom.xml"><code translate="no" dir="ltr">pom.xml</code></a>:</p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="XML">&lt;dependency&gt; <span class="devsite-syntax-w"> </span>&lt;groupId&gt;com.google.cloud&lt;/groupId&gt; <span class="devsite-syntax-w"> </span>&lt;artifactId&gt;google-cloud-vertexai&lt;/artifactId&gt; <span class="devsite-syntax-w"> </span>&lt;version&gt;0.4.0&lt;/version&gt; &lt;/dependency&gt;</pre></devsite-code></section> <section><h3 id="gradle-without-bom" data-text="Gradle without BOM" tabindex="-1">Gradle without BOM</h3><p>Add the following to your <code translate="no" dir="ltr">build.gradle</code>:</p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="XML">implementation<span class="devsite-syntax-w"> </span>'com.google.cloud:google-cloud-vertexai:0.4.0'</pre></devsite-code></section> </div></section> <section><h3 id="go" data-text="Go" tabindex="-1">Go</h3><p>Review the available Vertex AI API Go packages to determine which package best meets your project&#39;s needs.</p> <ul> <li><p>(<strong>Recommended</strong>) <a href="https://pkg.go.dev/cloud.google.com/go/vertexai"><code translate="no" dir="ltr">cloud.google.com/go/vertexai</code></a></p> <p><code translate="no" dir="ltr">vertexai</code> is a human authored package that provides access to common capabilities and features.</p> <p>This package is recommended as the starting point for most developers building with the Vertex AI API. To access capabilities and features not yet covered by this package, use the auto-generated <code translate="no" dir="ltr">aiplatform</code> package instead.</p> <p>To install this package, run this command.</p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="Bash">go<span class="devsite-syntax-w"> </span>get<span class="devsite-syntax-w"> </span>cloud.google.com/go/vertexai</pre></devsite-code></li> <li><p><a href="https://pkg.go.dev/cloud.google.com/go/aiplatform"><code translate="no" dir="ltr">cloud.google.com/go/aiplatform</code></a></p> <p><code translate="no" dir="ltr">aiplatform</code> is an auto-generated package.</p> <p>This package is intended for projects that require access to Vertex AI API capabilities and features not yet provided by the human authored <code translate="no" dir="ltr">vertexai</code> package.</p> <p>To install this package, run this command.</p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="Bash">go<span class="devsite-syntax-w"> </span>get<span class="devsite-syntax-w"> </span>cloud.google.com/go/aiplatform</pre></devsite-code></li> </ul></section> <section><h3 id="c" data-text="C#" tabindex="-1">C#</h3><p>Install the <code translate="no" dir="ltr">Google.Cloud.AIPlatform.V1</code> package from NuGet. Use your preferred method of adding packages to your project. For example, right-click the project in Visual Studio and choose <strong>Manage NuGet Packages...</strong>.</p></section> <section><h3 id="rest" data-text="REST" tabindex="-1">REST</h3><ol> <li><p>Configure your environment variables by entering the following. Replace <var translate="no"><code translate="no" dir="ltr">PROJECT_ID</var></code> with the ID of your Google Cloud project.</p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="Bash"><span class="devsite-syntax-nv">MODEL_ID</span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-s2">"gemini-1.5-flash-002"</span> <span class="devsite-syntax-nv">PROJECT_ID</span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-s2">"<var translate="no">PROJECT_ID</var>"</span></pre></devsite-code></li> <li><p>Use Google Cloud CLI to provision the endpoint by running this command.</p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="Bash">gcloud<span class="devsite-syntax-w"> </span>beta<span class="devsite-syntax-w"> </span>services<span class="devsite-syntax-w"> </span>identity<span class="devsite-syntax-w"> </span>create<span class="devsite-syntax-w"> </span>--service<span class="devsite-syntax-o">=</span>aiplatform.googleapis.com<span class="devsite-syntax-w"> </span>--project<span class="devsite-syntax-o">=</span><span class="devsite-syntax-si">${</span><span class="devsite-syntax-nv">PROJECT_ID</span><span class="devsite-syntax-si">}</span></pre></devsite-code></li> </ol></section> </div> <h2 id="send-text-only-request" data-text="Send a prompt to the Vertex AI Gemini API" tabindex="-1">Send a prompt to the Vertex AI Gemini API</h2> <p>Use the following code to send a prompt to the Vertex AI Gemini API. This sample returns a <a href="/vertex-ai/generative-ai/docs/prompt-gallery/samples/ideation_creative_naming_49">list of possible names</a> for a specialty flower store.</p> <p>You can run the code from the command line, by using an IDE, or by including the code in your application.</p> <div id="gemini-text-only-samples-code-sample" class="ds-selector-tabs" data-ds-scope="code-sample"> <section> <h3 id="gemini-text-only-samples-python_vertex_ai_sdk" track-metadata-position="gemini-text-only-samples" track-metadata-region-tag="gemini-text-only-samples" data-text="Python" tabindex="-1">Python</h3> <p> To send a prompt request, create a Python file (<code translate="no" dir="ltr">.py</code>) and copy the following code into the file. Set the value of <code translate="no" dir="ltr">PROJECT_ID</code> to the ID of your Google Cloud project. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/python-docs-samples/generative_ai/text_generation/text_example01.py/HEAD/generativeaionvertexai_gemini_generate_from_text_input" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/python-docs-samples/blob/HEAD/generative_ai/text_generation/text_example01.py" feedback-context="{&#34;language&#34;: &#34;python_vertex_ai_sdk&#34;, &#34;region_tag&#34;: &#34;gemini-text-only-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/python-docs-samples/blob/HEAD/generative_ai/text_generation/text_example01.py&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="python_vertex_ai_sdk" data-github-path="GoogleCloudPlatform/python-docs-samples/generative_ai/text_generation/text_example01.py" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_generate_from_text_input" dir="ltr" is-upgraded syntax="Python"><code translate="no" dir="ltr"><span class="devsite-syntax-kn">import</span> <span class="devsite-syntax-nn">vertexai</span> <span class="devsite-syntax-kn">from</span> <span class="devsite-syntax-nn">vertexai.generative_models</span> <span class="devsite-syntax-kn">import</span> <span class="devsite-syntax-n">GenerativeModel</span> <span class="devsite-syntax-c1"># TODO(developer): Update and un-comment below line</span> <span class="devsite-syntax-c1"># PROJECT_ID = "your-project-id"</span> <span class="devsite-syntax-n">vertexai</span><span class="devsite-syntax-o">.</span><span class="devsite-syntax-n">init</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">project</span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-n">PROJECT_ID</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-n">location</span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-s2">"us-central1"</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-n">model</span> <span class="devsite-syntax-o">=</span> <span class="devsite-syntax-n">GenerativeModel</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s2">"gemini-1.5-flash-002"</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-n">response</span> <span class="devsite-syntax-o">=</span> <span class="devsite-syntax-n">model</span><span class="devsite-syntax-o">.</span><span class="devsite-syntax-n">generate_content</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-s2">"What's a good name for a flower shop that specializes in selling bouquets of dried flowers?"</span> <span class="devsite-syntax-p">)</span> <span class="devsite-syntax-nb">print</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-o">.</span><span class="devsite-syntax-n">text</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-c1"># Example response:</span> <span class="devsite-syntax-c1"># **Emphasizing the Dried Aspect:**</span> <span class="devsite-syntax-c1"># * Everlasting Blooms</span> <span class="devsite-syntax-c1"># * Dried &amp; Delightful</span> <span class="devsite-syntax-c1"># * The Petal Preserve</span> <span class="devsite-syntax-c1"># ...</span> </code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-only-samples-nodejs" track-metadata-position="gemini-text-only-samples" track-metadata-region-tag="gemini-text-only-samples" data-text="Node.js" tabindex="-1"><span class="notranslate">Node.js</span></h3> <p> To send a prompt request, create a Node.js file (<code translate="no" dir="ltr">.js</code>) and copy the following code into the file. Replace <var translate="no"><code translate="no" dir="ltr">PROJECT_ID</code></var> with the ID of your Google Cloud project. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/nodejs-docs-samples/generative-ai/snippets/gemini-text-input.js/HEAD/generativeaionvertexai_gemini_generate_from_text_input" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/HEAD/generative-ai/snippets/gemini-text-input.js" feedback-context="{&#34;language&#34;: &#34;nodejs&#34;, &#34;region_tag&#34;: &#34;gemini-text-only-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/HEAD/generative-ai/snippets/gemini-text-input.js&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="nodejs" data-github-path="GoogleCloudPlatform/nodejs-docs-samples/generative-ai/snippets/gemini-text-input.js" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_generate_from_text_input" dir="ltr" is-upgraded syntax="JavaScript"><code translate="no" dir="ltr"><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span><span class="devsite-syntax-nx">VertexAI</span><span class="devsite-syntax-p">}</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">require</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s1">'@google-cloud/vertexai'</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-cm">/**</span> <span class="devsite-syntax-cm"> * TODO(developer): Update these variables before running the sample.</span> <span class="devsite-syntax-cm"> */</span> <span class="devsite-syntax-k">async</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">function</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">generate_from_text_input</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">projectId</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'<var translate="no">PROJECT_ID</var>'</span><span class="devsite-syntax-p">)</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">vertexAI</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-ow">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">VertexAI</span><span class="devsite-syntax-p">({</span><span class="devsite-syntax-nx">project</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">projectId</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">location</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'us-central1'</span><span class="devsite-syntax-p">});</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">generativeModel</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">vertexAI</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">getGenerativeModel</span><span class="devsite-syntax-p">({</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">model</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'gemini-1.5-flash-001'</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">});</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">prompt</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s2">"What's a good name for a flower shop that specializes in selling bouquets of dried flowers?"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">resp</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">await</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">generativeModel</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">generateContent</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">prompt</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">contentResponse</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">await</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">resp</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">response</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">console</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">log</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nb">JSON</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">stringify</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">contentResponse</span><span class="devsite-syntax-p">));</span> <span class="devsite-syntax-p">}</span></code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-only-samples-java" track-metadata-position="gemini-text-only-samples" track-metadata-region-tag="gemini-text-only-samples" data-text="Java" tabindex="-1"><span class="notranslate">Java</span></h3> <p> To send a prompt request, create a Java file (<code translate="no" dir="ltr">.java</code>) and copy the following code into the file. Set <var translate="no"><code translate="no" dir="ltr">your-google-cloud-project-id</code></var> to your Google Cloud project ID. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/java-docs-samples/vertexai/snippets/src/main/java/vertexai/gemini/TextInput.java/HEAD/generativeaionvertexai_gemini_generate_from_text_input" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/java-docs-samples/blob/HEAD/vertexai/snippets/src/main/java/vertexai/gemini/TextInput.java" feedback-context="{&#34;language&#34;: &#34;java&#34;, &#34;region_tag&#34;: &#34;gemini-text-only-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/java-docs-samples/blob/HEAD/vertexai/snippets/src/main/java/vertexai/gemini/TextInput.java&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="java" data-github-path="GoogleCloudPlatform/java-docs-samples/vertexai/snippets/src/main/java/vertexai/gemini/TextInput.java" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_generate_from_text_input" dir="ltr" is-upgraded syntax="Java"><code translate="no" dir="ltr"><span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.VertexAI</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.api.GenerateContentResponse</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.generativeai.GenerativeModel</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.generativeai.ResponseHandler</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">java.io.IOException</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kd">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">class</span> <span class="devsite-syntax-nc">TextInput</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">static</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">void</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nf">main</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-o">[]</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">args</span><span class="devsite-syntax-p">)</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">throws</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">IOException</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// TODO(developer): Replace these variables before running the sample.</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"your-google-cloud-project-id"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"us-central1"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">modelName</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gemini-1.5-flash-001"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">textPrompt</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"What's a good name for a flower shop that specializes in selling bouquets of"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">+</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">" dried flowers?"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">output</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">textInput</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">modelName</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">textPrompt</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">System</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">out</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">println</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">output</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Passes the provided text input to the Gemini model and returns the text-only response.</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// For the specified textPrompt, the model returns a list of possible store names.</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">static</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nf">textInput</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">modelName</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">textPrompt</span><span class="devsite-syntax-p">)</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">throws</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">IOException</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Initialize client that will be used to send requests. This client only needs</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// to be created once, and can be reused for multiple requests.</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">try</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">VertexAI</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">vertexAI</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">VertexAI</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-p">))</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerativeModel</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">model</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerativeModel</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">modelName</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">vertexAI</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerateContentResponse</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">model</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">generateContent</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">textPrompt</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">output</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">ResponseHandler</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">getText</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">output</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-p">}</span></code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-only-samples-go" track-metadata-position="gemini-text-only-samples" track-metadata-region-tag="gemini-text-only-samples" data-text="Go" tabindex="-1"><span class="notranslate">Go</span></h3> <p> To send a prompt request, create a Go file (<code translate="no" dir="ltr">.go</code>) and copy the following code into the file. Replace <code translate="no" dir="ltr">projectID</code> with the ID of your Google Cloud project. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/golang-samples/vertexai/snippets/text_input.go/HEAD/generativeaionvertexai_gemini_generate_from_text_input" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/golang-samples/blob/HEAD/vertexai/snippets/text_input.go" feedback-context="{&#34;language&#34;: &#34;golang&#34;, &#34;region_tag&#34;: &#34;gemini-text-only-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/golang-samples/blob/HEAD/vertexai/snippets/text_input.go&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="golang" data-github-path="GoogleCloudPlatform/golang-samples/vertexai/snippets/text_input.go" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_generate_from_text_input" dir="ltr" is-upgraded syntax="Go"><code translate="no" dir="ltr"><span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"context"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"encoding/json"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"fmt"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"io"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"cloud.google.com/go/vertexai/genai"</span> <span class="devsite-syntax-p">)</span> <span class="devsite-syntax-kd">func</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">generateContentFromText</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">w</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">io</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Writer</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">projectID</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-p">)</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">error</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">location</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"us-central1"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">modelName</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gemini-1.5-flash-001"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">ctx</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">context</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Background</span><span class="devsite-syntax-p">()</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">client</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">genai</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">NewClient</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">ctx</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">projectID</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">location</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">if</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">!=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kc">nil</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fmt</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Errorf</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"error creating client: %w"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">gemini</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">client</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">GenerativeModel</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">modelName</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">prompt</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">genai</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Text</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"What's a good name for a flower shop that specializes in selling bouquets of dried flowers?"</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">resp</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">gemini</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">GenerateContent</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">ctx</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">prompt</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">if</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">!=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kc">nil</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fmt</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Errorf</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"error generating content: %w"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// See the JSON response in</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// https://pkg.go.dev/cloud.google.com/go/vertexai/genai#GenerateContentResponse.</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">rb</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">json</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">MarshalIndent</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">resp</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">""</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">" "</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">if</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">!=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kc">nil</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fmt</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Errorf</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"json.MarshalIndent: %w"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fmt</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Fprintln</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">w</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nb">string</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">rb</span><span class="devsite-syntax-p">))</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kc">nil</span> <span class="devsite-syntax-p">}</span> </code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-only-samples-csharp" track-metadata-position="gemini-text-only-samples" track-metadata-region-tag="gemini-text-only-samples" data-text="C#" tabindex="-1"><span class="notranslate">C#</span></h3> <p> To send a prompt request, create a C# file (<code translate="no" dir="ltr">.cs</code>) and copy the following code into the file. Set <var translate="no"><code translate="no" dir="ltr">your-project-id</code></var> to your Google Cloud project ID. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/dotnet-docs-samples/aiplatform/api/AIPlatform.Samples/TextInputSample.cs/HEAD/generativeaionvertexai_gemini_generate_from_text_input" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/dotnet-docs-samples/blob/HEAD/aiplatform/api/AIPlatform.Samples/TextInputSample.cs" feedback-context="{&#34;language&#34;: &#34;csharp&#34;, &#34;region_tag&#34;: &#34;gemini-text-only-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/dotnet-docs-samples/blob/HEAD/aiplatform/api/AIPlatform.Samples/TextInputSample.cs&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="csharp" data-github-path="GoogleCloudPlatform/dotnet-docs-samples/aiplatform/api/AIPlatform.Samples/TextInputSample.cs" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_generate_from_text_input" dir="ltr" is-upgraded syntax="C#"><code translate="no" dir="ltr"> <span class="devsite-syntax-k">using</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">Google.Cloud.AIPlatform.V1</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-k">using</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">System</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-k">using</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">System.Threading.Tasks</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-k">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">class</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nc">TextInputSample</span> <span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">async</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Task&lt;string&gt;</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nf">TextInput</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"your-project-id"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"us-central1"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">publisher</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"google"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">model</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gemini-1.5-flash-001"</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">var</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">predictionServiceClient</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">PredictionServiceClientBuilder</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Endpoint</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">$"{location}-aiplatform.googleapis.com"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}.</span><span class="devsite-syntax-n">Build</span><span class="devsite-syntax-p">();</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">prompt</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">@"What's a good name for a flower shop that specializes in selling bouquets of dried flowers?"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">var</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">generateContentRequest</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerateContentRequest</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Model</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">$"projects/{projectId}/locations/{location}/publishers/{publisher}/models/{model}"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Contents</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Content</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Role</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"USER"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Parts</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Part</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Text</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">prompt</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">};</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerateContentResponse</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">await</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">predictionServiceClient</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">GenerateContentAsync</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">generateContentRequest</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">responseText</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">Candidates</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-m">0</span><span class="devsite-syntax-p">].</span><span class="devsite-syntax-n">Content</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">Parts</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-m">0</span><span class="devsite-syntax-p">].</span><span class="devsite-syntax-n">Text</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Console</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">WriteLine</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">responseText</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">responseText</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-p">}</span> </code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-only-samples-drest" track-metadata-position="gemini-text-only-samples" track-metadata-region-tag="gemini-text-only-samples" data-text="REST" tabindex="-1">REST</h3> <p> To send this prompt request, run the curl command from the command line or include the REST call in your application. </p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="Bash">curl<span class="devsite-syntax-w"> </span>-X<span class="devsite-syntax-w"> </span>POST<span class="devsite-syntax-w"> </span><span class="devsite-syntax-se">\</span> -H<span class="devsite-syntax-w"> </span><span class="devsite-syntax-s2">"Authorization: Bearer </span><span class="devsite-syntax-k">$(</span>gcloud<span class="devsite-syntax-w"> </span>auth<span class="devsite-syntax-w"> </span>print-access-token<span class="devsite-syntax-k">)</span><span class="devsite-syntax-s2">"</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-se">\</span> -H<span class="devsite-syntax-w"> </span><span class="devsite-syntax-s2">"Content-Type: application/json"</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-se">\</span> https://us-central1-aiplatform.googleapis.com/v1/projects/<span class="devsite-syntax-si">${</span><span class="devsite-syntax-nv">PROJECT_ID</span><span class="devsite-syntax-si">}</span>/locations/us-central1/publishers/google/models/<span class="devsite-syntax-si">${</span><span class="devsite-syntax-nv">MODEL_ID</span><span class="devsite-syntax-si">}</span>:generateContent<span class="devsite-syntax-w"> </span>-d<span class="devsite-syntax-w"> </span><span class="devsite-syntax-se">\</span> <span class="devsite-syntax-s1">$'{</span> <span class="devsite-syntax-s1"> "contents": {</span> <span class="devsite-syntax-s1"> "role": "user",</span> <span class="devsite-syntax-s1"> "parts": [</span> <span class="devsite-syntax-s1"> {</span> <span class="devsite-syntax-s1"> "text": "What\'s a good name for a flower shop that specializes in selling bouquets of dried flowers?"</span> <span class="devsite-syntax-s1"> }</span> <span class="devsite-syntax-s1"> ]</span> <span class="devsite-syntax-s1"> }</span> <span class="devsite-syntax-s1">}'</span></pre></devsite-code> </p> The model returns a response. Note that the response is generated in sections with each section separately evaluated for safety. </p> </section> </div></p> <h2 id="send-request-image" data-text="Send a prompt and an image to the Vertex AI Gemini API" tabindex="-1">Send a prompt and an image to the Vertex AI Gemini API</h2> <p>Use the following code to send a prompt that includes text and an image to the Vertex AI Gemini API. This sample returns a description of the <a href="https://storage.googleapis.com/cloud-samples-data/generative-ai/image/scones.jpg">provided image</a> (<a href="https://storage.googleapis.com/cloud-samples-data/vertex-ai/llm/prompts/landmark1.png">image for Java sample</a>).</p> <div id="gemini-text-and-image-samples-code-sample" class="ds-selector-tabs" data-ds-scope="code-sample"> <section> <h3 id="gemini-text-and-image-samples-python_vertex_ai_sdk" track-metadata-position="gemini-text-and-image-samples" track-metadata-region-tag="gemini-text-and-image-samples" data-text="Python" tabindex="-1">Python</h3> <p> To send a prompt request, create a Python file (<code translate="no" dir="ltr">.py</code>) and copy the following code into the file. Set the value of <code translate="no" dir="ltr">PROJECT_ID</code> to the ID of your Google Cloud project. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/python-docs-samples/generative_ai/image/image_example01.py/HEAD/generativeaionvertexai_gemini_get_started" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/python-docs-samples/blob/HEAD/generative_ai/image/image_example01.py" feedback-context="{&#34;language&#34;: &#34;python_vertex_ai_sdk&#34;, &#34;region_tag&#34;: &#34;gemini-text-and-image-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/python-docs-samples/blob/HEAD/generative_ai/image/image_example01.py&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="python_vertex_ai_sdk" data-github-path="GoogleCloudPlatform/python-docs-samples/generative_ai/image/image_example01.py" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_get_started" dir="ltr" is-upgraded syntax="Python"><code translate="no" dir="ltr"><span class="devsite-syntax-kn">import</span> <span class="devsite-syntax-nn">vertexai</span> <span class="devsite-syntax-kn">from</span> <span class="devsite-syntax-nn">vertexai.generative_models</span> <span class="devsite-syntax-kn">import</span> <span class="devsite-syntax-n">GenerativeModel</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-n">Part</span> <span class="devsite-syntax-c1"># TODO(developer): Update and un-comment below line</span> <span class="devsite-syntax-c1"># PROJECT_ID = "your-project-id"</span> <span class="devsite-syntax-n">vertexai</span><span class="devsite-syntax-o">.</span><span class="devsite-syntax-n">init</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">project</span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-n">PROJECT_ID</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-n">location</span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-s2">"us-central1"</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-n">model</span> <span class="devsite-syntax-o">=</span> <span class="devsite-syntax-n">GenerativeModel</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s2">"gemini-1.5-flash-002"</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-n">response</span> <span class="devsite-syntax-o">=</span> <span class="devsite-syntax-n">model</span><span class="devsite-syntax-o">.</span><span class="devsite-syntax-n">generate_content</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-p">[</span> <span class="devsite-syntax-n">Part</span><span class="devsite-syntax-o">.</span><span class="devsite-syntax-n">from_uri</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-s2">"gs://cloud-samples-data/generative-ai/image/scones.jpg"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-n">mime_type</span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-s2">"image/jpeg"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-p">),</span> <span class="devsite-syntax-s2">"What is shown in this image?"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-p">]</span> <span class="devsite-syntax-p">)</span> <span class="devsite-syntax-nb">print</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-o">.</span><span class="devsite-syntax-n">text</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-c1"># That's a lovely overhead shot of a rustic-style breakfast or brunch spread.</span> <span class="devsite-syntax-c1"># Here's what's in the image:</span> <span class="devsite-syntax-c1"># * **Blueberry scones:** Several freshly baked blueberry scones are arranged on parchment paper.</span> <span class="devsite-syntax-c1"># They look crumbly and delicious.</span> <span class="devsite-syntax-c1"># ...</span> </code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-and-image-samples-nodejs" track-metadata-position="gemini-text-and-image-samples" track-metadata-region-tag="gemini-text-and-image-samples" data-text="Node.js" tabindex="-1"><span class="notranslate">Node.js</span></h3> <p> To send a prompt request, create a Node.js file (<code translate="no" dir="ltr">.js</code>) and copy the following code into the file. Replace <var translate="no"><code translate="no" dir="ltr">PROJECT_ID</code></var> with the ID of your Google Cloud project. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/nodejs-docs-samples/generative-ai/snippets/nonStreamingMultipartContent.js/HEAD/generativeaionvertexai_gemini_get_started" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/HEAD/generative-ai/snippets/nonStreamingMultipartContent.js" feedback-context="{&#34;language&#34;: &#34;nodejs&#34;, &#34;region_tag&#34;: &#34;gemini-text-and-image-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/HEAD/generative-ai/snippets/nonStreamingMultipartContent.js&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="nodejs" data-github-path="GoogleCloudPlatform/nodejs-docs-samples/generative-ai/snippets/nonStreamingMultipartContent.js" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_get_started" dir="ltr" is-upgraded syntax="JavaScript"><code translate="no" dir="ltr"><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span><span class="devsite-syntax-nx">VertexAI</span><span class="devsite-syntax-p">}</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">require</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s1">'@google-cloud/vertexai'</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-cm">/**</span> <span class="devsite-syntax-cm"> * TODO(developer): Update these variables before running the sample.</span> <span class="devsite-syntax-cm"> */</span> <span class="devsite-syntax-k">async</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">function</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">createNonStreamingMultipartContent</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">projectId</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'<var translate="no">PROJECT_ID</var>'</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">location</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'us-central1'</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">model</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'gemini-1.5-flash-001'</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">image</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'gs://generativeai-downloads/images/scones.jpg'</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">mimeType</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'image/jpeg'</span> <span class="devsite-syntax-p">)</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Initialize Vertex with your Cloud project and location</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">vertexAI</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-ow">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">VertexAI</span><span class="devsite-syntax-p">({</span><span class="devsite-syntax-nx">project</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">projectId</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">location</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">location</span><span class="devsite-syntax-p">});</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Instantiate the model</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">generativeVisionModel</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">vertexAI</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">getGenerativeModel</span><span class="devsite-syntax-p">({</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">model</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">model</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">});</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// For images, the SDK supports both Google Cloud Storage URI and base64 strings</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">filePart</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fileData</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fileUri</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">image</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">mimeType</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">mimeType</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">},</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">};</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">textPart</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">text</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'what is shown in this image?'</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">};</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">request</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">contents</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">[{</span><span class="devsite-syntax-nx">role</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'user'</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">parts</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-nx">filePart</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">textPart</span><span class="devsite-syntax-p">]}],</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">};</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">console</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">log</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s1">'Prompt Text:'</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">console</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">log</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">request</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">contents</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-mf">0</span><span class="devsite-syntax-p">].</span><span class="devsite-syntax-nx">parts</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-mf">1</span><span class="devsite-syntax-p">].</span><span class="devsite-syntax-nx">text</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">console</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">log</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s1">'Non-Streaming Response Text:'</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Generate a response</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">response</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">await</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">generativeVisionModel</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">generateContent</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">request</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Select the text from the response</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fullTextResponse</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">response</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">response</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">candidates</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-mf">0</span><span class="devsite-syntax-p">].</span><span class="devsite-syntax-nx">content</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">parts</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-mf">0</span><span class="devsite-syntax-p">].</span><span class="devsite-syntax-nx">text</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">console</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">log</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">fullTextResponse</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-p">}</span></code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-and-image-samples-java" track-metadata-position="gemini-text-and-image-samples" track-metadata-region-tag="gemini-text-and-image-samples" data-text="Java" tabindex="-1"><span class="notranslate">Java</span></h3> <p> To send a prompt request, create a Java file (<code translate="no" dir="ltr">.java</code>) and copy the following code into the file. Set <var translate="no"><code translate="no" dir="ltr">your-google-cloud-project-id</code></var> to your Google Cloud project ID. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/java-docs-samples/vertexai/snippets/src/main/java/vertexai/gemini/Quickstart.java/HEAD/generativeaionvertexai_gemini_get_started" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/java-docs-samples/blob/HEAD/vertexai/snippets/src/main/java/vertexai/gemini/Quickstart.java" feedback-context="{&#34;language&#34;: &#34;java&#34;, &#34;region_tag&#34;: &#34;gemini-text-and-image-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/java-docs-samples/blob/HEAD/vertexai/snippets/src/main/java/vertexai/gemini/Quickstart.java&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="java" data-github-path="GoogleCloudPlatform/java-docs-samples/vertexai/snippets/src/main/java/vertexai/gemini/Quickstart.java" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_get_started" dir="ltr" is-upgraded syntax="Java"><code translate="no" dir="ltr"><span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.VertexAI</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.api.GenerateContentResponse</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.generativeai.ContentMaker</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.generativeai.GenerativeModel</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.generativeai.PartMaker</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">java.io.IOException</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kd">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">class</span> <span class="devsite-syntax-nc">Quickstart</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">static</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">void</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nf">main</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-o">[]</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">args</span><span class="devsite-syntax-p">)</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">throws</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">IOException</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// TODO(developer): Replace these variables before running the sample.</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"your-google-cloud-project-id"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"us-central1"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">modelName</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gemini-1.5-flash-001"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">output</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">quickstart</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">modelName</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">System</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">out</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">println</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">output</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Analyzes the provided Multimodal input.</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">static</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nf">quickstart</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">modelName</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">throws</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">IOException</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Initialize client that will be used to send requests. This client only needs</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// to be created once, and can be reused for multiple requests.</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">try</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">VertexAI</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">vertexAI</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">VertexAI</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-p">))</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">imageUri</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gs://generativeai-downloads/images/scones.jpg"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerativeModel</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">model</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerativeModel</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">modelName</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">vertexAI</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerateContentResponse</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">model</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">generateContent</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">ContentMaker</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">fromMultiModalData</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">PartMaker</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">fromMimeTypeAndData</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"image/png"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">imageUri</span><span class="devsite-syntax-p">),</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"What's in this photo"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">));</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">toString</span><span class="devsite-syntax-p">();</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-p">}</span></code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-and-image-samples-go" track-metadata-position="gemini-text-and-image-samples" track-metadata-region-tag="gemini-text-and-image-samples" data-text="Go" tabindex="-1"><span class="notranslate">Go</span></h3> <p> To send a prompt request, create a Go file (<code translate="no" dir="ltr">.go</code>) and copy the following code into the file. Replace <code translate="no" dir="ltr">projectID</code> with the ID of your Google Cloud project. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/golang-samples/vertexai/snippets/try_gemini.go/HEAD/generativeaionvertexai_gemini_image" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/golang-samples/blob/HEAD/vertexai/snippets/try_gemini.go" feedback-context="{&#34;language&#34;: &#34;golang&#34;, &#34;region_tag&#34;: &#34;gemini-text-and-image-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/golang-samples/blob/HEAD/vertexai/snippets/try_gemini.go&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="golang" data-github-path="GoogleCloudPlatform/golang-samples/vertexai/snippets/try_gemini.go" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_image" dir="ltr" is-upgraded syntax="Go"><code translate="no" dir="ltr"><span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"context"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"encoding/json"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"fmt"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"io"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"cloud.google.com/go/vertexai/genai"</span> <span class="devsite-syntax-p">)</span> <span class="devsite-syntax-kd">func</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">tryGemini</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">w</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">io</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Writer</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">projectID</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">location</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">modelName</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-p">)</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">error</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// location := "us-central1"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// modelName := "gemini-1.5-flash-001"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">ctx</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">context</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Background</span><span class="devsite-syntax-p">()</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">client</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">genai</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">NewClient</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">ctx</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">projectID</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">location</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">if</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">!=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kc">nil</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fmt</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Errorf</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"error creating client: %w"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">gemini</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">client</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">GenerativeModel</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">modelName</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">img</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">genai</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">FileData</span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">MIMEType</span><span class="devsite-syntax-p">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"image/jpeg"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">FileURI</span><span class="devsite-syntax-p">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gs://generativeai-downloads/images/scones.jpg"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">prompt</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">genai</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Text</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"What is in this image?"</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">resp</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">gemini</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">GenerateContent</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">ctx</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">img</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">prompt</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">if</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">!=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kc">nil</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fmt</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Errorf</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"error generating content: %w"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">rb</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">json</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">MarshalIndent</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">resp</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">""</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">" "</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">if</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">!=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kc">nil</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fmt</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Errorf</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"json.MarshalIndent: %w"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fmt</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Fprintln</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">w</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nb">string</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">rb</span><span class="devsite-syntax-p">))</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kc">nil</span> <span class="devsite-syntax-p">}</span> </code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-and-image-samples-csharp" track-metadata-position="gemini-text-and-image-samples" track-metadata-region-tag="gemini-text-and-image-samples" data-text="C#" tabindex="-1"><span class="notranslate">C#</span></h3> <p> To send a prompt request, create a C# file (<code translate="no" dir="ltr">.cs</code>) and copy the following code into the file. Set <var translate="no"><code translate="no" dir="ltr">your-project-id</code></var> to your Google Cloud project ID. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/dotnet-docs-samples/aiplatform/api/AIPlatform.Samples/GeminiQuickstart.cs/HEAD/generativeaionvertexai_gemini_image" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/dotnet-docs-samples/blob/HEAD/aiplatform/api/AIPlatform.Samples/GeminiQuickstart.cs" feedback-context="{&#34;language&#34;: &#34;csharp&#34;, &#34;region_tag&#34;: &#34;gemini-text-and-image-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/dotnet-docs-samples/blob/HEAD/aiplatform/api/AIPlatform.Samples/GeminiQuickstart.cs&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="csharp" data-github-path="GoogleCloudPlatform/dotnet-docs-samples/aiplatform/api/AIPlatform.Samples/GeminiQuickstart.cs" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_image" dir="ltr" is-upgraded syntax="C#"><code translate="no" dir="ltr"> <span class="devsite-syntax-k">using</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">Google.Api.Gax.Grpc</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-k">using</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">Google.Cloud.AIPlatform.V1</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-k">using</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">System.Text</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-k">using</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">System.Threading.Tasks</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-k">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">class</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nc">GeminiQuickstart</span> <span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">async</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Task&lt;string&gt;</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nf">GenerateContent</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"your-project-id"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"us-central1"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">publisher</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"google"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">model</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gemini-1.5-flash-001"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Create client</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">var</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">predictionServiceClient</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">PredictionServiceClientBuilder</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Endpoint</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">$"{location}-aiplatform.googleapis.com"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}.</span><span class="devsite-syntax-n">Build</span><span class="devsite-syntax-p">();</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Initialize content request</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">var</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">generateContentRequest</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerateContentRequest</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Model</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">$"projects/{projectId}/locations/{location}/publishers/{publisher}/models/{model}"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerationConfig</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerationConfig</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Temperature</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-m">0.4f</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">TopP</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-m">1</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">TopK</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-m">32</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">MaxOutputTokens</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-m">2048</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">},</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Contents</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Content</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Role</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"USER"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Parts</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Part</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Text</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"What's in this photo?"</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">},</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Part</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">FileData</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-p">()</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">MimeType</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"image/png"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">FileUri</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gs://generativeai-downloads/images/scones.jpg"</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">};</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Make the request, returning a streaming response</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">using</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">PredictionServiceClient.StreamGenerateContentStream</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">predictionServiceClient</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">StreamGenerateContent</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">generateContentRequest</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">StringBuilder</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">fullText</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-p">();</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Read streaming responses from server until complete</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">AsyncResponseStream&lt;GenerateContentResponse&gt;</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">responseStream</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">GetResponseStream</span><span class="devsite-syntax-p">();</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">await</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nf">foreach</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">GenerateContentResponse</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">responseItem</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">in</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">responseStream</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">fullText</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">Append</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">responseItem</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">Candidates</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-m">0</span><span class="devsite-syntax-p">].</span><span class="devsite-syntax-n">Content</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">Parts</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-m">0</span><span class="devsite-syntax-p">].</span><span class="devsite-syntax-n">Text</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">fullText</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">ToString</span><span class="devsite-syntax-p">();</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-p">}</span> </code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-and-image-samples-drest" track-metadata-position="gemini-text-and-image-samples" track-metadata-region-tag="gemini-text-and-image-samples" data-text="REST" tabindex="-1">REST</h3> <p> You can send this prompt request from from your IDE, or you can embed the REST call into your application where appropriate. </p> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="Bash">curl<span class="devsite-syntax-w"> </span>-X<span class="devsite-syntax-w"> </span>POST<span class="devsite-syntax-w"> </span><span class="devsite-syntax-se">\</span> -H<span class="devsite-syntax-w"> </span><span class="devsite-syntax-s2">"Authorization: Bearer </span><span class="devsite-syntax-k">$(</span>gcloud<span class="devsite-syntax-w"> </span>auth<span class="devsite-syntax-w"> </span>print-access-token<span class="devsite-syntax-k">)</span><span class="devsite-syntax-s2">"</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-se">\</span> -H<span class="devsite-syntax-w"> </span><span class="devsite-syntax-s2">"Content-Type: application/json"</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-se">\</span> https://us-central1-aiplatform.googleapis.com/v1/projects/<span class="devsite-syntax-si">${</span><span class="devsite-syntax-nv">PROJECT_ID</span><span class="devsite-syntax-si">}</span>/locations/us-central1/publishers/google/models/<span class="devsite-syntax-si">${</span><span class="devsite-syntax-nv">MODEL_ID</span><span class="devsite-syntax-si">}</span>:generateContent<span class="devsite-syntax-w"> </span>-d<span class="devsite-syntax-w"> </span><span class="devsite-syntax-se">\</span> <span class="devsite-syntax-s1">$'{</span> <span class="devsite-syntax-s1"> "contents": {</span> <span class="devsite-syntax-s1"> "role": "user",</span> <span class="devsite-syntax-s1"> "parts": [</span> <span class="devsite-syntax-s1"> {</span> <span class="devsite-syntax-s1"> "fileData": {</span> <span class="devsite-syntax-s1"> "mimeType": "image/jpeg",</span> <span class="devsite-syntax-s1"> "fileUri": "gs://generativeai-downloads/images/scones.jpg"</span> <span class="devsite-syntax-s1"> }</span> <span class="devsite-syntax-s1"> },</span> <span class="devsite-syntax-s1"> {</span> <span class="devsite-syntax-s1"> "text": "Describe this picture."</span> <span class="devsite-syntax-s1"> }</span> <span class="devsite-syntax-s1"> ]</span> <span class="devsite-syntax-s1"> }</span> <span class="devsite-syntax-s1">}'</span></pre></devsite-code> <p> The model returns a response. Note that the response is generated in sections with each section separately evaluated for safety. </p> </section> </div></p> <h2 id="send-request-audio-video" data-text="Send a prompt and a video to the Vertex AI Gemini API" tabindex="-1">Send a prompt and a video to the Vertex AI Gemini API</h2> <p>Use the following code to send a prompt that includes text, audio, and video to the Vertex AI Gemini API. This sample returns a description of the <a href="https://storage.googleapis.com/cloud-samples-data/generative-ai/video/pixel8.mp4">provided video</a>, including anything important from the audio track.</p> <p>You can send this prompt request by using the command line, using your IDE, or by including the REST call in your application.</p> <div id="gemini-text-and-audio-and-video-samples-code-sample" class="ds-selector-tabs" data-ds-scope="code-sample"> <section> <h3 id="gemini-text-and-audio-and-video-samples-python_vertex_ai_sdk" track-metadata-position="gemini-text-and-audio-and-video-samples" track-metadata-region-tag="gemini-text-and-audio-and-video-samples" data-text="Python" tabindex="-1">Python</h3> <p> To send a prompt request, create a Python file (<code translate="no" dir="ltr">.py</code>) and copy the following code into the file. Set the value of <code translate="no" dir="ltr">PROJECT_ID</code> to the ID of your Google Cloud project. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/python-docs-samples/generative_ai/understand_video/audio_video_example.py/HEAD/generativeaionvertexai_gemini_video_with_audio" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/python-docs-samples/blob/HEAD/generative_ai/understand_video/audio_video_example.py" feedback-context="{&#34;language&#34;: &#34;python_vertex_ai_sdk&#34;, &#34;region_tag&#34;: &#34;gemini-text-and-audio-and-video-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/python-docs-samples/blob/HEAD/generative_ai/understand_video/audio_video_example.py&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="python_vertex_ai_sdk" data-github-path="GoogleCloudPlatform/python-docs-samples/generative_ai/understand_video/audio_video_example.py" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_video_with_audio" dir="ltr" is-upgraded syntax="Python"><code translate="no" dir="ltr"> <span class="devsite-syntax-kn">import</span> <span class="devsite-syntax-nn">vertexai</span> <span class="devsite-syntax-kn">from</span> <span class="devsite-syntax-nn">vertexai.generative_models</span> <span class="devsite-syntax-kn">import</span> <span class="devsite-syntax-n">GenerativeModel</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-n">Part</span> <span class="devsite-syntax-c1"># TODO(developer): Update and un-comment below line</span> <span class="devsite-syntax-c1"># PROJECT_ID = "your-project-id"</span> <span class="devsite-syntax-n">vertexai</span><span class="devsite-syntax-o">.</span><span class="devsite-syntax-n">init</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">project</span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-n">PROJECT_ID</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-n">location</span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-s2">"us-central1"</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-n">model</span> <span class="devsite-syntax-o">=</span> <span class="devsite-syntax-n">GenerativeModel</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s2">"gemini-1.5-flash-002"</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-n">prompt</span> <span class="devsite-syntax-o">=</span> <span class="devsite-syntax-s2">"""</span> <span class="devsite-syntax-s2">Provide a description of the video.</span> <span class="devsite-syntax-s2">The description should also contain anything important which people say in the video.</span> <span class="devsite-syntax-s2">"""</span> <span class="devsite-syntax-n">video_file</span> <span class="devsite-syntax-o">=</span> <span class="devsite-syntax-n">Part</span><span class="devsite-syntax-o">.</span><span class="devsite-syntax-n">from_uri</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-n">uri</span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-s2">"gs://cloud-samples-data/generative-ai/video/pixel8.mp4"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-n">mime_type</span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-s2">"video/mp4"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-p">)</span> <span class="devsite-syntax-n">contents</span> <span class="devsite-syntax-o">=</span> <span class="devsite-syntax-p">[</span><span class="devsite-syntax-n">video_file</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-n">prompt</span><span class="devsite-syntax-p">]</span> <span class="devsite-syntax-n">response</span> <span class="devsite-syntax-o">=</span> <span class="devsite-syntax-n">model</span><span class="devsite-syntax-o">.</span><span class="devsite-syntax-n">generate_content</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">contents</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-nb">print</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-o">.</span><span class="devsite-syntax-n">text</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-c1"># Example response:</span> <span class="devsite-syntax-c1"># Here is a description of the video.</span> <span class="devsite-syntax-c1"># ... Then, the scene changes to a woman named Saeko Shimada..</span> <span class="devsite-syntax-c1"># She says, "Tokyo has many faces. The city at night is totally different</span> <span class="devsite-syntax-c1"># from what you see during the day."</span> <span class="devsite-syntax-c1"># ...</span> </code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-and-audio-and-video-samples-nodejs" track-metadata-position="gemini-text-and-audio-and-video-samples" track-metadata-region-tag="gemini-text-and-audio-and-video-samples" data-text="Node.js" tabindex="-1"><span class="notranslate">Node.js</span></h3> <p> To send a prompt request, create a Node.js file (<code translate="no" dir="ltr">.js</code>) and copy the following code into the file. Replace <var translate="no"><code translate="no" dir="ltr">PROJECT_ID</code></var> with the ID of your Google Cloud project. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/nodejs-docs-samples/generative-ai/snippets/gemini-video-audio.js/HEAD/generativeaionvertexai_gemini_video_with_audio" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/HEAD/generative-ai/snippets/gemini-video-audio.js" feedback-context="{&#34;language&#34;: &#34;nodejs&#34;, &#34;region_tag&#34;: &#34;gemini-text-and-audio-and-video-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/HEAD/generative-ai/snippets/gemini-video-audio.js&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="nodejs" data-github-path="GoogleCloudPlatform/nodejs-docs-samples/generative-ai/snippets/gemini-video-audio.js" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_video_with_audio" dir="ltr" is-upgraded syntax="JavaScript"><code translate="no" dir="ltr"><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span><span class="devsite-syntax-nx">VertexAI</span><span class="devsite-syntax-p">}</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">require</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s1">'@google-cloud/vertexai'</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-cm">/**</span> <span class="devsite-syntax-cm"> * TODO(developer): Update these variables before running the sample.</span> <span class="devsite-syntax-cm"> */</span> <span class="devsite-syntax-k">async</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">function</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">analyze_video_with_audio</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">projectId</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'<var translate="no">PROJECT_ID</var>'</span><span class="devsite-syntax-p">)</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">vertexAI</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-ow">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">VertexAI</span><span class="devsite-syntax-p">({</span><span class="devsite-syntax-nx">project</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">projectId</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">location</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'us-central1'</span><span class="devsite-syntax-p">});</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">generativeModel</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">vertexAI</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">getGenerativeModel</span><span class="devsite-syntax-p">({</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">model</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'gemini-1.5-flash-001'</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">});</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">filePart</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">file_data</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">file_uri</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'gs://cloud-samples-data/generative-ai/video/pixel8.mp4'</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">mime_type</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'video/mp4'</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">},</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">};</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">textPart</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">text</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-sb">`</span> <span class="devsite-syntax-sb"> Provide a description of the video.</span> <span class="devsite-syntax-sb"> The description should also contain anything important which people say in the video.`</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">};</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">request</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">contents</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">[{</span><span class="devsite-syntax-nx">role</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s1">'user'</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">parts</span><span class="devsite-syntax-o">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-nx">filePart</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">textPart</span><span class="devsite-syntax-p">]}],</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">};</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">resp</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">await</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">generativeModel</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">generateContent</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">request</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">const</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">contentResponse</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">await</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">resp</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">response</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">console</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">log</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nb">JSON</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">stringify</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">contentResponse</span><span class="devsite-syntax-p">));</span> <span class="devsite-syntax-p">}</span></code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-and-audio-and-video-samples-java" track-metadata-position="gemini-text-and-audio-and-video-samples" track-metadata-region-tag="gemini-text-and-audio-and-video-samples" data-text="Java" tabindex="-1"><span class="notranslate">Java</span></h3> <p> To send a prompt request, create a Java file (<code translate="no" dir="ltr">.java</code>) and copy the following code into the file. Set <var translate="no"><code translate="no" dir="ltr">your-google-cloud-project-id</code></var> to your Google Cloud project ID. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/java-docs-samples/vertexai/snippets/src/main/java/vertexai/gemini/VideoInputWithAudio.java/HEAD/generativeaionvertexai_gemini_video_with_audio" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/java-docs-samples/blob/HEAD/vertexai/snippets/src/main/java/vertexai/gemini/VideoInputWithAudio.java" feedback-context="{&#34;language&#34;: &#34;java&#34;, &#34;region_tag&#34;: &#34;gemini-text-and-audio-and-video-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/java-docs-samples/blob/HEAD/vertexai/snippets/src/main/java/vertexai/gemini/VideoInputWithAudio.java&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="java" data-github-path="GoogleCloudPlatform/java-docs-samples/vertexai/snippets/src/main/java/vertexai/gemini/VideoInputWithAudio.java" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_video_with_audio" dir="ltr" is-upgraded syntax="Java"><code translate="no" dir="ltr"> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.VertexAI</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.api.GenerateContentResponse</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.generativeai.ContentMaker</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.generativeai.GenerativeModel</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.generativeai.PartMaker</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">com.google.cloud.vertexai.generativeai.ResponseHandler</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">java.io.IOException</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-kd">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">class</span> <span class="devsite-syntax-nc">VideoInputWithAudio</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">static</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">void</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nf">main</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-o">[]</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">args</span><span class="devsite-syntax-p">)</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">throws</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">IOException</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// TODO(developer): Replace these variables before running the sample.</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"your-google-cloud-project-id"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"us-central1"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">modelName</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gemini-1.5-flash-001"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">videoAudioInput</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">modelName</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Analyzes the given video input, including its audio track.</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">static</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nf">videoAudioInput</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">modelName</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kd">throws</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">IOException</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Initialize client that will be used to send requests. This client only needs</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// to be created once, and can be reused for multiple requests.</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">try</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">VertexAI</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">vertexAI</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">VertexAI</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-p">))</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">videoUri</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gs://cloud-samples-data/generative-ai/video/pixel8.mp4"</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerativeModel</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">model</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerativeModel</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">modelName</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">vertexAI</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerateContentResponse</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">model</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">generateContent</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">ContentMaker</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">fromMultiModalData</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"Provide a description of the video.\n The description should also "</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">+</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"contain anything important which people say in the video."</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">PartMaker</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">fromMimeTypeAndData</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"video/mp4"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">videoUri</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">));</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">String</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">output</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">ResponseHandler</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">getText</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">System</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">out</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-na">println</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">output</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">output</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-p">}</span></code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-and-audio-and-video-samples-go" track-metadata-position="gemini-text-and-audio-and-video-samples" track-metadata-region-tag="gemini-text-and-audio-and-video-samples" data-text="Go" tabindex="-1"><span class="notranslate">Go</span></h3> <p> To send a prompt request, create a Go file (<code translate="no" dir="ltr">.go</code>) and copy the following code into the file. Replace <code translate="no" dir="ltr">projectID</code> with the ID of your Google Cloud project. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/golang-samples/vertexai/multimodal-video-with-audio/multimodalvideoaudio.go/HEAD/generativeaionvertexai_gemini_video_with_audio" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/golang-samples/blob/HEAD/vertexai/multimodal-video-with-audio/multimodalvideoaudio.go" feedback-context="{&#34;language&#34;: &#34;golang&#34;, &#34;region_tag&#34;: &#34;gemini-text-and-audio-and-video-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/golang-samples/blob/HEAD/vertexai/multimodal-video-with-audio/multimodalvideoaudio.go&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="golang" data-github-path="GoogleCloudPlatform/golang-samples/vertexai/multimodal-video-with-audio/multimodalvideoaudio.go" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_video_with_audio" dir="ltr" is-upgraded syntax="Go"><code translate="no" dir="ltr"><span class="devsite-syntax-kn">import</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"context"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"errors"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"fmt"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"io"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"mime"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"path/filepath"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"cloud.google.com/go/vertexai/genai"</span> <span class="devsite-syntax-p">)</span> <span class="devsite-syntax-c1">// generateMultimodalContent shows how to send video and text prompts to a model, writing the response to</span> <span class="devsite-syntax-c1">// the provided io.Writer.</span> <span class="devsite-syntax-kd">func</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">generateMultimodalContent</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">w</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">io</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Writer</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">projectID</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">location</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">modelName</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-p">)</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">error</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// location := "us-central1"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// modelName := "gemini-1.5-flash-001"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">ctx</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">context</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Background</span><span class="devsite-syntax-p">()</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">client</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">genai</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">NewClient</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">ctx</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">projectID</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">location</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">if</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">!=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kc">nil</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fmt</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Errorf</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"unable to create client: %w"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">defer</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">client</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Close</span><span class="devsite-syntax-p">()</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">model</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">client</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">GenerativeModel</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">modelName</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-c1">// Given a video file URL, prepare video file as genai.Part</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">part</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">genai</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">FileData</span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">MIMEType</span><span class="devsite-syntax-p">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">mime</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">TypeByExtension</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">filepath</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Ext</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"pixel8.mp4"</span><span class="devsite-syntax-p">)),</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">FileURI</span><span class="devsite-syntax-p">:</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gs://cloud-samples-data/generative-ai/video/pixel8.mp4"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">res</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">:=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">model</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">GenerateContent</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">ctx</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">part</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">genai</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Text</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">`</span> <span class="devsite-syntax-s"> Provide a description of the video.</span> <span class="devsite-syntax-s"> The description should also contain anything important which people say in the video.</span> <span class="devsite-syntax-s"> `</span><span class="devsite-syntax-p">))</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">if</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">!=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kc">nil</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fmt</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Errorf</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"unable to generate contents: %w"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">err</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">if</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nb">len</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">res</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Candidates</span><span class="devsite-syntax-p">)</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">==</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-mi">0</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">||</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nb">len</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">res</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Candidates</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-mi">0</span><span class="devsite-syntax-p">].</span><span class="devsite-syntax-nx">Content</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Parts</span><span class="devsite-syntax-p">)</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">==</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-mi">0</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">errors</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">New</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-s">"empty response from model"</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">fmt</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Fprintf</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-nx">w</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"generated response: %s\n"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nx">res</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Candidates</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-mi">0</span><span class="devsite-syntax-p">].</span><span class="devsite-syntax-nx">Content</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-nx">Parts</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-mi">0</span><span class="devsite-syntax-p">])</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-kc">nil</span> <span class="devsite-syntax-p">}</span> </code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-and-audio-and-video-samples-csharp" track-metadata-position="gemini-text-and-audio-and-video-samples" track-metadata-region-tag="gemini-text-and-audio-and-video-samples" data-text="C#" tabindex="-1"><span class="notranslate">C#</span></h3> <p> To send a prompt request, create a C# file (<code translate="no" dir="ltr">.cs</code>) and copy the following code into the file. Set <var translate="no"><code translate="no" dir="ltr">your-project-id</code></var> to your Google Cloud project ID. After updating the values, run the code. </p> <div class="github-docwidget-gitinclude-code"> <div></div><devsite-code><pre suppresswarning="suppresswarning" translate="no" class="devsite-click-to-copy" track-metadata-position="GoogleCloudPlatform/dotnet-docs-samples/aiplatform/api/AIPlatform.Samples/VideoInputWithAudio.cs/HEAD/generativeaionvertexai_gemini_video_with_audio" data-code-snippet="true" data-github-includecode-link="https://github.com/GoogleCloudPlatform/dotnet-docs-samples/blob/HEAD/aiplatform/api/AIPlatform.Samples/VideoInputWithAudio.cs" feedback-context="{&#34;language&#34;: &#34;csharp&#34;, &#34;region_tag&#34;: &#34;gemini-text-and-audio-and-video-samples&#34;, &#34;snippet_file_url&#34;: &#34;https://github.com/GoogleCloudPlatform/dotnet-docs-samples/blob/HEAD/aiplatform/api/AIPlatform.Samples/VideoInputWithAudio.cs&#34;}" feedback-product="1634365" feedback-bucket="cloud-ai" language="csharp" data-github-path="GoogleCloudPlatform/dotnet-docs-samples/aiplatform/api/AIPlatform.Samples/VideoInputWithAudio.cs" data-git-revision="HEAD" data-region-tag="generativeaionvertexai_gemini_video_with_audio" dir="ltr" is-upgraded syntax="C#"><code translate="no" dir="ltr"> <span class="devsite-syntax-k">using</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">Google.Cloud.AIPlatform.V1</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-k">using</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">System</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-k">using</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nn">System.Threading.Tasks</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-k">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">class</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nc">VideoInputWithAudio</span> <span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">public</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">async</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Task&lt;string&gt;</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-nf">DescribeVideo</span><span class="devsite-syntax-p">(</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">projectId</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"your-project-id"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">location</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"us-central1"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">publisher</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"google"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">model</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gemini-1.5-flash-001"</span><span class="devsite-syntax-p">)</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">var</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">predictionServiceClient</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">PredictionServiceClientBuilder</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Endpoint</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">$"{location}-aiplatform.googleapis.com"</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}.</span><span class="devsite-syntax-n">Build</span><span class="devsite-syntax-p">();</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">prompt</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">@"Provide a description of the video.</span> <span class="devsite-syntax-s">The description should also contain anything important which people say in the video."</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">var</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">generateContentRequest</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerateContentRequest</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Model</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">$"projects/{projectId}/locations/{location}/publishers/{publisher}/models/{model}"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Contents</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Content</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Role</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"USER"</span><span class="devsite-syntax-p">,</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Parts</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Part</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Text</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">prompt</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">},</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Part</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">FileData</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">new</span><span class="devsite-syntax-p">()</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">{</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">MimeType</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"video/mp4"</span><span class="devsite-syntax-p">,</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">FileUri</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-s">"gs://cloud-samples-data/generative-ai/video/pixel8.mp4"</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">};</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">GenerateContentResponse</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">await</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">predictionServiceClient</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">GenerateContentAsync</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">generateContentRequest</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-kt">string</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">responseText</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-o">=</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">response</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">Candidates</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-m">0</span><span class="devsite-syntax-p">].</span><span class="devsite-syntax-n">Content</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">Parts</span><span class="devsite-syntax-p">[</span><span class="devsite-syntax-m">0</span><span class="devsite-syntax-p">].</span><span class="devsite-syntax-n">Text</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">Console</span><span class="devsite-syntax-p">.</span><span class="devsite-syntax-n">WriteLine</span><span class="devsite-syntax-p">(</span><span class="devsite-syntax-n">responseText</span><span class="devsite-syntax-p">);</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-k">return</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-n">responseText</span><span class="devsite-syntax-p">;</span> <span class="devsite-syntax-w"> </span><span class="devsite-syntax-p">}</span> <span class="devsite-syntax-p">}</span> </code></pre></devsite-code> </div> </section> <section> <h3 id="gemini-text-and-audio-and-video-samples-drest" track-metadata-position="gemini-text-and-audio-and-video-samples" track-metadata-region-tag="gemini-text-and-audio-and-video-samples" data-text="REST" tabindex="-1">REST</h3> <div></div><devsite-code><pre class="devsite-click-to-copy" translate="no" dir="ltr" is-upgraded syntax="Bash">curl<span class="devsite-syntax-w"> </span>-X<span class="devsite-syntax-w"> </span>POST<span class="devsite-syntax-w"> </span><span class="devsite-syntax-se">\</span> -H<span class="devsite-syntax-w"> </span><span class="devsite-syntax-s2">"Authorization: Bearer </span><span class="devsite-syntax-k">$(</span>gcloud<span class="devsite-syntax-w"> </span>auth<span class="devsite-syntax-w"> </span>print-access-token<span class="devsite-syntax-k">)</span><span class="devsite-syntax-s2">"</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-se">\</span> -H<span class="devsite-syntax-w"> </span><span class="devsite-syntax-s2">"Content-Type: application/json"</span><span class="devsite-syntax-w"> </span><span class="devsite-syntax-se">\</span> https://us-central1-aiplatform.googleapis.com/v1/projects/<span class="devsite-syntax-si">${</span><span class="devsite-syntax-nv">PROJECT_ID</span><span class="devsite-syntax-si">}</span>/locations/us-central1/publishers/google/models/<span class="devsite-syntax-si">${</span><span class="devsite-syntax-nv">MODEL_ID</span><span class="devsite-syntax-si">}</span>:generateContent<span class="devsite-syntax-w"> </span>-d<span class="devsite-syntax-w"> </span><span class="devsite-syntax-se">\</span> <span class="devsite-syntax-s1">$'{</span> <span class="devsite-syntax-s1"> "contents": {</span> <span class="devsite-syntax-s1"> "role": "user",</span> <span class="devsite-syntax-s1"> "parts": [</span> <span class="devsite-syntax-s1"> {</span> <span class="devsite-syntax-s1"> "fileData": {</span> <span class="devsite-syntax-s1"> "mimeType": "video/mp4",</span> <span class="devsite-syntax-s1"> "fileUri": "gs://cloud-samples-data/generative-ai/video/pixel8.mp4"</span> <span class="devsite-syntax-s1"> }</span> <span class="devsite-syntax-s1"> },</span> <span class="devsite-syntax-s1"> {</span> <span class="devsite-syntax-s1"> "text": "Provide a description of the video. The description should also contain anything important which people say in the video."</span> <span class="devsite-syntax-s1"> }</span> <span class="devsite-syntax-s1"> ]</span> <span class="devsite-syntax-s1"> }</span> <span class="devsite-syntax-s1">}'</span></pre></devsite-code> <p> The model returns a response. Note that the response is generated in sections with each section separately evaluated for safety. </p> </section> </div></p> <h2 id="whats_next" data-text="What's next" tabindex="-1">What's next</h2> <ul> <li>Learn more about the <a href="/vertex-ai/generative-ai/docs/overview">Gemini API in Vertex AI</a>.</li> <li>Explore the Vertex AI Gemini API SDK reference for <a href="/vertex-ai/generative-ai/docs/reference/python/latest">Python</a>, <a href="/nodejs/docs/reference/vertexai/latest">Node.js</a>, <a href="/java/docs/reference/google-cloud-vertexai/latest/overview">Java</a>, <a href="/go/docs/reference/cloud.google.com/go/vertexai/latest">Go</a>, or <a href="/dotnet/docs/reference/Google.Cloud.AIPlatform.V1/latest">C#</a>.</li> <li>See the <a href="/vertex-ai/generative-ai/docs/model-reference/gemini">Model API for Gemini in Vertex AI</a>.</li> <li>Learn about <a href="/vertex-ai/generative-ai/docs/multimodal/call-vertex-using-openai-library">calling Vertex AI models by using the OpenAI library</a>.</li> </ul> <devsite-hats-survey class="nocontent" hats-id="mwETRvWii0eU5NUYprb0Y9z5GVbc" listnr-id="83405"></devsite-hats-survey> </div> <devsite-thumb-rating position="footer"> </devsite-thumb-rating> <devsite-feedback position="footer" project-name="Generative AI on Vertex AI" product-id="5164350" bucket="Documentation" context="" version="t-devsite-webserver-20241114-r00-rc02.464922260396498922" data-label="Send Feedback Button" track-type="feedback" track-name="sendFeedbackLink" track-metadata-position="footer" class="nocontent" project-feedback-url="https://issuetracker.google.com/issues/new?component=1130925" project-icon="https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/cloud/images/favicons/onecloud/super_cloud.png" project-support-url="https://cloud.google.com/support-hub" > <button> Send feedback </button> </devsite-feedback> <div class="devsite-floating-action-buttons"> </div> </article> <devsite-content-footer class="nocontent"> <p>Except as otherwise noted, the content of this page is licensed under the <a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 License</a>, and code samples are licensed under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache 2.0 License</a>. For details, see the <a href="https://developers.google.com/site-policies">Google Developers Site Policies</a>. Java is a registered trademark of Oracle and/or its affiliates.</p> <p>Last updated 2024-11-22 UTC.</p> </devsite-content-footer> <devsite-notification > </devsite-notification> <div class="devsite-content-data"> <template class="devsite-thumb-rating-feedback"> <devsite-feedback position="thumb-rating" project-name="Generative AI on Vertex AI" product-id="5164350" bucket="Documentation" context="" version="t-devsite-webserver-20241114-r00-rc02.464922260396498922" data-label="Send Feedback Button" track-type="feedback" track-name="sendFeedbackLink" track-metadata-position="thumb-rating" class="nocontent" project-feedback-url="https://issuetracker.google.com/issues/new?component=1130925" project-icon="https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/cloud/images/favicons/onecloud/super_cloud.png" project-support-url="https://cloud.google.com/support-hub" > <button> Need to tell us more? </button> </devsite-feedback> </template> <template class="devsite-content-data-template"> [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-22 UTC."],[],[]] </template> </div> </devsite-content> </main> <devsite-footer-promos class="devsite-footer"> </devsite-footer-promos> <devsite-footer-linkboxes class="devsite-footer"> <nav class="devsite-footer-linkboxes nocontent" aria-label="Footer links"> <ul class="devsite-footer-linkboxes-list"> <li class="devsite-footer-linkbox "> <h3 class="devsite-footer-linkbox-heading no-link">Why Google</h3> <ul class="devsite-footer-linkbox-list"> <li class="devsite-footer-linkbox-item"> <a href="/why-google-cloud/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 1)" track-metadata-eventDetail="cloud.google.com/why-google-cloud/"track-name="choosing google cloud"track-metadata-position="footer"track-metadata-module="footer"track-type="footer link"track-metadata-child_headline="why google"> Choosing Google Cloud </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/trust-center/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 2)" track-metadata-module="footer"track-metadata-child_headline="why google"track-metadata-position="footer"track-type="footer link"track-name="trust and security"track-metadata-eventDetail="cloud.google.com/security/"> Trust and security </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/solutions/modern-infrastructure/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 3)" track-metadata-child_headline="why google"track-metadata-position="footer"track-metadata-eventDetail="cloud.google.com/solutions/modern-infrastructure/"track-name="modern infrastructure cloud"track-metadata-module="footer"track-type="footer link"> Modern Infrastructure Cloud </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/multicloud/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 4)" track-name="multicloud"track-metadata-eventDetail="cloud.google.com/multicloud/"track-metadata-module="footer"track-metadata-child_headline="why google"track-type="footer link"track-metadata-position="footer"> Multicloud </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/infrastructure/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 5)" track-name="global infrastructure"track-metadata-child_headline="why google"track-type="footer link"track-metadata-module="footer"track-metadata-eventDetail="cloud.google.com/infrastructure/"track-metadata-position="footer"> Global infrastructure </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/customers/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 6)" track-type="footer link"track-name="customers and case studies"track-metadata-child_headline="why google"track-metadata-module="footer"track-metadata-position="footer"track-metadata-eventDetail="cloud.google.com/customers/"> Customers and case studies </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/analyst-reports/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 7)" track-metadata-position="footer"track-metadata-eventDetail="cloud.google.com/analyst-reports/"track-name="analyst reports"track-metadata-child_headline="why google"track-type="footer link"track-metadata-module="footer"> Analyst reports </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/whitepapers/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 8)" track-type="footer link"track-metadata-position="footer"track-metadata-eventDetail="cloud.google.com/whitepapers/"track-name="whitepapers"track-metadata-child_headline="why google"track-metadata-module="footer"> Whitepapers </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//cloud.google.com/blog/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 9)" track-metadata-module="footer"track-type="footer link"track-metadata-eventDetail="cloud.google.com/blog/"track-name="blog"track-metadata-child_headline="engage"track-metadata-position="footer"> Blog </a> </li> </ul> </li> <li class="devsite-footer-linkbox "> <h3 class="devsite-footer-linkbox-heading no-link">Products and pricing</h3> <ul class="devsite-footer-linkbox-list"> <li class="devsite-footer-linkbox-item"> <a href="/pricing/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 1)" track-metadata-child_headline="products and pricing"track-name="google cloud pricing"track-metadata-module="footer"track-metadata-position="footer"track-type="footer link"track-metadata-eventDetail="cloud.google.com/pricing/"> Google Cloud pricing </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//workspace.google.com/pricing.html" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 2)" track-metadata-child_headline="products and pricing"track-metadata-eventDetail="workspace.google.com/pricing.html"track-name="google workspace pricing"target="_blank"track-metadata-module="footer"track-metadata-position="footer"track-type="footer link"> Google Workspace pricing </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/products/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 3)" track-metadata-module="footer"track-type="footer link"track-metadata-child_headline="products and pricing"track-name="see all products"track-metadata-eventDetail="cloud.google.com/products/"track-metadata-position="footer"> See all products </a> </li> </ul> </li> <li class="devsite-footer-linkbox "> <h3 class="devsite-footer-linkbox-heading no-link">Solutions</h3> <ul class="devsite-footer-linkbox-list"> <li class="devsite-footer-linkbox-item"> <a href="/solutions/infrastructure-modernization/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 1)" track-metadata-child_headline="solutions"track-metadata-position="footer"track-metadata-eventDetail="cloud.google.com/solutions/infrastructure-modernization/"track-name="infrastructure modernization"track-type="footer link"track-metadata-module="footer"> Infrastructure modernization </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/solutions/databases/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 2)" track-metadata-position="footer"track-metadata-child_headline="solutions"track-type="footer link"track-name="databases"track-metadata-module="footer"track-metadata-eventDetail="cloud.google.com/solutions/databases"> Databases </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/solutions/application-modernization/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 3)" track-type="footer link"track-name="application development"track-metadata-child_headline="solutions"track-metadata-eventDetail="cloud.google.com/solutions/application-modernization/"track-metadata-module="footer"track-metadata-position="footer"> Application modernization </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/solutions/smart-analytics/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 4)" track-metadata-module="footer"track-metadata-eventDetail="cloud.google.com/solutions/smart-analytics/"track-name="smart analytics"track-type="footer link"track-metadata-position="footer"track-metadata-child_headline="solutions"> Smart analytics </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/solutions/ai/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 5)" track-type="footer link"track-metadata-position="footer"track-metadata-module="footer"track-metadata-child_headline="solutions"track-name="artificial intelligence"track-metadata-eventDetail="cloud.google.com/solutions/ai/"> Artificial Intelligence </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/solutions/security/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 6)" track-type="footer link"track-name="security"track-metadata-child_headline="solutions"track-metadata-module="footer"track-metadata-position="footer"track-metadata-eventDetail="cloud.google.com/solutions/security/"> Security </a> </li> <li class="devsite-footer-linkbox-item"> <a href="https://workspace.google.com/enterprise/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 7)" track-metadata-eventDetail="workspace.google.com/enterprise/"track-name="productivity and work transformation"track-metadata-position="footer"track-type="footer link"target="_blank"track-metadata-module="footer"track-metadata-child_headline="solutions"> Productivity & work transformation </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/solutions/#industry-solutions" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 8)" track-metadata-module="footer"track-type="footer link"track-metadata-position="footer"track-metadata-child_headline="solutions"track-name="industry solutions"track-metadata-eventDetail="cloud.google.com/solutions/#industry-solutions"> Industry solutions </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/solutions/devops/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 9)" track-type="footer link"track-name="devops solutions"track-metadata-position="footer"track-metadata-eventDetail="cloud.google.com/solutions/devops/"track-metadata-child_headline="solutions"track-metadata-module="footer"> DevOps solutions </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/solutions/#section-14" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 10)" track-metadata-module="footer"track-metadata-position="footer"track-type="footer link"track-name="small business solutions"track-metadata-eventDetail="cloud.google.com/solutions/#section-14"track-metadata-child_headline="solutions"> Small business solutions </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/solutions/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 11)" track-metadata-eventDetail="cloud.google.com/solutions/"track-metadata-position="footer"track-type="footer link"track-metadata-child_headline="solutions"track-name="see all solutions"track-metadata-module="footer"> See all solutions </a> </li> </ul> </li> <li class="devsite-footer-linkbox "> <h3 class="devsite-footer-linkbox-heading no-link">Resources</h3> <ul class="devsite-footer-linkbox-list"> <li class="devsite-footer-linkbox-item"> <a href="/affiliate-program/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 1)" track-metadata-child_headline="resources"track-name="google cloud affiliate program"track-type="footer link"track-metadata-position="footer"track-metadata-module="footer"track-metadata-eventDetail="cloud.google.com/affiliate-program/"> Google Cloud Affiliate Program </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/docs/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 2)" track-name="google cloud documentation"track-metadata-child_headline="resources"track-metadata-module="footer"track-metadata-position="footer"track-metadata-eventDetail="cloud.google.com/docs/"track-type="footer link"> Google Cloud documentation </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/docs/get-started/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 3)" track-metadata-module="footer"track-metadata-eventDetail="cloud.google.com/docs/get-started/"track-name="google cloud quickstarts"track-metadata-child_headline="resources"track-type="footer link"track-metadata-position="footer"> Google Cloud quickstarts </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/marketplace/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 4)" track-metadata-module="footer"track-metadata-child_headline="resources"track-type="footer link"track-metadata-position="footer"track-name="google cloud marketplace"track-metadata-eventDetail="cloud.google.com/marketplace/"> Google Cloud Marketplace </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/discover/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 5)" track-metadata-child_headline="resources"track-metadata-module="footer"track-name="learn about cloud computing"track-metadata-position="footer"track-type="footer link"track-metadata-eventDetail="learn/"> Learn about cloud computing </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/support-hub/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 6)" track-metadata-module="footer"track-type="footer link"track-metadata-child_headline="resources"track-metadata-eventDetail="cloud.google.com/support-hub/"track-name="support"track-metadata-position="footer"> Support </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/docs/samples" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 7)" track-metadata-module="footer"track-metadata-eventDetail="cloud.google.com/docs/samples"track-type="footer link"track-metadata-position="footer"track-name="code samples"track-metadata-child_headline="resources"> Code samples </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/architecture/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 8)" track-name="cloud architecture center"track-metadata-position="footer"track-metadata-child_headline="resources"track-metadata-module="footer"track-metadata-eventDetail="cloud.google.com/architecture/"track-type="footer link"> Cloud Architecture Center </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/learn/training/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 9)" track-name="training"track-metadata-position="footer"track-metadata-child_headline="resources"track-type="footer link"track-metadata-eventDetail="cloud.google.com/training/"track-metadata-module="footer"> Training </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/learn/certification/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 10)" track-type="footer link"track-metadata-eventDetail="cloud.google.com/certification"track-metadata-child_headline="resources"track-name="certifications"track-metadata-module="footer"track-metadata-position="footer"> Certifications </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//developers.google.com" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 11)" track-type="footer link"track-metadata-eventDetail="developers.google.com"track-metadata-module="footer"track-metadata-position="footer"target="_blank"track-name="google developers"track-metadata-child_headline="resources"> Google for Developers </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/startup/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 12)" track-metadata-position="footer"track-type="footer link"track-name="google cloud for startups"track-metadata-eventDetail="cloud.google.com/startup/"track-metadata-child_headline="resources"track-metadata-module="footer"> Google Cloud for Startups </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//status.cloud.google.com" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 13)" track-name="system status"track-metadata-eventDetail="status.cloud.google.com"track-metadata-child_headline="resources"track-metadata-position="footer"track-metadata-module="footer"target="_blank"track-type="footer link"> System status </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/release-notes" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 14)" track-type="footer link"track-name="release notes"track-metadata-eventDetail="cloud.google.com/release-notes/"track-metadata-position="footer"track-metadata-module="footer"track-metadata-child_headline="resources"> Release Notes </a> </li> </ul> </li> <li class="devsite-footer-linkbox "> <h3 class="devsite-footer-linkbox-heading no-link">Engage</h3> <ul class="devsite-footer-linkbox-list"> <li class="devsite-footer-linkbox-item"> <a href="/contact/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 1)" track-metadata-eventDetail="cloud.google.com/contact/"track-metadata-module="footer"track-type="footer link"track-metadata-child_headline="engage"track-metadata-position="footer"track-name="contact sales"> Contact sales </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//cloud.google.com/find-a-partner" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 2)" track-metadata-module="footer"target="_blank"track-metadata-child_headline="engage"track-name="find a partner"track-metadata-position="footer"track-metadata-eventDetail="cloud.google.com/find-a-partner"track-type="footer link"> Find a Partner </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/partners/become-a-partner/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 3)" track-metadata-module="footer"track-metadata-position="footer"track-metadata-eventDetail="cloud.google.com/partners/become-a-partner/"track-type="footer link"track-name="become a partner"track-metadata-child_headline="engage"> Become a Partner </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/events/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 4)" track-metadata-child_headline="engage"track-metadata-module="footer"track-metadata-eventDetail="cloud.withgoogle.com/events"track-type="footer link"track-name="events"track-metadata-position="footer"> Events </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/podcasts/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 5)" track-metadata-eventDetail="cloud.google.com/podcasts/"rel="noopener"track-metadata-position="footer"track-metadata-module="footer"track-name="podcasts"track-metadata-child_headline="engage"track-type="footer link"target="_blank"> Podcasts </a> </li> <li class="devsite-footer-linkbox-item"> <a href="/developers/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 6)" track-type="footer link"track-name="developer center"track-metadata-eventDetail="cloud.google.com/developers/"track-metadata-child_headline="engage"track-metadata-module="footer"track-metadata-position="footer"> Developer Center </a> </li> <li class="devsite-footer-linkbox-item"> <a href="https://www.googlecloudpresscorner.com/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 7)" track-metadata-child_headline="engage"target="_blank"track-metadata-eventDetail="www.googlecloudpresscorner.com"track-metadata-module="footer"track-name="press corner"rel="noopener"track-metadata-position="footer"track-type="footer link"> Press Corner </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//www.youtube.com/googlecloud" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 8)" target="_blank"track-name="google cloud on youtube"rel="noopener"track-metadata-module="footer"track-metadata-eventDetail="www.youtube.com/googlecloud"track-metadata-child_headline="engage"track-metadata-position="footer"track-type="footer link"> Google Cloud on YouTube </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//www.youtube.com/googlecloudplatform" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 9)" rel="noopener"track-type="footer link"track-metadata-module="footer"track-metadata-child_headline="engage"track-metadata-position="footer"track-name="google cloud tech on youtube"target="_blank"track-metadata-eventDetail="www.youtube.com/googlecloudplatform"> Google Cloud Tech on YouTube </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//x.com/googlecloud" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 10)" track-metadata-child_headline="engage"track-metadata-eventDetail="x.com/googlecloud"rel="noopener"track-metadata-position="footer"track-metadata-module="footer"target="_blank"track-name="follow on x"track-type="footer link"> Follow on X </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//userresearch.google.com/?reserved=1&amp;utm_source=website&amp;Q_Language=en&amp;utm_medium=own_srch&amp;utm_campaign=CloudWebFooter&amp;utm_term=0&amp;utm_content=0&amp;productTag=clou&amp;campaignDate=jul19&amp;pType=devel&amp;referral_code=jk212693" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 11)" track-metadata-position="footer"target="_blank"track-metadata-eventDetail="userresearch.google.com/?reserved=1&amp;utm_source=website&amp;Q_Language=en&amp;utm_medium=own_srch&amp;utm_campaign=CloudWebFooter&amp;utm_term=0&amp;utm_content=0&amp;productTag=clou&amp;campaignDate=jul19&amp;pType=devel&amp;referral_code=jk212693"track-metadata-child_headline="engage"track-name="join user research"track-metadata-module="footer"track-type="footer link"> Join User Research </a> </li> <li class="devsite-footer-linkbox-item"> <a href="//careers.google.com/cloud" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 12)" track-name="we are hiring join google cloud"track-metadata-module="footer"track-metadata-position="footer"track-metadata-child_headline="engage"track-type="footer link"target="_blank"track-metadata-eventDetail="careers.google.com/cloud"> We're hiring. Join Google Cloud! </a> </li> <li class="devsite-footer-linkbox-item"> <a href="https://www.googlecloudcommunity.com/" class="devsite-footer-linkbox-link gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Footer Link (index 13)" track-metadata-child_headline="engage"track-type="footer link"track-name="google cloud community"rel="noopener"track-metadata-position="footer"target="_blank"track-metadata-module="footer"track-metadata-eventDetail="www.googlecloudcommunity.com"> Google Cloud Community </a> </li> </ul> </li> </ul> </nav> </devsite-footer-linkboxes> <devsite-footer-utility class="devsite-footer"> <div class="devsite-footer-utility nocontent"> <nav class="devsite-footer-utility-links" aria-label="Utility links"> <ul class="devsite-footer-utility-list"> <li class="devsite-footer-utility-item "> <a class="devsite-footer-utility-link gc-analytics-event" href="//about.google/" data-category="Site-Wide Custom Events" data-label="Footer About Google link" target="_blank" track-metadata-position="footer" track-metadata-module="utility footer" track-type="footer link" track-metadata-eventDetail="//about.google/" track-name="about google" > About Google </a> </li> <li class="devsite-footer-utility-item devsite-footer-privacy-link"> <a class="devsite-footer-utility-link gc-analytics-event" href="//policies.google.com/privacy" data-category="Site-Wide Custom Events" data-label="Footer Privacy link" track-metadata-module="utility footer" track-metadata-eventDetail="//policies.google.com/privacy" target="_blank" track-metadata-position="footer" track-name="privacy" track-type="footer link" > Privacy </a> </li> <li class="devsite-footer-utility-item "> <a class="devsite-footer-utility-link gc-analytics-event" href="//www.google.com/intl/en/policies/terms/regional.html" data-category="Site-Wide Custom Events" data-label="Footer Site terms link" target="_blank" track-type="footer link" track-metadata-module="utility footer" track-metadata-eventDetail="//www.google.com/intl/en/policies/terms/regional.html" track-name="site terms" track-metadata-position="footer" > Site terms </a> </li> <li class="devsite-footer-utility-item "> <a class="devsite-footer-utility-link gc-analytics-event" href="/product-terms/" data-category="Site-Wide Custom Events" data-label="Footer Google Cloud terms link" track-type="footer link" track-name="google cloud terms" track-metadata-eventDetail="/product-terms/" track-metadata-position="footer" track-metadata-module="utility footer" > Google Cloud terms </a> </li> <li class="devsite-footer-utility-item glue-cookie-notification-bar-control"> <a class="devsite-footer-utility-link gc-analytics-event" href="#" data-category="Site-Wide Custom Events" data-label="Footer Manage cookies link" aria-hidden="true" track-metadata-module="utility footer" track-name="Manage cookies" track-metadata-eventDetail="#" track-type="footer link" track-metadata-position="footer" > Manage cookies </a> </li> <li class="devsite-footer-utility-item devsite-footer-carbon-button"> <a class="devsite-footer-utility-link gc-analytics-event" href="/sustainability" data-category="Site-Wide Custom Events" data-label="Footer Our third decade of climate action: join us link" track-metadata-position="footer" track-type="footer link" track-metadata-module="utility footer" track-metadata-eventDetail="/sustainability/" track-name="Our third decade of climate action: join us" > Our third decade of climate action: join us </a> </li> <li class="devsite-footer-utility-item devsite-footer-utility-button"> <span class="devsite-footer-utility-description">Sign up for the Google Cloud newsletter</span> <a class="devsite-footer-utility-link gc-analytics-event" href="/newsletter/" data-category="Site-Wide Custom Events" data-label="Footer Subscribe link" track-name="subscribe" track-metadata-module="utility footer" track-metadata-position="footer" track-type="footer link" track-metadata-eventDetail="/newsletter/" > Subscribe </a> </li> </ul> <devsite-language-selector> <ul role="presentation"> <li role="presentation"> <a role="menuitem" lang="en" >English</a> </li> <li role="presentation"> <a role="menuitem" lang="de" >Deutsch</a> </li> <li role="presentation"> <a role="menuitem" lang="es_419" >Español – América Latina</a> </li> <li role="presentation"> <a role="menuitem" lang="fr" >Français</a> </li> <li role="presentation"> <a role="menuitem" lang="id" >Indonesia</a> </li> <li role="presentation"> <a role="menuitem" lang="it" >Italiano</a> </li> <li role="presentation"> <a role="menuitem" lang="pt_br" >Português – Brasil</a> </li> <li role="presentation"> <a role="menuitem" lang="zh_cn" >中文 – 简体</a> </li> <li role="presentation"> <a role="menuitem" lang="ja" >日本語</a> </li> <li role="presentation"> <a role="menuitem" lang="ko" >한국어</a> </li> </ul> </devsite-language-selector> </nav> </div> </devsite-footer-utility> <devsite-panel></devsite-panel> </section></section> <devsite-sitemask></devsite-sitemask> <devsite-snackbar></devsite-snackbar> <devsite-tooltip ></devsite-tooltip> <devsite-heading-link></devsite-heading-link> <devsite-analytics> <script type="application/json" analytics>[]</script> <script type="application/json" tag-management>{&#34;at&#34;: &#34;True&#34;, &#34;ga4&#34;: [], &#34;ga4p&#34;: [], &#34;gtm&#34;: [{&#34;id&#34;: &#34;GTM-5CVQBG&#34;, &#34;purpose&#34;: 1}], &#34;parameters&#34;: {&#34;internalUser&#34;: &#34;False&#34;, &#34;language&#34;: {&#34;machineTranslated&#34;: &#34;False&#34;, &#34;requested&#34;: &#34;en&#34;, &#34;served&#34;: &#34;en&#34;}, &#34;pageType&#34;: &#34;article&#34;, &#34;projectName&#34;: &#34;Generative AI on Vertex AI&#34;, &#34;signedIn&#34;: &#34;False&#34;, &#34;tenant&#34;: &#34;cloud&#34;, &#34;recommendations&#34;: {&#34;sourcePage&#34;: &#34;&#34;, &#34;sourceType&#34;: 0, &#34;sourceRank&#34;: 0, &#34;sourceIdenticalDescriptions&#34;: 0, &#34;sourceTitleWords&#34;: 0, &#34;sourceDescriptionWords&#34;: 0, &#34;experiment&#34;: &#34;&#34;}, &#34;experiment&#34;: {&#34;ids&#34;: &#34;&#34;}}}</script> </devsite-analytics> <devsite-badger></devsite-badger> <cloudx-user></cloudx-user> <cloudx-free-trial-eligible-store freeTrialEligible='true'></cloudx-free-trial-eligible-store> <cloudx-pricing-socket></cloudx-pricing-socket> <cloudx-experiments type="TestAACodivertedExperiment" path="/virtual/TestAACodivertedExperiment/configureExperiment" location="SG" variant="variant2" ></cloudx-experiments> <cloudx-experiment-ids userCountry="SG" devsiteExperimentIdList="[39300012, 39300022, 39300118, 39300192, 39300196, 39300241, 39300319, 39300320, 39300324, 39300346, 39300354, 39300363, 39300373, 39300412, 39300422, 39300436, 39300472, 39300488, 39300496, 39300498]"> </cloudx-experiment-ids> <script nonce="z7V3s8+gOA2g09qHtll/ur+2Nb2hT/"> (function(d,e,v,s,i,t,E){d['GoogleDevelopersObject']=i; t=e.createElement(v);t.async=1;t.src=s;E=e.getElementsByTagName(v)[0]; E.parentNode.insertBefore(t,E);})(window, document, 'script', 'https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/cloud/js/app_loader.js', '[2,"en",null,"/js/devsite_app_module.js","https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625","https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/cloud","https://cloud-dot-devsite-v2-prod.appspot.com",null,null,["/_pwa/cloud/manifest.json","https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/images/video-placeholder.svg","https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/cloud/images/favicons/onecloud/favicon.ico","https://www.gstatic.com/devrel-devsite/prod/v870e399c64f7c43c99a3043db4b3a74327bb93d0914e84a0c3dba90bbfd67625/cloud/images/cloud-logo.svg","https://fonts.googleapis.com/css?family=Google+Sans:400,500,700|Google+Sans+Text:400,400italic,500,500italic,700,700italic|Roboto:400,400italic,500,500italic,700,700italic|Roboto+Mono:400,500,700&display=swap"],1,null,[1,6,8,12,14,17,21,25,50,52,63,70,75,76,80,87,91,92,93,97,98,100,101,102,103,104,105,107,108,109,110,112,113,117,118,120,122,124,125,126,127,129,130,131,132,133,134,135,136,138,140,141,147,148,149,151,152,156,157,158,159,161,163,164,168,169,170,179,180,182,183,186,191,193,196],"AIzaSyAP-jjEJBzmIyKR4F-3XITp8yM9T1gEEI8","AIzaSyB6xiKGDR5O3Ak2okS4rLkauxGUG7XP0hg","cloud.google.com","AIzaSyAQk0fBONSGUqCNznf6Krs82Ap1-NV6J4o","AIzaSyCCxcqdrZ_7QMeLCRY20bh_SXdAYqy70KY",null,null,null,["Cloud__enable_cloud_facet_chat","Cloud__enable_cloudx_experiment_ids","Profiles__require_profile_eligibility_for_signin","DevPro__enable_developer_subscriptions","Cloud__enable_cloud_shell_fte_user_flow","Search__enable_page_map","Profiles__enable_profile_collections","Cloud__enable_legacy_calculator_redirect","EngEduTelemetry__enable_engedu_telemetry","MiscFeatureFlags__enable_firebase_utm","Profiles__enable_recognition_badges","MiscFeatureFlags__developers_footer_dark_image","Analytics__enable_clearcut_logging","DevPro__enable_cloud_innovators_plus","Profiles__enable_public_developer_profiles","MiscFeatureFlags__emergency_css","Profiles__enable_completecodelab_endpoint","MiscFeatureFlags__enable_project_variables","MiscFeatureFlags__developers_footer_image","Profiles__enable_dashboard_curated_recommendations","CloudShell__cloud_shell_button","Concierge__enable_pushui","MiscFeatureFlags__enable_explain_this_code","Cloud__enable_cloud_shell","MiscFeatureFlags__enable_view_transitions","Profiles__enable_release_notes_notifications","MiscFeatureFlags__enable_variable_operator","Search__scope_to_project_tenant","BookNav__enable_tenant_cache_key","Profiles__enable_awarding_url","Search__enable_dynamic_content_confidential_banner","Cloud__enable_llm_concierge_chat","Cloud__enable_cloud_dlp_service","Profiles__enable_complete_playlist_endpoint","TpcFeatures__enable_required_headers","Cloud__enable_free_trial_server_call","Search__enable_ai_search_summaries","Profiles__enable_page_saving","TpcFeatures__enable_mirror_tenant_redirects","Profiles__enable_developer_profiles_callout","CloudShell__cloud_code_overflow_menu","Search__enable_suggestions_from_borg","Search__enable_ai_eligibility_checks","Search__enable_ai_search_summaries_restricted","Experiments__reqs_query_experiments","Concierge__enable_concierge_restricted","Cloud__enable_cloudx_ping"],null,null,"AIzaSyBLEMok-5suZ67qRPzx0qUtbnLmyT_kCVE","https://developerscontentserving-pa.clients6.google.com","AIzaSyCM4QpTRSqP5qI4Dvjt4OAScIN8sOUlO-k","https://developerscontentsearch-pa.clients6.google.com",1,4,1,"https://developerprofiles-pa.clients6.google.com",[2,"cloud","Google Cloud","cloud.google.com",null,"cloud-dot-devsite-v2-prod.appspot.com",null,null,[1,1,null,null,null,null,null,null,null,null,null,[1],null,null,null,null,null,1,[1],[null,null,null,[1,20],"/terms/recommendations"],[1],null,[1],[1,null,1],[1,1,null,null,1,null,["/vertex-ai/"]]],null,[22,null,null,null,null,null,"/images/cloud-logo.svg","/images/favicons/onecloud/apple-icon.png",null,null,null,null,1,1,1,[6,5],[],null,null,[[],[],[],[],[],[],[],[]],null,1,null,null,null,null,[]],[],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[6,1,14,15,22,23,29,37],null,[[null,null,null,null,null,null,[1,[["docType","Choose a content type",[["ApiReference",null,null,null,null,null,null,null,null,"API reference"],["Sample",null,null,null,null,null,null,null,null,"Code sample"],["ReferenceArchitecture",null,null,null,null,null,null,null,null,"Reference architecture"],["Tutorial",null,null,null,null,null,null,null,null,"Tutorial"]]],["category","Choose a topic",[["AiAndMachineLearning",null,null,null,null,null,null,null,null,"Artificial intelligence and machine learning (AI/ML)"],["ApplicationDevelopment",null,null,null,null,null,null,null,null,"Application development"],["BigDataAndAnalytics",null,null,null,null,null,null,null,null,"Big data and analytics"],["Compute",null,null,null,null,null,null,null,null,"Compute"],["Containers",null,null,null,null,null,null,null,null,"Containers"],["Databases",null,null,null,null,null,null,null,null,"Databases"],["HybridCloud",null,null,null,null,null,null,null,null,"Hybrid and multicloud"],["LoggingAndMonitoring",null,null,null,null,null,null,null,null,"Logging and monitoring"],["Migrations",null,null,null,null,null,null,null,null,"Migrations"],["Networking",null,null,null,null,null,null,null,null,"Networking"],["SecurityAndCompliance",null,null,null,null,null,null,null,null,"Security and compliance"],["Serverless",null,null,null,null,null,null,null,null,"Serverless"],["Storage",null,null,null,null,null,null,null,null,"Storage"]]]]]],[1],null,1],[[null,null,null,null,null,["GTM-5CVQBG"],null,null,null,null,null,[["GTM-5CVQBG",2]],1],null,null,null,null,null,1],"mwETRvWii0eU5NUYprb0Y9z5GVbc",4,null,null,null,null,null,null,null,null,null,null,null,null,null,"cloud.devsite.google"],null,"pk_live_5170syrHvgGVmSx9sBrnWtA5luvk9BwnVcvIi7HizpwauFG96WedXsuXh790rtij9AmGllqPtMLfhe2RSwD6Pn38V00uBCydV4m"]') </script> <devsite-a11y-announce></devsite-a11y-announce> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10