Use cURL to test sample prompts with the API

Check my progress

/ 15

Write Streamlit framework code for the user interface

Check my progress

/ 25

Test the application in Cloud Shell

Check my progress

/ 20

Modify the Dockerfile and push the Docker image to the Artifact Registry

Check my progress

/ 20

Deploy the application to Cloud Run and test it

Check my progress

/ 20

This lab may incorporate AI tools to support your learning.
This content is not yet optimized for mobile devices.
For the best experience, please visit us on a desktop computer using a link sent by email.

GSP517

Google Cloud self-paced labs

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 enrolled in the Develop Gen AI Apps with Gemini and Streamlit course. Are you ready for the challenge?

Explore other content in the Gemini Enterprise Agent Ready (GEAR) program.

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 onboarded at Cymbal Health just a few months ago. Cymbal Health is an established health network in East Central Minnesota dedicated to reimagining and transforming the way that healthcare can be delivered. Cymbal Health connects care and coverage under one health plan to make it easier for patients to receive high quality care at an affordable cost.

As a value added service, Cymbal Health is interested in improving customer Healthy Living and Wellness, with tips, and advice within apps. One particular area they want to focus on is improving customer nutrition.

Cymbal Health logo

By harnessing the power of Gemini, a multimodal model for generating text, audio, images, and video, Cymbal Health can build applications that generate meal recommendations for its customers.

As an example, your team is working to create an AI-based Chef app that generates recipes based on customer cuisine preferences, dietary restrictions, food allergies, and what they typically have in their homes or can purchase at a grocery store. Your job is to build, test, and deploy a proof of concept (POC) for this Chef app built on the Gemini model, Streamlit framework, and Cloud Run. As part of this POC, they have a list of tasks for you to complete in an allotted period of time in a sandbox environment.

Your challenge

In this lab, you learn how to perform the following tasks:

  • Use cURL to test a prompt with the API.
  • Write Streamlit framework and prompt Python code to complete chef.py.
  • Test the application.
  • Modify the Dockerfile and push the Docker image to Artifact Registry.
  • Deploy the application to Cloud Run and test it.

Task 1. Use cURL to test a prompt with the API

Before you begin to create the Chef app in Agent Platform, test connectivity with the Gemini API.

  1. In the Google Cloud console, on the Navigation menu (Navigation menu icon), click Agent Platform > Notebooks > 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. From the File Browser, open prompt.ipynb and select the Python 3 (Local) kernel when prompted.

  2. Modify prompt.ipynb to use the following prompt with cURL in cell 5 by replacing the existing prompt:

    I am a Chef. I need to create Japanese recipes for customers who want low sodium meals. However, I do not want to include recipes that use ingredients associated with a peanuts food allergy. I have ahi tuna, fresh ginger, and edamame in my kitchen and other ingredients. The customer wine preference is red. Please provide some for meal recommendations. For each recommendation include preparation instructions, time to prepare and the recipe title at the beginning of the response. Then include the wine paring for each recommendation. At the end of the recommendation provide the calories associated with the meal and the nutritional facts. Note: In cell 3, the LOCATION variable is automatically configured with your assigned lab region ({{{project_0.default_region | Region}}}). Ensure that cell 3 runs before running cell 5 so that the API endpoint correctly targets your assigned regional Vertex AI service.
  3. Run all cells and observe the results.

  4. Save prompt.ipynb.

Once you are satisfied with the results, verify the objective.

To verify the objective, click Check my progress. Use cURL to test a prompt with the API

Task 2. Write Streamlit framework and prompt Python code to complete chef.py

In this task, you clone a GitHub repository and download the chef.py file. Then you add Streamlit framework code in the chef.py file for the wine preference to complete the user interface for the application. You also include a custom Gemini prompt (similar to the one in Task 1) that uses variables.

  1. In Cloud Shell, clone the following repository from the default directory:

    git clone https://github.com/GoogleCloudPlatform/generative-ai.git
  2. Navigate to the gemini-streamlit-cloudrun directory:

    cd generative-ai/gemini/sample-apps/gemini-streamlit-cloudrun
  3. Add the following dependency to the requirements.txt file:

    google-cloud-logging Important: Complete all work in this challenge lab within this directory. If you do not download the chef.py file and make changes to it in this directory, it cannot access the Streamlit framework, and you cannot test it in Cloud Shell (Task 3), build the Docker container (Task 4), or deploy and test it in Cloud Run (Task 5).
  4. Download the chef.py file using the following command:

    gcloud storage cp {{{project_0.startup_script.python_file_path|Chef Python file path}}} .
  5. Open the chef.py file in the Cloud Shell Editor and review the code.

    Note: The chef.py file already includes the Streamlit framework user interface code for the cuisine, dietary_preference, allergy, ingredient_1, ingredient_2, and ingredient_3 variables. Review this interface code before completing the next step.
  6. Replace GCP_PROJECT_ID with , and GEMINI_FLASH_MODEL_ID with .

  7. Add a Streamlit framework radio button option for the wine variable with options for Red, White, and None.

  1. Save the chef.py file.

  2. Add the following Gemini prompt in the Python code:

    prompt = f"""I am a Chef. I need to create {cuisine} \n recipes for customers who want {dietary_preference} meals. \n However, don't include recipes that use ingredients with the customer's {allergy} allergy. \n I have {ingredient_1}, \n {ingredient_2}, \n and {ingredient_3} \n in my kitchen and other ingredients. \n The customer's wine preference is {wine} \n Please provide some for meal recommendations. For each recommendation include preparation instructions, time to prepare and the recipe title at the beginning of the response. Then include the wine paring for each recommendation. At the end of the recommendation provide the calories associated with the meal and the nutritional facts. """
  3. Save the chef.py file.

Once you are satisfied with the Gemini prompt code that you added in chef.py, in the Google Cloud console, click Open Terminal to return to Cloud Shell, and run the following command to upload the file to the -generative-ai bucket:

gcloud storage cp chef.py gs://{{{project_0.project_id|set at lab start}}}-generative-ai/

To verify the objective, click Check my progress. Write prompt and Streamlit framework Python code to complete chef.py

Note: Make sure to run the preceding command after making any changes to the chef.py file so that the updated chef.py file is present in the bucket.

Task 3. Test the application

In this task, you use the terminal in Cloud Shell to run and test your application.

Make sure you are still in the generative-ai/gemini/sample-apps/gemini-streamlit-cloudrun directory.

  1. Set up the Python virtual environment and install the dependencies.

  2. Set environment variables for PROJECT (your Project ID) and REGION (the region you are using in the lab environment).

  3. Run the chef.py application and test it.

Once you have tested the application in Cloud Shell and confirmed that it performs as designed without errors, verify the objective.

To verify the objective, click Check my progress. Test the application

Task 4. Modify the Dockerfile and push the image to Artifact Registry

In this task, you modify the sample Dockerfile to use your chef.py file and push the Docker image to Artifact Registry.

Important: Before completing the steps in this task, set the environment variables for PROJECT (your Project ID) and REGION (the region you are using in the lab environment) as you did in the previous task.
  1. In the Cloud Shell Editor, modify the Dockerfile to use chef.py, and then save the file.

  2. In Cloud Shell, set the following environment variables:

    Variable Value
    AR_REPO chef-repo
    SERVICE_NAME chef-streamlit-app
    Note: Combine this command and the following two commands as a single command, because creating the Artifact Registry repository and submitting the build to Cloud Build takes approximately 8 minutes.
  3. Create the Artifact Registry repository with the gcloud artifacts repositories create command and the following parameters:

    Parameter Value
    Repository name $AR_REPO
    Location $REGION
    Repository format Docker
  4. Submit the build with the gcloud builds submit command and the following parameter:

    Parameter Value
    Tag "$REGION-docker.pkg.dev/$PROJECT/$AR_REPO/$SERVICE_NAME"
  5. Wait for the command to complete.

Once the command is complete, verify the objective.

To verify the objective, click Check my progress. Modify the Dockerfile and push the Docker image to the Artifact Registry

Task 5. Deploy the application to Cloud Run and test it

In this task, you deploy the application (as a Docker artifact) to Cloud Run and then test the application running from the Cloud Run service endpoint.

  1. In Cloud Shell, deploy the application using the gcloud run deploy command and the following parameter values:

    Parameter Value
    Port 8080
    Image "$REGION-docker.pkg.dev/$PROJECT/$AR_REPO/$SERVICE_NAME"
    Flag --allow-unauthenticated
    Region $REGION
    Project $PROJECT
    Set-env-vars PROJECT=$PROJECT,REGION=$REGION
    Note: You may see a prompt asking "Do you want enable these APIs to continue (this will take a few minutes)?" If you do, press Y for yes.

The deployment takes a few minutes to complete and provides a URL to the Cloud Run service. You can open that URL in your browser to view the deployed Cloud Run application.

  1. Test the application using the provided service URL.

Once you have tested the application running on Cloud Run, verify the objective.

To verify the objective, click Check my progress. Deploy the application to Cloud Run and test

Congratulations!

By completing this challenge lab, you verified your skills in Gen AI application development with Gemini and how you can apply these skills to an AI-based Chef application.

Gen AI application development with Gemini and Streamlit skill badge

Next steps / Learn more

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 on November 10, 2026

Lab Last Tested on November 9, 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.

Before you begin

  1. Labs create a Google Cloud project and resources for a fixed time
  2. Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
  3. On the top left of your screen, click Start lab to begin

Use private browsing

  1. Copy the provided Username and Password for the lab
  2. Click Open console in private mode

Sign in to the Console

  1. Sign in using your lab credentials. Using other credentials might cause errors or incur charges.
  2. Accept the terms, and skip the recovery resource page
  3. Don't click End lab unless you've finished the lab or want to restart it, as it will clear your work and remove the project

This content is not currently available

We can notify you via email when it becomes available

Great!

We can contact you via email if it becomes available

One lab at a time

Confirm to end all existing labs and start this one

Use private browsing to run the lab

Using an Incognito or private browser window is the best way to run this lab. This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account.