Python: basic python a2a support (#906)

* basic python a2a support

* fixes

* small fixes

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
This commit is contained in:
Giles Odigwe
2025-09-29 10:53:45 -07:00
committed by GitHub
Unverified
parent fe6492ce60
commit c102706146
13 changed files with 1296 additions and 2 deletions
@@ -0,0 +1,24 @@
# Copyright (c) Microsoft. All rights reserved.
import importlib
from typing import Any
PACKAGE_NAME = "agent_framework_a2a"
PACKAGE_EXTRA = "a2a"
_IMPORTS = ["__version__", "A2AAgent"]
def __getattr__(name: str) -> Any:
if name in _IMPORTS:
try:
return getattr(importlib.import_module(PACKAGE_NAME), name)
except ModuleNotFoundError as exc:
raise ModuleNotFoundError(
f"The '{PACKAGE_EXTRA}' extra is not installed, "
f"please do `pip install agent-framework[{PACKAGE_EXTRA}]`"
) from exc
raise AttributeError(f"Module {PACKAGE_NAME} has no attribute {name}.")
def __dir__() -> list[str]:
return _IMPORTS
@@ -0,0 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
from agent_framework_a2a import A2AAgent, __version__
__all__ = ["A2AAgent", "__version__"]
+6 -1
View File
@@ -35,7 +35,7 @@ dependencies = [
"opentelemetry-exporter-otlp-proto-grpc>=1.36.0",
"opentelemetry-semantic-conventions-ai>=0.4.13",
"aiofiles>=24.1.0",
"azure-identity>=1,<2"
"azure-identity>=1,<2",
]
[project.optional-dependencies]
@@ -63,6 +63,9 @@ runtime = [
mem0 = [
"agent-framework-mem0"
]
a2a = [
"agent-framework-a2a"
]
devui = [
"agent-framework-devui"
]
@@ -71,6 +74,7 @@ all = [
"agent-framework-azure-ai",
"agent-framework-runtime",
"agent-framework-mem0",
"agent-framework-a2a",
"agent-framework-redis",
"agent-framework-devui",
"graphviz>=0.20.0"
@@ -91,6 +95,7 @@ fallback-version = "0.0.0"
testpaths = [
'tests',
'packages/main/tests',
'packages/a2a/tests',
'packages/azure-ai/tests',
'packages/copilotstudio/tests',
'packages/mem0/tests',