Struct google_api_proto::google::ai::generativelanguage::v1beta::QueryDocumentRequest
source · pub struct QueryDocumentRequest {
pub name: String,
pub query: String,
pub results_count: i32,
pub metadata_filters: Vec<MetadataFilter>,
}Expand description
Request for querying a Document.
Fields§
§name: StringRequired. The name of the Document to query.
Example: corpora/my-corpus-123/documents/the-doc-abc
query: StringRequired. Query string to perform semantic search.
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.
metadata_filters: Vec<MetadataFilter>Optional. Filter for Chunk metadata. Each MetadataFilter object should
correspond to a unique key. Multiple MetadataFilter objects are joined by
logical “AND“s.
Note: Document-level filtering is not supported for this request because
a Document name is already specified.
Example query: (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action)
MetadataFilter object list:
metadata_filters = [
{key = “chunk.custom_metadata.year”
conditions = [{int_value = 2020, operation = GREATER_EQUAL},
{int_value = 2010, operation = LESS}},
{key = “chunk.custom_metadata.genre”
conditions = [{string_value = “drama”, operation = EQUAL},
{string_value = “action”, operation = EQUAL}}]
Example query 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.
Trait Implementations§
source§impl Clone for QueryDocumentRequest
impl Clone for QueryDocumentRequest
source§fn clone(&self) -> QueryDocumentRequest
fn clone(&self) -> QueryDocumentRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for QueryDocumentRequest
impl Debug for QueryDocumentRequest
source§impl Default for QueryDocumentRequest
impl Default for QueryDocumentRequest
source§impl Message for QueryDocumentRequest
impl Message for QueryDocumentRequest
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 QueryDocumentRequest
impl PartialEq for QueryDocumentRequest
source§fn eq(&self, other: &QueryDocumentRequest) -> bool
fn eq(&self, other: &QueryDocumentRequest) -> bool
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for QueryDocumentRequest
Auto Trait Implementations§
impl Freeze for QueryDocumentRequest
impl RefUnwindSafe for QueryDocumentRequest
impl Send for QueryDocumentRequest
impl Sync for QueryDocumentRequest
impl Unpin for QueryDocumentRequest
impl UnwindSafe for QueryDocumentRequest
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