#[non_exhaustive]pub struct GenerateGroundedContentRequest {
pub location: String,
pub system_instruction: Option<GroundedGenerationContent>,
pub contents: Vec<GroundedGenerationContent>,
pub generation_spec: Option<GenerationSpec>,
pub grounding_spec: Option<GroundingSpec>,
pub user_labels: HashMap<String, String>,
/* private fields */
}grounded-generation-service only.Expand description
Top-level message sent by the client for the GenerateGroundedContent
method.
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.location: StringRequired. Location resource.
Format: projects/{project}/locations/{location}.
system_instruction: Option<GroundedGenerationContent>Content of the system instruction for the current API.
These instructions will take priority over any other prompt instructions if the selected model is supporting them.
contents: Vec<GroundedGenerationContent>Content of the current conversation with the model.
For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.
generation_spec: Option<GenerationSpec>Content generation specification.
grounding_spec: Option<GroundingSpec>Grounding specification.
user_labels: HashMap<String, String>The user labels applied to a resource must meet the following requirements:
- Each resource can have multiple labels, up to a maximum of 64.
- Each label must be a key-value pair.
- Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
- Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
- The key portion of a label must be unique. However, you can use the same key with multiple resources.
- Keys must start with a lowercase letter or international character.
See Google Cloud Document for more details.
Implementations§
Source§impl GenerateGroundedContentRequest
impl GenerateGroundedContentRequest
Sourcepub fn set_location<T: Into<String>>(self, v: T) -> Self
pub fn set_location<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_system_instruction<T>(self, v: T) -> Selfwhere
T: Into<GroundedGenerationContent>,
pub fn set_system_instruction<T>(self, v: T) -> Selfwhere
T: Into<GroundedGenerationContent>,
Sets the value of system_instruction.
§Example
use google_cloud_discoveryengine_v1::model::GroundedGenerationContent;
let x = GenerateGroundedContentRequest::new().set_system_instruction(GroundedGenerationContent::default()/* use setters */);Sourcepub fn set_or_clear_system_instruction<T>(self, v: Option<T>) -> Selfwhere
T: Into<GroundedGenerationContent>,
pub fn set_or_clear_system_instruction<T>(self, v: Option<T>) -> Selfwhere
T: Into<GroundedGenerationContent>,
Sets or clears the value of system_instruction.
§Example
use google_cloud_discoveryengine_v1::model::GroundedGenerationContent;
let x = GenerateGroundedContentRequest::new().set_or_clear_system_instruction(Some(GroundedGenerationContent::default()/* use setters */));
let x = GenerateGroundedContentRequest::new().set_or_clear_system_instruction(None::<GroundedGenerationContent>);Sourcepub fn set_contents<T, V>(self, v: T) -> Self
pub fn set_contents<T, V>(self, v: T) -> Self
Sourcepub fn set_generation_spec<T>(self, v: T) -> Selfwhere
T: Into<GenerationSpec>,
pub fn set_generation_spec<T>(self, v: T) -> Selfwhere
T: Into<GenerationSpec>,
Sets the value of generation_spec.
§Example
use google_cloud_discoveryengine_v1::model::generate_grounded_content_request::GenerationSpec;
let x = GenerateGroundedContentRequest::new().set_generation_spec(GenerationSpec::default()/* use setters */);Sourcepub fn set_or_clear_generation_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<GenerationSpec>,
pub fn set_or_clear_generation_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<GenerationSpec>,
Sets or clears the value of generation_spec.
§Example
use google_cloud_discoveryengine_v1::model::generate_grounded_content_request::GenerationSpec;
let x = GenerateGroundedContentRequest::new().set_or_clear_generation_spec(Some(GenerationSpec::default()/* use setters */));
let x = GenerateGroundedContentRequest::new().set_or_clear_generation_spec(None::<GenerationSpec>);Sourcepub fn set_grounding_spec<T>(self, v: T) -> Selfwhere
T: Into<GroundingSpec>,
pub fn set_grounding_spec<T>(self, v: T) -> Selfwhere
T: Into<GroundingSpec>,
Sets the value of grounding_spec.
§Example
use google_cloud_discoveryengine_v1::model::generate_grounded_content_request::GroundingSpec;
let x = GenerateGroundedContentRequest::new().set_grounding_spec(GroundingSpec::default()/* use setters */);Sourcepub fn set_or_clear_grounding_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<GroundingSpec>,
pub fn set_or_clear_grounding_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<GroundingSpec>,
Sets or clears the value of grounding_spec.
§Example
use google_cloud_discoveryengine_v1::model::generate_grounded_content_request::GroundingSpec;
let x = GenerateGroundedContentRequest::new().set_or_clear_grounding_spec(Some(GroundingSpec::default()/* use setters */));
let x = GenerateGroundedContentRequest::new().set_or_clear_grounding_spec(None::<GroundingSpec>);Sourcepub fn set_user_labels<T, K, V>(self, v: T) -> Self
pub fn set_user_labels<T, K, V>(self, v: T) -> Self
Sets the value of user_labels.
§Example
let x = GenerateGroundedContentRequest::new().set_user_labels([
("key0", "abc"),
("key1", "xyz"),
]);Trait Implementations§
Source§impl Clone for GenerateGroundedContentRequest
impl Clone for GenerateGroundedContentRequest
Source§fn clone(&self) -> GenerateGroundedContentRequest
fn clone(&self) -> GenerateGroundedContentRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for GenerateGroundedContentRequest
impl Default for GenerateGroundedContentRequest
Source§fn default() -> GenerateGroundedContentRequest
fn default() -> GenerateGroundedContentRequest
impl StructuralPartialEq for GenerateGroundedContentRequest
Auto Trait Implementations§
impl Freeze for GenerateGroundedContentRequest
impl RefUnwindSafe for GenerateGroundedContentRequest
impl Send for GenerateGroundedContentRequest
impl Sync for GenerateGroundedContentRequest
impl Unpin for GenerateGroundedContentRequest
impl UnsafeUnpin for GenerateGroundedContentRequest
impl UnwindSafe for GenerateGroundedContentRequest
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> 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