--- title: Azure AI Foundry Agent 建立教學 --- # Azure AI Foundry Agent 建立教學 --- 參考資料: + [Create a project for Azure AI Foundry](https://learn.microsoft.com/en-us/azure/ai-foundry/how-to/create-projects?tabs=ai-foundry&pivots=fdp-project) + [Create a New Agent](https://learn.microsoft.com/en-us/azure/ai-foundry/agents/quickstart?pivots=ai-foundry-portal) --- ## 一、前置需求 ### Subscription Scope 存取權限 (任一角色即可): + 任一Resource Group: **Owner** (擁有管理資源群組的完整權限) + **Contributor** 或 **Cognitive Services Contributor** 角色 --- ## 二、Azure AI Foundry Project 建立 ### 1. 在Azure Portal 輸入 Azure AI Foundry ![image](https://hackmd.io/_uploads/B1laTQeXeg.png) ### 2. 選擇 **AI Foundry** + 點選 Create ![image](https://hackmd.io/_uploads/BJPYaRuBll.png) ### 3. Create **AI Foundry** + Resource group: 新建立或既有Resource Group + Region: 建議選擇 **West US** + name: 輸入AI foundry name + default project name: 輸入任一名稱 + Next ![image](https://hackmd.io/_uploads/rJOVRAdBxx.png) + Next ![image](https://hackmd.io/_uploads/HyDpRAurxe.png) + Next ![image](https://hackmd.io/_uploads/SkwkJkYHeg.png) + Next ![image](https://hackmd.io/_uploads/r1hlkJKrxx.png) + Next ![image](https://hackmd.io/_uploads/SJHfkkYSeg.png) + Create ![image](https://hackmd.io/_uploads/ByA7k1YSxx.png) + Go to resource ![image](https://hackmd.io/_uploads/Hy0Qx1YSxe.png) + Go to Azure AI Foundry portal ![image](https://hackmd.io/_uploads/HJOyZ1trxg.png) + Continue ![image](https://hackmd.io/_uploads/SyMmb1FHee.png) ## 三、Azure AI Agent 建立 ### 1. 新增Agent + 點選 **Agent** ![image](https://hackmd.io/_uploads/ryC0UGcrxx.png) + 點選 **gpt-4.1** + 點選 **Confirm** ![image](https://hackmd.io/_uploads/S15XDfcrxl.png) + 點選 **Deploy** ![image](https://hackmd.io/_uploads/B1Wiwz5Sge.png) ### 2. Agent 基本設置 + Agent Name: 輸入任一Agent 名稱 + Instructions: ```shell 你是一位專責助理,負責根據使用者提供的電子郵件內容,判斷信件中是否有提及需召開下一次的「會議」。 請注意: 1. 只專注於郵件中「Action Item」或類似標題之後的內容,忽略其前的部分。 2. 僅判斷會議,而非一般活動。 3. 只針對有**明確日期**的會議建立會議。像「每天」「每週」「雙週」這類重覆時間的表述,不需要建立會議。 4. 一封郵件可能包含多場未來需召開的會議,請逐一識別與處理。 5. 若郵件中未提及任何符合條件的未來會議,則無需建立會議。 會議建立原則 - 所建立的 Teams 會議邀請中,會議主旨應明確指出會議目的(例如:「Placeholder:專案進度討論」)。 - 會議邀請的內容(本文)保持空白,僅需在邀請說明的最尾端,完整附上使用者傳入的郵件全文,包含寄件人、收件人、副本、主旨及郵件本文等內容,不得簡略或省略任何部分。 - 若郵件中僅提及會議日期但未說明具體時間,請預設會議時間為整天,並於會議主旨前加上「Placeholder:」作為標註,表示此會議為暫定安排。 - 建立會議,請務必以完整 ISO 8601 格式(YYYY-MM-DDTHH:MM:SS)輸出 Start_time 與 End_time。 若僅提供日期,請自動補上 T00:00:00 作為開始時間,並於結束時間補上隔日 T00:00:00。 補充說明 - 若郵件中未提及任何未來會議,請直接回覆說明「無需召開後續會議」。 - 成功建立會議後,請簡單告知使用者你已成功建立會議。 嚴格限制 - 在會議邀請說明中,務必將使用者所傳入的郵件內容完整覆述於最尾端,不得省略或簡化。 - 除郵件內容外,會議邀請說明不得加入任何其他自動生成的文字描述。 ``` ![image](https://hackmd.io/_uploads/SyrndGcSex.png) ### 3. 新增 Action - Azure Logic Apps + 點選 **Actions** `+ Add` ![image](https://hackmd.io/_uploads/r1GL6m5Sxe.png) + 選取 Azure Logic Apps ![image](https://hackmd.io/_uploads/HJvTxrBXxl.png) + Call external HTTP or HTTPS endpoints ![image](https://hackmd.io/_uploads/HJ8J-HSQlx.png) + Your action name: 可自訂 Logic Apps的名稱 + Your action description: 自訂說明 + Next ![image](https://hackmd.io/_uploads/r10BGSHmgg.png) + POST ![image](https://hackmd.io/_uploads/rkNdGSr7gg.png) + Next ![image](https://hackmd.io/_uploads/SJ85fBS7ge.png) + 將 "RequestBody"的node置換為 ```bash "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "Subject": { "description": "Subject of the meeting. ", "type": "string" }, "Body": { "description": "Describe Body Event message content. ", "type": "string" }, "Start_time": { "description": "Start time of the event in full ISO 8601 format (e.g., '2025-10-31T00:00:00'). Must include both date and time parts.", "type": "string" }, "End_time": { "description":"End time of the event in full ISO 8601 format (e.g., '2025-11-01T00:00:00'). Must include both date and time parts.", "type": "string" } } } } }, ``` + Create ![image](https://hackmd.io/_uploads/S1Nyy4cHgx.png) ### 4. Azure Portal - Azure Logic Apps 設定 + 在Azure Portal找到剛建立的Logic Apps ![image](https://hackmd.io/_uploads/HkYI145Hgl.png) + Edit ![image](https://hackmd.io/_uploads/HJVq1Ncrxe.png) + 選取 **When a HTTP request is received** + Request Body JSON Schema置換為 ```bash { "type": "object", "properties": { "Subject": { "description": "Subject of the meeting. ", "type": "string" }, "Body": { "description": "Describe Body Event message content. ", "type": "string" }, "Start_time": { "description": "Start time of the event (Example: '2017-08-29T05:00:00')", "type": "string" }, "End_time": { "description": "End time of the event (Example: '2017-08-29T05:00:00')", "type": "string" } } } ``` ![image](https://hackmd.io/_uploads/rywDlNqSgg.png) + 點選 **Add an Action** search **Create Event** + 選擇 Create Event (V4) ![image](https://hackmd.io/_uploads/BJwM-Ncree.png) + Calendar Id: 選擇 `行事曆` + Subject: 選取`Subject` + Start Time: 選取`Start_time` + End Time: 選取`End_time` + Time Zone: 選取`(UTC+08:00) Taipei` + Is all day event?: 選取`Yes` + Body: 請輸入 ```bash 📍 董事長指示| ✅ 會議議題 1. 【標題】敘述 [報告人:XXXX] 2. 【標題】敘述 [報告人:XXXX] ⚠️ AR進度追蹤 ※請各項目負責人於會議前完成AR進度更新並同步提供會議資料。 AR進度表更新方式說明如下: 1. 狀態燈號更新 : 狀態燈號請使用以下四個顏色表達 已完成 執行中 瓶頸(須提出因應對策) 長期 2. 未完成項目進度說明填寫,若有特殊需求或狀況請一併填寫於此欄位 3. 回報方式勾選,如需另會報告請一併提供日程需求 4. 未完成項目請提供目標完成日期 🌻會議注意須知 1.報告資料:為了確保資安及強化高效會議管理。敬請於會議前一天將資料設定權限,用share points連結,傳給董事長、與會人員先閱讀。🚫會議前一小時不允許有任何報告變更 2.請提前10分鐘上線做連線品質測試,測試項目包含:音訊 (聽及說話的聲音品質)、視訊、連線訊號品質(IT後台確認) 3.海外地點、移動中、環境吵雜等可能影響會議進行因素,請主動提報 4.同一廠區請集中同一會議室上線 (不在提報名單中請勿自行上線) **與會者名稱: 單位_姓名 (地點); 例 Chairman office_Jarvis (DY) 5.會議進行中需開啟視訊鏡頭。 <若因連線訊號頻寬不佳而無法開啟視訊鏡頭,請主動提報無法開啟視訊> 6.不發言者,請按靜音,以確保會議品質 🔗會議連線方式 Zoom Link:點擊加入會議 Zoom ID:770 518 1888 Password:6088 === 📩【以下為郵件原文供參考】 === @{triggerBody()?['Body']} ``` ![image](https://hackmd.io/_uploads/H1_YZ4qrge.png) + 設置完成 ![image](https://hackmd.io/_uploads/ryxb2GV5Hll.png)