All Generative AI on Vertex AI code samples
This page contains code samples for Generative AI on Vertex AI. To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.
Process images, video, audio, and text with Gemini 1.5 Pro
This sample shows you how to process images, video, audio, and text at the same time. This sample works with Gemini 1.5 Pro only.
- Google Gen AI SDK
- Generative AI on Vertex AI
- Google Cloud
- Go
- Java
- JavaScript
- Node JS
- C#
- Python
- Sample
Generate streaming text by using Gemini and the Chat Completions API
Generate streaming text by using the Chat Completions API, which lets you send requests to Vertex AI models by using the OpenAI libraries.
- Google Cloud
- Google Gen AI SDK
- Generative AI on Vertex AI
- Python
- Sample
Batch Predict with Gemini using BigQuery data
Perform batch text prediction with Gemini using BigQuery data source as input.
- Google Gen AI SDK
- Google Cloud
- Generative AI on Vertex AI
- Java
- Python
- JavaScript
- Node JS
- Go
- Sample
Generate text from multimodal prompt
This sample demonstrates how to generate text from a multimodal prompt using the Gemini model. The prompt consists of three images and two text prompts. The model generates a text response that describes the images and the text prompts.
- Google Cloud
- Generative AI on Vertex AI
- Google Gen AI SDK
- Node JS
- Java
- Python
- C#
- Go
- JavaScript
- Sample
Fine-tune Generative AI models with Vertex AI Supervised Fine-tuning
Automatically tune a Gemini model using Google Cloud's Vertex AI SFT (Supervised Fine-tuning).
- Generative AI on Vertex AI
- Google Gen AI SDK
- Google Cloud
- Python
- Sample
Function calling with Gemini AI Model
The code sample demonstrates how to use the Vertex AI Generative Models to do function calling.
- Generative AI on Vertex AI
- Google Cloud
- Google Gen AI SDK
- JavaScript
- Node JS
- Go
- Sample
Generate text from a video
This sample demonstrates how to use the Gemini API to generate text from a video
- Google Cloud
- Generative AI on Vertex AI
- Google Gen AI SDK
- Python
- Java
- JavaScript
- C#
- Node JS
- Sample
Use function calling with Gemini using OpenAI SDK
This code sample demonstrates how to do function calling in Gemini using Chat Completions API in the OpenAI SDK.
- Google Gen AI SDK
- Generative AI on Vertex AI
- Google Cloud
- Python
- Sample
Describe an image by using Gemini and the Chat Completions API
Generate text description of an image by using the Chat Completions API, which lets you send requests to Vertex AI models by using the OpenAI libraries.
- Generative AI on Vertex AI
- Google Gen AI SDK
- Google Cloud
- Python
- Sample
Process a PDF file with Gemini
This sample shows you how to process a PDF document using Gemini.
- Generative AI on Vertex AI
- Google Cloud
- Google Gen AI SDK
- JavaScript
- Go
- Python
- Node JS
- C#
- Java
- Sample
Fine-tune Gemini using custom settings for advanced use cases
Tune a Generative AI model using Vertex AI Supervised Fine-tuning with advanced parameters.
- Google Cloud
- Google Gen AI SDK
- Generative AI on Vertex AI
- Python
- Sample
Describe a video
This code sample shows how to use Gemini to generate text descriptions for a video.
- Google Cloud
- Generative AI on Vertex AI
- Google Gen AI SDK
- Python
- Sample
Count tokens in a prompt
This sample demonstrates how to count the number of tokens in a prompt using the Vertex AI Gemini API.
- Generative AI on Vertex AI
- Google Cloud
- Google Gen AI SDK
- Go
- JavaScript
- Node JS
- C#
- Java
- Python
- Sample
Generate text responses using Gemini API with external function calls in a chat scenario
Generate text responses using Gemini API with external function calls. This example demonstrates a chat scenario with two functions and two sequential prompts.
- Google Gen AI SDK
- Google Cloud
- Generative AI on Vertex AI
- Node JS
- JavaScript
- Python
- Sample
Count tokens for Gemini
The code sample demonstrates how to use the Vertex AI Generative Models API to count the number of tokens in a prompt and generate content using the Gemini model.
- Google Gen AI SDK
- Google Cloud
- Generative AI on Vertex AI
- Python
- Go
- Sample
Ground Gemini model responses to Google Search
Use this to ground Gemini model output to Google Search results
- Google Gen AI SDK
- Generative AI on Vertex AI
- Google Cloud
- Python
- C#
- Sample
Interactive text generation with a chatbot
This sample demonstrates how to use the Gemini model to generate text interactively.
- Google Gen AI SDK
- Google Cloud
- Generative AI on Vertex AI
- Go
- Java
- C#
- Python
- Sample
Configure Gemini model parameters
Generates text from an image using the Gemini model and returns the generated text. This example demonstrates how to set model configuration parameters.
- Google Gen AI SDK
- Generative AI on Vertex AI
- Google Cloud
- Python
- Sample
Generate text by using Gemini and the Chat Completions API
Generate text by using the Chat Completions API, which lets you send requests to Vertex AI models by using the OpenAI libraries.
- Google Gen AI SDK
- Google Cloud
- Generative AI on Vertex AI
- Python
- Sample
Summarize an audio file with Gemini 1.5 Pro
This sample shows you how to use an audio file to summarize a podcast. This sample works with Gemini 1.5 Pro only.
- Google Cloud
- Generative AI on Vertex AI
- Google Gen AI SDK
- Go
- Java
- Python
- JavaScript
- Node JS
- C#
- Sample
Use Gemini to summarize PDF files
This sample demonstrates how to use Gemini to generate a summary of a PDF file.
- Google Cloud
- Generative AI on Vertex AI
- Google Gen AI SDK
- Python
- Sample
Function calling with Gemini AI Model
The code sample demonstrates how to use the Vertex AI Generative Models to do function calling.
- Generative AI on Vertex AI
- Google Gen AI SDK
- Google Cloud
- Python
- Sample
Interactive text stream generation with a chatbot
This sample demonstrates how to use the Gemini model to generate text stream interactively.
- Google Cloud
- Generative AI on Vertex AI
- Google Gen AI SDK
- JavaScript
- Python
- Node JS
- Sample
Generate text from an image
This sample demonstrates how to use the Gemini model to generate text from an image.
- Generative AI on Vertex AI
- Google Gen AI SDK
- Google Cloud
- C++
- Java
- JavaScript
- Node JS
- Python
- Sample
Describe an image
This code sample shows how to use Gemini to generate text descriptions for an image.
- Generative AI on Vertex AI
- Google Gen AI SDK
- Google Cloud
- Python
- Sample
Ground Gemini to a Vertex AI Search data store
Use this to ground Gemini output to your own data stored in a Vertex AI Search data store
- Generative AI on Vertex AI
- Google Cloud
- Google Gen AI SDK
- Python
- C#
- Sample
Batch text prediction with Gemini model
Perform batch text prediction using Gemini model and returns the output location.
- Google Cloud
- Google Gen AI SDK
- Generative AI on Vertex AI
- Go
- Python
- Sample
Generate text from an image with safety settings
This sample demonstrates how to use the Gemini model with safety settings to generate text from an image.
- Generative AI on Vertex AI
- Google Gen AI SDK
- Google Cloud
- Java
- Python
- JavaScript
- Go
- Node JS
- C#
- Sample
Use Gemini to summarize YouTube videos
This sample demonstrates how to use Gemini to summarize YouTube videos.
- Generative AI on Vertex AI
- Google Cloud
- Google Gen AI SDK
- Python
- Sample
Set system instructions to Gemini 1.5 Pro
This sample shows you how to set system instructions to Gemini 1.5 Pro.
- Generative AI on Vertex AI
- Google Gen AI SDK
- Google Cloud
- Java
- JavaScript
- Node JS
- Python
- C#
- Go
- Sample
Generate text from an image
Prompt the Gemini model with an image and a text prompt, and returns the generated text.
- Generative AI on Vertex AI
- Google Cloud
- Google Gen AI SDK
- Java
- Python
- Go
- Sample
Specify a MIME response type for the Gemini API
Specify a MIME response type for the Gemini API so that the generated response is compliant with that type.
- Generative AI on Vertex AI
- Google Cloud
- Google Gen AI SDK
- Java
- Go
- C#
- Python
- Sample
Transcript an audio file with Gemini 1.5 Pro
This sample shows you how to use an audio file to generate a podcast transcript with timestamps. This sample works with Gemini 1.5 Pro only.
- Generative AI on Vertex AI
- Google Cloud
- Google Gen AI SDK
- Java
- JavaScript
- Python
- Go
- Node JS
- C#
- Sample
Batch Predict with Gemini using GCS data
Perform batch text prediction with Gemini using GCS data source as input.
- Google Gen AI SDK
- Google Cloud
- Generative AI on Vertex AI
- JavaScript
- Node JS
- Java
- Sample
Use Gemini to identify key moments in YouTube videos
This code sample demonstrates how to use Gemini to identify key moments in YouTube videos. It takes a YouTube video URL as input and returns a list of key moments along with their timestamps.
- Generative AI on Vertex AI
- Google Gen AI SDK
- Google Cloud
- Python
- Sample
Summarize a video file with audio with Gemini 1.5 Pro
This sample shows you how to summarize a video file with audio and return chapters with timestamps. This sample works with Gemini 1.5 Pro only.
- Google Cloud
- Google Gen AI SDK
- Generative AI on Vertex AI
- C#
- Go
- C++
- Python
- JavaScript
- Java
- Node JS
- Sample
Getting Started with Grounding with Gemini in Vertex AI
Generate content grounded in your own documents and data using Vertex AI's generative text models.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Batch Predictions with the Gemini API using BigQuery input
Process large batches of multimodal requests asynchronously using the Gemini API in Vertex AI for offline model predictions.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Function Calling with the Gemini API & Python SDK
Use Gemini, Google DeepMind's multimodal generative AI model, to call functions by describing them in code and receiving matching function names in the response.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Gemini 2.0 Pro
Learn how to use Google's Gemini 2.0 Pro for coding and general knowledge tasks.
- Generative AI on Vertex AI
- Python
- Notebook
Introduction to Long Context Window with Gemini on Vertex AI
Explore the expanded context window capabilities of Gemini 1.5 LLMs for improved performance in various applications.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Gemini 2.0 Flash-Lite
Explore Gemini 2.0 Flash-Lite, a fast and cost-effective flash model, through an introductory YouTube video.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Batch Predictions with the Gemini API
Process large batches of multimodal requests asynchronously using the Gemini API in Vertex AI for offline model predictions.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Context Caching with the Gemini API
Use the Gemini API's context caching feature to store and reuse input tokens, thereby reducing redundant requests and improving efficiency.
- Generative AI on Vertex AI
- Python
- Notebook
Responsible AI with Gemini API in Vertex AI: Safety ratings and thresholds
Explore the capabilities and limitations of large language models.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Controlled Generation with the Gemini API
Explore Google DeepMind's Gemini, a family of generative AI models enabling controlled generation of structured or unstructured data for various applications.
- Generative AI on Vertex AI
- Python
- Notebook
Spatial understanding with Gemini 2.0
Learn object detection and spatial understanding using the Gemini API in Vertex AI.
- Generative AI on Vertex AI
- Python
- Notebook
Create High Quality Visual Assets with Imagen and Gemini
Generate high-quality images from text descriptions using Imagen on Vertex AI.
- Generative AI on Vertex AI
- Python
- Notebook
Hugging Face DLCs: Serving Gemma 2 with multiple LoRA adapters with Text Generation Inference (TGI) on Vertex AI
Use pre-built, optimized deep learning containers to simplify the configuration of lightweight, state-of-the-art open Gemini family models.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Gemini 2.0 Flash
Use the Gemini 2.0 Flash multimodal generative ai model to create real-time vision and audio streaming applications.
- Generative AI on Vertex AI
- Python
- Notebook
Getting started with Gemini 2.0 in Vertex AI using REST API
Use REST API in cURL commands to interact with the Gemini 2.0 Flash model.
- Generative AI on Vertex AI
- Python
- Notebook
Getting Started with Gemini 2.0 Flash Thinking Mode
Demonstrate how to use Gemini 2.0 Flash Thinking mode to solve complex tasks that require multiple rounds.
- Generative AI on Vertex AI
- Python
- Notebook
Supervised Fine Tuning with Gemini 1.5 Flash for change detection using the Google Gen AI SDK
Fine-tune Gemini model" component Fine-tune the Gemini 1.5 Pro model for change detection task (spot differences) with the Vertex AI "Fine-tune Gemini model" component.
- Generative AI on Vertex AI
- Python
- Notebook
Scaled Video Analysis with the YouTube Data API, Gemini, and Batch Prediction
Explore how to search and analyze publicly available YouTube videos at scale, using the YouTube Data API, Vertex AI Batch Prediction with Gemini, and BigQuery.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Generating and Executing Python Code with Gemini 2.0
Introduce the code execution capabilities of the Gemini 2.0 Flash model.
- Generative AI on Vertex AI
- Python
- Notebook
Vertex Prompt Optimizer Notebook SDK (Preview) - Long Prompt Optimization
Use the Vertex AI prompt optimizer to optimize a long prompt for a Gemini model.
- Generative AI on Vertex AI
- Python
- Notebook
Getting started with Gemini using Vertex AI in Express Mode
Send API requests to the Gemini API in Vertex AI: - Non-streaming request - Streaming request - Function calling request
- Generative AI on Vertex AI
- Python
- Notebook
Creating Marketing Assets using Gemini 2.0
Get started with the Google Gen AI SDK on Vertex AI
- Generative AI on Vertex AI
- Python
- Notebook
Real-time Retrieval Augmented Generation (RAG) using the Multimodal Live API with Gemini 2.0
Learn to develop a real-time Retrieval Augmented Generation (RAG) system leveraging the Multimodal Live API.
- Generative AI on Vertex AI
- Python
- Notebook
Patents Document Understanding with Gemini 2.0
Train custom machine learning models for a Document Understanding Pipeline using AutoML.
- Generative AI on Vertex AI
- Python
- Notebook
Building a Research Multi Agent System - a Design Pattern Overview with Gemini 2.0
Learn how to use Data Fusion to build a scalable and secure data lake for your organization.
- Generative AI on Vertex AI
- Python
- Notebook
Supervised fine-tuning with Gemini 1.5 Flash for Q&A using the Google Gen AI SDK
Fine-tune the Gemini 1.5 Flash model using Vertex AI Supervised Tuning.
- Generative AI on Vertex AI
- Python
- Notebook
Getting Started with the Multimodal Live API in Vertex AI
Run this tutorial to get started with the Multimodal Live API in Vertex AI, which enables low-latency bidirectional voice and video interactions with Gemini.
- Generative AI on Vertex AI
- Python
- Notebook
Vertex Prompt Optimizer Notebook SDK (Preview) - Tool usage
optimize prompt template for tool usage with a Gemini model
- Generative AI on Vertex AI
- Python
- Notebook
Supervised Fine Tuning with Gemini 1.5 Flash for change detection
Fine-tune Vision Model" colab template Fine-tune Gemini 1.5 Pro model for change detection task (spot differences)
- Generative AI on Vertex AI
- Python
- Notebook
Create a multi speaker podcast with Gemini Controlled Generation & Text-to-Speech
Use the Gemini API in Vertex AI to generate an engaging multi-speaker podcast using studio voices Text-to-Speech API" notebook. Generate an engaging multi-speaker podcast using studio voices Text-to-Speech API.
- Generative AI on Vertex AI
- Python
- Notebook
AI Agents for Engineers (Evolution of AI Agents)
Demonstrate 3 different approaches to generating essays using the Gemini API in Google AI Studio
- Generative AI on Vertex AI
- Python
- Notebook
Resume Generation
Generate resumes using the Gemini 1.5 Flash model and LLM prompting
- Generative AI on Vertex AI
- Python
- Notebook
Guess who or what app using Hugging Face Deep Learning container model on Vertex AI
Create a simple "Guess who or what" application which combines an image generation open model with Gemini to answer and represent subjects of Guess who or what riddles.
- Generative AI on Vertex AI
- Python
- Notebook
Monitor batch prediction with Gemini API
Orchestrate and monitor Gemini batch prediction jobs using Vertex AI Pipelines."
- Generative AI on Vertex AI
- Python
- Notebook
Get Started
Generate advertising images using Gemini and Imagen 3
- Generative AI on Vertex AI
- Python
- Notebook
Enhance Imagen prompts with Gemini
Optimize or rewrite your image generation prompts with Gemini based on a subject, action, scene, and style, or generate enhanced prompts from an initial image.
- Generative AI on Vertex AI
- Python
- Notebook
From API to Report: Building a Currency Analysis Agent with LangGraph and Gemini
Build an AI-powered currency analysis agent using LangGraph and the Gemini API in Vertex AI
- Generative AI on Vertex AI
- Python
- Notebook
Anomaly Detection of Infrastructure Logs using Gemini and BigQuery Vector Search
Learn how to process large volumes of logs using Gemini, vector embeddings and BigQuery Vector Search for anomaly detection
- Generative AI on Vertex AI
- Python
- Notebook
Basic prototyping of the solution with Gemini API in Vertex AI
Learn how to use the Gemini 1.5 Pro model to perform text summarization.
- Generative AI on Vertex AI
- Python
- Notebook
Stage 2: Building MVP: - 01 Data Processing
Process diverse data and generate summaries for a multimodal retrieval augmented generation (RAG) system using the Gemini API in Vertex AI.
- Generative AI on Vertex AI
- Python
- Notebook
Stage 2: Building MVP: - 02 Chunk & Embeddings
Build a simple text-based search engine using the Vertex Gemini API
- Generative AI on Vertex AI
- Python
- Notebook
Build Your Own AI Podcasting Agent with LangGraph & Gemini
target="_blank">Generate an audio overview of a document</a> 🔈🔈
- Generative AI on Vertex AI
- Python
- Notebook
Stage 2: Building MVP: - 03 RAG
Build the core retrieval and generation components of a Multimodal Retrieval Augmented Generation (RAG) system using the Vertex Gemini API.
- Generative AI on Vertex AI
- Python
- Notebook
Video Thumbnail Generation using Gemini 1.5 Pro (API & Python SDK)
to create a thumbnail video from thumbnails
- Generative AI on Vertex AI
- Python
- Notebook
Getting Started with RAGAS & Vertex AI Gemini API
Evaluate your RAG pipelines with Ragas.
- Generative AI on Vertex AI
- Python
- Notebook
Getting Started with DeepEval & Vertex AI Gemini API
Use the DeepEval framework to evaluate LLMs with unit tests and metrics.
- Generative AI on Vertex AI
- Python
- Notebook
YouTube Video Analysis with Gemini
Learn how to do direct analysis of publicly available YouTube videos with Gemini.
- Generative AI on Vertex AI
- Python
- Notebook
Evaluating prompts at scale with Gemini Batch Prediction API
Use Apache Beam to perform batch ETL on Google Cloud Platform.
- Generative AI on Vertex AI
- Python
- Notebook
Building a Weather Agent with AutoGen and Gemini
Build a weather agent using Autogen and the Gemini 1.5 Flash model on Vertex AI
- Generative AI on Vertex AI
- Python
- Notebook
Multimodal Function Calling with the Gemini API & Python SDK
Learn how to use Gemini's multimodal function calling capability to predict function calls and function parameters based on various inputs like images, audio, and text.
- Generative AI on Vertex AI
- Python
- Notebook
Migrate from PaLM to Gemini model
Evaluate PaLM and Gemini foundation models using multiple metrics in an `EvalTask` to support decisions around migrating from one model to another.
- Generative AI on Vertex AI
- Python
- Notebook
Narrate a Multi-character Story with Text-to-Speech and Gemini
Demonstrate how to use the Text-to-Speech API to read a story with each character having a distinct voice.
- Generative AI on Vertex AI
- Python
- Notebook
Supervised Fine Tuning with Gemini 1.5 Flash for Q&A
Fine-tune the Gemini 1.5 Flash model using the Vertex AI Supervised Tuning feature.
- Generative AI on Vertex AI
- Python
- Notebook
Supervised Fine Tuning with Gemini 1.5 Pro for Image Captioning
Fine-tune the Gemini 1.5 Pro Model for Vision task using Vertex AI Supervised Tuning.
- Generative AI on Vertex AI
- Python
- Notebook
Question Answering with Generative Models on Vertex AI
Evaluate a Gemini model using various metrics"
- Generative AI on Vertex AI
- Python
- Notebook
Vertex Prompt Optimizer Notebook SDK (Preview)
optimize a simple prompt for a Gemini model using your own metrics
- Generative AI on Vertex AI
- Python
- Notebook
LlamaIndex RAG Workflows using Gemini and Firestore
Learn how to use LlamaIndex workflows to build AI systems that go beyond simple question-answering
- Generative AI on Vertex AI
- Python
- Notebook
Use Retrieval Augmented Generation (RAG) with Gemini API
Augment output from Gemini API by bringing in external knowledge using Code Retrieval Augmented Generation(RAG) pattern using Google Cloud's Generative AI github repository as external knowledge.
- Generative AI on Vertex AI
- Python
- Notebook
Vertex Prompt Optimizer Notebook SDK (Preview) - Custom metric
optimize a prompt for a Gemini model using your own metric
- Generative AI on Vertex AI
- Python
- Notebook
Evaluate Gemini with AutoSxS using custom task
Demonstrate how to use Vertex AI automatic side-by-side (AutoSxS) with custom task (translation) to evaluate the performance between Gemini on Vertex AI and PaLM API in a media newspaper company for translation scenario.
- Generative AI on Vertex AI
- Python
- Notebook
Evaluate Generative Model Tool Use
evaluate the Gemini model tool use quality with Vertex AI Python SDK for Gen AI Evaluation Service
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Batch Predictions with the Gemini API
Run batch prediction with the Vertex AI Gemini API.
- Generative AI on Vertex AI
- Python
- Notebook
Getting Started with LangChain 🦜️🔗 + Vertex AI Gemini API
Vertex AI Gemini: A Large Language Model Platform" by Google AI Learn how to use LangChain components and use cases of LangChain with the Vertex AI Gemini API.
- Generative AI on Vertex AI
- Python
- Notebook
Vertex AI Supervised Tuning token count and cost estimation.
Use this notebook to estimate token counts for tuning costs for tuning `gemini-1.0-pro-002`.
- Generative AI on Vertex AI
- Python
- Notebook
Product attributes extraction and detailed descriptions from images using Gemini 1.5 Pro
Build a general agent to extract different product attributes or detailed product descriptions from an image input
- Generative AI on Vertex AI
- Python
- Notebook
Introduction to Long Context Window with Gemini on Vertex AI
Use this notebook to test the performance of Gemini LLMs with a 1 million token context window.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Context Caching with the Gemini API
Use the Gemini context caching API to cache frequently used input tokens to improve performance.
- Generative AI on Vertex AI
- Python
- Notebook
Call Gemini by using the OpenAI Library
Learn how to call Gemini by using the OpenAI library.
- Generative AI on Vertex AI
- Python
- Notebook
Building a Multimodal Chatbot for Warranty Claims using Gemini and Vector Search in Vertex AI
Build a warranty claims chatbot that utilizes Vector Search and the Gemini API in Vertex AI in Google Cloud.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Controlled Generation with the Gemini API
Use this notebook to control the generation of text, images, and other content from a pre-trained multimodal language model.
- Generative AI on Vertex AI
- Python
- Notebook
Code Vulnerability Scanning & Automated Remediation using Vertex AI Gemini API (Gemini Pro 1.5)
Learn how to use Gemini 1.5 Pro, a generative AI model for codebase analysis.
- Generative AI on Vertex AI
- Python
- Notebook
Getting started with Vertex AI Gemini 1.5 Flash
Run a sentiment analysis model on a text file with Vertex AI Gemini API
- Generative AI on Vertex AI
- Python
- Notebook
Product listing generation with Gemini 1.5 Pro
Learn about the Gemini 1.5 Pro language model, which introduces a long context window of up to 1 million tokens and can seamlessly analyze large amounts of information.
- Generative AI on Vertex AI
- Python
- Notebook
Product image background generation with Gemini 1.5 Pro and Imagen 2
Use the Imagen 2 model on Vertex AI to generate images from text.
- Generative AI on Vertex AI
- Python
- Notebook
Introduction to ReAct Agents with Gemini & Function Calling
Illustrate how a ReAct agent coordinates between reasoning and acting.
- Generative AI on Vertex AI
- Python
- Notebook
Code migration from PaLM to Gemini
Migrate the Vertex AI SDK for Python from using the PaLM API to using the Gemini API.
- Generative AI on Vertex AI
- Python
- Notebook
Working with Parallel Function Calls and Multiple Function Responses in Gemini
Use the Gemini API to call a function from your code and get the function's return value.
- Generative AI on Vertex AI
- Python
- Notebook
Multimodal retail recommendation: using Gemini to recommend items based on images and image reasoning
Create a multimodal recommendation system using Gemini 1.0 Pro Vision model
- Generative AI on Vertex AI
- Python
- Notebook
Document Processing with Gemini
Learn how to process documents with Apache Beam.
- Generative AI on Vertex AI
- Python
- Notebook
Responsible AI with Vertex AI Gemini API: Safety ratings and thresholds
Detect and mitigate risks of unintended and unforeseen outputs from large language models.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Function Calling with the Gemini API & Python SDK
Learn how to call functions from Gemini, a family of generative AI models developed by Google DeepMind.
- Generative AI on Vertex AI
- Python
- Notebook
Gemini: An Overview of Multimodal Use Cases
Explore multimodal use cases with Gemini 1.0 Pro Vision and the Vertex AI Gemini API.
- Generative AI on Vertex AI
- Python
- Notebook
Getting Started with the Vertex AI Gemini API with cURL
Use the Vertex AI Gemini API to generate text, images, and videos from prompts.
- Generative AI on Vertex AI
- Python
- Notebook
Video Analysis with Gemini
Use this notebook to learn how to use the Google Cloud Natural Language API.
- Generative AI on Vertex AI
- Python
- Notebook
Sheet Music Analysis with Gemini
Extract metadata from sheet music PDFs using Gemini.
- Generative AI on Vertex AI
- Python
- Notebook
Getting Started with the Gemini Pro Model
Use the Vertex AI Gemini API to generate text, images, and audio using multimodal prompts.
- Generative AI on Vertex AI
- Python
- Notebook
Analyzing movie posters in BigQuery with Gemini 1.0 Pro and Gemini 1.0 Pro Vision
Demonstrate how to use Gemini models for analysis in BigQuery.
- Generative AI on Vertex AI
- Python
- Notebook
Building and Deploying a Google Maps API Agent with Reasoning Engine
Use Gemini to generate function names in your code.
- Generative AI on Vertex AI
- Python
- Notebook
Supervised Fine Tuning with Gemini for Article Summarization
Fine-tune the Gemini generative model using Vertex AI Supervised Tuning.
- Generative AI on Vertex AI
- Python
- Notebook
Intro to Building and Deploying an Agent with Reasoning Engine in Vertex AI
Use the Gemini language model to generate code for a function that takes an image of a cat and returns the breed of the cat.
- Generative AI on Vertex AI
- Python
- Notebook
Augment Gemini Output with Vector Embeddings from BigQuery
Create text embeddings for publicly available abstracts from patents data and use them in our LLM search
- Generative AI on Vertex AI
- Python
- Notebook
Analyze a codebase with the Vertex AI Gemini 1.5 Pro
Analyze an entire codebase with Gemini 1.5 Pro and prompt it with a single code file.
- Generative AI on Vertex AI
- Python
- Notebook
Document QnA using Gemini and Vertex Vector Search
Perform RAG to perform Q&A over a document filled with both text and images.
- Generative AI on Vertex AI
- Python
- Notebook
Getting Started with Chat with the Gemini Pro model
Demonstrate how to send chat prompts to the Gemini 1.0 Pro model using the Vertex AI SDK for Python and LangChain.
- Generative AI on Vertex AI
- Python
- Notebook
Vertex AI Search - Querying Blended Data Apps and Summarization with Gemini
Create a search app with Vertex AI Search.
- Generative AI on Vertex AI
- Python
- Notebook
Multimodal Retrieval Augmented Generation (RAG) using Vertex AI Gemini API
Perform multimodal RAG where you will perform Q&A over a financial document filled with both text and images.
- Generative AI on Vertex AI
- Python
- Notebook
Working with Data Structures and Schemas in Gemini Function Calling
Create a description of a function in your code, then pass that description to a language model in a request. The response from the model includes the name of the function, its arguments, and its return type
- Generative AI on Vertex AI
- Python
- Notebook
Intra Knowledge QnA
Get started with the Gemini 1.0 Pro model for natural language tasks, multi-turn text and code chat, and code generation.
- Generative AI on Vertex AI
- Python
- Notebook
ReAct (Reasoning + Acting) + Custom tool for Healthcare NL API + Gemini 1.0 Pro + Langchain
Use the GenAI medical coding model to suggest accurate medical codes for healthcare claims.
- Generative AI on Vertex AI
- Python
- Notebook
Generate a mock auto owner's manual using Gemini
Create a dataset with a column of the number of days between two dates.
- Generative AI on Vertex AI
- Python
- Notebook
Getting Started with Grounding with Gemini in Vertex AI
Use this notebook to learn how to ground your generative language model in your own data using Vertex AI Search.
- Generative AI on Vertex AI
- Python
- Notebook
Multimodal Retrieval Augmented Generation (RAG) with Gemini, Vertex AI Vector Search, and LangChain
Perform multimodal RAG with Gemini to perform Q&A over a financial document filled with both text and images.
- Generative AI on Vertex AI
- Python
- Notebook
Using Gemini in Education
Explore a variety of use cases enabled by Gemini models in the context of education.
- Generative AI on Vertex AI
- Python
- Notebook
Synthetic Data Generation using Gemini APIs
Use the Vertex AI Gemini API to generate creative text, translate languages, and write different kinds of creative content.
- Generative AI on Vertex AI
- Python
- Notebook
Create High Quality Visual Assets with Imagen and Gemini
Learn how to generate high-quality images from text descriptions with Imagen on Vertex AI.
- Generative AI on Vertex AI
- Python
- Notebook
Forced Function Calling with Tool Configurations in Gemini
Demonstrate forced Function Calling in the Gemini model.
- Generative AI on Vertex AI
- Python
- Notebook
Using Gemini Function Calling to Get Real-Time Company News and Insights
Use the Function Calling in Gemini API to create a description of a function in your code, then pass that description to a language model in a request.
- Generative AI on Vertex AI
- Python
- Notebook