#[non_exhaustive]pub struct EmbedContentConfig {
pub title: Option<String>,
pub task_type: Option<EmbeddingTaskType>,
pub auto_truncate: Option<bool>,
pub output_dimensionality: Option<i32>,
pub document_ocr: Option<bool>,
pub audio_track_extraction: Option<bool>,
/* private fields */
}prediction-service only.Expand description
Configurations for the EmbedContent API.
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.title: Option<String>Optional. The title for the text.
Only applicable to text-only embedding models.
task_type: Option<EmbeddingTaskType>Optional. The task type of the embedding.
Only applicable to text-only embedding models.
auto_truncate: Option<bool>Optional. Whether to silently truncate the input content if it’s longer than the maximum sequence length.
Only applicable to text-only embedding models.
output_dimensionality: Option<i32>Optional. Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end.
document_ocr: Option<bool>Optional. Whether to enable OCR for document content.
audio_track_extraction: Option<bool>Optional. Whether to extract audio from video content.
Implementations§
Source§impl EmbedContentConfig
impl EmbedContentConfig
pub fn new() -> 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 = EmbedContentConfig::new().set_task_type(EmbeddingTaskType::RetrievalQuery);
let x1 = EmbedContentConfig::new().set_task_type(EmbeddingTaskType::RetrievalDocument);
let x2 = EmbedContentConfig::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 = EmbedContentConfig::new().set_or_clear_task_type(Some(EmbeddingTaskType::RetrievalQuery));
let x1 = EmbedContentConfig::new().set_or_clear_task_type(Some(EmbeddingTaskType::RetrievalDocument));
let x2 = EmbedContentConfig::new().set_or_clear_task_type(Some(EmbeddingTaskType::SemanticSimilarity));
let x_none = EmbedContentConfig::new().set_or_clear_task_type(None::<EmbeddingTaskType>);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 = EmbedContentConfig::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 = EmbedContentConfig::new().set_or_clear_auto_truncate(Some(false));
let x = EmbedContentConfig::new().set_or_clear_auto_truncate(None::<bool>);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 = EmbedContentConfig::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 = EmbedContentConfig::new().set_or_clear_output_dimensionality(Some(42));
let x = EmbedContentConfig::new().set_or_clear_output_dimensionality(None::<i32>);Sourcepub fn set_document_ocr<T>(self, v: T) -> Self
pub fn set_document_ocr<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_document_ocr<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_document_ocr<T>(self, v: Option<T>) -> Self
Sets or clears the value of document_ocr.
§Example
let x = EmbedContentConfig::new().set_or_clear_document_ocr(Some(false));
let x = EmbedContentConfig::new().set_or_clear_document_ocr(None::<bool>);Sourcepub fn set_audio_track_extraction<T>(self, v: T) -> Self
pub fn set_audio_track_extraction<T>(self, v: T) -> Self
Sets the value of audio_track_extraction.
§Example
let x = EmbedContentConfig::new().set_audio_track_extraction(true);Sourcepub fn set_or_clear_audio_track_extraction<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_audio_track_extraction<T>(self, v: Option<T>) -> Self
Sets or clears the value of audio_track_extraction.
§Example
let x = EmbedContentConfig::new().set_or_clear_audio_track_extraction(Some(false));
let x = EmbedContentConfig::new().set_or_clear_audio_track_extraction(None::<bool>);Trait Implementations§
Source§impl Clone for EmbedContentConfig
impl Clone for EmbedContentConfig
Source§fn clone(&self) -> EmbedContentConfig
fn clone(&self) -> EmbedContentConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more