/* ┌──────────────────────────────────────────────────────────────────────────────┐ │ @author: Davidson Gomes │ │ @file: /app/documentation/components/DocumentationSection.tsx │ │ Developed by: Davidson Gomes │ │ Creation date: May 13, 2025 │ │ Contact: contato@evolution-api.com │ ├──────────────────────────────────────────────────────────────────────────────┤ │ @copyright © Evolution API 2025. All rights reserved. │ │ Licensed under the Apache License, Version 2.0 │ │ │ │ You may not use this file except in compliance with the License. │ │ You may obtain a copy of the License at │ │ │ │ http://www.apache.org/licenses/LICENSE-2.0 │ │ │ │ Unless required by applicable law or agreed to in writing, software │ │ distributed under the License is distributed on an "AS IS" BASIS, │ │ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. │ │ See the License for the specific language governing permissions and │ │ limitations under the License. │ ├──────────────────────────────────────────────────────────────────────────────┤ │ @important │ │ For any future changes to the code in this file, it is recommended to │ │ include, together with the modification, the information of the developer │ │ who changed it and the date of modification. │ └──────────────────────────────────────────────────────────────────────────────┘ */ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { ClipboardCopy, Info, ExternalLink, Users, Shield, Zap, Network, FileText, MessageSquare, Settings, AlertCircle, CheckCircle2, Globe } from "lucide-react"; import { CodeBlock } from "@/app/documentation/components/CodeBlock"; interface DocumentationSectionProps { copyToClipboard: (text: string) => void; } export function DocumentationSection({ copyToClipboard }: DocumentationSectionProps) { const quickStartExample = { jsonrpc: "2.0", id: "req-001", method: "message/send", params: { message: { role: "user", parts: [ { type: "text", text: "Hello! Can you help me analyze this data?" } ], messageId: "6dbc13b5-bd57-4c2b-b503-24e381b6c8d6" } } }; const streamingExample = { jsonrpc: "2.0", id: "req-002", method: "message/stream", params: { message: { role: "user", parts: [ { type: "text", text: "Generate a detailed report on market trends" } ], messageId: "f47ac10b-58cc-4372-a567-0e02b2c3d479" } } }; const fileUploadExample = { jsonrpc: "2.0", id: "req-003", method: "message/send", params: { message: { role: "user", parts: [ { type: "text", text: "Analyze this image and highlight any faces." }, { type: "file", file: { name: "input_image.png", mimeType: "image/png", bytes: "iVBORw0KGgoAAAANSUhEUgAAAAUA..." } } ], messageId: "8f0dc03c-4c65-4a14-9b56-7e8b9f2d1a3c" } } }; return (
A2A is Google's open protocol enabling seamless communication and interoperability between AI agents across different platforms, providers, and architectures.
Support for complex, contextual dialogues between agents
Upload and download files with proper MIME type handling
Server-Sent Events for live response streaming
Track, query, and cancel long-running tasks
Bearer tokens, API keys, and HTTPS enforcement
Standardized agent cards for capability discovery
A2A supports multiple RPC methods for different interaction patterns
Send a message and receive a complete response after processing is finished.
Receive partial responses in real-time via Server-Sent Events.
Check the status, progress, and results of a specific task.
Terminate a running task before completion.
Retrieve detailed information about agent capabilities, skills, and requirements.
Ready-to-use JSON-RPC examples based on the official A2A specification
Key Points:
message/send
for standard HTTP requestsmessageId
must be a valid UUID v4Streaming Features:
File Handling:
x-api-key
Custom header for API key authentication
Authorization: Bearer
OAuth 2.0 Bearer token authentication
Important:
Always obtain API credentials out-of-band. Never include sensitive authentication data in client-side code or version control systems.
Aspect | Agent2Agent (A2A) | Model Context Protocol (MCP) |
---|---|---|
Purpose | Agent-to-agent communication | Model-to-tool/resource integration |
Use Case | AI agents collaborating as peers | AI models accessing external capabilities |
Relationship | Partner/delegate work | Use specific capabilities |
Integration | ✓ Can use MCP internally | ✓ Complements A2A |
Working Together: An A2A client agent might request an A2A server agent to perform a complex task. The server agent, in turn, might use MCP to interact with tools, APIs, or data sources necessary to fulfill the A2A task.