#[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 */
}prediction-service only.Expand description
Response message for [PredictionService.GenerateContent].
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.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.
§Example
use google_cloud_aiplatform_v1::model::Candidate;
let x = GenerateContentResponse::new()
.set_candidates([
Candidate::default()/* use setters */,
Candidate::default()/* use (different) setters */,
]);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.
§Example
let x = GenerateContentResponse::new().set_model_version("example");Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = GenerateContentResponse::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = GenerateContentResponse::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = GenerateContentResponse::new().set_or_clear_create_time(None::<Timestamp>);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.
§Example
let x = GenerateContentResponse::new().set_response_id("example");Sourcepub fn set_prompt_feedback<T>(self, v: T) -> Selfwhere
T: Into<PromptFeedback>,
pub fn set_prompt_feedback<T>(self, v: T) -> Selfwhere
T: Into<PromptFeedback>,
Sets the value of prompt_feedback.
§Example
use google_cloud_aiplatform_v1::model::generate_content_response::PromptFeedback;
let x = GenerateContentResponse::new().set_prompt_feedback(PromptFeedback::default()/* use setters */);Sourcepub fn set_or_clear_prompt_feedback<T>(self, v: Option<T>) -> Selfwhere
T: Into<PromptFeedback>,
pub fn set_or_clear_prompt_feedback<T>(self, v: Option<T>) -> Selfwhere
T: Into<PromptFeedback>,
Sets or clears the value of prompt_feedback.
§Example
use google_cloud_aiplatform_v1::model::generate_content_response::PromptFeedback;
let x = GenerateContentResponse::new().set_or_clear_prompt_feedback(Some(PromptFeedback::default()/* use setters */));
let x = GenerateContentResponse::new().set_or_clear_prompt_feedback(None::<PromptFeedback>);Sourcepub fn set_usage_metadata<T>(self, v: T) -> Selfwhere
T: Into<UsageMetadata>,
pub fn set_usage_metadata<T>(self, v: T) -> Selfwhere
T: Into<UsageMetadata>,
Sets the value of usage_metadata.
§Example
use google_cloud_aiplatform_v1::model::generate_content_response::UsageMetadata;
let x = GenerateContentResponse::new().set_usage_metadata(UsageMetadata::default()/* use setters */);Sourcepub fn set_or_clear_usage_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<UsageMetadata>,
pub fn set_or_clear_usage_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<UsageMetadata>,
Sets or clears the value of usage_metadata.
§Example
use google_cloud_aiplatform_v1::model::generate_content_response::UsageMetadata;
let x = GenerateContentResponse::new().set_or_clear_usage_metadata(Some(UsageMetadata::default()/* use setters */));
let x = GenerateContentResponse::new().set_or_clear_usage_metadata(None::<UsageMetadata>);Trait Implementations§
Source§impl Clone for GenerateContentResponse
impl Clone for GenerateContentResponse
Source§fn clone(&self) -> GenerateContentResponse
fn clone(&self) -> GenerateContentResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more