Fasta2a (current version 0.6.0) is a Python library that converts an AI Agent into an A2A (Agent-to-Agent) server. It facilitates communication between AI agents by implementing the A2A protocol, allowing agents to expose their capabilities and interact programmatically. The library is relatively new but actively developed, with releases occurring every few months as the protocol specification evolves.
pip install fasta2aVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a basic Fasta2a application by initializing `Fasta2aApp` and defining an asynchronous message handler using the `@app.handle_message()` decorator. The handler processes `AgentMessage` objects and returns `AgentResponse` objects, optionally including `ToolCall`s. The example also shows how to run the application using `uvicorn`.
Always check the release notes for the supported A2A protocol version for your `fasta2a` library version. Upgrade `fasta2a` to match the desired protocol version, or ensure your client/agent adheres to the protocol version supported by your `fasta2a` server.
Regularly review the `fasta2a` changelog and schema definitions when upgrading. Be prepared to adapt your agent logic and data models to new schema versions to maintain compatibility.
To run your `fasta2a` application, use the command `uvicorn your_module_name:app --host 0.0.0.0 --port 8000` (replacing `your_module_name` with your script's filename). Do not attempt to run it directly as `python your_module_name.py`.