55from datetime import datetime
66from typing import Annotated
77
8+ from agent_framework import ChatAgent
89from agent_framework .azure import AzureOpenAIChatClient
910from agent_framework .openai import OpenAIChatClient
1011from azure .identity import DefaultAzureCredential
@@ -80,7 +81,8 @@ def get_current_date() -> str:
8081 return datetime .now ().strftime ("%Y-%m-%d" )
8182
8283
83- weekend_agent = client .create_agent (
84+ weekend_agent = ChatAgent (
85+ chat_client = client ,
8486 instructions = (
8587 "You help users plan their weekends and choose the best activities for the given weather. "
8688 "If an activity would be unpleasant in the weather, don't suggest it. "
@@ -144,7 +146,8 @@ def check_fridge() -> list[str]:
144146 return items
145147
146148
147- meal_agent = client .create_agent (
149+ meal_agent = ChatAgent (
150+ chat_client = client ,
148151 instructions = (
149152 "You help users plan meals and choose the best recipes. "
150153 "Include the ingredients and cooking instructions in your response. "
@@ -165,7 +168,8 @@ async def plan_meal(query: str) -> str:
165168# Supervisor agent orchestrating sub-agents
166169# ----------------------------------------------------------------------------------
167170
168- supervisor_agent = client .create_agent (
171+ supervisor_agent = ChatAgent (
172+ chat_client = client ,
169173 instructions = (
170174 "You are a supervisor managing two specialist agents: a weekend planning agent and a meal planning agent. "
171175 "Break down the user's request, decide which specialist (or both) to call via the available tools, "
0 commit comments