pub struct A2aServer { /* private fields */ }Expand description
A2A server that handles incoming task requests.
Implementations§
Source§impl A2aServer
impl A2aServer
Sourcepub fn new(config: A2aServerConfig) -> Self
pub fn new(config: A2aServerConfig) -> Self
Create a new A2A server.
Sourcepub fn agent_card(&self) -> AgentCard
pub fn agent_card(&self) -> AgentCard
Return the cached agent card, generating it on first call.
Use [invalidate_agent_card] to force regeneration.
Sourcepub fn invalidate_agent_card(&self)
pub fn invalidate_agent_card(&self)
Invalidate the cached agent card so the next call to [agent_card]
regenerates it (e.g. after workflows change on disk).
Sourcepub fn handle_request(&self, request: &JsonRpcRequest) -> JsonRpcResponse
pub fn handle_request(&self, request: &JsonRpcRequest) -> JsonRpcResponse
Handle an incoming JSON-RPC request.
Sourcepub fn update_task_status(
&self,
task_id: &str,
state: TaskState,
message: Option<String>,
artifacts: Option<Vec<TaskArtifact>>,
) -> Result<()>
pub fn update_task_status( &self, task_id: &str, state: TaskState, message: Option<String>, artifacts: Option<Vec<TaskArtifact>>, ) -> Result<()>
Update the status of a task (called by workflow runner).
Sourcepub fn list_tasks(&self) -> Vec<TaskResponse>
pub fn list_tasks(&self) -> Vec<TaskResponse>
List all active tasks.
Auto Trait Implementations§
impl !Freeze for A2aServer
impl RefUnwindSafe for A2aServer
impl Send for A2aServer
impl Sync for A2aServer
impl Unpin for A2aServer
impl UnsafeUnpin for A2aServer
impl UnwindSafe for A2aServer
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