#[non_exhaustive]pub struct VertexEmbeddingConfig {
pub model_id: String,
pub text_template: String,
pub task_type: EmbeddingTaskType,
/* private fields */
}Expand description
Message describing the configuration for generating embeddings for a vector field using Vertex AI embeddings API.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.model_id: StringRequired. Required: ID of the embedding model to use. See https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#embeddings-models for the list of supported models.
text_template: StringRequired. Required: Text template for the input to the model. The template must contain one or more references to fields in the DataObject, e.g.: “Movie Title: {title} –– Movie Plot: {plot}”.
task_type: EmbeddingTaskTypeRequired. Required: Task type for the embeddings.
Implementations§
Source§impl VertexEmbeddingConfig
impl VertexEmbeddingConfig
pub fn new() -> Self
Sourcepub fn set_model_id<T: Into<String>>(self, v: T) -> Self
pub fn set_model_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_text_template<T: Into<String>>(self, v: T) -> Self
pub fn set_text_template<T: Into<String>>(self, v: T) -> Self
Sets the value of text_template.
§Example
ⓘ
let x = VertexEmbeddingConfig::new().set_text_template("example");Sourcepub fn set_task_type<T: Into<EmbeddingTaskType>>(self, v: T) -> Self
pub fn set_task_type<T: Into<EmbeddingTaskType>>(self, v: T) -> Self
Sets the value of task_type.
§Example
ⓘ
use google_cloud_vectorsearch_v1::model::EmbeddingTaskType;
let x0 = VertexEmbeddingConfig::new().set_task_type(EmbeddingTaskType::RetrievalQuery);
let x1 = VertexEmbeddingConfig::new().set_task_type(EmbeddingTaskType::RetrievalDocument);
let x2 = VertexEmbeddingConfig::new().set_task_type(EmbeddingTaskType::SemanticSimilarity);Trait Implementations§
Source§impl Clone for VertexEmbeddingConfig
impl Clone for VertexEmbeddingConfig
Source§fn clone(&self) -> VertexEmbeddingConfig
fn clone(&self) -> VertexEmbeddingConfig
Returns a duplicate 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 moreSource§impl Debug for VertexEmbeddingConfig
impl Debug for VertexEmbeddingConfig
Source§impl Default for VertexEmbeddingConfig
impl Default for VertexEmbeddingConfig
Source§fn default() -> VertexEmbeddingConfig
fn default() -> VertexEmbeddingConfig
Returns the “default value” for a type. Read more
Source§impl Message for VertexEmbeddingConfig
impl Message for VertexEmbeddingConfig
Source§impl PartialEq for VertexEmbeddingConfig
impl PartialEq for VertexEmbeddingConfig
impl StructuralPartialEq for VertexEmbeddingConfig
Auto Trait Implementations§
impl Freeze for VertexEmbeddingConfig
impl RefUnwindSafe for VertexEmbeddingConfig
impl Send for VertexEmbeddingConfig
impl Sync for VertexEmbeddingConfig
impl Unpin for VertexEmbeddingConfig
impl UnsafeUnpin for VertexEmbeddingConfig
impl UnwindSafe for VertexEmbeddingConfig
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