コンテンツにスキップ

Lab MBA4 - エージェントを Copilot Chat に導入

この最後のラボでは、カスタム エンジン エージェントを Copilot Chat に導入するために、エージェントのマニフェストを更新します。copilotAgents をアプリ マニフェストで有効にすると、AI 搭載アシスタントを Copilot 体験内で直接利用できるようになります。

Exercise 1: エージェントを Copilot Chat に導入

Step 1: マニフェストの更新

デバッグを停止

この演習を始める前に、前回のデバッグ セッションを終了してください。

M365Agent/AppPackage/manifest.json に移動し、マニフェストのスキーマとバージョンを次のように更新します。

"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.22/MicrosoftTeams.schema.json",
"manifestVersion": "1.22",

bots セクションを以下の内容に置き換え、copilotAgents もマニフェストに追加します。

このブロックでは、エージェントを M365 Copilot 向けのカスタム エンジン エージェントとして宣言しています。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 を選択します。

The UI of Microsoft Teams when uploading an app, with the "Upload an app" command highlighted.

アプリが Teams に表示されたら Add を選択します。今回は Open with Copilot のオプションが表示されるので、Open with Copilot を選択して Copilot 上でエージェントをテストします。

The UI of Microsoft Teams when the agents gets added, with the "Open with Copilot" command highlighted.

Copilot Chat のエージェント一覧から ContosoHRAgentlocal を選択します。会話スターターのいずれかをクリックしてエージェントとチャットを始められます。

The agent hosted inside Microsoft 365 Copilot, showing the conversation starters configured in the application manifest.

Copilot Chat 上でも、エージェントが同様の動作で応答することを確認してください。

The agent hosted in Microsoft 365 Copilot providing the same feedback as the one provided in Microsoft Teams, including evidence of the counter to count the number of interactions with the user.

おめでとうございます!

🎉 おめでとうございます! Microsoft 365 Agents SDK と Azure AI Foundry を使用して、初めてのカスタム エンジン エージェントを構築しました。

このラボで学んだこと:

  • Agent Playground を使用して Azure AI Foundry に AI エージェントを構成する方法
  • 企業ドキュメントをアップロードしてエージェントの応答を根拠付ける方法
  • Visual Studio で M365 Agents SDK を使用してボットをスキャフォールディングする方法
  • Semantic Kernel を追加し、Azure AI Agent Service に接続する方法
  • ボットを Azure AI Foundry のエージェントと統合してリアルタイムで根拠のある推論を行う方法
  • Microsoft TeamsCopilot Chat にエージェントをデプロイしてテストする方法

リソース