pub enum SendMessageResponse {
Task(Task),
Message(Message),
}Expand description
A typed SendMessage response.
The wire form is the inner object directly —
a Task is {"id": "...", "status": ...},
a Message is {"role": ..., "parts": ...}.
The two shapes are discriminated by which
top-level field is present (id for Task,
role for Message).
Variants§
Task(Task)
The agent created (or is creating) a
task to do the work. The task’s
status.state is one of Submitted,
Working, Completed, Failed,
Cancelled, or InputRequired. For
a blocking request, the state is
Completed, Failed, Cancelled, or
InputRequired by the time the
response is sent.
Message(Message)
The agent answered directly without creating a task. The message is the agent’s reply.
Trait Implementations§
Source§impl Clone for SendMessageResponse
impl Clone for SendMessageResponse
Source§impl Debug for SendMessageResponse
impl Debug for SendMessageResponse
Source§impl<'de> Deserialize<'de> for SendMessageResponse
impl<'de> Deserialize<'de> for SendMessageResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SendMessageResponse
Source§impl From<Message> for SendMessageResponse
impl From<Message> for SendMessageResponse
Source§impl From<Task> for SendMessageResponse
impl From<Task> for SendMessageResponse
Source§impl PartialEq for SendMessageResponse
impl PartialEq for SendMessageResponse
Source§impl Serialize for SendMessageResponse
impl Serialize for SendMessageResponse
impl StructuralPartialEq for SendMessageResponse
Auto Trait Implementations§
impl Freeze for SendMessageResponse
impl RefUnwindSafe for SendMessageResponse
impl Send for SendMessageResponse
impl Sync for SendMessageResponse
impl Unpin for SendMessageResponse
impl UnsafeUnpin for SendMessageResponse
impl UnwindSafe for SendMessageResponse
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