pub struct A2aClient { /* private fields */ }Expand description
HTTP client for interacting with A2A agents
Implementations§
Source§impl A2aClient
impl A2aClient
Sourcepub fn new(base_url: impl Into<String>) -> A2aResult<Self>
pub fn new(base_url: impl Into<String>) -> A2aResult<Self>
Create a new client with default reqwest settings
Sourcepub async fn agent_card(&self) -> A2aResult<AgentCard>
pub async fn agent_card(&self) -> A2aResult<AgentCard>
Fetch the remote agent card
Sourcepub async fn send_message(&self, params: MessageSendParams) -> A2aResult<Task>
pub async fn send_message(&self, params: MessageSendParams) -> A2aResult<Task>
Send a message/send RPC
Sourcepub async fn stream_message(
&self,
params: MessageSendParams,
) -> A2aResult<impl Stream<Item = A2aResult<StreamingEvent>>>
pub async fn stream_message( &self, params: MessageSendParams, ) -> A2aResult<impl Stream<Item = A2aResult<StreamingEvent>>>
Send a message/stream RPC and consume streaming events
Sourcepub async fn list_tasks(
&self,
params: Option<ListTasksParams>,
) -> A2aResult<Value>
pub async fn list_tasks( &self, params: Option<ListTasksParams>, ) -> A2aResult<Value>
List tasks with filters
Sourcepub async fn cancel_task(&self, task_id: String) -> A2aResult<Task>
pub async fn cancel_task(&self, task_id: String) -> A2aResult<Task>
Cancel a task
Sourcepub async fn set_push_config(
&self,
config: TaskPushNotificationConfig,
) -> A2aResult<bool>
pub async fn set_push_config( &self, config: TaskPushNotificationConfig, ) -> A2aResult<bool>
Set push notification config
Sourcepub async fn get_push_config(
&self,
task_id: String,
) -> A2aResult<Option<TaskPushNotificationConfig>>
pub async fn get_push_config( &self, task_id: String, ) -> A2aResult<Option<TaskPushNotificationConfig>>
Get push notification config
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for A2aClient
impl !UnwindSafe for A2aClient
impl Freeze for A2aClient
impl Send for A2aClient
impl Sync for A2aClient
impl Unpin for A2aClient
impl UnsafeUnpin for A2aClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more