Python: Support an autonomous handoff flow (#2497)

* Support an autonomous handoff flow.

* Simplify public API

* Address feedback
This commit is contained in:
Evan Mattson
2025-12-05 16:13:22 +09:00
committed by GitHub
Unverified
parent f2ed5b55f6
commit b78a2b6d2e
6 changed files with 421 additions and 24 deletions
@@ -86,9 +86,12 @@ async def run_agent_framework() -> None:
workflow = (
GroupChatBuilder()
.participants([python_expert, javascript_expert, database_expert])
.set_prompt_based_manager(
chat_client=client,
instructions="Based on the conversation, select the most appropriate expert to respond next.",
.set_manager(
manager=client.create_agent(
name="selector_manager",
instructions="Based on the conversation, select the most appropriate expert to respond next.",
),
display_name="SelectorManager",
)
.with_max_rounds(1)
.build()