Find answers from the community

Updated 2 years ago

Error

At a glance

The community member posted their code, which uses the GPTSimpleVectorIndex from the llama_index library to query a website. A comment from another community member suggests that the community member should use GPTSimpleVectorIndex.from_documents() instead, but there is no explicitly marked answer.

Useful resources
This is my code. from llama_index import GPTSimpleVectorIndex, download_loader

SimpleWebPageReader = download_loader("SimpleWebPageReader")

loader = SimpleWebPageReader()
documents = loader.load_data(urls=['https://google.com'])
index = GPTSimpleVectorIndex(documents)
index.query('What language is on this website?')
L
1 comment
As the error says, you should use GPTSimpleVectorIndex.from_documents() πŸ™πŸ‘
Add a reply
Sign up and join the conversation on Discord