pub struct TokensInfo {
pub token_ids: Vec<u32>,
pub tokens: Vec<Vec<u8>>,
pub role: Option<String>,
}Expand description
Information about tokens for a single content part,
matching the Python SDK’s TokensInfo.
Fields§
§token_ids: Vec<u32>The token IDs in the vocabulary.
tokens: Vec<Vec<u8>>The token pieces as byte sequences (UTF-8 encoded, with SentencePiece space markers replaced by actual spaces).
role: Option<String>The role of the content this part belongs to (e.g., “user”, “model”).
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 moreAuto 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