A2A
A2A Protocol Provider for the AI SDK
The dracoblue/a2a-ai-provider is a community provider enables the use of A2A protocol compliant agents with the AI SDK. This allows developers to stream, send, and receive text, tool calls, and artifacts using a standardized JSON-RPC interface over HTTP.
The a2a-ai-provider package is under constant development.
The provider supports (by using the official a2a-js sdk @a2a-js/sdk):
- Streaming Text Responses via
sendSubscribeand SSE - File & Artifact Uploads to the A2A server
- Multi-modal Messaging with support for text and file parts
- Full JSON-RPC 2.0 Compliance for A2A-compatible LLM agents
Learn more about A2A at the A2A Project Site.
Setup
Install the a2a-ai-provider from npm:
$ pnpm add a2a-ai-provider
$ npm install a2a-ai-provider
$ yarn add a2a-ai-provider
$ bun add a2a-ai-provider
Provider Instance
To create a provider instance for an A2A server:
Examples
You can now use the provider with the AI SDK like this:
generateText
streamText
Features
- Text Streaming: Streams token-by-token output from the A2A server
- File Uploads: Send files as part of your prompts
- Artifact Handling: Receives file artifacts in streamed or final results
Additional Resources
- GitHub Repository
- A2A Protocol Spec
- License: MIT