Skip to content

Conversation

lilyydu
Copy link
Collaborator

@lilyydu lilyydu commented Apr 16, 2025

No description provided.

@lilyydu lilyydu merged commit 303471d into main Apr 16, 2025
1 check passed
lilyydu pushed a commit that referenced this pull request Jun 17, 2025
@lilyydu lilyydu deleted the lilyydu/boilerplate branch August 20, 2025 21:00
lilyydu added a commit that referenced this pull request Oct 21, 2025
- completed a2a client plugin
- completed a2a server plugin
- completed a2a server + client sample test

NOTE #1: Due to the event looping implementation by the external a2a
SDK, they may raise a `CancelledError` when in debug mode. This is
because `EventConsumer.consume_all` will attempt to dequeue the event,
with a 0.5 second timeout.
Our response however takes more than 0.5 seconds to generate. 
Hence, the task is cancelled by `wait_for`, which causes
`CancelledError`.
This is raised by the coroutine `DefaultRequestHandler`, but
`consume_all` recognizes it as `TimeoutError` and will continue to
reloop and try again. I don't think there is any way to mitigate this as
our response takes ~ 1 second to generate.

NOTE #2: Improving the event type hinting will be a separate WI, for now
I am using a specific key. This feels like a larger ticket b/c I think
we should improve our typing hints for all our events in general. I
noticed we can do the following (string or any type versus `ErrorEvent`)
& it doesn't complain-
```python
@app.event("error")
async def handle_error(event: str) -> None:
```

NOTE #3: Will follow with docs soon after.

Sample example:
<img width="2130" height="1331" alt="image"
src="https://github.com/user-attachments/assets/11ccff75-a1fd-4356-91e2-f72beaf99f6d"
/>

---------

Co-authored-by: lilydu <lilydu+odspmdb@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant