QueryDocumentRequest Class

Request body for performing semantic search over a Document.

Definition

Namespace: GenerativeAI.Types
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public class QueryDocumentRequest
Inheritance
Object    QueryDocumentRequest

Constructors

QueryDocumentRequestInitializes a new instance of the QueryDocumentRequest class

Properties

MetadataFilters Filter for RelevantChunk 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: metadataFilters = [ {key = "chunk.custom_metadata.year" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}}, {key = "chunk.custom_metadata.genre" conditions = [{stringValue = "drama", operation = EQUAL}, {stringValue = "action", operation = EQUAL}}]
Example query for a numeric range of values: (year > 2015 AND year <= 2020)
MetadataFilter object list: metadataFilters = [ {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.
Query Query string to perform semantic search. Required.
ResultsCount The maximum number of RelevantChunks to return. The service may return fewer RelevantChunks. If unspecified, at most 10 RelevantChunks will be returned. The maximum specified result count is 100.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also