#[non_exhaustive]pub enum InvokeArgs {
Text(String),
ContentBlocks(Vec<ContentBlock>),
Messages(Vec<Message>),
InterruptResponses(Vec<InterruptResponseContent>),
}Expand description
The input of an agent invocation (InvokeArgs).
Build it with .into() from a string, content blocks, messages or interrupt responses.
use strands::{InterruptResponse, InvokeArgs};
assert!(matches!(InvokeArgs::from("Hello"), InvokeArgs::Text(_)));
let resume: InvokeArgs = vec![InterruptResponse::new("tool:t-1:confirm", "yes")].into();
assert!(matches!(resume, InvokeArgs::InterruptResponses(_)));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.
Text(String)
User text, sent as one user message with a text block.
ContentBlocks(Vec<ContentBlock>)
Content blocks, sent as one user message.
Messages(Vec<Message>)
Messages appended to the conversation as given.
InterruptResponses(Vec<InterruptResponseContent>)
Responses that resume an interrupted agent.
Trait Implementations§
Source§impl Clone for InvokeArgs
impl Clone for InvokeArgs
Source§impl Debug for InvokeArgs
impl Debug for InvokeArgs
Source§impl From<&String> for InvokeArgs
impl From<&String> for InvokeArgs
Source§impl From<&str> for InvokeArgs
impl From<&str> for InvokeArgs
Source§impl From<Message> for InvokeArgs
impl From<Message> for InvokeArgs
Source§impl From<String> for InvokeArgs
impl From<String> for InvokeArgs
Source§impl From<Vec<ContentBlock>> for InvokeArgs
impl From<Vec<ContentBlock>> for InvokeArgs
Source§fn from(blocks: Vec<ContentBlock>) -> Self
fn from(blocks: Vec<ContentBlock>) -> Self
Converts to this type from the input type.
Source§impl From<Vec<InterruptResponse>> for InvokeArgs
impl From<Vec<InterruptResponse>> for InvokeArgs
Source§fn from(responses: Vec<InterruptResponse>) -> Self
fn from(responses: Vec<InterruptResponse>) -> Self
Converts to this type from the input type.
Source§impl From<Vec<InterruptResponseContent>> for InvokeArgs
impl From<Vec<InterruptResponseContent>> for InvokeArgs
Source§fn from(responses: Vec<InterruptResponseContent>) -> Self
fn from(responses: Vec<InterruptResponseContent>) -> Self
Converts to this type from the input type.
Source§impl PartialEq for InvokeArgs
impl PartialEq for InvokeArgs
impl StructuralPartialEq for InvokeArgs
Auto Trait Implementations§
impl !RefUnwindSafe for InvokeArgs
impl !UnwindSafe for InvokeArgs
impl Freeze for InvokeArgs
impl Send for InvokeArgs
impl Sync for InvokeArgs
impl Unpin for InvokeArgs
impl UnsafeUnpin for InvokeArgs
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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.