#[non_exhaustive]pub struct CountTokensResponse {
pub total_tokens: i32,
pub total_billable_characters: i32,
pub prompt_tokens_details: Vec<ModalityTokenCount>,
/* private fields */
}Expand description
Response message for [PredictionService.CountTokens][].
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.total_tokens: i32The total number of tokens counted across all instances from the request.
total_billable_characters: i32The total number of billable characters counted across all instances from the request.
prompt_tokens_details: Vec<ModalityTokenCount>Output only. List of modalities that were processed in the request input.
Implementations§
Source§impl CountTokensResponse
impl CountTokensResponse
pub fn new() -> Self
Sourcepub fn set_total_tokens<T: Into<i32>>(self, v: T) -> Self
pub fn set_total_tokens<T: Into<i32>>(self, v: T) -> Self
Sets the value of total_tokens.
Sourcepub fn set_total_billable_characters<T: Into<i32>>(self, v: T) -> Self
pub fn set_total_billable_characters<T: Into<i32>>(self, v: T) -> Self
Sets the value of total_billable_characters.
Sourcepub fn set_prompt_tokens_details<T, V>(self, v: T) -> Self
pub fn set_prompt_tokens_details<T, V>(self, v: T) -> Self
Sets the value of prompt_tokens_details.
Trait Implementations§
Source§impl Clone for CountTokensResponse
impl Clone for CountTokensResponse
Source§fn clone(&self) -> CountTokensResponse
fn clone(&self) -> CountTokensResponse
Returns a copy 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 CountTokensResponse
impl Debug for CountTokensResponse
Source§impl Default for CountTokensResponse
impl Default for CountTokensResponse
Source§fn default() -> CountTokensResponse
fn default() -> CountTokensResponse
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CountTokensResponsewhere
CountTokensResponse: Default,
impl<'de> Deserialize<'de> for CountTokensResponsewhere
CountTokensResponse: Default,
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
Source§impl Message for CountTokensResponse
impl Message for CountTokensResponse
Source§impl PartialEq for CountTokensResponse
impl PartialEq for CountTokensResponse
Source§impl Serialize for CountTokensResponse
impl Serialize for CountTokensResponse
impl StructuralPartialEq for CountTokensResponse
Auto Trait Implementations§
impl Freeze for CountTokensResponse
impl RefUnwindSafe for CountTokensResponse
impl Send for CountTokensResponse
impl Sync for CountTokensResponse
impl Unpin for CountTokensResponse
impl UnwindSafe for CountTokensResponse
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