.query()
method empowers developers to ask questions and receive relevant answers through a user-friendly query API. Function signature is given below:
Question to ask
Configure different llm settings such as prompt, temprature, number_documents etc.
The purpose is to test the prompt structure without actually running LLM inference. Defaults to False
A dictionary of key-value pairs to filter the chunks from the vector database. Defaults to None
Return citations along with the LLM answer. Defaults to False
If citations=False
, return a stringified answer to the question asked.
If citations=True
, returns a tuple with answer and citations respectively.
If you want to get the answer to question and return both answer and citations, use the following code snippet:
When citations=True
, note that the returned sources
are a list of tuples where each tuple has two elements (in the following order):
url
: url of the sourcedoc_id
: document id (used for book keeping purposes)score
: score of the source chunk with respect to the questionIf you just want to return answers and don’t want to return citations, you can use the following example:
.query()
method empowers developers to ask questions and receive relevant answers through a user-friendly query API. Function signature is given below:
Question to ask
Configure different llm settings such as prompt, temprature, number_documents etc.
The purpose is to test the prompt structure without actually running LLM inference. Defaults to False
A dictionary of key-value pairs to filter the chunks from the vector database. Defaults to None
Return citations along with the LLM answer. Defaults to False
If citations=False
, return a stringified answer to the question asked.
If citations=True
, returns a tuple with answer and citations respectively.
If you want to get the answer to question and return both answer and citations, use the following code snippet:
When citations=True
, note that the returned sources
are a list of tuples where each tuple has two elements (in the following order):
url
: url of the sourcedoc_id
: document id (used for book keeping purposes)score
: score of the source chunk with respect to the questionIf you just want to return answers and don’t want to return citations, you can use the following example: