pub struct GenerateContent(/* private fields */);Available on crate feature
prediction-service only.Expand description
The request builder for PredictionService::generate_content calls.
§Example
use builder::prediction_service::GenerateContent;
let builder = prepare_request_builder();
let response = builder.send().await?;
fn prepare_request_builder() -> GenerateContent {
// ... details omitted ...
}Implementations§
Source§impl GenerateContent
impl GenerateContent
Sourcepub fn with_request<V: Into<GenerateContentRequest>>(self, v: V) -> Self
pub fn with_request<V: Into<GenerateContentRequest>>(self, v: V) -> Self
Sets the full request, replacing any prior values.
Sourcepub fn with_options<V: Into<RequestOptions>>(self, v: V) -> Self
pub fn with_options<V: Into<RequestOptions>>(self, v: V) -> Self
Sets all the options, replacing any prior values.
Sourcepub async fn send(self) -> Result<GenerateContentResponse>
pub async fn send(self) -> Result<GenerateContentResponse>
Sends the request.
Sourcepub fn set_model<T: Into<String>>(self, v: T) -> Self
pub fn set_model<T: Into<String>>(self, v: T) -> Self
Sets the value of model.
This is a required field for requests.
Sourcepub fn set_contents<T, V>(self, v: T) -> Self
pub fn set_contents<T, V>(self, v: T) -> Self
Sets the value of contents.
This is a required field for requests.
Sourcepub fn set_system_instruction<T: Into<Option<Content>>>(self, v: T) -> Self
pub fn set_system_instruction<T: Into<Option<Content>>>(self, v: T) -> Self
Sets the value of system_instruction.
Sourcepub fn set_cached_content<T: Into<String>>(self, v: T) -> Self
pub fn set_cached_content<T: Into<String>>(self, v: T) -> Self
Sets the value of cached_content.
Sourcepub fn set_tool_config<T: Into<Option<ToolConfig>>>(self, v: T) -> Self
pub fn set_tool_config<T: Into<Option<ToolConfig>>>(self, v: T) -> Self
Sets the value of tool_config.
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sets the value of labels.
Sourcepub fn set_safety_settings<T, V>(self, v: T) -> Self
pub fn set_safety_settings<T, V>(self, v: T) -> Self
Sets the value of safety_settings.
Sourcepub fn set_generation_config<T: Into<Option<GenerationConfig>>>(
self,
v: T,
) -> Self
pub fn set_generation_config<T: Into<Option<GenerationConfig>>>( self, v: T, ) -> Self
Sets the value of generation_config.
Trait Implementations§
Source§impl Clone for GenerateContent
impl Clone for GenerateContent
Source§fn clone(&self) -> GenerateContent
fn clone(&self) -> GenerateContent
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 moreAuto Trait Implementations§
impl Freeze for GenerateContent
impl !RefUnwindSafe for GenerateContent
impl Send for GenerateContent
impl Sync for GenerateContent
impl Unpin for GenerateContent
impl !UnwindSafe for GenerateContent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> RequestOptionsBuilder for Twhere
T: RequestBuilder,
impl<T> RequestOptionsBuilder for Twhere
T: RequestBuilder,
Source§fn with_idempotency(self, v: bool) -> T
fn with_idempotency(self, v: bool) -> T
If
v is true, treat the RPC underlying this method as idempotent.Source§fn with_user_agent<V>(self, v: V) -> T
fn with_user_agent<V>(self, v: V) -> T
Set the user agent header.
Source§fn with_attempt_timeout<V>(self, v: V) -> T
fn with_attempt_timeout<V>(self, v: V) -> T
Sets the per-attempt timeout. Read more
Source§fn with_retry_policy<V>(self, v: V) -> Twhere
V: Into<RetryPolicyArg>,
fn with_retry_policy<V>(self, v: V) -> Twhere
V: Into<RetryPolicyArg>,
Sets the retry policy configuration.
Source§fn with_backoff_policy<V>(self, v: V) -> Twhere
V: Into<BackoffPolicyArg>,
fn with_backoff_policy<V>(self, v: V) -> Twhere
V: Into<BackoffPolicyArg>,
Sets the backoff policy configuration.
Source§fn with_retry_throttler<V>(self, v: V) -> Twhere
V: Into<RetryThrottlerArg>,
fn with_retry_throttler<V>(self, v: V) -> Twhere
V: Into<RetryThrottlerArg>,
Sets the retry throttler configuration.
Source§fn with_polling_error_policy<V>(self, v: V) -> Twhere
V: Into<PollingErrorPolicyArg>,
fn with_polling_error_policy<V>(self, v: V) -> Twhere
V: Into<PollingErrorPolicyArg>,
Sets the polling error policy configuration.
Source§fn with_polling_backoff_policy<V>(self, v: V) -> Twhere
V: Into<PollingBackoffPolicyArg>,
fn with_polling_backoff_policy<V>(self, v: V) -> Twhere
V: Into<PollingBackoffPolicyArg>,
Sets the polling backoff policy configuration.