使用 Google AI Studio 建立採購代理

Lab 1 hour universal_currency_alt No cost show_chart Introductory
info 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.

GSP1383

Google Cloud 自學實驗室

總覽

在本實驗室中,您將使用 Google AI Studio 快速設計採購代理原型。您需要為零售公司 CymbalMart 建立派對策劃採購代理,協助顧客規劃活動並生成購物清單。透過這場實作活動,您將瞭解如何將關鍵使用者歷程 (CUJ) 轉化為可實際運作的代理、使用 Vibe Coding 和自然語言提示詞強化代理功能,並在各種情境驗證代理行為。

關鍵使用者歷程 (CUJ) 是詳細的流程圖,除了記錄顧客為達成特定目標而執行的重要步驟和互動,還囊括影響顧客體驗的決策點及結果。

如要深入瞭解相關背景資訊,建議參加「代理式策略:探索、設計與原型建立」課程。

課程內容

在本實驗室中,您將瞭解如何執行下列工作:

  • 根據關鍵使用者歷程 (CUJ) 建立採購代理。
  • 使用 Vibe Coding 和自然語言提示詞,強化及逐步調整代理的功能。
  • 在不同情境中測試及驗證代理行為。

設定和需求

瞭解以下事項後,再點選「Start Lab」按鈕

請詳閱以下操作說明。實驗室活動會計時,且中途無法暫停。點選「Start Lab」後就會開始計時,顯示可使用 Google Cloud 資源的時間。

您將在真正的雲端環境完成實作實驗室活動,而不是模擬或示範環境。為此,我們會提供新的暫時憑證,供您在實驗室活動期間登入及存取 Google Cloud。

為了順利完成這個實驗室,請先確認:

  • 可以使用標準的網際網路瀏覽器 (Chrome 瀏覽器為佳)。
注意事項:請使用無痕模式 (建議選項) 或私密瀏覽視窗執行此實驗室,這可以防止個人帳戶和學員帳戶之間的衝突,避免個人帳戶產生額外費用。
  • 是時候完成實驗室活動了!別忘了,活動一旦開始將無法暫停。
注意事項:務必使用實驗室專用的學員帳戶。如果使用其他 Google Cloud 帳戶,可能會產生額外費用。

開啟 Google AI Studio

  1. 點選「Start Lab」。實驗室面板會顯示這個實驗室的臨時憑證。

    • 注意事項:如為付費實驗室,系統會提示您選取付款方式。
  2. 無痕視窗開啟 Google AI Studio,接著會出現 Google 登入頁面。

    • 提示:在個別視窗開啟實驗室和 AI Studio 分頁再並排查看,操作上會比較方便。
  3. 複製下方的使用者名稱,並貼入「電子郵件地址」欄位,然後點選「下一步」

    {{{user_0.username | "Username"}}}
  4. 複製下方的密碼,並貼入「輸入密碼」欄位,然後點選「下一步」

    {{{user_0.password | "Password"}}}
  5. 為繼續操作,請接受畫面中的條款及細則。

您現在已透過臨時學生帳戶登入 Google AI Studio。

工作 1:根據關鍵使用者歷程 (CUJ) 建立採購代理

在這項工作中,您會根據定義的 CUJ 建立派對策劃採購代理,協助 CymbalMart 的顧客規劃派對並生成購物清單。

  1. 點按「Get Started」按鈕,然後接受條款及細則。

  2. 點按左側導覽選單中的「Build」

    如要啟用雲端硬碟存取權,請依序點按「Add files」圖示 (+) 和「Drive」,選取學生帳戶 (例如 [student-username]),並授予必要權限。

  3. 在「Build your ideas with Gemini」下方的主要文字提示詞列,貼上下列提示詞來建立派對策劃採購代理:

Create a Party Planner Shopping Agent.
  1. 點按「Build」,等待 Google AI Studio 生成代理。

  2. 查看代理,並使用範例資料進行測試。該代理是否符合您的需求?

  3. 在 Gemini 對話面板中,貼上下列 CUJ 提示詞,然後點按「Send prompt」來定義關鍵使用者歷程:

Create a party planner shopping agent for CymbalMart based on the following critical user journey (CUJ): User: Busy hosts needing event planning. Goal: Convert intent into a curated, budget-conscious shopping list. Tasks: Define event: Define party type, theme, budget, guest count, and special requests. Review list: Align items with the total budget. Refine & Checkout: Adjust for constraints and finalize plan. 注意:關鍵使用者歷程 (CUJ) 為結構化說明,描述顧客為達成特定目標而採取的關鍵步驟。整個歷程包括三個主要部分:使用者 (誰)、目標 (目的) 和工作 (方法)。
  1. 在 Gemini 對話面板中,查看生成的代理規格,確保符合 CUJ。

  2. 在「Preview」窗格中,使用範例派對詳細資料測試代理:

注意:由於代理會使用 AI 生成內容,因此輸出結果可能有所不同。
  • 派對類型:「生日」
  • 參與者人數:「20」
  • 日期:「下週六」
  • 主題:「熱帶」
  1. 確認代理生成的購物清單與 CUJ 相符。

  2. 重新命名應用程式。點按應用程式名稱旁的鉛筆圖示,將名稱改成「CymbalMart Shopping Agent」,然後按一下「Save」

點選「Check my progress」,確認目標已達成。 驗證建立的採購代理。

工作 2:運用 Vibe Coding 強化代理功能

在這項工作中,您會使用 Vibe Coding 為派對策劃採購代理增添自訂功能,並提升使用者體驗。

  1. 查看生成的程式碼。點按「Code」分頁中的 App.tsx 等檔案,即可查看主要應用程式程式碼,並瞭解 UI 元素的建構方式。

  2. 強化代理的功能。在 Gemini 對話面板中,貼上下列指令,將聊天機器人新增至代理 UI:

Add a chatbot called CymbalMart Assistant to interact with customers. 注意:如果代理已包含聊天機器人,請嘗試新增其他功能。
  1. 按一下「Send prompt」,觀察應用程式樣式和版面配置的變化。

  2. 持續強化功能。在 Gemini 面板中輸入下列指令:

Enable customers to update the shopping list and automatically recalculate the budget totals. 注意:如果對這項功能感到滿意,不妨試試新增其他功能,或進一步修正這項功能。
  1. 按一下「Send prompt」,觀察新增到 UI 的功能。

  2. 在「Preview」窗格測試新功能。

工作 3:測試並完成代理

在不同情境下測試派對策劃採購代理,並進行最後的強化,確保功能完善。

  1. 在「Preview」窗格中,使用下列情境測試代理:

    情境 1 - 兒童生日派對:

    • 派對類型:「兒童生日派對」
    • 參與者人數:「15」
    • 主題:「超級英雄」
    • 確認購物清單中的商品和數量適合孩子。

    情境 2 - 公司團隊活動:

    • 派對類型:「公司團隊訓練活動」
    • 參與者人數:「50」
    • 主題:「專業」
    • 確認清單包含適合企業的項目,以及合理的預算估算結果。

    情境 3 - 戶外婚禮:

    • 派對類型:「婚宴」
    • 參與者人數:「100」
    • 主題:「花園/戶外」
    • 確認代理提供的設施包含戶外專用項目,例如防風雨設施和戶外座位。
  2. 在 Gemini 面板中提供意見,視需要調整代理。

  3. 進行最終加強。在 Gemini 面板中貼上下列提示詞,加入語音控制功能:

Add a voice control feature that enables customers to complete the entire process hands-free.
  1. 按一下「Send prompt」,然後在彈出式視窗中允許麥克風存取權。

  2. 確認派對策劃採購代理的所有強化功能都可正常運作。

  3. 按一下「Back to start」,然後點按畫面左上角的 Google AI Studio 標誌,即可前往首頁。

  4. 點按左側導覽選單中的「Build」

  5. 依序按一下「Your apps」>「Created by you」,查看已完成所有強化作業的派對策劃採購代理。

選用:部署代理 如要與他人共用代理,請按照下列步驟操作: 1. 按一下「Publish」,即可部署到 Google Cloud (需要 Google Cloud 專案)。 2. 按一下「Code」,然後下載原始碼,即可部署到其他平台 (GitHub、第三方託管服務等)。

恭喜!

您已成功根據關鍵使用者歷程,建立並強化派對策劃採購代理。您學到了下列內容:

  • 根據關鍵使用者歷程 (CUJ) 建立採購代理。
  • 使用 Vibe Coding 和自然語言提示詞,強化及逐步調整代理的功能。
  • 在不同情境中測試及驗證代理行為。

現在,您已具備在 Google AI Studio 建構及逐步調整 AI 代理的能力!

Google Cloud 教育訓練與認證

協助您瞭解如何充分運用 Google Cloud 的技術。我們的課程會介紹專業技能和最佳做法,讓您可以快速掌握要領並持續進修。我們提供從基本到進階等級的訓練課程,並有隨選、線上和虛擬課程等選項,方便您抽空參加。認證可協助您驗證及證明自己在 Google Cloud 技術方面的技能和專業知識。

使用手冊上次更新日期:2026 年 4 月 1 日

實驗室上次測試日期:2026 年 4 月 1 日

Copyright 2026 Google LLC 保留所有權利。Google 和 Google 標誌是 Google LLC 的商標,其他公司和產品名稱則有可能是其關聯公司的商標。

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 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

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.