pub enum ToolResultContent {
Text(Text),
Image(Image),
}
Expand description
Describes the content of a tool result, which can be text or an image.
Variants§
Implementations§
Source§impl ToolResultContent
impl ToolResultContent
Sourcepub fn text(text: impl Into<String>) -> Self
pub fn text(text: impl Into<String>) -> Self
Helper constructor to make creating tool result text content easier.
Sourcepub fn image(
data: impl Into<String>,
format: Option<ContentFormat>,
media_type: Option<ImageMediaType>,
detail: Option<ImageDetail>,
) -> Self
pub fn image( data: impl Into<String>, format: Option<ContentFormat>, media_type: Option<ImageMediaType>, detail: Option<ImageDetail>, ) -> Self
Helper constructor to make creating tool result image content easier.
Trait Implementations§
Source§impl Clone for ToolResultContent
impl Clone for ToolResultContent
Source§fn clone(&self) -> ToolResultContent
fn clone(&self) -> ToolResultContent
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 ToolResultContent
impl Debug for ToolResultContent
Source§impl<'de> Deserialize<'de> for ToolResultContent
impl<'de> Deserialize<'de> for ToolResultContent
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
Source§impl From<String> for ToolResultContent
impl From<String> for ToolResultContent
Source§impl From<ToolResultContent> for Message
impl From<ToolResultContent> for Message
Source§fn from(tool_result_content: ToolResultContent) -> Self
fn from(tool_result_content: ToolResultContent) -> Self
Converts to this type from the input type.
Source§impl From<ToolResultContent> for ToolResultContent
impl From<ToolResultContent> for ToolResultContent
Source§fn from(content: ToolResultContent) -> Self
fn from(content: ToolResultContent) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ToolResultContent
impl PartialEq for ToolResultContent
Source§impl Serialize for ToolResultContent
impl Serialize for ToolResultContent
impl StructuralPartialEq for ToolResultContent
Auto Trait Implementations§
impl Freeze for ToolResultContent
impl RefUnwindSafe for ToolResultContent
impl Send for ToolResultContent
impl Sync for ToolResultContent
impl Unpin for ToolResultContent
impl UnwindSafe for ToolResultContent
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 more