#[non_exhaustive]pub struct TokensInfo {
pub tokens: Vec<Bytes>,
pub token_ids: Vec<i64>,
pub role: String,
/* private fields */
}Available on crate feature
llm-utility-service only.Expand description
Tokens info with a list of tokens and the corresponding list of token ids.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tokens: Vec<Bytes>A list of tokens from the input.
token_ids: Vec<i64>A list of token ids from the input.
role: StringOptional. Optional fields for the role from the corresponding Content.
Implementations§
Source§impl TokensInfo
impl TokensInfo
pub fn new() -> Self
Sourcepub fn set_tokens<T, V>(self, v: T) -> Self
pub fn set_tokens<T, V>(self, v: T) -> Self
Sourcepub fn set_token_ids<T, V>(self, v: T) -> Self
pub fn set_token_ids<T, V>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for TokensInfo
impl Clone for TokensInfo
Source§fn clone(&self) -> TokensInfo
fn clone(&self) -> TokensInfo
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 TokensInfo
impl Debug for TokensInfo
Source§impl Default for TokensInfo
impl Default for TokensInfo
Source§fn default() -> TokensInfo
fn default() -> TokensInfo
Returns the “default value” for a type. Read more
Source§impl PartialEq for TokensInfo
impl PartialEq for TokensInfo
impl StructuralPartialEq for TokensInfo
Auto Trait Implementations§
impl Freeze for TokensInfo
impl RefUnwindSafe for TokensInfo
impl Send for TokensInfo
impl Sync for TokensInfo
impl Unpin for TokensInfo
impl UnwindSafe for TokensInfo
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