#[non_exhaustive]pub struct ComputeTokensRequest {
pub endpoint: String,
pub instances: Vec<Value>,
pub model: String,
pub contents: Vec<Content>,
/* private fields */
}Expand description
Request message for ComputeTokens RPC call.
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.endpoint: StringRequired. The name of the Endpoint requested to get lists of tokens and token ids.
instances: Vec<Value>Optional. The instances that are the input to token computing API call. Schema is identical to the prediction schema of the text model, even for the non-text models, like chat models, or Codey models.
model: StringOptional. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers//models/
contents: Vec<Content>Optional. Input content.
Implementations§
Source§impl ComputeTokensRequest
impl ComputeTokensRequest
pub fn new() -> Self
Sourcepub fn set_endpoint<T: Into<String>>(self, v: T) -> Self
pub fn set_endpoint<T: Into<String>>(self, v: T) -> Self
Sets the value of endpoint.
Sourcepub fn set_instances<T, V>(self, v: T) -> Self
pub fn set_instances<T, V>(self, v: T) -> Self
Sets the value of instances.
Sourcepub fn set_contents<T, V>(self, v: T) -> Self
pub fn set_contents<T, V>(self, v: T) -> Self
Sets the value of contents.
Trait Implementations§
Source§impl Clone for ComputeTokensRequest
impl Clone for ComputeTokensRequest
Source§fn clone(&self) -> ComputeTokensRequest
fn clone(&self) -> ComputeTokensRequest
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 ComputeTokensRequest
impl Debug for ComputeTokensRequest
Source§impl Default for ComputeTokensRequest
impl Default for ComputeTokensRequest
Source§fn default() -> ComputeTokensRequest
fn default() -> ComputeTokensRequest
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ComputeTokensRequestwhere
ComputeTokensRequest: Default,
impl<'de> Deserialize<'de> for ComputeTokensRequestwhere
ComputeTokensRequest: 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 ComputeTokensRequest
impl Message for ComputeTokensRequest
Source§impl PartialEq for ComputeTokensRequest
impl PartialEq for ComputeTokensRequest
Source§impl Serialize for ComputeTokensRequest
impl Serialize for ComputeTokensRequest
impl StructuralPartialEq for ComputeTokensRequest
Auto Trait Implementations§
impl Freeze for ComputeTokensRequest
impl RefUnwindSafe for ComputeTokensRequest
impl Send for ComputeTokensRequest
impl Sync for ComputeTokensRequest
impl Unpin for ComputeTokensRequest
impl UnwindSafe for ComputeTokensRequest
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