❓ query
The .query()
method empowers developers to ask questions and receive relevant answers through a user-friendly query API.
Function signature is given below:
Parameters
Question to ask
The conversation ID to which the query belongs in case this is a chatbot scenario
In case you want to pass along your own context information. Passing this parameter disables the default context generation.
Returns
Unique identifier for the query response in a conversation
Unique identifier for the query response in a conversation
Unique identifier for the query response in a conversation
The individual sources that were used to generate the answer
The number of tokens used to answer the query
Usage
If you want to get the answer to question and return both answer and citations, use the following code snippet:
Was this page helpful?