pub struct A2aContext {
pub task: Option<Task>,
pub accepted_output_modes: Vec<String>,
/* private fields */
}Expand description
What a message handler sees besides the message.
Fields§
§task: Option<Task>The task this message continues (one waiting for input), if any.
accepted_output_modes: Vec<String>Media types the client accepts in replies (empty: any).
Implementations§
Source§impl A2aContext
impl A2aContext
Sourcepub fn task_id(&self) -> &str
pub fn task_id(&self) -> &str
The task id this message belongs to (new, or the continued task’s).
Sourcepub fn context_id(&self) -> &str
pub fn context_id(&self) -> &str
The conversation’s context id.
Sourcepub fn task(
&self,
state: TaskState,
message: Option<Message>,
artifacts: Vec<Artifact>,
) -> Task
pub fn task( &self, state: TaskState, message: Option<Message>, artifacts: Vec<Artifact>, ) -> Task
A task in state with an optional agent message and artifacts; its
history holds the earlier messages and this one.
Sourcepub fn complete(&self, artifacts: Vec<Artifact>) -> Task
pub fn complete(&self, artifacts: Vec<Artifact>) -> Task
A completed task with these artifacts.
Sourcepub fn input_required(&self, question: &str) -> Task
pub fn input_required(&self, question: &str) -> Task
A task waiting for the client to answer question.
Sourcepub fn start(&self) -> TaskHandle
pub fn start(&self) -> TaskHandle
Start working on this message in the background: the task is stored
(working) at once; return A2aReply::Running(handle) and update it
through the handle from any thread. SendMessage waits for it to
finish (or ask for input), streams follow it.
Auto Trait Implementations§
impl Freeze for A2aContext
impl RefUnwindSafe for A2aContext
impl Send for A2aContext
impl Sync for A2aContext
impl Unpin for A2aContext
impl UnsafeUnpin for A2aContext
impl UnwindSafe for A2aContext
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