pub struct A2aClient { /* private fields */ }Expand description
A2A client for communicating with remote A2A agents
Implementations§
Source§impl A2aClient
impl A2aClient
Sourcepub async fn resolve_agent_card(base_url: &str) -> Result<AgentCard>
pub async fn resolve_agent_card(base_url: &str) -> Result<AgentCard>
Resolve an agent card from a URL (fetch from /.well-known/agent.json)
Sourcepub async fn from_url(base_url: &str) -> Result<Self>
pub async fn from_url(base_url: &str) -> Result<Self>
Create a client by resolving an agent card from a URL
Sourcepub fn agent_card(&self) -> &AgentCard
pub fn agent_card(&self) -> &AgentCard
Get the agent card
Sourcepub async fn send_message(&self, message: Message) -> Result<JsonRpcResponse>
pub async fn send_message(&self, message: Message) -> Result<JsonRpcResponse>
Send a message to the remote agent (blocking/non-streaming)
Sourcepub async fn send_streaming_message(
&self,
message: Message,
) -> Result<Pin<Box<dyn Stream<Item = Result<UpdateEvent>> + Send>>>
pub async fn send_streaming_message( &self, message: Message, ) -> Result<Pin<Box<dyn Stream<Item = Result<UpdateEvent>> + Send>>>
Send a message and receive streaming events via SSE
Auto Trait Implementations§
impl Freeze for A2aClient
impl !RefUnwindSafe for A2aClient
impl Send for A2aClient
impl Sync for A2aClient
impl Unpin for A2aClient
impl !UnwindSafe for A2aClient
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more