# Computer Use Agent 部署說明 本文件說明 **Azure OpenAI Computer Use Agent (CUA)**的部署方式 。 --- ![image](https://hackmd.io/_uploads/SkeI93Fy-e.png) --- ## 參考資料 [CUA Repo](https://github.com/Azure-Samples/computer-use-model) --- ## 一、前置需求 ### Require Access for computer use Model: + 一個Subscription Id 對應一個申請單 [Request Form](https://aka.ms/oai/cuaaccess) ### 環境準備: + 可自動登入 & 禁用螢幕保護與自動鎖定 & 禁用睡眠/休眠 的Virtual Machine. --- ## 二、範例程式 本程式僅作為示範如何自動化執行 CUA 的範例,若需應用於正式生產環境,請依需求進行調整與最佳化。 ### 🔹 1. Download Code & Create Python venv + 請下載[Sample Code]() + Create a Virtual Environment 1. 切換Sample Code資料夾 ```bash cd "您的專案資料夾路徑" ``` 建立python venv ```bash python -m venv .venv ``` 2. Activate venv ```bash # For Windows .\.venv\Scripts\activate ``` 3. Install Dependency** ```bash # For Windows pip install -r requirements.txt ``` ### 🔹 2. 環境變數設定 (Env) 請在專案中設定以下環境變數: | 變數名稱 | 說明 | |----------|------| | **AZURE_OPENAI_ENDPOINT** | Azure OpenAI 服務的 Endpoint URL | | **AZURE_OPENAI_DEPLOYMENT_NAME** | 建議使用 `gpt-4.1` 作為部署名稱 | | **AZURE_OPENAI_API_KEY** | Azure OpenAI 的 API 金鑰 | | **NOTIFICATION_URL** | *(選填)* 可自訂通知機制,例如使用 Logic Apps。<br>參考:[Logic Apps - Teams Channel Notification] | > ⚠️ **提醒:** 範例程式使用的 CUA 模型為 `computer-use-preview`。 若模型名稱有調整,請至 main.py 進行修改。 ![image](https://hackmd.io/_uploads/By-Kxks1Zl.png)