#[non_exhaustive]pub struct EmbedContentRequest {
pub model: Option<String>,
pub content: Option<Content>,
pub title: Option<String>,
pub task_type: Option<EmbeddingTaskType>,
pub output_dimensionality: Option<i32>,
pub auto_truncate: Option<bool>,
/* private fields */
}prediction-service only.Expand description
Request message for PredictionService.EmbedContent.
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.model: Option<String>Required. The name of the publisher model requested to serve the
prediction. Format:
projects/{project}/locations/{location}/publishers/*/models/*
content: Option<Content>Required. Input content to be embedded. Required.
title: Option<String>Optional. An optional title for the text.
task_type: Option<EmbeddingTaskType>Optional. The task type of the embedding.
output_dimensionality: Option<i32>Optional. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end.
auto_truncate: Option<bool>Optional. Whether to silently truncate the input content if it’s longer than the maximum sequence length.
Implementations§
Source§impl EmbedContentRequest
impl EmbedContentRequest
pub fn new() -> Self
Sourcepub fn set_or_clear_model<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_model<T>(self, v: Option<T>) -> Self
Sourcepub fn set_content<T>(self, v: T) -> Self
pub fn set_content<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_content<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_content<T>(self, v: Option<T>) -> Self
Sourcepub fn set_or_clear_title<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_title<T>(self, v: Option<T>) -> Self
Sourcepub fn set_task_type<T>(self, v: T) -> Selfwhere
T: Into<EmbeddingTaskType>,
pub fn set_task_type<T>(self, v: T) -> Selfwhere
T: Into<EmbeddingTaskType>,
Sets the value of task_type.
§Example
use google_cloud_aiplatform_v1::model::embed_content_request::EmbeddingTaskType;
let x0 = EmbedContentRequest::new().set_task_type(EmbeddingTaskType::RetrievalQuery);
let x1 = EmbedContentRequest::new().set_task_type(EmbeddingTaskType::RetrievalDocument);
let x2 = EmbedContentRequest::new().set_task_type(EmbeddingTaskType::SemanticSimilarity);Sourcepub fn set_or_clear_task_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<EmbeddingTaskType>,
pub fn set_or_clear_task_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<EmbeddingTaskType>,
Sets or clears the value of task_type.
§Example
use google_cloud_aiplatform_v1::model::embed_content_request::EmbeddingTaskType;
let x0 = EmbedContentRequest::new().set_or_clear_task_type(Some(EmbeddingTaskType::RetrievalQuery));
let x1 = EmbedContentRequest::new().set_or_clear_task_type(Some(EmbeddingTaskType::RetrievalDocument));
let x2 = EmbedContentRequest::new().set_or_clear_task_type(Some(EmbeddingTaskType::SemanticSimilarity));
let x_none = EmbedContentRequest::new().set_or_clear_task_type(None::<EmbeddingTaskType>);Sourcepub fn set_output_dimensionality<T>(self, v: T) -> Self
pub fn set_output_dimensionality<T>(self, v: T) -> Self
Sets the value of output_dimensionality.
§Example
let x = EmbedContentRequest::new().set_output_dimensionality(42);Sourcepub fn set_or_clear_output_dimensionality<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_output_dimensionality<T>(self, v: Option<T>) -> Self
Sets or clears the value of output_dimensionality.
§Example
let x = EmbedContentRequest::new().set_or_clear_output_dimensionality(Some(42));
let x = EmbedContentRequest::new().set_or_clear_output_dimensionality(None::<i32>);Sourcepub fn set_auto_truncate<T>(self, v: T) -> Self
pub fn set_auto_truncate<T>(self, v: T) -> Self
Sets the value of auto_truncate.
§Example
let x = EmbedContentRequest::new().set_auto_truncate(true);Sourcepub fn set_or_clear_auto_truncate<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_auto_truncate<T>(self, v: Option<T>) -> Self
Sets or clears the value of auto_truncate.
§Example
let x = EmbedContentRequest::new().set_or_clear_auto_truncate(Some(false));
let x = EmbedContentRequest::new().set_or_clear_auto_truncate(None::<bool>);Trait Implementations§
Source§impl Clone for EmbedContentRequest
impl Clone for EmbedContentRequest
Source§fn clone(&self) -> EmbedContentRequest
fn clone(&self) -> EmbedContentRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more