Pinecone TypeScript SDK - v9.0.0
    Preparing search index...

    Interface RerankOptions

    Options for reranking documents against a query.

    import type { RerankOptions } from '@pinecone-database/pinecone';
    const options: RerankOptions = {
    model: 'bge-reranker-v2-m3',
    query: 'How do I return an order?',
    documents: [{ body: 'Start a return from your order history.' }],
    rankFields: ['body'],
    };
    interface RerankOptions {
        documents: (string | { [key: string]: string })[];
        model: string;
        parameters?: { [key: string]: string };
        query: string;
        rankFields?: string[];
        returnDocuments?: boolean;
        topN?: number;
    }
    Index
    documents: (string | { [key: string]: string })[]

    Text strings or document objects. Objects need a text field unless you supply rankFields.

    model: string

    The model to use for reranking.

    parameters?: { [key: string]: string }

    Additional model-specific parameters. Refer to the model guide for available model parameters.

    query: string

    The query to rerank documents against.

    rankFields?: string[]

    The field(s) to consider for reranking. If not provided, the default is ["text"].

    The number of fields supported is model-specific.

    returnDocuments?: boolean

    Include document contents in each result. Defaults to true.

    topN?: number

    The number of results to return sorted by relevance. Defaults to the number of inputs.