#[non_exhaustive]pub struct CountTokensRequest {
pub endpoint: String,
pub model: String,
pub instances: Vec<Value>,
pub contents: Vec<Content>,
pub system_instruction: Option<Content>,
pub tools: Vec<Tool>,
pub generation_config: Option<GenerationConfig>,
/* private fields */
}Expand description
Request message for [PredictionService.CountTokens][].
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
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 perform token counting.
Format:
projects/{project}/locations/{location}/endpoints/{endpoint}
model: StringOptional. The name of the publisher model requested to serve the
prediction. Format:
projects/{project}/locations/{location}/publishers/*/models/*
instances: Vec<Value>Optional. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.
contents: Vec<Content>Optional. Input content.
system_instruction: Option<Content>Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.
tools: Vec<Tool>Optional. A list of Tools the model may use to generate the next
response.
A Tool is a piece of code that enables the system to interact with
external systems to perform an action, or set of actions, outside of
knowledge and scope of the model.
generation_config: Option<GenerationConfig>Optional. Generation config that the model will use to generate the response.
Implementations§
Source§impl CountTokensRequest
impl CountTokensRequest
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.
Sourcepub fn set_system_instruction<T: Into<Option<Content>>>(self, v: T) -> Self
pub fn set_system_instruction<T: Into<Option<Content>>>(self, v: T) -> Self
Sets the value of system_instruction.
Sourcepub fn set_generation_config<T: Into<Option<GenerationConfig>>>(
self,
v: T,
) -> Self
pub fn set_generation_config<T: Into<Option<GenerationConfig>>>( self, v: T, ) -> Self
Sets the value of generation_config.
Trait Implementations§
Source§impl Clone for CountTokensRequest
impl Clone for CountTokensRequest
Source§fn clone(&self) -> CountTokensRequest
fn clone(&self) -> CountTokensRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more