1 Commits

  • Python: Add A2A server sample (#4528)
    * Python: Add A2A server sample and fix client streaming bug
    
    Add a pure Python A2A server sample so testing the A2A client no longer
    requires running the .NET server. The server uses the a2a-sdk's
    A2AStarletteApplication with uvicorn and supports three agent types
    (invoice, policy, logistics) backed by AzureOpenAIResponsesClient.
    
    New files:
    - a2a_server.py: Main server entry point with CLI args
    - agent_executor.py: Bridges a2a-sdk AgentExecutor to Agent Framework
    - agent_definitions.py: Agent and AgentCard factory definitions
    - invoice_data.py: Mock invoice data and query tool functions
    - a2a_server.http: REST Client requests for testing
    
    Also fixes a streaming bug in agent_with_a2a.py where async with was
    used on ResponseStream which does not support the async context manager
    protocol. Changed to async for to match all other samples.
    
    Closes #4045
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR review: handle CancelledError and fix end_date filtering
    
    - Re-raise asyncio.CancelledError before the broad exception handler
      so cooperative cancellation is not swallowed.
    - Make end_date filter inclusive of the full day by comparing with
      < end + timedelta(days=1) instead of <= midnight.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>