Struct google_api_proto::google::cloud::aiplatform::v1::GenerationConfig
source · pub struct GenerationConfig {
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<f32>,
pub candidate_count: Option<i32>,
pub max_output_tokens: Option<i32>,
pub stop_sequences: Vec<String>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub seed: Option<i32>,
pub response_mime_type: String,
pub response_schema: Option<Schema>,
pub routing_config: Option<RoutingConfig>,
}
Expand description
Generation config.
Fields§
§temperature: Option<f32>
Optional. Controls the randomness of predictions.
top_p: Option<f32>
Optional. If specified, nucleus sampling will be used.
top_k: Option<f32>
Optional. If specified, top-k sampling will be used.
candidate_count: Option<i32>
Optional. Number of candidates to generate.
max_output_tokens: Option<i32>
Optional. The maximum number of output tokens to generate per message.
stop_sequences: Vec<String>
Optional. Stop sequences.
presence_penalty: Option<f32>
Optional. Positive penalties.
frequency_penalty: Option<f32>
Optional. Frequency penalties.
seed: Option<i32>
Optional. Seed.
response_mime_type: String
Optional. Output response mimetype of the generated candidate text. Supported mimetype:
text/plain
: (default) Text output.application/json
: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.
response_schema: Option<Schema>
Optional. The Schema
object allows the definition of input and output
data types. These types can be objects, but also primitives and arrays.
Represents a select subset of an OpenAPI 3.0 schema
object.
If set, a compatible response_mime_type must also be set.
Compatible mimetypes:
application/json
: Schema for JSON response.
routing_config: Option<RoutingConfig>
Optional. Routing configuration.
Implementations§
source§impl GenerationConfig
impl GenerationConfig
sourcepub fn temperature(&self) -> f32
pub fn temperature(&self) -> f32
Returns the value of temperature
, or the default value if temperature
is unset.
sourcepub fn candidate_count(&self) -> i32
pub fn candidate_count(&self) -> i32
Returns the value of candidate_count
, or the default value if candidate_count
is unset.
sourcepub fn max_output_tokens(&self) -> i32
pub fn max_output_tokens(&self) -> i32
Returns the value of max_output_tokens
, or the default value if max_output_tokens
is unset.
sourcepub fn presence_penalty(&self) -> f32
pub fn presence_penalty(&self) -> f32
Returns the value of presence_penalty
, or the default value if presence_penalty
is unset.
sourcepub fn frequency_penalty(&self) -> f32
pub fn frequency_penalty(&self) -> f32
Returns the value of frequency_penalty
, or the default value if frequency_penalty
is unset.
Trait Implementations§
source§impl Clone for GenerationConfig
impl Clone for GenerationConfig
source§fn clone(&self) -> GenerationConfig
fn clone(&self) -> GenerationConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GenerationConfig
impl Debug for GenerationConfig
source§impl Default for GenerationConfig
impl Default for GenerationConfig
source§impl Message for GenerationConfig
impl Message for GenerationConfig
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for GenerationConfig
impl PartialEq for GenerationConfig
source§fn eq(&self, other: &GenerationConfig) -> bool
fn eq(&self, other: &GenerationConfig) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for GenerationConfig
Auto Trait Implementations§
impl Freeze for GenerationConfig
impl RefUnwindSafe for GenerationConfig
impl Send for GenerationConfig
impl Sync for GenerationConfig
impl Unpin for GenerationConfig
impl UnwindSafe for GenerationConfig
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request