Skip to content

QueryVectorsInput

Source code in docs_src/capo_s3vectors/types/query_vectors_input.py
class QueryVectorsInput(TypedDict, closed=True):
    vector_bucket_name: NotRequired[
        "capo_s3vectors.types.vector_bucket_name.VectorBucketName"
    ]
    """<p>The name of the vector bucket that contains the vector index. </p>"""
    index_name: NotRequired["capo_s3vectors.types.index_name.IndexName"]
    """<p>The name of the vector index that you want to query. </p>"""
    index_arn: NotRequired["capo_s3vectors.types.index_arn.IndexArn"]
    """<p>The ARN of the vector index that you want to query.</p>"""
    top_k: "capo_s3vectors.types.top_k.TopK"
    """<p>The number of results to return for each query.</p>"""
    query_vector: NotRequired["capo_s3vectors.types.vector_data.VectorData"]
    """<p>The query vector for vector similarity search. The query vector must have the same dimension as the vector index. For example, if the vector index has 384 dimensions, the query vector must also have 384 dimensions. You can omit this parameter when you supply <code>queryTexts</code> to perform a full-text-only search. A request must include <code>queryVector</code>, <code>queryTexts</code>, or both.</p>"""
    filter: NotRequired["object"]
    """<p>Metadata filter to apply during the query. For more information about metadata keys, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-vectors-metadata-filtering.html">Metadata filtering</a> in the <i>Amazon S3 User Guide</i>. </p>"""
    query_mode: NotRequired["capo_s3vectors.types.index_mode.IndexMode"]
    """<p>The mode to use to process the query. If you don't specify a query mode, the operation uses the mode that's currently configured for the vector index.</p> <p>Valid values:</p> <ul> <li> <p> <code>CLASSIC</code> - Applies metadata filters during the vector search. You can't specify <code>CLASSIC</code> for an <code>ENHANCED</code> index.</p> </li> <li> <p> <code>ENHANCED</code> - Applies metadata filters before the vector search.</p> </li> </ul>"""
    return_metadata: NotRequired["bool"]
    """<p>Indicates whether to include metadata in the response. The default value is <code>false</code>.</p>"""
    return_distance: NotRequired["bool"]
    """<p>Indicates whether to include the computed distance in the response. The default value is <code>false</code>.</p>"""
    query_texts: NotRequired["capo_s3vectors.types.query_text_list.QueryTextList"]
    """<p>Full-text queries for searchable metadata keys. Omit <code>queryVector</code> to run a full-text-only search, or provide both fields to run a hybrid search. Each entry must target a distinct searchable metadata key.</p>"""
    return_scores: NotRequired["bool"]
    """<p>Indicates whether to include relevance scores in the response. Full-text-only results can include BM25 scores. Hybrid results can also include a Reciprocal Rank Fusion (RRF) score and vector distance. This setting doesn't add scores to vector-only requests. The default value is <code>false</code>.</p>"""
    next_token: NotRequired[
        "capo_s3vectors.types.query_vectors_next_token.QueryVectorsNextToken"
    ]
    """<p>Pagination token from a previous request. The value of this field is empty for an initial request.</p>"""

filter instance-attribute

filter: NotRequired[object]

Metadata filter to apply during the query. For more information about metadata keys, see Metadata filtering in the Amazon S3 User Guide.

index_arn instance-attribute

index_arn: NotRequired[IndexArn]

The ARN of the vector index that you want to query.

index_name instance-attribute

index_name: NotRequired[IndexName]

The name of the vector index that you want to query.

next_token instance-attribute

next_token: NotRequired[QueryVectorsNextToken]

Pagination token from a previous request. The value of this field is empty for an initial request.

query_mode instance-attribute

query_mode: NotRequired[IndexMode]

The mode to use to process the query. If you don't specify a query mode, the operation uses the mode that's currently configured for the vector index.

Valid values:

  • CLASSIC - Applies metadata filters during the vector search. You can't specify CLASSIC for an ENHANCED index.

  • ENHANCED - Applies metadata filters before the vector search.

query_texts instance-attribute

query_texts: NotRequired[QueryTextList]

Full-text queries for searchable metadata keys. Omit queryVector to run a full-text-only search, or provide both fields to run a hybrid search. Each entry must target a distinct searchable metadata key.

query_vector instance-attribute

query_vector: NotRequired[VectorData]

The query vector for vector similarity search. The query vector must have the same dimension as the vector index. For example, if the vector index has 384 dimensions, the query vector must also have 384 dimensions. You can omit this parameter when you supply queryTexts to perform a full-text-only search. A request must include queryVector, queryTexts, or both.

return_distance instance-attribute

return_distance: NotRequired[bool]

Indicates whether to include the computed distance in the response. The default value is false.

return_metadata instance-attribute

return_metadata: NotRequired[bool]

Indicates whether to include metadata in the response. The default value is false.

return_scores instance-attribute

return_scores: NotRequired[bool]

Indicates whether to include relevance scores in the response. Full-text-only results can include BM25 scores. Hybrid results can also include a Reciprocal Rank Fusion (RRF) score and vector distance. This setting doesn't add scores to vector-only requests. The default value is false.

top_k instance-attribute

top_k: TopK

The number of results to return for each query.

vector_bucket_name instance-attribute

vector_bucket_name: NotRequired[VectorBucketName]

The name of the vector bucket that contains the vector index.