1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! A2A (Agent-to-Agent) protocol support.
//!
//! This module implements the A2A protocol for inter-agent communication.
//! It enables LangChain Rust agents to discover, invoke, and communicate
//! with other agents over HTTP using a JSON-RPC style protocol.
//!
//! # Architecture
//!
//! - **protocol**: Core data types (`AgentCard`, `A2ATask`, `A2ARequest`, etc.)
//! - **server**: `A2AServer` - handler functions to expose an agent via A2A
//! - **client**: `A2AClient` - HTTP client to connect to remote A2A agents
//!
//! # Quick Start
//!
//! ## Server (expose your agent)
//!
//! ```ignore
//! use langchainrust::a2a::{A2AServer, AgentCard};
//! use langchainrust::LLMChain;
//! use std::sync::Arc;
//!
//! let chain = Arc::new(LLMChain::new(llm, "You are a helpful assistant"));
//! let server = A2AServer::new(chain)
//! .with_card(AgentCard::new("my-agent", "A helpful agent", "http://localhost:8080"));
//!
//! // In your HTTP handler (axum, actix, warp, etc.):
//! // GET /.well-known/agent.json -> server.get_agent_card()
//! // POST / -> server.handle_a2a_request(body).await
//! ```
//!
//! ## Client (call a remote agent)
//!
//! ```ignore
//! use langchainrust::a2a::{A2AClient, A2AMessage};
//!
//! let client = A2AClient::new("http://localhost:8080".to_string());
//! let card = client.get_agent_card().await?;
//! let task = client.send_task(A2AMessage::user("hello")).await?;
//! ```
pub use ;
pub use ;
pub use A2AServer;