Add AgentCard v1.0 integration#7620
Open
kwailapt wants to merge 1 commit intomicrosoft:mainfrom
Open
Conversation
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add AgentCard v1.0 integration for A2A agent identity
Summary
This PR adds
autogen/agentcard.py— a bidirectional adapter between AutoGenagents/group chats and the AgentCard v1.0 open standard
(https://github.com/kwailapt/AgentCard).
AgentCard provides a framework-neutral JSON identity format for agent-to-agent (A2A)
communication — analogous to HTTP headers for the web.
Motivation
Multi-agent systems built with AutoGen increasingly need to interoperate with agents
from other frameworks. Without a standard identity layer, each integration requires
custom protocols.
AgentCard enables:
AssistantAgent→ publish its capabilities as discoverable JSONGroupChat→ export all agents as an AgentCard registryAgentCardRegistry→ resolve any peer by name during conversationWhat's included
autogen/agentcard.pyagent_to_agentcard(agent, agent_id, endpoint_url)ConversableAgentto AgentCardgroupchat_to_agentcards(groupchat, agent_ids, base_url)agentcard_to_tool_function(card)(fn, schema)— OpenAI function schema + HTTP callerAgentCardRegistrytest/agentcard_test.pyFull mock-based test coverage (AutoGen v0.2 + v0.4 compatible). Zero real LLM calls.
Usage examples
Export an AssistantAgent
Use a remote AgentCard as an AutoGen tool
GroupChat with AgentCard registry
AutoGen v0.2 + v0.4 compatibility
function_map→ capabilities_toolslist → capabilitiesdescriptionfieldsystem_messagefallbackChecklist
agentcard-adaptersoptional)function_map(v0.2) and_tools(v0.4) both extracted as capabilitiesdescriptionpreferred oversystem_messagefor capability descriptionagentcard_to_tool_functionreturns OpenAI-compatible function schemaAgentCardRegistrysupportsfunction_map-style batch registrationReferences
pip install agentcard-adapters[autogen]