Hello everyone, I got an error when running the following code. The wrong code is"index = VectorStoreIndex.from_documents(documents)", and the error content is"'str' object has no attribute 'data'",how can i deal with it?
from dotenv import load_dotenv load_dotenv()
from llama_index.core import SimpleDirectoryReader documents = SimpleDirectoryReader(r"data").load_data() print(documents)
from llama_index.core import VectorStoreIndex index = VectorStoreIndex.from_documents(documents)
agent = index.as_query_engine() response = agent.query("what's my favorite game?") print("what's my favorite game?", response) index.storage_context.persist()