mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: [BREAKING] Renamed create_agent to as_agent (#3249)
* Renamed create_agent to as_agent * Override for as_agent * Added override
This commit is contained in:
committed by
GitHub
Unverified
parent
a151f10cc2
commit
5687e13221
+2
-2
@@ -104,7 +104,7 @@ async def main() -> None:
|
||||
# 3. Create two agents focused on different stocks but with the same tool sets
|
||||
chat_client = OpenAIChatClient()
|
||||
|
||||
microsoft_agent = chat_client.create_agent(
|
||||
microsoft_agent = chat_client.as_agent(
|
||||
name="MicrosoftAgent",
|
||||
instructions=(
|
||||
"You are a personal trading assistant focused on Microsoft (MSFT). "
|
||||
@@ -113,7 +113,7 @@ async def main() -> None:
|
||||
tools=[get_stock_price, get_market_sentiment, get_portfolio_balance, execute_trade],
|
||||
)
|
||||
|
||||
google_agent = chat_client.create_agent(
|
||||
google_agent = chat_client.as_agent(
|
||||
name="GoogleAgent",
|
||||
instructions=(
|
||||
"You are a personal trading assistant focused on Google (GOOGL). "
|
||||
|
||||
+2
-2
@@ -96,7 +96,7 @@ async def main() -> None:
|
||||
# 3. Create specialized agents
|
||||
chat_client = OpenAIChatClient()
|
||||
|
||||
qa_engineer = chat_client.create_agent(
|
||||
qa_engineer = chat_client.as_agent(
|
||||
name="QAEngineer",
|
||||
instructions=(
|
||||
"You are a QA engineer responsible for running tests before deployment. "
|
||||
@@ -105,7 +105,7 @@ async def main() -> None:
|
||||
tools=[run_tests],
|
||||
)
|
||||
|
||||
devops_engineer = chat_client.create_agent(
|
||||
devops_engineer = chat_client.as_agent(
|
||||
name="DevOpsEngineer",
|
||||
instructions=(
|
||||
"You are a DevOps engineer responsible for deployments. First check staging "
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ def get_database_schema() -> str:
|
||||
async def main() -> None:
|
||||
# 2. Create the agent with tools (approval mode is set per-tool via decorator)
|
||||
chat_client = OpenAIChatClient()
|
||||
database_agent = chat_client.create_agent(
|
||||
database_agent = chat_client.as_agent(
|
||||
name="DatabaseAgent",
|
||||
instructions=(
|
||||
"You are a database assistant. You can view the database schema and execute "
|
||||
|
||||
Reference in New Issue
Block a user