Instrukcje i wymagania dotyczące konfiguracji modułu
Chroń swoje konto i postępy. Zawsze używaj okna przeglądania prywatnego i danych logowania do modułu, kiedy go uruchamiasz.

Introduction to Gemini 3

Laboratorium 1 godz. universal_currency_alt 1 punkt show_chart Wprowadzające
info Ten moduł może zawierać narzędzia AI, które ułatwią Ci naukę.
Te treści nie są jeszcze zoptymalizowane pod kątem urządzeń mobilnych.
Dla maksymalnej wygody odwiedź nas na komputerze, korzystając z linku przesłanego e-mailem.

GSP1150

Google Cloud self-paced labs logo

Overview

The model is a versatile model designed to process text, code, and images. It handles complex tasks requiring sophisticated reasoning and multimodal analysis. Gemini excels in coding, STEM subjects, web development, and debugging. It's particularly effective for generating code and resolving nuanced prompts.

The model is a fast, efficient model optimized for high-frequency workflows, enabling enterprises to automate tasks and build responsive applications without sacrificing quality. It delivers near real-time responses and superior price performance, allowing businesses to provide engaging, production-scale experiences.

In this lab, you run examples that demonstrate key model capabilities and showcase new API features.

Prerequisites

Before starting this lab, you should be familiar with:

  • Basic Python programming.
  • General API concepts.
  • Running Python code in a Jupyter notebook on Vertex AI Workbench.

Objectives

In this lab, you use the and models to perform the following:

  • Generate text and control reasoning with thinking levels.
  • Configure model parameters and system instructions.
  • Process multimodal data including audio, code, and video.
  • Implement advanced features like function calling and code execution.

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.

How to start your lab and sign in to the Google Cloud console

  1. Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:

    • The Open Google Cloud console button
    • Time remaining
    • The temporary credentials that you must use for this lab
    • Other information, if needed, to step through this lab
  2. Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).

    The lab spins up resources, and then opens another tab that shows the Sign in page.

    Tip: Arrange the tabs in separate windows, side-by-side.

    Note: If you see the Choose an account dialog, click Use Another Account.
  3. If necessary, copy the Username below and paste it into the Sign in dialog.

    {{{user_0.username | "Username"}}}

    You can also find the Username in the Lab Details pane.

  4. Click Next.

  5. Copy the Password below and paste it into the Welcome dialog.

    {{{user_0.password | "Password"}}}

    You can also find the Password in the Lab Details pane.

  6. Click Next.

    Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials. Note: Using your own Google Cloud account for this lab may incur extra charges.
  7. Click through the subsequent pages:

    • Accept the terms and conditions.
    • Do not add recovery options or two-factor authentication (because this is a temporary account).
    • Do not sign up for free trials.

After a few moments, the Google Cloud console opens in this tab.

Note: To access Google Cloud products and services, click the Navigation menu or type the service or product name in the Search field. Navigation menu icon and Search field

Task 1. Configure the environment

In this section, you install packages and import libraries.

Open the notebook in Vertex AI Workbench

  1. In the Google Cloud console, on the Navigation menu (Navigation menu icon), 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.

Set up the notebook

  1. Open the file.

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

  3. Run through the Get Started section of the notebook. The Project ID and Location are pre-configured for you.

Note: If you experience a 429 response from any of the notebook cell executions, wait one minute before running the cell again to proceed.

Click Check my progress to verify the objective. Install packages and import libraries.

Task 2. Load the Gemini models

  • In the notebook, execute the cells in the Load the Gemini Models section to initialize the genai client and define the model variables.

Click Check my progress to verify the objective. Run through the Load the Gemini 3 models section of the notebook.

Task 3. Explore Gemini's capabilities

In this section, you explore key Gemini 3 Pro model capabilities and API features. After you explore a feature in the notebook, you're instructed to return to these instructions to Check your progress.

Set system instructions

  • Navigate to the Set system instructions section and run the cells to define the model's behavior (translating English to Spanish).

Click Check my progress to verify the objective. Run the Set system instructions section of the notebook.

Thinking level

  • Navigate to the Thinking level section. Execute the cells to observe how adjusting the thinking_level parameter changes the depth of the model's reasoning process.

Click Check my progress to verify the objective. Run the Thinking level section of the notebook.

Configure the temperature parameter

  • In the Configure the temperature parameter section, run the code to adjust the randomness of the response generation.

Click Check my progress to verify the objective. Run the Configure the temperature parameter section of the notebook.

Generate content stream

  • Execute the Generate content stream section to see how the model delivers responses in chunks rather than waiting for the full completion.

Click Check my progress to verify the objective. Run the Generate content stream section of the notebook.

Thought summaries

  • Run the Thought summaries cells to inspect the model's intermediate reasoning steps before the final answer.

Click Check my progress to verify the objective. Run the Thought summaries section of the notebook.

Multi-turn chat

  • Complete the Multi-turn chat section to start a chat session that retains context from previous prompts.

Click Check my progress to verify the objective. Run the Multi-turn chat section of the notebook.

Safety filters

  • Navigate to the Safety filters section and run the cells to configure blocking thresholds for hate speech, harassment, and other categories.

Click Check my progress to verify the objective. Run the Safety filters section of the notebook.

Send asynchronous requests

  • Execute the Send asynchronous requests section to learn how to send non-blocking requests using async methods.

Click Check my progress to verify the objective. Run the Send asynchronous requests section of the notebook.

Multimodality

  • In the Multimodality section, run the code to analyze different media types, including images and video, along with text prompts..

Click Check my progress to verify the objective. Run the Multimodality section of the notebook.

Media resolution

  • Complete the Media resolution section to compare how different resolution settings affect the model's analysis of visual details.

Click Check my progress to verify the objective. Run the Media resolution section of the notebook.

Structured output

  • Execute the Structured output cells to force the model to respond in specific formats, such as JSON.

Click Check my progress to verify the objective. Run the Structured output section of the notebook.

Grounding with Google Search

  • Run the Grounding with Google Search section to ground the model's responses in real-time data from Google Search.

Click Check my progress to verify the objective. Run the Grounding with Google Search section of the notebook.

Code Execution

  • Navigate to the Code Execution section and run the cells to allow the model to write and execute Python code to solve math problems.

Click Check my progress to verify the objective. Run the Code Execution section of the notebook.

URL context

  • Complete the URL context section to see how the model can process and summarize content directly from a provided URL.

Click Check my progress to verify the objective. Run through the URL context section of the notebook.

Function calling

  • Execute the Function calling section to define custom tools that the model can invoke to retrieve external information.

Click Check my progress to verify the objective. Run the Function calling section of the notebook.

Streaming function calling

  • Run the Streaming function calling cells to handle tool outputs within a streaming response.

Click Check my progress to verify the objective. Run the Streaming function calling section of the notebook.

Multimodal function responses

  • Complete the Multimodal function responses section to see how functions can return non-text data, such as images or plots.

Click Check my progress to verify the objective. Run the Multimodal function responses section of the notebook.

Thought signatures

  • Execute the Thought signatures section to verify the authenticity of the model's reasoning chain.

Click Check my progress to verify the objective. Run the Thought signatures section of the notebook.

Count tokens and compute tokens

  • Finally, run the Count tokens and compute tokens cells to analyze the cost and size of your prompts and responses.

Click Check my progress to verify the objective. Run the Count tokens and compute tokens section of the notebook.

Congratulations!

You have now completed the lab! In this lab, you worked with the and models in a Jupyter notebook using the Gemini API and Google Gen AI SDK for Generative AI.

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 March 27, 2026

Lab Last Tested March 27, 2026

Copyright 2026 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.

Zanim zaczniesz

  1. Moduły tworzą projekt Google Cloud i zasoby na określony czas.
  2. Moduły mają ograniczenie czasowe i nie mają funkcji wstrzymywania. Jeśli zakończysz moduł, musisz go zacząć od początku.
  3. Aby rozpocząć, w lewym górnym rogu ekranu kliknij Rozpocznij moduł.

Użyj przeglądania prywatnego

  1. Skopiuj podaną nazwę użytkownika i hasło do modułu.
  2. Kliknij Otwórz konsolę w trybie prywatnym.

Zaloguj się w konsoli

  1. Zaloguj się z użyciem danych logowania do modułu. Użycie innych danych logowania może spowodować błędy lub naliczanie opłat.
  2. Zaakceptuj warunki i pomiń stronę zasobów przywracania.
  3. Nie klikaj Zakończ moduł, chyba że właśnie został przez Ciebie zakończony lub chcesz go uruchomić ponownie, ponieważ spowoduje to usunięcie wyników i projektu.

Ta treść jest obecnie niedostępna

Kiedy dostępność się zmieni, wyślemy Ci e-maila z powiadomieniem

Świetnie

Kiedy dostępność się zmieni, skontaktujemy się z Tobą e-mailem

Jeden moduł, a potem drugi

Potwierdź, aby zakończyć wszystkie istniejące moduły i rozpocząć ten

Aby uruchomić moduł, użyj przeglądania prywatnego

Najlepszym sposobem na uruchomienie tego laboratorium jest użycie okna incognito lub przeglądania prywatnego. Dzięki temu unikniesz konfliktu między swoim kontem osobistym a kontem do nauki, co mogłoby spowodować naliczanie dodatkowych opłat na koncie osobistym.