
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Create a basic prompt
/ 25
Add context and structure to prompts
/ 25
Explore Gemini models and adjust temperature
/ 25
Experiment with tools to adjust the model’s output
/ 25
Google AI Studio is a powerful tool that allows you to interact with various AI models and experiment with different prompts. Google AI Studio serves as a platform for developers to experiment with and integrate Gemini's multimodal generative AI capabilities into their applications. It provides an environment for prompt engineering, allowing users to test and refine their 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'll learn how to craft prompts that are concise, specific, and well-defined, focusing on one task at a time. Throughout this lab, you'll take on the persona of a creative writer using Google AI Studio to brainstorm ideas for a new science fiction story.
In this lab, you will learn how to:
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:
Click Start Lab. The lab panel will display the temporary credentials for this lab.
Open Google AI Studio in an Incognito window. The Google sign-in page will appear.
Copy the Username below and paste it into the Email field, then click Next.
Copy the Password below and paste it into the Enter your password field, then click Next.
Accept any on-screen terms and conditions to proceed.
You are now logged into Google AI Studio using your temporary student account.
In this task, you'll start by sending a simple, "zero-shot" prompt to the model. This is the most fundamental interaction, where you ask the model to perform a task without giving it any prior examples.
In the left navigation menu, click Chat to open a new, empty chat session.
In the prompt entry field, type the following request:
Click the Run button (the arrow icon to the right of the prompt field).
Review the list of names generated by the model. In the right-hand panel, notice the Token count, which shows the size of your prompt and the model's response.
Save your prompts and responses by clicking the save prompt icon to edit the title and description of the prompt.
If a pop-up window prompts for permissions, choose your student account (e.g., student-XX-YYYY@qwiklabs.net
) and grant any necessary permissions to continue.
In the Save prompt dialog, for Prompt name, type Rugged Space Freighter Names.
Click Save.
Click Check my progress to verify the objective.
In this task, you'll guide the model to produce a more specific and higher-quality response. First, you'll use the System instructions feature to give the model a persona. Then, you'll provide a "one-shot" example within your prompt to show the model the exact format you want.
To start a new, empty chat session, click the Clear Chat icon on the toolbar at the top of the chat window.
At the top of the chat window, click the System instructions icon (the leftmost icon, showing a clipboard) to reveal the system instructions field.
In this field, define the model's persona by entering the following:
Name
, Class
, and Description
format because you provided a clear example.Click Check my progress to verify the objective.
In this task, you'll learn how to modify two key parameters that control the model's behavior: the model itself and the temperature, which governs creativity.
Use the same prompt from the previous task. In the right-hand panel, choose a model from the model dropdown menu.
From the dropdown menu, select
Click Run and note the model's response speed.
Click the model selector again and switch back to
In this task, you'll 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 the right-hand panel, locate the Temperature slider and set it 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.
Now, drag 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.
In this task, you'll explore the Tools available in Google AI Studio. These allow the model to interact with external systems or provide its output in a specific format.
In the Tools section on the right, click the Structured output toggle. This tells the model to strictly follow your formatting request.
Click Run. Observe the output, which should be a perfectly formatted JSON array, ready to be used in an application.
Sometimes you need the model to access up-to-date, real-world information.
To start a new, empty chat session, click the Clear Chat icon on the toolbar at the top of the chat window.
In the Tools section, click the toggle to enable Grounding with Google Search.
Enter a prompt that requires both factual retrieval and creative writing:
Click Check my progress to verify the objective.
In this task, you'll 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 on the left side of the page, click History.
You will now see a list of your saved prompts.
This loads the prompt and its previously generated response back into the chat window, allowing you to review your work or continue the conversation.
Congratulations! You've 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.
...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 June 27, 2025
Lab Last Tested June 27, 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.
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