#[non_exhaustive]pub struct GenerateContentResponse {
pub candidates: Vec<Candidate>,
pub model_version: String,
pub create_time: Option<Timestamp>,
pub response_id: String,
pub prompt_feedback: Option<PromptFeedback>,
pub usage_metadata: Option<UsageMetadata>,
/* private fields */
}Expand description
Response message for [PredictionService.GenerateContent].
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.candidates: Vec<Candidate>Output only. Generated candidates.
model_version: StringOutput only. The model version used to generate the response.
create_time: Option<Timestamp>Output only. Timestamp when the request is made to the server.
response_id: StringOutput only. response_id is used to identify each response. It is the encoding of the event_id.
prompt_feedback: Option<PromptFeedback>Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.
usage_metadata: Option<UsageMetadata>Usage metadata about the response(s).
Implementations§
Source§impl GenerateContentResponse
impl GenerateContentResponse
pub fn new() -> Self
Sourcepub fn set_candidates<T, V>(self, v: T) -> Self
pub fn set_candidates<T, V>(self, v: T) -> Self
Sets the value of candidates.
Sourcepub fn set_model_version<T: Into<String>>(self, v: T) -> Self
pub fn set_model_version<T: Into<String>>(self, v: T) -> Self
Sets the value of model_version.
Sourcepub fn set_create_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self
pub fn set_create_time<T: Into<Option<Timestamp>>>(self, v: T) -> Self
Sets the value of create_time.
Sourcepub fn set_response_id<T: Into<String>>(self, v: T) -> Self
pub fn set_response_id<T: Into<String>>(self, v: T) -> Self
Sets the value of response_id.
Sourcepub fn set_prompt_feedback<T: Into<Option<PromptFeedback>>>(self, v: T) -> Self
pub fn set_prompt_feedback<T: Into<Option<PromptFeedback>>>(self, v: T) -> Self
Sets the value of prompt_feedback.
Sourcepub fn set_usage_metadata<T: Into<Option<UsageMetadata>>>(self, v: T) -> Self
pub fn set_usage_metadata<T: Into<Option<UsageMetadata>>>(self, v: T) -> Self
Sets the value of usage_metadata.
Trait Implementations§
Source§impl Clone for GenerateContentResponse
impl Clone for GenerateContentResponse
Source§fn clone(&self) -> GenerateContentResponse
fn clone(&self) -> GenerateContentResponse
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 GenerateContentResponse
impl Debug for GenerateContentResponse
Source§impl Default for GenerateContentResponse
impl Default for GenerateContentResponse
Source§fn default() -> GenerateContentResponse
fn default() -> GenerateContentResponse
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GenerateContentResponsewhere
GenerateContentResponse: Default,
impl<'de> Deserialize<'de> for GenerateContentResponsewhere
GenerateContentResponse: 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 GenerateContentResponse
impl Message for GenerateContentResponse
Source§impl PartialEq for GenerateContentResponse
impl PartialEq for GenerateContentResponse
Source§impl Serialize for GenerateContentResponse
impl Serialize for GenerateContentResponse
impl StructuralPartialEq for GenerateContentResponse
Auto Trait Implementations§
impl Freeze for GenerateContentResponse
impl RefUnwindSafe for GenerateContentResponse
impl Send for GenerateContentResponse
impl Sync for GenerateContentResponse
impl Unpin for GenerateContentResponse
impl UnwindSafe for GenerateContentResponse
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