Wczytuję…
Nie znaleziono wyników.

Google Cloud Skills Boost

Wykorzystuj swoje umiejętności w konsoli Google Cloud


Zyskaj dostęp do ponad 700 modułów i kursów

Prompt Design in Vertex AI: Challenge Lab

Moduł 1 godz. 30 godz. universal_currency_alt Bezpłatnie show_chart Wprowadzające
info Ten moduł może zawierać narzędzia AI, które ułatwią Ci naukę.
Zyskaj dostęp do ponad 700 modułów i kursów

GSP519

Google Cloud self-paced labs logo

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 Prompt Design in Vertex AI course. Are you ready for the challenge?

Topics tested

  • Craft effective prompts and use parameters to guide generative AI output in Vertex AI Studio.
  • Apply Gemini models to create product descriptions and taglines in a real-world marketing scenario.
  • Examine and run Python code exported from Vertex AI Studio to gain a basic understanding of generative AI implementation.
  • Use Jupyter Notebooks to test and modify generative AI code.

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

You're a member of an educational content startup specializing in engaging learners with the natural world. You've formed a partnership with Cymbal Direct, an online retailer launching a new line of outdoor gear and apparel designed to encourage young people to explore and connect with nature.

Cymbal Direct wants to create a marketing campaign for its new product line that leverages the power of generative AI. Your task is to help them develop a set of tools within Google Cloud's Vertex AI platform that will streamline the generation of the following:

  • Evocative Product Descriptions: using image analysis to inspire short, descriptive text that captures the essence of their products and the feeling of being in nature.
  • Catchy Taglines: focused on highlighting product features, the target audience, and the desired emotional response.

Task 1. Build a Gemini image analysis tool

In this section, you will create a template for analyzing images of Cymbal Direct products using the model in Vertex AI Studio. The goal is to generate descriptive text options inspired by the image, from simple details to more evocative, mood-setting phrases.

Tasks:

  1. Create a prompt in Vertex AI Studio with the model to analyze Cymbal Direct's product image (provided in Google Cloud Storage) and generate multiple descriptive text options inspired by the image.

The image for this task is located at: .

  1. Experiment with different prompts to generate the following:

    • Short, descriptive text inspired by the image.
    • Catchy phrases suitable for advertisements.
    • A poetic description for a nature-focused campaign.
  2. Evaluate and Iterate: adjust your prompt and parameters as needed to refine the results.

  3. Name your prompt Cymbal Product Analysis.

  4. Save Prompt: Once you're happy with the results, click Save, and select the region.

Note: Ensure you are using the model for this task! Build a Gemini image analysis tool.

Task 2. Build a Gemini tagline generator

In this task, you will create a prompt for generating diverse tagline possibilities using the model in Vertex AI Studio. The goal is to develop a prompt that allows for customization of the tagline style, based on product attributes, target audience, and emotional resonance.

Tasks:

  1. Create a new prompt with the model to create a customizable tagline generator for Cymbal Direct's new product line.

  2. In the System instructions box, enter the following:

Cymbal Direct is partnering with an outdoor gear retailer. They're launching a new line of products designed to encourage young people to explore the outdoors. Help them create catchy taglines for this product line.
  1. Include 2 Examples in your prompt to guide the output style. Add this example input and output for your first example, then use this template to add another example.
Input Output
Write a tagline for a durable backpack designed for hikers that makes them feel prepared. Consider styles like minimalist. Built for the Journey: Your Adventure Essentials.
  1. Design a prompt with parameters to customize taglines based on:

    • Product attributes (e.g., durable, lightweight)
    • Target audience (e.g., young adventurers, families)
    • Emotional resonance (e.g., empowered, connected)
  2. Add one input and your prompt, then click the submit button to have Gemini generate a tagline option.

  3. Evaluate and Iterate:

    • Experiment with different parameter combinations to see the variety of taglines produced.
    • Based on the results, fine-tune the wording of your prompt, add more parameter options, or adjust the style choices to achieve your desired outcome.
  4. Name your prompt Cymbal Tagline Generator Template.

  5. Save Prompt: Once you're happy with the results, click Save, and select the region. Note: if you prompt is already saved with the Autosave functionality, ensure the name of the prompt is correct and you can see it in the Prompt Management page.

Note: Ensure you are using the model for this task! Build a Gemini tagline generator.

Task 3. Experiment with image analysis code

In this task, you will explore the Python code for the image analysis prompt you created. You will then modify the prompt to be more specific and test the new prompt in a notebook.

  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.

  1. Create a new notebook file named image-analysis.ipynb. Set the kernel to Python 3.

Explore the image analysis code

  1. From the Vertex AI Studio page, navigate to the Prompt Management page. Select the Cymbal Product Analysis prompt you created.

  2. On the right side of the toolbar, click Build with Code. Use Python as the language.

Note: The first code block uses terminal commands to install the necessary Python packages. You can run these commands in a terminal inside of your Workbench instance by navigating to File > New > Terminal.
  1. Run the second code cells in the notebook. Verify that the code executes successfully and produces the expected output.

Modify the image analysis prompt

  1. Within the code, there will be a line of text between triple quotes ("""). This is your current image analysis prompt. For example, it might be:
"""Describe this image with a focus on colors, textures, and the feeling it evokes."""
  1. Now you will modify the prompt to be more specific. Change the wording of the prompt in the code cell to make the output less than 10 words.

  2. Next, modify the prompt code to encourage the model to produce the most creative, unusual, and unexpected descriptions of the image it can think of.

Hint: You will need to adjust one of the parameters in the code to achieve this!
  1. Save the changes to your code. Then, rerun the code cell in your notebook to test Gemini with the new prompt.

  2. Verify that the new descriptions are shorter and more creative than the previous ones.

Note: Ensure you are saving your notebook file to pass the progress check! Experiment with image analysis code.

Task 4. Experiment with tagline generation code

In this task, you will explore the Python code for the tagline prompt you created. You will then modify the prompt to include a specific keyword and test the new prompt in a notebook.

Explore the tagline generator code

  1. Inside of your Workbench instance, create a new notebook file named tagline-generator.ipynb. Set the kernel to Python 3.

  2. From the Vertex AI Studio page, navigate to the Prompt Management page. Select the Cymbal Tagline Generator Template prompt you created.

  3. On the right side of the toolbar, click Build with Code. Use Python as the language.

Note: The first code block uses terminal commands to install the necessary Python packages. If you ran the it in the previous section already, you won't need to run it again.
  1. Run the second code cells in the notebook. Verify that the code executes successfully and produces the expected output.

Modify the tagline generation prompt

  1. Within the code, there will be multiple lines of text between triple quotes ("""). This is your current tagline generation prompt.

  2. Now you will modify the prompt to include a specific keyword. Modify the last input to specifically request that the tagline includes the keyword nature.

  3. Save the changes to your code. Then, rerun the code cell in your notebook to test the language model with the new prompt.

  4. Verify that the new tagline includes the keyword nature.

Experiment with tagline generation code. Note: Wait for couple of minutes and click the check my progress button if you are not getting the score.

Congratulations!

Congratulations, you've successfully completed the lab! You've helped Cymbal Direct create a set of tools within Google Cloud's Vertex AI platform that will streamline the generation of evocative product descriptions and catchy taglines for their new product line. You've also explored and modified the image analysis and tagline generation code in a notebook. Great job!

Prompt Design in Vertex AI skill badge

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 May 14, 2025

Lab Last Tested May 14, 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.

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

Uruchom ten moduł w oknie 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.