curl --request GET \
--url https://api.example.com/.well-known/agent.json \
--header 'Authorization: Bearer <token>'Agent-to-Agent communication protocol HTTP endpoints
curl --request GET \
--url https://api.example.com/.well-known/agent.json \
--header 'Authorization: Bearer <token>'http://localhost:8000
{
"name": "PraisonAI Agent",
"description": "PraisonAI Agent via A2A",
"url": "http://localhost:8000/a2a",
"version": "1.0.0",
"capabilities": {
"streaming": true,
"pushNotifications": false,
"stateTransitionHistory": false
},
"skills": [
{
"id": "chat",
"name": "Chat",
"description": "General conversation"
}
]
}
{
"status": "ok",
"name": "PraisonAI Agent",
"version": "1.0.0"
}
{
"jsonrpc": "2.0",
"method": "message/send",
"id": "request-123",
"params": {
"message": {
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, agent!"
}
]
}
}
}
{
"jsonrpc": "2.0",
"id": "request-123",
"result": {
"message": {
"role": "agent",
"parts": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
]
}
}
}
import requests
# Get Agent Card
response = requests.get("http://localhost:8000/.well-known/agent.json")
agent_card = response.json()
print(f"Agent: {agent_card['name']}")
# Send Message
message = {
"jsonrpc": "2.0",
"method": "message/send",
"id": "1",
"params": {
"message": {
"role": "user",
"parts": [{"type": "text", "text": "Hello!"}]
}
}
}
response = requests.post("http://localhost:8000/a2a", json=message)
print(response.json())
from praisonaiagents import Agent
from praisonaiagents.ui.a2a import A2A
from fastapi import FastAPI
import uvicorn
# Create agent
agent = Agent(
name="Assistant",
role="Helpful AI Assistant",
goal="Help users with their questions"
)
# Create A2A interface
a2a = A2A(
agent=agent,
url="http://localhost:8000/a2a"
)
# Create FastAPI app
app = FastAPI()
app.include_router(a2a.get_router())
# Run server
uvicorn.run(app, host="0.0.0.0", port=8000)