Struct google_api_proto::google::ai::generativelanguage::v1::EmbedContentRequest
source · pub struct EmbedContentRequest {
pub model: String,
pub content: Option<Content>,
pub task_type: Option<i32>,
pub title: Option<String>,
pub output_dimensionality: Option<i32>,
}
Expand description
Request containing the Content
for the model to embed.
Fields§
§model: String
Required. The model’s resource name. This serves as an ID for the Model to use.
This name should match a model name returned by the ListModels
method.
Format: models/{model}
content: Option<Content>
Required. The content to embed. Only the parts.text
fields will be
counted.
task_type: Option<i32>
Optional. Optional task type for which the embeddings will be used. Can
only be set for models/embedding-001
.
title: Option<String>
Optional. An optional title for the text. Only applicable when TaskType is
RETRIEVAL_DOCUMENT
.
Note: Specifying a title
for RETRIEVAL_DOCUMENT
provides better quality
embeddings for retrieval.
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.
Supported by newer models since 2024 only. You cannot set this value if
using the earlier model (models/embedding-001
).
Implementations§
source§impl EmbedContentRequest
impl EmbedContentRequest
sourcepub fn task_type(&self) -> TaskType
pub fn task_type(&self) -> TaskType
Returns the enum value of task_type
, or the default if the field is unset or set to an invalid enum value.
sourcepub fn set_task_type(&mut self, value: TaskType)
pub fn set_task_type(&mut self, value: TaskType)
Sets task_type
to the provided enum value.
sourcepub fn title(&self) -> &str
pub fn title(&self) -> &str
Returns the value of title
, or the default value if title
is unset.
sourcepub fn output_dimensionality(&self) -> i32
pub fn output_dimensionality(&self) -> i32
Returns the value of output_dimensionality
, or the default value if output_dimensionality
is unset.
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 moresource§impl Debug for EmbedContentRequest
impl Debug for EmbedContentRequest
source§impl Default for EmbedContentRequest
impl Default for EmbedContentRequest
source§impl Message for EmbedContentRequest
impl Message for EmbedContentRequest
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 EmbedContentRequest
impl PartialEq for EmbedContentRequest
source§fn eq(&self, other: &EmbedContentRequest) -> bool
fn eq(&self, other: &EmbedContentRequest) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for EmbedContentRequest
Auto Trait Implementations§
impl Freeze for EmbedContentRequest
impl RefUnwindSafe for EmbedContentRequest
impl Send for EmbedContentRequest
impl Sync for EmbedContentRequest
impl Unpin for EmbedContentRequest
impl UnwindSafe for EmbedContentRequest
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