feat: Enhance A2A integration with modular architecture

Address review comments from João:
- Add TaskInfo dataclass for enhanced task management with status tracking
- Add ServerConfig dataclass for improved server configuration management
- Add custom exception classes (A2AServerError, TransportError, ExecutionError)
- Refactor code to use modular components for better maintainability
- Update output conversion to handle JSON data types properly
- Improve error handling with granular exception types
- All tests pass (30 passed, 6 skipped)

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-06-07 00:12:16 +00:00
parent 6806803bf8
commit c91500c887
7 changed files with 112 additions and 40 deletions

View File

@@ -95,7 +95,8 @@ class TestA2AServer:
def test_create_a2a_app_fastapi(self, mock_agent_executor):
"""Test creating A2A app with FastAPI transport raises error."""
with pytest.raises(ValueError, match="FastAPI transport is not available"):
from crewai.a2a.exceptions import TransportError
with pytest.raises(TransportError, match="FastAPI transport is not available"):
create_a2a_app(
mock_agent_executor,
transport="fastapi",