Skip to content

Commit 6e7bd13

Browse files
author
Jarno Hakulinen
authored
Multiagent sample update (#41121)
* multiagent sample update * ai feedback * update * review feedback
1 parent b0bd213 commit 6e7bd13

File tree

4 files changed

+43
-13
lines changed

4 files changed

+43
-13
lines changed

sdk/ai/azure-ai-agents/samples/agents_multiagent/sample_agents_agent_team.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,30 @@
77
DESCRIPTION:
88
This sample demonstrates how to use multiple agents using AgentTeam with traces.
99
10+
The team consists of
11+
• one leader agent - automatically created by AgentTeam from the
12+
configuration in `utils/agent_team_config.yaml`
13+
• two worker agents - `Coder` and `Reviewer`, defined in the code below
14+
15+
IMPORTANT - leader-agent model configuration
16+
`utils/agent_team_config.yaml` contains the key TEAM_LEADER_MODEL.
17+
Its value must be the name of a **deployed** model in your Azure AI
18+
project (e.g. "gpt-4o-mini").
19+
If this model deployment is not available, AgentTeam cannot instantiate
20+
the leader agent and the sample will fail.
21+
1022
USAGE:
1123
python sample_agents_agent_team.py
1224
1325
Before running the sample:
1426
15-
pip install azure-ai-agents azure-identity
16-
17-
Set these environment variables with your own values:
18-
PROJECT_ENDPOINT - the Azure AI Agents endpoint.
19-
MODEL_DEPLOYMENT_NAME - the name of the model deployment to use.
27+
1. pip install azure-ai-agents azure-identity
28+
2. Ensure `utils/agent_team_config.yaml` is present and TEAM_LEADER_MODEL points
29+
to a valid model deployment.
30+
3. Set these environment variables with your own values:
31+
PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview
32+
page of your Azure AI Foundry portal.
33+
MODEL_DEPLOYMENT_NAME - The model deployment name used for the worker agents.
2034
"""
2135

2236
import os

sdk/ai/azure-ai-agents/samples/agents_multiagent/sample_agents_multi_agent_team.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,34 @@
66

77
"""
88
DESCRIPTION:
9-
This sample demonstrates how to use multiple agents to execute tasks.
9+
This sample demonstrates how to use an AgentTeam to execute a multi-step
10+
user request with automatic function calling and trace collection.
11+
12+
The team consists of
13+
• one leader agent - created automatically from the configuration in
14+
`utils/agent_team_config.yaml`
15+
• three worker agents - `TimeWeatherAgent`, `SendEmailAgent`, and
16+
`TemperatureAgent`, each defined in the code below with its own tools
17+
18+
IMPORTANT - leader-agent model configuration
19+
`utils/agent_team_config.yaml` contains the key TEAM_LEADER_MODEL.
20+
Its value must be the name of a **deployed** model in your Azure AI
21+
project (e.g. "gpt-4o-mini").
22+
If this deployment does not exist, AgentTeam cannot instantiate the
23+
leader agent and the sample will fail.
1024
1125
USAGE:
1226
python sample_agents_multi_agent_team.py
1327
1428
Before running the sample:
1529
16-
pip install azure-ai-agents azure-identity
17-
18-
Set these environment variables with your own values:
19-
PROJECT_ENDPOINT - the Azure AI Agents endpoint.
20-
MODEL_DEPLOYMENT_NAME - the name of the model deployment to use.
30+
1. pip install azure-ai-agents azure-identity
31+
2. Ensure `utils/agent_team_config.yaml` is present and TEAM_LEADER_MODEL points
32+
to a valid model deployment.
33+
3. Set these environment variables with your own values:
34+
PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview
35+
page of your Azure AI Foundry portal.
36+
MODEL_DEPLOYMENT_NAME - The model deployment name used for the worker agents.
2137
"""
2238

2339
import os

sdk/ai/azure-ai-agents/samples/agents_multiagent/utils/agent_team.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import yaml # type: ignore
88

99
from opentelemetry import trace
10-
from opentelemetry.trace import StatusCode, Span # noqa: F401 # pylint: disable=unused-import
10+
from opentelemetry.trace import Span # noqa: F401 # pylint: disable=unused-import
1111
from typing import Any, Dict, Optional, Set, List
1212
from azure.ai.agents import AgentsClient
1313
from azure.ai.agents.models import FunctionTool, ToolSet, MessageRole, Agent, AgentThread

sdk/ai/azure-ai-agents/samples/agents_multiagent/utils/agent_team_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
TEAM_LEADER_MODEL: |
2-
gpt-4
2+
gpt-4o-mini
33
44
TEAM_LEADER_INSTRUCTIONS: |
55
You are an agent named '{agent_name}'. You are a leader of a team of agents. The name of your team is '{team_name}'.

0 commit comments

Comments
 (0)