Skip to content

A programming framework for agentic AI

Fix: Correct cancellation token usage in UserProxyAgent docstring (#4874)

WcWa1d782d3ec1f
diff --git a/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_user_proxy_agent.py b/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_user_proxy_agent.py
index b3e15da85..2ad9a2468 100644
--- a/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_user_proxy_agent.py
+++ b/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_user_proxy_agent.py
@@ -98,7 +98,7 @@ class UserProxyAgent(BaseChatAgent):
agent_task = asyncio.create_task(
agent.on_messages(
[TextMessage(content="What is your name? ", source="user")],
- cancellation_token=CancellationToken(),
+ cancellation_token=token,
)
)
response = await agent_task