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
Send a text prompt requests to GenAI and generate an Image
/ 50
Analyze the saved image by using a multimodal model
/ 50
在挑戰實驗室中,您會在特定情境下完成一系列任務。挑戰實驗室中沒有逐步說明,請運用從課程實驗室學到的知識和技巧,獨立完成任務!自動評分系統 (如本頁所示) 會解析您是否正確完成工作。
挑戰實驗室中不會介紹新的 Google Cloud 概念。請活用所學技巧來解決問題,例如變更預設值、閱讀研究錯誤訊息。
如果想拿滿分,就必須在時限內完成所有任務!準備好迎接挑戰了嗎?
情境:您是 AI 花藝設計公司的開發人員。客戶描述想要的花束樣貌後,系統會生成逼真圖片請客戶確認。為了進一步提升體驗,您整合最先進的圖像分析技術,為生成的花束圖片提供描述性摘要。主應用程式會根據使用者的互動叫用相關方法,因此您需要完成下列工作:
工作 1:開發一個 Python 函式,命名為 generate_bouquet_image(prompt)。這個函式應使用輸入的提示詞叫用 imagen-3.0-generate-002 模型來生成圖片,並儲存至本機。請使用這個提示詞:Create an image containing a bouquet of 2 sunflowers and 3 roses。
點選「Check my progress」確認目標已達成。
工作 2:開發第二個 Python 函式,命名為 analyze_bouquet_image(image_path)。這個函式會將圖片路徑和文字提示詞做為輸入內容,根據傳入的圖片生成生日祝福,並傳送至 gemini-2.0-flash-001 模型。請在提示詞中啟用串流功能,確保回應生成時,您能立即取得。
點選「Check my progress」確認目標已達成。
您已完成這個實驗室!很棒!
Copyright 2026 Google LLC 保留所有權利。Google 和 Google 標誌是 Google LLC 的商標,其他公司和產品名稱則有可能是其關聯公司的商標。
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