Struct google_api_proto::google::cloud::aiplatform::v1beta1::GenerateContentRequest
source · pub struct GenerateContentRequest {
pub model: String,
pub contents: Vec<Content>,
pub system_instruction: Option<Content>,
pub cached_content: String,
pub tools: Vec<Tool>,
pub tool_config: Option<ToolConfig>,
pub safety_settings: Vec<SafetySetting>,
pub generation_config: Option<GenerationConfig>,
}
Expand description
Request message for [PredictionService.GenerateContent].
Fields§
§model: String
Required. The name of the publisher model requested to serve the
prediction. Format:
projects/{project}/locations/{location}/publishers/*/models/*
contents: Vec<Content>
Required. The 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.
system_instruction: Option<Content>
Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.
cached_content: String
Optional. The name of the cached content used as context to serve the
prediction. Note: only used in explicit caching, where users can have
control over caching (e.g. what content to cache) and enjoy guaranteed cost
savings. Format:
projects/{project}/locations/{location}/cachedContents/{cachedContent}
tools: Vec<Tool>
Optional. A list of Tools
the model may use to generate the next
response.
A Tool
is a piece of code that enables the system to interact with
external systems to perform an action, or set of actions, outside of
knowledge and scope of the model.
tool_config: Option<ToolConfig>
Optional. Tool config. This config is shared for all tools provided in the request.
safety_settings: Vec<SafetySetting>
Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.
generation_config: Option<GenerationConfig>
Optional. Generation config.
Trait Implementations§
source§impl Clone for GenerateContentRequest
impl Clone for GenerateContentRequest
source§fn clone(&self) -> GenerateContentRequest
fn clone(&self) -> GenerateContentRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GenerateContentRequest
impl Debug for GenerateContentRequest
source§impl Default for GenerateContentRequest
impl Default for GenerateContentRequest
source§impl Message for GenerateContentRequest
impl Message for GenerateContentRequest
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for GenerateContentRequest
impl PartialEq for GenerateContentRequest
source§fn eq(&self, other: &GenerateContentRequest) -> bool
fn eq(&self, other: &GenerateContentRequest) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for GenerateContentRequest
Auto Trait Implementations§
impl Freeze for GenerateContentRequest
impl RefUnwindSafe for GenerateContentRequest
impl Send for GenerateContentRequest
impl Sync for GenerateContentRequest
impl Unpin for GenerateContentRequest
impl UnwindSafe for GenerateContentRequest
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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