pinecone.data.types.search_rerank_typed_dict

 1from typing import TypedDict, Optional, Union, Dict, Any
 2from ..features.inference import RerankModel
 3
 4
 5class SearchRerankTypedDict(TypedDict):
 6    # """
 7    # SearchRerank represents a rerank request when searching within a specific namespace.
 8    # """
 9
10    model: Union[str, RerankModel]
11    # model: str
12    # """
13    # The name of the [reranking model](https://docs.pinecone.io/guides/inference/understanding-inference#reranking-models) to use.
14    # Required.
15    # """
16
17    rank_fields: list[str]
18    # rank_fields: List[str]
19    # """
20    # The fields to use for reranking.
21    # Required.
22    # """
23
24    top_n: Optional[int]
25    # """
26    # The number of top results to return after reranking. Defaults to top_k.
27    # Optional.
28    # """
29
30    parameters: Optional[Dict[str, Any]]
31    # """
32    # Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/inference/understanding-inference#models)
33    # for available model parameters.
34    # Optional.
35    # """
36
37    query: Optional[str]
38    # """
39    # The query to rerank documents against. If a specific rerank query is specified, it overwrites
40    # the query input that was provided at the top level.
41    # """
class SearchRerankTypedDict(typing.TypedDict):
 6class SearchRerankTypedDict(TypedDict):
 7    # """
 8    # SearchRerank represents a rerank request when searching within a specific namespace.
 9    # """
10
11    model: Union[str, RerankModel]
12    # model: str
13    # """
14    # The name of the [reranking model](https://docs.pinecone.io/guides/inference/understanding-inference#reranking-models) to use.
15    # Required.
16    # """
17
18    rank_fields: list[str]
19    # rank_fields: List[str]
20    # """
21    # The fields to use for reranking.
22    # Required.
23    # """
24
25    top_n: Optional[int]
26    # """
27    # The number of top results to return after reranking. Defaults to top_k.
28    # Optional.
29    # """
30
31    parameters: Optional[Dict[str, Any]]
32    # """
33    # Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/inference/understanding-inference#models)
34    # for available model parameters.
35    # Optional.
36    # """
37
38    query: Optional[str]
39    # """
40    # The query to rerank documents against. If a specific rerank query is specified, it overwrites
41    # the query input that was provided at the top level.
42    # """
rank_fields: list[str]
top_n: Optional[int]
parameters: Optional[Dict[str, Any]]
query: Optional[str]