arrow_back

Gemini API: Qwik Start

Login Gabung
Dapatkan akses ke 700+ lab dan kursus

Gemini API: Qwik Start

Lab 15 menit universal_currency_alt 1 Kredit show_chart Pengantar
info Lab ini mungkin menggabungkan alat AI untuk mendukung pembelajaran Anda.
Dapatkan akses ke 700+ lab dan kursus

GSP1308

Overview

The Gemini API empowers developers and creators across various fields by providing advanced natural language processing and code generation capabilities. It enables the creation of intelligent chatbots, automated content generation tools, insightful data analysis platforms, and personalized learning experiences. Its versatility stems from its ability to understand context, generate creative text, analyze complex data, and adapt to diverse applications.

There are two Gemini models, Gemini Pro and Gemini Flash. In this lab, you will use the Gemini 2.0 Flash model.

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 will learn how to:

  • Set up and authenticate the Gemini API.
  • Make basic API calls to interact with Gemini models.

Task 1. Set your API Key

  1. In the Jupyter Notebook, copy the below API key into API_KEY variable.
{{{project_0.startup_script.api_key|"API KEY"}}}

Task 2. Run through the notebook cells

  1. Once you have set your API_KEY variable, please follow instructions directly in the Jupyter Notebook.
Note: API calls to Gemini require processing time. Please allow a moment for the response to appear after executing a notebook cell.

Click Check my progress to verify the objective. Generate Text from the Gemini API.

Click Check my progress to verify the objective. Multi-Turn Conversations.

Congratulations!

Congratulations! In this lab, you learned how to use the Gemini API and make basic API calls to interact with Gemini models.

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 24, 2025

Lab Last Tested March 24, 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.

Sebelum memulai

  1. Lab membuat project dan resource Google Cloud untuk jangka waktu tertentu
  2. Lab memiliki batas waktu dan tidak memiliki fitur jeda. Jika lab diakhiri, Anda harus memulainya lagi dari awal.
  3. Di kiri atas layar, klik Start lab untuk memulai

Konten ini tidak tersedia untuk saat ini

Kami akan memberi tahu Anda melalui email saat konten tersedia

Bagus!

Kami akan menghubungi Anda melalui email saat konten tersedia

Satu lab dalam satu waktu

Konfirmasi untuk mengakhiri semua lab yang ada dan memulai lab ini

Gunakan penjelajahan rahasia untuk menjalankan lab

Gunakan jendela Samaran atau browser pribadi untuk menjalankan lab ini. Langkah ini akan mencegah konflik antara akun pribadi Anda dan akun Siswa yang dapat menyebabkan tagihan ekstra pada akun pribadi Anda.