#[non_exhaustive]pub enum UserEvent {
Message {
content: Vec<ContentBlock>,
},
Interrupt {},
ToolConfirmation {
tool_use_id: String,
result: ConfirmationResult,
deny_message: Option<String>,
},
CustomToolResult {
custom_tool_use_id: String,
content: Vec<ContentBlock>,
},
ToolResult {
tool_use_id: String,
content: Vec<ContentBlock>,
},
DefineOutcome {
criteria: String,
},
}Expand description
Client-to-agent event. Discriminated by type field for wire serialization.
§Wire Shapes (CANON §3.4)
{"type": "user.message", "content": [{"type": "text", "text": "Hello"}]}
{"type": "user.interrupt"}§Example
use adk_managed::types::{UserEvent, ContentBlock};
let event = UserEvent::Message {
content: vec![ContentBlock::Text { text: "Hello".to_string() }],
};
let json = serde_json::to_string(&event).unwrap();
assert!(json.contains(r#""type":"user.message""#));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Message
Send a message turn.
Fields
§
content: Vec<ContentBlock>The message content blocks.
Interrupt
Interrupt the current turn.
ToolConfirmation
Approve or deny a tool confirmation request.
Fields
§
result: ConfirmationResultWhether to allow or deny.
CustomToolResult
Return results for a client-executed custom tool.
Fields
§
content: Vec<ContentBlock>The result content blocks.
ToolResult
Return results for a built-in tool (self-hosted only). In hosted topology, built-in tools execute server-side in the sandbox.
Fields
§
content: Vec<ContentBlock>The result content blocks.
DefineOutcome
Define success criteria for the session.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UserEvent
impl<'de> Deserialize<'de> for UserEvent
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
Auto Trait Implementations§
impl Freeze for UserEvent
impl RefUnwindSafe for UserEvent
impl Send for UserEvent
impl Sync for UserEvent
impl Unpin for UserEvent
impl UnsafeUnpin for UserEvent
impl UnwindSafe for UserEvent
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