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
+1
-1
@@ -32,7 +32,7 @@ async def run_agent_framework() -> None:
|
||||
|
||||
assistants_client = OpenAIAssistantsClient()
|
||||
# AF wraps the assistant lifecycle with an async context manager.
|
||||
async with assistants_client.create_agent(
|
||||
async with assistants_client.as_agent(
|
||||
name="Helper",
|
||||
instructions="Answer questions in one concise paragraph.",
|
||||
model=ASSISTANT_MODEL,
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ async def run_agent_framework() -> None:
|
||||
|
||||
assistants_client = OpenAIAssistantsClient()
|
||||
# AF exposes the same tool configuration via create_agent.
|
||||
async with assistants_client.create_agent(
|
||||
async with assistants_client.as_agent(
|
||||
name="CodeRunner",
|
||||
instructions="Use the code interpreter when calculations are required.",
|
||||
model="gpt-4.1",
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ async def run_agent_framework() -> None:
|
||||
|
||||
assistants_client = OpenAIAssistantsClient()
|
||||
# AF converts the decorated function into an assistant-compatible tool.
|
||||
async with assistants_client.create_agent(
|
||||
async with assistants_client.as_agent(
|
||||
name="WeatherHelper",
|
||||
instructions="Call get_forecast to fetch weather details.",
|
||||
model=ASSISTANT_MODEL,
|
||||
|
||||
Reference in New Issue
Block a user