pub enum PromptInput {
String(String),
Strings(Vec<String>),
Ints(Vec<i64>),
MultiInts(Vec<Vec<i64>>),
}
Expand description
Represents the diverse ways a prompt can be supplied:
- A single string (
"Hello, world!"
) - An array of strings
- An array of integers (token IDs)
- An array of arrays of integers (multiple sequences of token IDs)
This enumeration corresponds to the JSON schema’s oneOf
for prompt
.
By using #[serde(untagged)]
, Serde will automatically handle whichever
variant is provided.
Variants§
String(String)
A single string prompt
Strings(Vec<String>)
Multiple string prompts
Ints(Vec<i64>)
A single sequence of token IDs
MultiInts(Vec<Vec<i64>>)
Multiple sequences of token IDs
Trait Implementations§
Source§impl Clone for PromptInput
impl Clone for PromptInput
Source§fn clone(&self) -> PromptInput
fn clone(&self) -> PromptInput
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 PromptInput
impl Debug for PromptInput
Source§impl<'de> Deserialize<'de> for PromptInput
impl<'de> Deserialize<'de> for PromptInput
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
Auto Trait Implementations§
impl Freeze for PromptInput
impl RefUnwindSafe for PromptInput
impl Send for PromptInput
impl Sync for PromptInput
impl Unpin for PromptInput
impl UnwindSafe for PromptInput
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