pub struct SemanticRetrieverConfig {
pub source: String,
pub query: Option<Content>,
pub metadata_filters: Vec<MetadataFilter>,
pub max_chunks_count: Option<i32>,
pub minimum_relevance_score: Option<f32>,
}
Expand description
Configuration for retrieving grounding content from a Corpus
or
Document
created using the Semantic Retriever API.
Fields§
§source: String
Required. Name of the resource for retrieval. Example: corpora/123
or
corpora/123/documents/abc
.
query: Option<Content>
Required. Query to use for matching Chunk
s in the given resource by
similarity.
metadata_filters: Vec<MetadataFilter>
Optional. Filters for selecting Document
s and/or Chunk
s from the
resource.
max_chunks_count: Option<i32>
Optional. Maximum number of relevant Chunk
s to retrieve.
minimum_relevance_score: Option<f32>
Optional. Minimum relevance score for retrieved relevant Chunk
s.
Implementations§
source§impl SemanticRetrieverConfig
impl SemanticRetrieverConfig
sourcepub fn max_chunks_count(&self) -> i32
pub fn max_chunks_count(&self) -> i32
Returns the value of max_chunks_count
, or the default value if max_chunks_count
is unset.
sourcepub fn minimum_relevance_score(&self) -> f32
pub fn minimum_relevance_score(&self) -> f32
Returns the value of minimum_relevance_score
, or the default value if minimum_relevance_score
is unset.
Trait Implementations§
source§impl Clone for SemanticRetrieverConfig
impl Clone for SemanticRetrieverConfig
source§fn clone(&self) -> SemanticRetrieverConfig
fn clone(&self) -> SemanticRetrieverConfig
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 moresource§impl Debug for SemanticRetrieverConfig
impl Debug for SemanticRetrieverConfig
source§impl Default for SemanticRetrieverConfig
impl Default for SemanticRetrieverConfig
source§impl Message for SemanticRetrieverConfig
impl Message for SemanticRetrieverConfig
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
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,
Encodes the message to a buffer. Read more
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Encodes the message to a newly allocated buffer.
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,
Encodes the message with a length-delimiter to a buffer. Read more
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,
Encodes the message with a length-delimiter to a newly allocated buffer.
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
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,
Decodes a length-delimited instance of the message from the buffer.
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,
Decodes an instance of the message from a buffer, and merges it into
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,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self
.source§impl PartialEq for SemanticRetrieverConfig
impl PartialEq for SemanticRetrieverConfig
source§fn eq(&self, other: &SemanticRetrieverConfig) -> bool
fn eq(&self, other: &SemanticRetrieverConfig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for SemanticRetrieverConfig
Auto Trait Implementations§
impl Freeze for SemanticRetrieverConfig
impl RefUnwindSafe for SemanticRetrieverConfig
impl Send for SemanticRetrieverConfig
impl Sync for SemanticRetrieverConfig
impl Unpin for SemanticRetrieverConfig
impl UnwindSafe for SemanticRetrieverConfig
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
§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>
Wrap the input message
T
in a tonic::Request