Find answers from the community

Updated 3 months ago

Specify number of documents used by a retreiver

Specify number of documents used by a retreiver
k
2 comments
Please stand by @maximilian as I search the knowledge base. We are experiencing especially high traffic right now and might take longer than usual. :wave:
----------------------
To specify the number of documents used by a retriever, you can set the top_k parameter when using a specific reader. For example, when using the PineconeReader, you can set the top_k parameter to control the number of results returned.

Here's an example from the extracted information:

Plain Text
- **index_name** (*str*) – Name of the index.
- **id_to_text_map** (*Dict**[**str**,* *str**]*) – A map from ID’s to text.
- **separate_documents** (*Optional**[**bool**]*) – Whether to return separate
  documents per retrieved entry. Defaults to True.
- **vector** (*List**[**float**]*) – Query vector.
- **top_k** (*int*) – Number of results to return.
- **include_values** (*bool*) – Whether to include the embedding in the response.
  Defaults to True.
- ****query_kwargs** – Keyword arguments to pass to the query.
  Arguments are the exact same as those found in
  Pinecone’s reference documentation for the
  query method.
Returns
A list of documents.

Return type
List**[Document** (https://gpt-index.readthedocs.io/en/latest/reference/readers.html#gpt_index.readers.Document)]


In this case, you can set the top_k parameter to control the number of documents returned by the retriever.

Source: GPT Index Readers (https://gpt-index.readthedocs.io/en/latest/reference/readers.html)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Add a reply
Sign up and join the conversation on Discord