Enum aleph_alpha_client::Modality
source · pub enum Modality<'a> {
Text {
data: Cow<'a, str>,
},
}
Expand description
The prompt for models can be a combination of different modalities (Text and Image). The type of modalities which are supported depend on the Model in question.
Variants§
Implementations§
source§impl<'a> Modality<'a>
impl<'a> Modality<'a>
sourcepub fn borrow(&self) -> Modality<'_>
pub fn borrow(&self) -> Modality<'_>
Create a semantically idetical entry of modality which borrows the contents of this one.
It is very practical to allow Modality of e.g. Text to take both ownership of the string it contains as well as borrow a slice. However then we are creating a body from the user input we want to avoid copying everything and needing to allocate for that modality again. This is there this borrow function really shines.
Trait Implementations§
source§impl<'a> PartialEq<Modality<'a>> for Modality<'a>
impl<'a> PartialEq<Modality<'a>> for Modality<'a>
impl<'a> Eq for Modality<'a>
impl<'a> StructuralEq for Modality<'a>
impl<'a> StructuralPartialEq for Modality<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Modality<'a>
impl<'a> Send for Modality<'a>
impl<'a> Sync for Modality<'a>
impl<'a> Unpin for Modality<'a>
impl<'a> UnwindSafe for Modality<'a>
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.