Python: docs: fix removed ChatAgent references in _clients.py docstrings - #6924
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Python core docstrings in agent_framework/_clients.py to reflect the breaking rename from ChatAgent to Agent, keeping the tool-support protocol examples and as_agent docs aligned with the current public API.
Changes:
- Replaced stale
ChatAgentreferences withAgentacross multiple tool-support protocol docstrings. - Fixed nearby grammar in the
as_agentdocstring (“a Agent” → “an Agent”). - Kept changes docstring-only (no runtime behavior changes intended).
|
@microsoft-github-policy-service agree |
|
Sumesh Ramasamy (@sumesh-ramasamy) Thank you for the contribution. Please have a look at Copilot's PR feedback. |
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Import Agent in each tool-support protocol docstring example so copy/pasting no longer raises NameError, and define the shell executor (LocalShellTool) in the SupportsShellTool example. Addresses Copilot review feedback on microsoft#6924. Co-authored-by: Cursor <cursoragent@cursor.com>
`async with LocalShellTool()` is a SyntaxError at module level, so the copy/pasted snippet must live inside an async function to be valid. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks Evan Mattson (@moonbox3), and thanks to Copilot for the review. I've pushed two follow-up commits addressing the feedback:
I verified locally by extracting each docstring code-block and executing it verbatim against a protocol-conforming client — all six now import, run, and construct an Happy to make any further adjustments. |
What
ChatAgentwas renamed toAgent(#3747) with no back-compat alias, but the tool-supportprotocol docstrings in
python/packages/core/agent_framework/_clients.pystill referenceChatAgent. Copy-pasting the examples raisesNameError.This renames the 12 stale references to
Agentacross 6 protocol classes(
SupportsCodeInterpreterTool,SupportsWebSearchTool,SupportsImageGenerationTool,SupportsMCPTool,SupportsFileSearchTool,SupportsShellTool). Also fixes three"a Agent" -> "an Agent" grammar slips in the adjacent
as_agentdocstring.Docstring-only; no code behavior changes.
Verify
from agent_framework import ChatAgentraisesImportError—Agentis the exported name.