----------------------
To query from
GPTListIndex.from_documents()
, you first need to create an index using the
from_documents()
method and then use the
query()
method on the created index. Here's an example:
from gpt_index import GPTListIndex
documents = ... # Load your documents here
index = GPTListIndex.from_documents(documents)
response = index.query("Your query here")
You can also specify different query modes and response modes. For example:
response = index.query("Your query here", mode="embedding", response_mode="compact")
For more information on query modes and response modes, refer to the following extracts:
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------