arrow_back

Explore Generative AI with the Gemini API in Vertex AI: Challenge Lab

Sign in Join
Get access to 700+ labs and courses

Explore Generative AI with the Gemini API in Vertex AI: Challenge Lab

Lab 1 hour 30 minutes universal_currency_alt 5 Credits show_chart Intermediate
info This lab may incorporate AI tools to support your learning.
Get access to 700+ labs and courses

GSP515

Overview

In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to complete the tasks on your own! An automated scoring system (shown on this page) will provide feedback on whether you have completed your tasks correctly.

When you take a challenge lab, you will not be taught new Google Cloud concepts. You are expected to extend your learned skills, like changing default values and reading and researching error messages to fix your own mistakes.

To score 100% you must successfully complete all tasks within the time period!

This lab is recommended for students who have enrolled in the Explore Generative AI with the Gemini API in Vertex AI course. Are you ready for the challenge?

Topics tested

  • Generate text using Gemini
  • Create a function call using Gemini
  • Describe video contents using Gemini

Setup and requirements

Before you click the Start Lab button

Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.

This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito (recommended) or private browser window to run this lab. This prevents conflicts between your personal account and the student account, which may cause extra charges incurred to your personal account.
  • Time to complete the lab—remember, once you start, you cannot pause a lab.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.

Challenge Scenario

As a developer at a pioneering startup specializing in AI-driven video content analysis, you're tasked with harnessing Gemini's cutting-edge capabilities to elevate the platform's functionality. Your mission is to implement three pivotal features using Gemini's APIs: text generation, function calls, and video content analysis.

Your long-term objective is to enhance the platform's capabilities, enabling it to automatically generate coherent and polished text, execute specific actions or commands, and describe video contents using Gemini's state-of-the-art AI capabilities. Your goal for today is to implement demos of these features using Gemini's APIs, ensuring they meet the expected standards before deploying them to production.

Your success in this challenge will not only advance the platform's functionality but also demonstrate your proficiency in leveraging Gemini's state-of-the-art AI capabilities to address real-world problems in the realm of video content analysis. Are you ready to take on the challenge?

Task 1. Generate text using Gemini

In this section, you are tasked with calling the Gemini API via Cloud Shell to confirm your understanding of how to make API calls.

  1. Run the following command to set environment variables required.
PROJECT_ID={{{ project_0.project_id | "Filled in at lab startup." }}} LOCATION={{{ project_0.default_region | "Filled in at lab startup." }}} API_ENDPOINT=${LOCATION}-aiplatform.googleapis.com MODEL_ID="gemini-2.0-flash-001"
  1. Enable the APIs required to call Gemini APIs via cloud console.
Hint: You can perform this step in Cloud Console in the Vertex AI section of the UI.
  1. Call the gemini-2.0-flash-001 model via curl in Cloud Shell. Use the following documentation to assist you properly write the curl command: Send Chat Prompts to Gemini. Ask the following question:
Why is the sky blue?

Click Check my progress to verify the objective. Enable the required API

Task 2. Open the notebook in Vertex AI Workbench

  1. In the Google Cloud console, on the Navigation menu (), click Vertex AI > Workbench.

  2. Find the instance and click on the Open JupyterLab button.

The JupyterLab interface for your Workbench instance opens in a new browser tab.

Task 3. Create a function call using Gemini

  1. Open the file.

  2. In the Select Kernel dialog, choose Python 3 from the list of available kernels.

  3. Run through the Getting Started and the Import libraries sections of the notebook.

    • For Project ID, use , and for Location, use .
Note: You can skip any notebook cells that are noted Colab only. If you experience a 429 response from any of the notebook cell executions, wait 1 minute before running the cell again to proceed.
  1. Complete the missing parts of each cell to progress to the next section. These will be denoted with INSERT and an instruction to complete.
Note: Ensure you can see the weather related data in the response that is printed.

Click Check my progress to verify the objective. Create a function call with Gemini

Task 4. Describe video contents using Gemini

In this section, you are tasked with completing the python code in cells of a Jupyter notebook which leverage the Gemini 2.0 Flash 001 model to describe contents of a video.

  1. Remain in Vertex AI Workbench and proceed to the cell with the comment # Task 4.

  2. Complete the required sections of the notebook under Task 4.

Click Check my progress to verify the objective. Describe Video Contents

Congratulations!

Throughout this challenge, you've demonstrated your adeptness in leveraging Gemini APIs to generate text, create function calls, and describe video contents. Your work ensured that these features met the expected standards before deployment to production.

Next steps / learn more

Check out the following resources to learn more about Gemini:

Google Cloud training and certification

...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.

Manual Last Updated April 29, 2025

Lab Last Tested April 29, 2025

Copyright 2025 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.

Before you begin

  1. Labs create a Google Cloud project and resources for a fixed time
  2. Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
  3. On the top left of your screen, click Start lab to begin

This content is not currently available

We will notify you via email when it becomes available

Great!

We will contact you via email if it becomes available

One lab at a time

Confirm to end all existing labs and start this one

Use private browsing to run the lab

Use an Incognito or private browser window to run this lab. This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account.