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
@@ -29,7 +29,7 @@ async def run_agent_framework() -> None:
from agent_framework.openai import OpenAIChatClient
# AF constructs a lightweight ChatAgent backed by OpenAIChatClient.
chat_agent = OpenAIChatClient().create_agent(
chat_agent = OpenAIChatClient().as_agent(
name="Support",
instructions="Answer in one sentence.",
)
@@ -42,7 +42,7 @@ async def run_agent_framework() -> None:
return "Clam chowder, Cobb salad, Chai tea"
# AF tools are provided as callables on each agent instance.
chat_agent = OpenAIChatClient().create_agent(
chat_agent = OpenAIChatClient().as_agent(
name="Host",
instructions="Answer menu questions accurately.",
tools=[specials],
@@ -40,7 +40,7 @@ async def run_agent_framework() -> None:
from agent_framework.openai import OpenAIChatClient
# AF thread objects are requested explicitly from the agent.
chat_agent = OpenAIChatClient().create_agent(
chat_agent = OpenAIChatClient().as_agent(
name="Writer",
instructions="Keep answers short and friendly.",
)