pub enum LanguageModelInput {
Text(String),
StringPrompt(StringPromptValue),
ChatPrompt(ChatPromptValue),
ImagePrompt(ImagePromptValue),
Messages(Vec<BaseMessage>),
}Expand description
Input to a language model.
Can be a string, a prompt value, or a sequence of messages.
Variants§
Text(String)
A simple string input.
StringPrompt(StringPromptValue)
A string prompt value.
ChatPrompt(ChatPromptValue)
A chat prompt value (messages).
ImagePrompt(ImagePromptValue)
An image prompt value.
Messages(Vec<BaseMessage>)
A sequence of messages.
Implementations§
Source§impl LanguageModelInput
impl LanguageModelInput
Sourcepub fn to_messages(&self) -> Vec<BaseMessage>
pub fn to_messages(&self) -> Vec<BaseMessage>
Convert the input to messages.
Trait Implementations§
Source§impl Clone for LanguageModelInput
impl Clone for LanguageModelInput
Source§fn clone(&self) -> LanguageModelInput
fn clone(&self) -> LanguageModelInput
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 LanguageModelInput
impl Debug for LanguageModelInput
Source§impl Display for LanguageModelInput
impl Display for LanguageModelInput
Source§impl From<&str> for LanguageModelInput
impl From<&str> for LanguageModelInput
Source§impl From<ChatPromptValue> for LanguageModelInput
impl From<ChatPromptValue> for LanguageModelInput
Source§fn from(p: ChatPromptValue) -> Self
fn from(p: ChatPromptValue) -> Self
Converts to this type from the input type.
Source§impl From<ImagePromptValue> for LanguageModelInput
impl From<ImagePromptValue> for LanguageModelInput
Source§fn from(p: ImagePromptValue) -> Self
fn from(p: ImagePromptValue) -> Self
Converts to this type from the input type.
Source§impl From<String> for LanguageModelInput
impl From<String> for LanguageModelInput
Source§impl From<StringPromptValue> for LanguageModelInput
impl From<StringPromptValue> for LanguageModelInput
Source§fn from(p: StringPromptValue) -> Self
fn from(p: StringPromptValue) -> Self
Converts to this type from the input type.
Source§impl From<Vec<BaseMessage>> for LanguageModelInput
impl From<Vec<BaseMessage>> for LanguageModelInput
Source§fn from(m: Vec<BaseMessage>) -> Self
fn from(m: Vec<BaseMessage>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for LanguageModelInput
impl RefUnwindSafe for LanguageModelInput
impl Send for LanguageModelInput
impl Sync for LanguageModelInput
impl Unpin for LanguageModelInput
impl UnwindSafe for LanguageModelInput
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.