pub struct AiMessage {
pub role: MessageRole,
pub content: String,
pub parts: Vec<AiContentPart>,
}Fields§
§role: MessageRole§content: String§parts: Vec<AiContentPart>Implementations§
Source§impl AiMessage
impl AiMessage
pub fn user(content: impl Into<String>) -> AiMessage
pub fn assistant(content: impl Into<String>) -> AiMessage
pub fn system(content: impl Into<String>) -> AiMessage
pub fn user_with_parts( content: impl Into<String>, parts: Vec<AiContentPart>, ) -> AiMessage
pub fn has_media(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AiMessage
impl<'de> Deserialize<'de> for AiMessage
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AiMessage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AiMessage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&AiMessage> for AnthropicMessage
impl From<&AiMessage> for AnthropicMessage
Source§impl From<&AiMessage> for GeminiContent
impl From<&AiMessage> for GeminiContent
Source§impl From<&AiMessage> for OpenAiMessage
impl From<&AiMessage> for OpenAiMessage
Source§impl Serialize for AiMessage
impl Serialize for AiMessage
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for AiMessage
impl RefUnwindSafe for AiMessage
impl Send for AiMessage
impl Sync for AiMessage
impl Unpin for AiMessage
impl UnsafeUnpin for AiMessage
impl UnwindSafe for AiMessage
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