Python: [BREAKING] Renamed AgentProtocol to SupportsAgentRun#3717
Python: [BREAKING] Renamed AgentProtocol to SupportsAgentRun#3717dmytrostruk merged 5 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request implements a breaking change that renames the AgentProtocol to AgentLike throughout the Python codebase to avoid confusion with communication protocols like the A2A protocol. The renaming is comprehensive and affects the core protocol definition, all type annotations, imports, documentation, error messages, and test files.
Changes:
- Renamed the core
AgentProtocolprotocol class toAgentLikeinagent_framework/_agents.py - Updated all type annotations, imports, and isinstance checks across packages and samples
- Updated documentation, docstrings, comments, error messages, and test files to reflect the new name
Reviewed changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| python/packages/core/agent_framework/_agents.py | Core protocol definition renamed from AgentProtocol to AgentLike with updated exports |
| python/packages/core/agent_framework/_middleware.py | Updated TypeVar and type annotations for agent middleware |
| python/packages/core/agent_framework/observability.py | Updated TypeVar bound for agent telemetry |
| python/packages/core/agent_framework/_workflows/*.py | Updated all workflow builder and executor type annotations |
| python/packages/orchestrations/agent_framework_orchestrations/*.py | Updated all orchestration builder type annotations and error messages |
| python/packages/durabletask/agent_framework_durabletask/*.py | Updated durable task agent types and docstrings |
| python/packages/devui/agent_framework_devui/*.py | Updated dev UI agent types |
| python/packages/declarative/agent_framework_declarative/_workflows/_factory.py | Updated workflow factory agent types |
| python/packages/azurefunctions/agent_framework_azurefunctions/*.py | Updated Azure Functions agent types and docstrings |
| python/packages/ag-ui/agent_framework_ag_ui/*.py | Updated AG-UI agent types |
| python/packages/chatkit/README.md | Updated documentation reference |
| python/packages/core/AGENTS.md | Updated architecture documentation |
| python/samples/**/*.py | Updated all sample code comments and type hints |
| python/packages//tests/**/.py | Updated all test files including class names, docstrings, and assertions |
python/samples/getting_started/workflows/agents/magentic_workflow_as_agent.py
Outdated
Show resolved
Hide resolved
|
Are there existing protocols in well-known Python packages with the *Like suffix? It really doesn't sit well with me. See my other ideas here: #3096 (comment). |
@moonbox3 There is I'm not sure about the alternatives you proposed in the issue. Maybe we can make it simply |
|
The problem with AgentProtocol is that it overlaps with protocols in the agent space like A2A and mcp, so I do think AgentLike is the best alternative, and indeed PathLike is a good comparison |
|
And I would prefer to use Agent for a actual implementation because otherwise people would expect to be able to use it, I'm not opposed to ranking ChatAgent to Agent 😉 |
Following Python's stdlib (SupportsFloat, SupportsClose) and typing spec examples, |
|
Then it should be SupportsAgentRun, because the whole point is that its generic and doesn't care what kind of agent it is. And Chat is generic over the type of content in it, so I would hesitate to Chat part of this, having said that maybe we need to make ChatMessage -> Message as well... |
|
Yes, SupportsAgentRun is good, too. |
* Renamed AgentProtocol to AgentLike * Resolved comments * Renamed AgentLike to SupportsAgentRun * Resolved comments
Motivation and Context
Resolves: #3616
Contribution Checklist