ラボ MBA4 - エージェントを Copilot Chat に追加
In this final lab, you’ll bring your custom engine agent into Copilot Chat by updating the agent's manifest. By enabling copilotAgents in the app manifest, you’ll make your AI-powered assistant available directly inside the Copilot experience.
演習 1: エージェントを Copilot Chat に追加
Step 1: マニフェストを更新する
デバッグを停止
この演習を始める前に、前回のデバッグ セッションを終了してください。
M365Agent/AppPackage/manifest.json に移動し、次のようにマニフェストの schema と version を更新します。
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.22/MicrosoftTeams.schema.json",
"manifestVersion": "1.22",
bots セクションを次の内容に置き換え、copilotAgents をマニフェストに追加します:
このブロックは、エージェントを Microsoft 365 Copilot 用の Custom Engine エージェントとして宣言します。Microsoft 365 に対し、Copilot Chat にこのエージェントを表示し、会話 UI にコマンド リストと会話スターターを表示して ユーザー がすばやく開始できるように指示します。
"bots": [
{
"botId": "${{BOT_ID}}",
"scopes": [
"personal",
"team",
"groupChat"
],
"supportsFiles": false,
"isNotificationOnly": false,
"commandLists": [
{
"scopes": [ "personal", "team", "groupChat" ],
"commands": [
{
"title": "Emergency and Mental Health",
"description": "What’s the difference between Northwind Standard and Health Plus when it comes to emergency and mental health coverage?"
},
{
"title": "PerksPlus Details",
"description": "Can I use PerksPlus to pay for both a rock climbing class and a virtual fitness program?"
},
{
"title": "Contoso Electronics Values",
"description": "What values guide behavior and decision making at Contoso Electronics?"
}
]
}
]
}
],
"copilotAgents": {
"customEngineAgents": [
{
"id": "${{BOT_ID}}",
"type": "bot"
}
]
},
Start または F5 を押してデバッグを開始します。Microsoft Teams が自動的に起動します。ブラウザーで Microsoft Teams が開いたら、アプリのポップアップは無視し、Apps > Manage your apps > Upload an app を選択してから Upload a custom app を選択します。エクスプローラーでプロジェクト フォルダー ...\ContosoHRAgent\M365Agent\appPackage\build に移動し、appPackage.local.zip を選択します。
アプリが Teams に再度表示されたら Add を選択します。今回は Open with Copilot のオプションが表示されるので、Open with Copilot を選択して Copilot 上でエージェントをテストします。
Copilot Chat のエージェント一覧から ContosoHRAgentlocal を選択します。会話スターターのいずれかを選択して、エージェントと対話できます。
エージェントが Copilot Chat 上でも同様の動作で応答することを確認してください。
おめでとうございます!
🎉 おめでとうございます! Microsoft 365 Agents SDK と Microsoft Foundry を使用して、初めての Custom Engine エージェントを構築しました。
このラボでは、次の内容を学習しました:
- Agent Playground を使用して Microsoft Foundry で AI エージェントを構成する
- 企業ドキュメントをアップロードしてエージェントの回答を根拠付ける
- Visual Studio で M365 Agents SDK を使用してボットをスキャフォールディングする
- Semantic Kernel を追加し、Azure AI Agent Service に接続する
- 実時間で根拠に基づいた推論を行うため Microsoft Foundry エージェントとボットを統合する
- Microsoft Teams と Copilot Chat でエージェントをデプロイしてテストする