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:
Dmytro Struk
2026-01-16 11:21:52 -08:00
committed by GitHub
Unverified
parent a151f10cc2
commit 5687e13221
163 changed files with 498 additions and 358 deletions
@@ -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,
@@ -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",
@@ -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,