Skip to content

[Feat]: A2A FastAPI Application #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
martimfasantos opened this issue May 15, 2025 · 3 comments · May be fixed by #26
Open
1 task done

[Feat]: A2A FastAPI Application #21

martimfasantos opened this issue May 15, 2025 · 3 comments · May be fixed by #26

Comments

@martimfasantos
Copy link

Is your feature request related to a problem? Please describe.

Currently, the A2A Google SDK provides server implementations in Starlette and a basic HTTP app, but lacks an official FastAPI integration. FastAPI is a widely adopted, modern Python framework with built-in async support, OpenAPI documentation, and strong performance. Many developers (including myself) prefer FastAPI for its ease of use and feature set, making it a natural fit for Google’s SDK.

Describe the solution you'd like

Adding an official FastAPI server app to the A2A Google SDK, alongside the existing Starlette and HTTP app options, would:

  • Provide better integration with FastAPI’s dependency injection system.
  • Allow seamless use of FastAPI’s OpenAPI/Swagger documentation.
  • Improve developer experience for those already using FastAPI in their projects.

Ideally, this would follow a similar structure to the existing Starlette app but leverage FastAPI’s features.

Describe alternatives you've considered

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@martimfasantos martimfasantos linked a pull request May 15, 2025 that will close this issue
4 tasks
@didier-durand
Copy link
Contributor

Hi,

For my understanding: FastAPI is a layer on top of Starlette. So, what is the purpose / advantage of moving A2A app from Starlette to FastAPI ?

Didier

@martimfasantos
Copy link
Author

martimfasantos commented May 15, 2025

@didier-durand You're absolutely right that FastAPI is built on top of Starlette. The key benefit here is that FastAPI adds useful (development) features like automatic OpenAPI docs, validation, and easier route extensibility.

By exposing the A2A app directly as a FastAPI app, we can take advantage of these features without needing a separate FastAPI wrapper. Otherwise, we'd have to maintain two apps — a FastAPI app that mounts the existing Starlette one (FastAPI docs) — just to get those extras. This change avoids that extra complexity.

@didier-durand
Copy link
Contributor

didier-durand commented May 15, 2025

Thanks for the explanations: I now understand your perspective much better.

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 a pull request may close this issue.

2 participants