#[non_exhaustive]pub enum OutgoingUserEvent {
Message {
content: Vec<UserContentBlock>,
},
Interrupt {},
CustomToolResult {
custom_tool_use_id: String,
content: Vec<UserContentBlock>,
is_error: Option<bool>,
session_thread_id: Option<String>,
},
ToolConfirmation {
tool_use_id: String,
result: ConfirmationResult,
deny_message: Option<String>,
session_thread_id: Option<String>,
},
DefineOutcome(UserDefineOutcomeEvent),
}Available on crate feature
managed-agents-preview only.Expand description
One event included in a Events::send call.
This is the outgoing form – the user-event variants only. For the
echoed / received form (which can also carry agent / session / span
events) use SessionEvent.
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 user message.
Fields
§
content: Vec<UserContentBlock>Content blocks.
Interrupt
Interrupt the agent mid-execution.
CustomToolResult
Respond to an agent.custom_tool_use.
Fields
§
content: Vec<UserContentBlock>Result content.
ToolConfirmation
Allow or deny a pending tool call.
Fields
§
result: ConfirmationResultAllow or deny.
DefineOutcome(UserDefineOutcomeEvent)
Define an outcome.
Implementations§
Source§impl OutgoingUserEvent
impl OutgoingUserEvent
Sourcepub fn message(text: impl Into<String>) -> Self
pub fn message(text: impl Into<String>) -> Self
Build a simple user.message from a single text string.
Sourcepub fn allow_tool(tool_use_id: impl Into<String>) -> Self
pub fn allow_tool(tool_use_id: impl Into<String>) -> Self
Build a user.tool_confirmation (allow).
Sourcepub fn deny_tool(
tool_use_id: impl Into<String>,
deny_message: impl Into<String>,
) -> Self
pub fn deny_tool( tool_use_id: impl Into<String>, deny_message: impl Into<String>, ) -> Self
Build a user.tool_confirmation (deny with message).
Sourcepub fn custom_tool_result_text(
custom_tool_use_id: impl Into<String>,
text: impl Into<String>,
) -> Self
pub fn custom_tool_result_text( custom_tool_use_id: impl Into<String>, text: impl Into<String>, ) -> Self
Build a user.custom_tool_result with a single text block.
Sourcepub fn with_session_thread_id(self, thread_id: impl Into<String>) -> Self
pub fn with_session_thread_id(self, thread_id: impl Into<String>) -> Self
Attach a session_thread_id to a ToolConfirmation or
CustomToolResult event for multi-agent thread routing. No-op
on other variants.
Trait Implementations§
Source§impl Clone for OutgoingUserEvent
impl Clone for OutgoingUserEvent
Source§fn clone(&self) -> OutgoingUserEvent
fn clone(&self) -> OutgoingUserEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OutgoingUserEvent
impl Debug for OutgoingUserEvent
Source§impl PartialEq for OutgoingUserEvent
impl PartialEq for OutgoingUserEvent
Source§impl Serialize for OutgoingUserEvent
impl Serialize for OutgoingUserEvent
impl StructuralPartialEq for OutgoingUserEvent
Auto Trait Implementations§
impl Freeze for OutgoingUserEvent
impl RefUnwindSafe for OutgoingUserEvent
impl Send for OutgoingUserEvent
impl Sync for OutgoingUserEvent
impl Unpin for OutgoingUserEvent
impl UnsafeUnpin for OutgoingUserEvent
impl UnwindSafe for OutgoingUserEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.