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
@@ -113,7 +113,7 @@ async def main() -> None:
|
||||
credential = AzureCliCredential()
|
||||
|
||||
# 2. Create agent inline
|
||||
agent = AzureOpenAIChatClient(credential=credential).create_agent(
|
||||
agent = AzureOpenAIChatClient(credential=credential).as_agent(
|
||||
model="gpt-4o",
|
||||
instructions="You are a helpful financial advisor..."
|
||||
)
|
||||
|
||||
@@ -41,7 +41,7 @@ async def main() -> None:
|
||||
# Create the agent
|
||||
# Constructor automatically reads from environment variables:
|
||||
# AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_DEPLOYMENT_NAME, AZURE_OPENAI_API_KEY
|
||||
agent = AzureOpenAIChatClient(credential=credential).create_agent(
|
||||
agent = AzureOpenAIChatClient(credential=credential).as_agent(
|
||||
name="FinancialAdvisor",
|
||||
instructions="""You are a professional financial advisor assistant.
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ async def run_self_reflection_batch(
|
||||
agent = AzureOpenAIChatClient(
|
||||
credential=AzureCliCredential(),
|
||||
deployment_name=agent_model,
|
||||
).create_agent(
|
||||
).as_agent(
|
||||
instructions="You are a helpful agent.",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user