Struct google_api_proto::google::ai::generativelanguage::v1beta::QueryCorpusRequest
source · pub struct QueryCorpusRequest {
pub name: String,
pub query: String,
pub metadata_filters: Vec<MetadataFilter>,
pub results_count: i32,
}Expand description
Request for querying a Corpus.
Fields§
§name: StringRequired. The name of the Corpus to query.
Example: corpora/my-corpus-123
query: StringRequired. Query string to perform semantic search.
metadata_filters: Vec<MetadataFilter>Optional. Filter for Chunk and Document metadata. Each MetadataFilter
object should correspond to a unique key. Multiple MetadataFilter objects
are joined by logical “AND“s.
Example query at document level: (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action)
MetadataFilter object list:
metadata_filters = [
{key = “document.custom_metadata.year”
conditions = [{int_value = 2020, operation = GREATER_EQUAL},
{int_value = 2010, operation = LESS}]},
{key = “document.custom_metadata.year”
conditions = [{int_value = 2020, operation = GREATER_EQUAL},
{int_value = 2010, operation = LESS}]},
{key = “document.custom_metadata.genre”
conditions = [{string_value = “drama”, operation = EQUAL},
{string_value = “action”, operation = EQUAL}]}]
Example query at chunk level for a numeric range of values: (year > 2015 AND year <= 2020)
MetadataFilter object list:
metadata_filters = [
{key = “chunk.custom_metadata.year”
conditions = [{int_value = 2015, operation = GREATER}]},
{key = “chunk.custom_metadata.year”
conditions = [{int_value = 2020, operation = LESS_EQUAL}]}]
Note: “AND“s for the same key are only supported for numeric values. String values only support “OR“s for the same key.
results_count: i32Optional. The maximum number of Chunks to return.
The service may return fewer Chunks.
If unspecified, at most 10 Chunks will be returned.
The maximum specified result count is 100.
Trait Implementations§
source§impl Clone for QueryCorpusRequest
impl Clone for QueryCorpusRequest
source§fn clone(&self) -> QueryCorpusRequest
fn clone(&self) -> QueryCorpusRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for QueryCorpusRequest
impl Debug for QueryCorpusRequest
source§impl Default for QueryCorpusRequest
impl Default for QueryCorpusRequest
source§impl Message for QueryCorpusRequest
impl Message for QueryCorpusRequest
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 QueryCorpusRequest
impl PartialEq for QueryCorpusRequest
source§fn eq(&self, other: &QueryCorpusRequest) -> bool
fn eq(&self, other: &QueryCorpusRequest) -> bool
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for QueryCorpusRequest
Auto Trait Implementations§
impl Freeze for QueryCorpusRequest
impl RefUnwindSafe for QueryCorpusRequest
impl Send for QueryCorpusRequest
impl Sync for QueryCorpusRequest
impl Unpin for QueryCorpusRequest
impl UnwindSafe for QueryCorpusRequest
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