0

In the following code

def load_index():
    # index if dir 'storage' does not exist
    if not os.path.exists('storage'):
        print('Building index...')
        build_index()
    storage_context = StorageContext.from_defaults(persist_dir='./storage')
    # doc_hash_to_filename = json.load(open('doc_hash_to_filename.json', 'r'))
    return load_index_from_storage(storage_context)

def ask_question(index, query):
    query_engine = index.as_query_engine()
    response = query_engine.query(query)
    return response

I always get 2 responses right now, for any query. How can I get more? is there a parameter I can change?

piedpiper
  • 1,222
  • 3
  • 14
  • 27
  • I've suggested removing the `langchain` tag from your question which isn't relevant to `langchain`. Instead, use [llama-index](https://stackoverflow.com/questions/tagged/llama-index). Let me know if I do this in error. – Rijoanul Hasan Shanto May 22 '23 at 13:47
  • `langchain` is a related package; and i've already tagged `gpt-index`. i want to keep it as a tag. – piedpiper May 23 '23 at 13:21

0 Answers0