Skip to main content

GenerateContentRequestBody

Struct GenerateContentRequestBody 

Source
#[non_exhaustive]
pub struct GenerateContentRequestBody {
Show 38 fields pub messages: Vec<ChatMessage>, pub model: String, pub audio: Option<Option<ChatAudioParam>>, pub frequency_penalty: Option<Option<f64>>, pub function_call: Option<FunctionCallChoice>, pub functions: Option<Vec<LegacyFunction>>, pub logit_bias: Option<Option<BTreeMap<String, f64>>>, pub logprobs: Option<Option<bool>>, pub max_completion_tokens: Option<Option<i64>>, pub max_tokens: Option<Option<i64>>, pub metadata: Option<Option<BTreeMap<String, String>>>, pub modalities: Option<Option<Vec<Modality>>>, pub moderation: Option<Option<Moderation>>, pub n: Option<Option<i64>>, pub parallel_tool_calls: Option<bool>, pub prediction: Option<Option<Prediction>>, pub presence_penalty: Option<Option<f64>>, pub prompt_cache_key: Option<Option<String>>, pub prompt_cache_options: Option<PromptCacheOptions>, pub prompt_cache_retention: Option<Option<PromptCacheRetention>>, pub reasoning_effort: Option<Option<ReasoningEffort>>, pub response_format: Option<ResponseFormat>, pub safety_identifier: Option<Option<String>>, pub seed: Option<Option<i64>>, pub service_tier: Option<Option<ServiceTier>>, pub stop: Option<Option<Stop>>, pub store: Option<Option<bool>>, pub stream: Option<Option<bool>>, pub stream_options: Option<Option<StreamOptions>>, pub temperature: Option<Option<f64>>, pub tool_choice: Option<ToolChoice>, pub tools: Option<Vec<ChatTool>>, pub top_logprobs: Option<Option<i64>>, pub top_p: Option<Option<f64>>, pub user: Option<String>, pub verbosity: Option<Option<Verbosity>>, pub web_search_options: Option<WebSearchOptions>, pub rest: Rest,
}

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.
§messages: Vec<ChatMessage>§model: String§audio: Option<Option<ChatAudioParam>>§frequency_penalty: Option<Option<f64>>§function_call: Option<FunctionCallChoice>§functions: Option<Vec<LegacyFunction>>§logit_bias: Option<Option<BTreeMap<String, f64>>>§logprobs: Option<Option<bool>>§max_completion_tokens: Option<Option<i64>>§max_tokens: Option<Option<i64>>§metadata: Option<Option<BTreeMap<String, String>>>§modalities: Option<Option<Vec<Modality>>>§moderation: Option<Option<Moderation>>§n: Option<Option<i64>>§parallel_tool_calls: Option<bool>§prediction: Option<Option<Prediction>>§presence_penalty: Option<Option<f64>>§prompt_cache_key: Option<Option<String>>§prompt_cache_options: Option<PromptCacheOptions>§prompt_cache_retention: Option<Option<PromptCacheRetention>>§reasoning_effort: Option<Option<ReasoningEffort>>§response_format: Option<ResponseFormat>§safety_identifier: Option<Option<String>>§seed: Option<Option<i64>>§service_tier: Option<Option<ServiceTier>>§stop: Option<Option<Stop>>§store: Option<Option<bool>>§stream: Option<Option<bool>>§stream_options: Option<Option<StreamOptions>>§temperature: Option<Option<f64>>§tool_choice: Option<ToolChoice>§tools: Option<Vec<ChatTool>>§top_logprobs: Option<Option<i64>>§top_p: Option<Option<f64>>§user: Option<String>§verbosity: Option<Option<Verbosity>>§web_search_options: Option<WebSearchOptions>§rest: Rest

Implementations§

Source§

impl GenerateContentRequestBody

Source

pub fn builder( messages: Vec<ChatMessage>, model: String, ) -> GenerateContentRequestBodyBuilder

Start a builder by supplying the required fields in declaration order.

Trait Implementations§

Source§

impl Clone for GenerateContentRequestBody

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GenerateContentRequestBody

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DeclaredFields for GenerateContentRequestBody

Source§

fn into_declared(self) -> Self

Source§

impl<'de> Deserialize<'de> for GenerateContentRequestBody

Source§

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 PartialEq for GenerateContentRequestBody

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for GenerateContentRequestBody

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for GenerateContentRequestBody

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ResourceSend for T
where T: Send + ?Sized,

Source§

impl<T> ResourceSync for T
where T: Sync + ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.