run-llama / llama-hub

A library of data loaders for LLMs made by the community -- to be used with LlamaIndex and/or LangChain
https://llamahub.ai/
MIT License
3.43k stars 728 forks source link

Fix docs: query index #886

Closed MarouaneMaatouk closed 6 months ago

MarouaneMaatouk commented 6 months ago

Description

In this PR, there's a fix for documentation about querying indices:

index = VectorStoreIndex.from_documents(documents)
index.query(question)

which should be:

index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
query_engine.query(question)

Fixes #874

Type of Change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Suggested Checklist:

review-notebook-app[bot] commented 6 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB