pub struct A2aClient { /* private fields */ }Expand description
Unified A2A client.
Implementations§
Source§impl A2aClient
impl A2aClient
Sourcepub fn new_jsonrpc(base_url: Url) -> Self
pub fn new_jsonrpc(base_url: Url) -> Self
Create a client using JSON-RPC transport.
Sourcepub fn with_bearer_token(self, token: &str) -> Self
pub fn with_bearer_token(self, token: &str) -> Self
Set a bearer token for authentication.
Returns a new client with the token applied to the active transport.
Sourcepub async fn discover(base_url: &str) -> Result<AgentCard, A2aError>
pub async fn discover(base_url: &str) -> Result<AgentCard, A2aError>
Discover an agent card from a well-known URL.
Sourcepub async fn send_message(
&self,
req: SendMessageRequest,
) -> Result<SendMessageResponse, A2aError>
pub async fn send_message( &self, req: SendMessageRequest, ) -> Result<SendMessageResponse, A2aError>
Send a message.
Sourcepub fn stream_message(
&self,
req: SendMessageRequest,
) -> Pin<Box<dyn Stream<Item = Result<StreamResponse, A2aError>> + Send>>
pub fn stream_message( &self, req: SendMessageRequest, ) -> Pin<Box<dyn Stream<Item = Result<StreamResponse, A2aError>> + Send>>
Stream a message (returns SSE events).
Sourcepub async fn list_tasks(
&self,
req: ListTasksRequest,
) -> Result<ListTasksResponse, A2aError>
pub async fn list_tasks( &self, req: ListTasksRequest, ) -> Result<ListTasksResponse, A2aError>
List tasks.
Sourcepub async fn cancel_task(
&self,
req: CancelTaskRequest,
) -> Result<Task, A2aError>
pub async fn cancel_task( &self, req: CancelTaskRequest, ) -> Result<Task, A2aError>
Cancel a task.
Sourcepub fn subscribe_to_task(
&self,
req: SubscribeToTaskRequest,
) -> Pin<Box<dyn Stream<Item = Result<StreamResponse, A2aError>> + Send>>
pub fn subscribe_to_task( &self, req: SubscribeToTaskRequest, ) -> Pin<Box<dyn Stream<Item = Result<StreamResponse, A2aError>> + Send>>
Subscribe to task updates.
Sourcepub async fn set_push_config(
&self,
config: TaskPushNotificationConfig,
) -> Result<TaskPushNotificationConfig, A2aError>
pub async fn set_push_config( &self, config: TaskPushNotificationConfig, ) -> Result<TaskPushNotificationConfig, A2aError>
Set push notification config.
Sourcepub async fn get_push_config(
&self,
req: GetTaskPushNotificationConfigRequest,
) -> Result<TaskPushNotificationConfig, A2aError>
pub async fn get_push_config( &self, req: GetTaskPushNotificationConfigRequest, ) -> Result<TaskPushNotificationConfig, A2aError>
Get push notification config.
Sourcepub async fn delete_push_config(
&self,
req: DeleteTaskPushNotificationConfigRequest,
) -> Result<(), A2aError>
pub async fn delete_push_config( &self, req: DeleteTaskPushNotificationConfigRequest, ) -> Result<(), A2aError>
Delete push notification config.
Sourcepub async fn list_push_configs(
&self,
req: ListTaskPushNotificationConfigsRequest,
) -> Result<ListTaskPushNotificationConfigsResponse, A2aError>
pub async fn list_push_configs( &self, req: ListTaskPushNotificationConfigsRequest, ) -> Result<ListTaskPushNotificationConfigsResponse, A2aError>
List push notification configs.
Sourcepub async fn get_authenticated_extended_card(
&self,
req: GetExtendedAgentCardRequest,
) -> Result<AgentCard, A2aError>
pub async fn get_authenticated_extended_card( &self, req: GetExtendedAgentCardRequest, ) -> Result<AgentCard, A2aError>
Get the authenticated extended agent card.
Auto Trait Implementations§
impl Freeze for A2aClient
impl !RefUnwindSafe for A2aClient
impl Send for A2aClient
impl Sync for A2aClient
impl Unpin for A2aClient
impl UnsafeUnpin for A2aClient
impl !UnwindSafe 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