Prompt Design in Vertex AI: Challenge Lab - GSP519

A passionate full-stack developer from @ePlus.DEV
Search for a command to run...

A passionate full-stack developer from @ePlus.DEV
No comments yet. Be the first to comment.
Quick and practical tips to help users optimize tasks, improve skills, and solve common problems effectively across various areas like tech, lifestyle, productivity, and more.
Một bản tin giúp Developer cập nhật nhanh AI, Cloud, Open Source và những công nghệ đáng chú ý trong ngày. 📌 Executive Summary Vercel AI Gateway thêm Grok Imagine Image 2.0 Preview, đưa image gene

Một bản tin giúp Developer cập nhật nhanh AI, Cloud, Open Source và những công nghệ đáng chú ý trong ngày. 📌 Executive Summary Cloudflare đang hợp nhất Workers AI và AI Gateway thành một control p

Một bản tin giúp Developer cập nhật nhanh AI, Cloud, Open Source và những công nghệ đáng chú ý trong ngày. 📌 Executive Summary GitHub thay đổi hành vi của Code Quality: bật Code Quality sẽ không c

Một bản tin giúp Developer cập nhật nhanh AI, Cloud, Open Source và những công nghệ đáng chú ý trong ngày. 📌 Executive Summary OpenAI thay đổi thời điểm tính phí seat mới của ChatGPT Business từ n

Overview Dataplex is an intelligent data fabric that enables organizations to centrally discover, manage, monitor, and govern their data across data lakes, data warehouses, and data marts to power ana

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?
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.
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:
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.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.
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.
In this section, you will create a template for analyzing images of Cymbal Direct products using the Gemini 2.5 Flash 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.
gemini-2.5-flash 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: qwiklabs-gcp-00-425c7fdc774b-bucket/cymbal-product-image.png.
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.
Evaluate and Iterate: adjust your prompt and parameters as needed to refine the results.
Name your prompt Cymbal Product Analysis.
Save Prompt: Once you're happy with the results, click Save, and select the us-central1 region.
Note: Ensure you are using the gemini-2.5-flash model for this task!
Build a Gemini image analysis tool.
In this task, you will create a prompt for generating diverse tagline possibilities using the Gemini 2.5 Flash 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.
Create a new prompt with the gemini-2.5-flash model to create a customizable tagline generator for Cymbal Direct's new product line.
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.
| 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. |
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)
Add one input and your prompt, then click the submit button to have Gemini generate a tagline option.
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.
Name your prompt Cymbal Tagline Generator Template.
Save Prompt: Once you're happy with the results, click Save, and select the us-central1 region. Note: if your prompt is already saved with the Autosave functionality, ensure the name of the prompt is correct.
Note: Ensure you are using the gemini-2.5-flash model for this task!
Build a Gemini tagline generator.
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.
In the Google Cloud console, on the Navigation menu (), click Vertex AI > Workbench.
Find the vertex-ai-jupyterlab instance and click on the Open JupyterLab button.
The JupyterLab interface for your Workbench instance opens in a new browser tab.
Note: If you do not see notebooks in JupyterLab, please follow these additional steps to reset the instance:
1. Close the browser tab for JupyterLab, and return to the Workbench home page.
2. Select the checkbox next to the instance name, and click Reset.
3. After the Open JupyterLab button is enabled again, wait one minute, and then click Open JupyterLab.
Open the notebook file named image-analysis.ipynb. Set the kernel to Python 3.
Run all the cells in the notebook to ensure your environment is set up correctly.
From the Vertex AI Studio page, navigate back to the Cymbal Product Analysis prompt you created.
On the right side of the page, click Code. Use Python as the language.
Copy the second code cell into the notebook file in the specified cell.
Run the code and verify that it executes successfully and produces the expected output.
Note: After pasting the code, remember to replace the client authentication block (which uses an API key) with the version that uses your PROJECT_ID and LOCATION, as described in the markdown cell in the notebook.
"""). 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."""
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.
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!
Save the changes to your code. Then, rerun the code cell in your notebook to test Gemini with the new prompt.
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.
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.
Inside of your Workbench instance, open the notebook file named tagline-generator.ipynb. Set the kernel to Python 3.
From the Vertex AI Studio page, navigate back to the Cymbal Tagline Generator Template prompt you created.
On the right side of the page, click Code. Use Python as the language.
Copy the second code cell into the notebook file in the specified cell.
Run the code and verify that it executes successfully and produces the expected output.
Note: After pasting the code, remember to replace the client authentication block (which uses an API key) with the version that uses your PROJECT_ID and LOCATION, as described in the markdown cell in the notebook.
Within the code, there will be multiple lines of text between triple quotes ("""). This is your current tagline generation prompt.
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.
Save the changes to your code. Then, rerun the code cell in your notebook to test the language model with the new prompt.
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.
Task 1 & Task 2:
Enable Vertex AI API Click Here
💡 Download the 2 files below:
File Task 1: Cymbal Product Analysis.json
File Task 2: Cymbal Tagline Generator Template.json
Click this link to open Vertex AI. Click Here


Open Promt Cymbal Product Analysis → choice file PROJECT-ID/cymbal-product-image.png → Submit





Open promt Cymbal Tagline Generator Template → Submit



Task 3 & 4:
Open Vetex AI -> Workbench → vertex-ai-jupyterlab → Open Open JupyterLab

curl -LO raw.githubusercontent.com/ePlus-DEV/storage/refs/heads/main/labs/GSP519/lab.sh
source lab.sh

Open file
