microsoft/ai-agents-for-beginners-.agents-deploying-scalable-agents
Dalhin ang isang gumaganang prototype ng agent sa isang scalable, observable na production deployment sa Microsoft Foundry. Saklaw nito ang mga deployment pattern (client-hosted, hosted agents, agent workflows), ang lifecycle ng agent, model routing, response caching, evaluation gates, human-in-the-loop approval, observability gamit ang OpenTelemetry, cost optimisation, at smoke-testing ng mga deployed na agent gamit ang AI Smoke Test action. Batay sa Lesson 16 ng AI Agents for Beginners. GAMITIN hosted agent, Foundry Agent Service, model routing, response caching, evaluation gate, release gate, human approval workflow, agent observability, agent tracing, agent cost optimisation, smoke test ng hosted agent, production customer support pagpapatakbo ng mga agent nang lokal sa device (gamitin ang local-ai-agents / Lesson 17), Azure infrastructure provisioning na hindi kaugnay sa mga agent, mga deployment target na hindi sa Foundry.'
npx skills add https://github.com/microsoft/ai-agents-for-beginners --skill deploying-scalable-agents
> 課程 16 – 部署可擴展代理 的輔助技能。
> 用於協助學習者將代理從原型移動到可擴展、可觀察的
> 生產部署。所有建議均基於課程內容和
> 可執行的筆記本;不要憑空捏造 Foundry API。
當學習者希望:
生產代理主要是模型(約 80%)<em>之外的</em>運行骨架,
而不是模型本身。將每個建議對應到以下某個關注點:
| 關注點 | 原型 → 生產 |
|---------|------------------------|
| 託管 | 筆記本 → 版本化託管服務 |
| 身份 | 你的 az login → 管理身份 + 範圍 RBAC |
| 狀態 | 內存中 → 外部線程/記憶體存儲 |
| 錯誤 | 堆疊追蹤 → 重試、回退、警報 |
| 成本 | "幾分錢" → 追蹤、路由、緩存、預算控制 |
| 質量 | 目測 → 自動化評估門檻 |
| 信任 | 你批准 → 政策 + 人工審核 |
建立 → 版本化 → 評估(門檻)→ 託管部署 → 在線觀察 → 收集失敗 → 重複。
離線評估是一個門檻,不是事後補充 — 未達標版本不會上線,
在線可觀察性會將實際失敗反饋
回離線測試集。
從筆記本指引學習者觀看
16-python-agent-framework.ipynb:
pass_rate >= threshold,僅在符合時部署。@tool(approval_mode="always_require") 用於大額退款等操作。tracer.start_as_current_span(...) 包裹每個請求,並設置屬性如 routed.model、customer.id。部署後,確認端點確實有回應(綠色部署仍可能
沒有響應)。通過 AI Smoke Test
行動,使用 .github/workflows/smoke-test.yml
和 tests/ 中的目錄。執行者將每條
提示 POST 到 POST {project_endpoint}/agents/{agent_name}/endpoint/protocols/openai/responses
並檢查回覆文字。身份需要在
Foundry 專案範圍內擁有 Azure AI User 角色;令牌受眾必須是 https://ai.azure.com/。
分層關卡:<strong>煙霧測試</strong>(可到達、有回應,每次部署)→ <strong>離線評估</strong>(達標才可發布,升級前)→ <strong>在線評估</strong>(持續追蹤運行情況)。
FoundryChatClient(...) + provider.as_agent(...) 模式。<!-- CO-OP TRANSLATOR DISCLAIMER START -->
免責聲明:
本文件由 AI 翻譯服務 Co-op Translator 翻譯而成。雖然我們致力於確保準確性,但請注意,機器自動翻譯可能包含錯誤或不準確之處。原始文件的母語版本應被視為權威來源。對於重要資訊,建議進行專業人工翻譯。我們不對因使用本翻譯而產生的任何誤解或誤釋承擔責任。
<!-- CO-OP TRANSLATOR DISCLAIMER END -->
Take microsoft/ai-agents-for-beginners-.agents-deploying-scalable-agents from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.