GSP1335
Overview
Google AI Studio is a powerful tool that allows you to interact with various AI
models and experiment with different prompts. It serves as a platform for
developers to experiment with and integrate Gemini's multimodal generative AI
capabilities into their applications. In addition, it provides an environment
for prompt engineering, where you can test and refine prompts to achieve desired
outputs from Gemini models.
This lab explores prompt engineering and best practices for designing effective
prompts to improve the quality of your LLM-generated responses. You learn how to
craft prompts that are concise, specific, and well-defined, focusing on one task
at a time. In this lab, you take on the persona of a creative writer using
Google AI Studio to brainstorm ideas for a new science fiction story.
Explore other content in the
Gemini Enterprise Agent Ready (GEAR) program.
Objectives
In this lab, you learn how to perform the following tasks:
- Create basic prompts in Google AI Studio.
- Add system instructions to prompts.
- Explore Gemini models and adjust temperature settings.
- Experiment with prompt tools to adjust the model's output.
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.
Open Google AI Studio
-
Click Start Lab. The lab panel will display the temporary credentials for this lab.
-
Note: If this is a paid lab, you will be prompted to select a payment method.
-
Open Google AI Studio in an Incognito window and click Get Started. The Google sign-in page will appear.
-
Tip: For easier access, arrange the lab and AI Studio tabs in separate, side-by-side windows.
-
Copy the Username below and paste it into the Email field, then click Next.
{{{user_0.username | "Username"}}}
-
Copy the Password below and paste it into the Enter your password field, then click Next.
{{{user_0.password | "Password"}}}
-
Accept any on-screen terms and conditions to proceed.
You are now logged into Google AI Studio using your temporary student account.
Task 1. Create a basic prompt
In this task, you start by sending a simple, "zero-shot" prompt to the model.
Zero-shot prompting is the most fundamental interaction, where you ask the
model to perform a task without providing any prior examples.
-
In the navigation menu, click Playground to open a new, empty chat
session.
-
Under Run settings, click the model card.
-
Under Model selection, select
.
-
In the prompt entry field, type the following request:
Suggest 5 names for a rugged space freighter.
-
Click Run (the arrow icon next to the prompt field).
-
In the Save your conversations in Google Drive (Recommended) pop-up
window, click Enable Google Drive. Then, select your student account (for
example, student-XX-YYYY@qwiklabs.net) and grant any required permissions
to proceed.
-
Review the list of names generated by the model. Notice the Token count,
which shows the size of your prompt and the model's response.
-
If the prompt does not save automatically, or to edit its title and
description, click the pencil icon
.
-
In the Save prompt dialog, for Prompt name, type Rugged Space
Freighter Names.
-
Click Save.
Click Check my progress to verify the objective.
Create a basic prompt
Task 2. Add context and structure to prompts
In this task, you guide the model to produce a more specific and higher-quality
response. First, you use the System instructions feature to give the model a
persona. Then, you provide a "one-shot" example within your prompt to show the
model the exact format that you want.
Use system instructions to set a persona
-
To start a new chat session, click the Playground icon on the chat
toolbar.
-
Under Run settings, verify that the model is set to
.
If not, click the model card and select
.
-
Click the System instructions icon (showing a clipboard) to reveal the
system instructions field.
-
In this field, define the model's persona by entering the following:
You are a science fiction author known for hard sci-fi and gritty, realistic world-building.
- In the main prompt field, enter the following request:
Write a one-paragraph ship description for a long-haul mining vessel named 'The Odyssey'.
- Click Run, and observe the result. Notice how the model adopts the "hard
sci-fi" persona, producing a more detailed and stylistically focused
description.
Use a one-shot example to define structure
- Edit your main prompt to include an example for the model to follow:
You are a science fiction author. Create a ship description.
**Example:**
Name: The Serenity
Class: Firefly
Description: A small, versatile transport ship, old but reliable, with many hidden compartments.
**My Request:**
Name: The Odyssey
Class: Long-Haul Miner
Description:
- Click Run. The model now fills in the blank and follows your requested
Name, Class, and Description format because you provided a clear
example.
Click Check my progress to verify the objective.
Add context and structure to prompts
Task 3. Explore Gemini models and adjust temperature
In this task, you learn how to modify two key parameters that control the
model's behavior: the model itself and the temperature, which governs
creativity.
Switch between Gemini models
-
Use the same prompt from the previous task. Under Run settings, click
the model card.
-
In the Model selection panel, select
.
-
Click Run, and note the model's response.
Adjust the temperature to influence the output
In this task, you adjust the temperature setting to see how it influences
the model's responses. A lower temperature makes the output more predictable and
focused, while a higher temperature is often used to elicit a more creative
response.
- In a new chat, enter the following prompt:
Suggest an exciting event that could happen aboard a spaceship.
-
Under Run settings, verify that the model is set to
.
-
Set the Temperature slider to a low value, such as 0.1.
-
Click Run, and review the response. A low temperature setting encourages
the model to choose the most probable and common words.
-
Set the Temperature slider to a high value, such as 1.8.
-
Click Run again. Compare this new response to the previous one and
observe the differences. The higher temperature allows the model to use a
wider range of words, which can lead to more varied or unexpected
suggestions.
Click Check my progress to verify the objective.
Explore Gemini models and adjust temperature
Task 4. Experiment with tools to adjust the model's output
In this task, you explore the Tools available in Google AI Studio. Tools
allow the model to interact with external systems or provide its output in a
specific format.
Use structured output to get JSON
Note: Only one feature can be enabled at a time. Disable Grounding
with Google Search before enabling Structured output, and vice versa.
- In a new chat session, enter the following prompt:
Generate a list of three planets in the Tau Ceti system, including their name, type, and a fictional key resource. Provide the output in JSON format.
-
Under Run settings, click the model card and select
.
-
In the Tools section, click the Structured output toggle to enable
it.
-
Click Run. Observe the output: the model generates a formatted JSON
array, ready for use in an application.
Use Google Search for factual grounding
Sometimes you need the model to access up-to-date, real-world information.
-
To start a new chat session, click the Playground icon on the chat
toolbar.
-
Under Run settings, verify that the model is set to
.
-
In the Tools section, if Grounding with Google Search is not
enabled, click the toggle to enable it.
-
In the prompt field, enter the following request:
Using Google Search, what is the latest news about the James Webb Space Telescope? Then, write a short, inspirational journal entry from an astronomer working on the project.
- Click Run. Notice how the model first provides current, factual
information sourced from Google Search before fulfilling the creative part
of the prompt.
Click Check my progress to verify the objective.
Experiment with tools to adjust the model’s output
Task 5. View the saved prompt in history
In this task, you navigate to the History page to find and review the
prompt you just saved. All saved prompts are stored here, connected to your
Google Drive.
-
In the navigation menu, click History.
-
In the list of saved prompts, click Rugged Space Freighter Names.
Opening the prompt loads it and its previously generated response back into the
chat window, so you can review your work or continue the conversation.
Congratulations!
Congratulations! You have successfully used Google AI Studio to move from a
simple idea to a well-structured and powerful prompt. You learned to guide the
model with context, control its creativity, and connect it to external tools.
You now have a strong foundation for crafting effective prompts for your own
projects.
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: October 28, 2026
Lab Last Tested: October 28, 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.