pub struct GoogleCloudDialogflowV2InferenceParameter {
pub max_output_tokens: Option<i32>,
pub temperature: Option<f64>,
pub top_k: Option<i32>,
pub top_p: Option<f64>,
}
Expand description
The parameters of inference.
This type is not used in any activity, and only used as part of another schema.
Fields§
§max_output_tokens: Option<i32>
Optional. Maximum number of the output tokens for the generator.
temperature: Option<f64>
Optional. Controls the randomness of LLM predictions. Low temperature = less random. High temperature = more random. If unset (or 0), uses a default value of 0.
top_k: Option<i32>
Optional. Top-k changes how the model selects tokens for output. A top-k of 1 means the selected token is the most probable among all tokens in the model’s vocabulary (also called greedy decoding), while a top-k of 3 means that the next token is selected from among the 3 most probable tokens (using temperature). For each token selection step, the top K tokens with the highest probabilities are sampled. Then tokens are further filtered based on topP with the final token selected using temperature sampling. Specify a lower value for less random responses and a higher value for more random responses. Acceptable value is [1, 40], default to 40.
top_p: Option<f64>
Optional. Top-p changes how the model selects tokens for output. Tokens are selected from most K (see topK parameter) probable to least until the sum of their probabilities equals the top-p value. For example, if tokens A, B, and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, then the model will select either A or B as the next token (using temperature) and doesn’t consider C. The default top-p value is 0.95. Specify a lower value for less random responses and a higher value for more random responses. Acceptable value is [0.0, 1.0], default to 0.95.
Trait Implementations§
Source§impl Clone for GoogleCloudDialogflowV2InferenceParameter
impl Clone for GoogleCloudDialogflowV2InferenceParameter
Source§fn clone(&self) -> GoogleCloudDialogflowV2InferenceParameter
fn clone(&self) -> GoogleCloudDialogflowV2InferenceParameter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for GoogleCloudDialogflowV2InferenceParameter
impl Default for GoogleCloudDialogflowV2InferenceParameter
Source§fn default() -> GoogleCloudDialogflowV2InferenceParameter
fn default() -> GoogleCloudDialogflowV2InferenceParameter
Source§impl<'de> Deserialize<'de> for GoogleCloudDialogflowV2InferenceParameter
impl<'de> Deserialize<'de> for GoogleCloudDialogflowV2InferenceParameter
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>,
impl Part for GoogleCloudDialogflowV2InferenceParameter
Auto Trait Implementations§
impl Freeze for GoogleCloudDialogflowV2InferenceParameter
impl RefUnwindSafe for GoogleCloudDialogflowV2InferenceParameter
impl Send for GoogleCloudDialogflowV2InferenceParameter
impl Sync for GoogleCloudDialogflowV2InferenceParameter
impl Unpin for GoogleCloudDialogflowV2InferenceParameter
impl UnwindSafe for GoogleCloudDialogflowV2InferenceParameter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more