Hey, all technical leaders, I have a problem about using llama_index which is an excellent project.
I want to use an existing data and vector in Weaviate, and I use
WeaviateReader("http://localhost:18090")
to load data, and use
GPTWeaviateIndex
to Query.
My problem is that I don't know how to deal with the param of index_struct
, is there a method to generate a content of index_struct from a existing data.The follow is my code:
from llama_index import download_loader, GPTWeaviateIndex
WeaviateReader = download_loader('WeaviateReader')
# There is already data in Weaviate
reader = WeaviateReader("http://localhost:18090")
documents = reader.load_data(
class_name="Question",
properties=["answer", "category", "question", "_additional{vector}"],
separate_documents=True
)
weaviate_index = GPTWeaviateIndex(weaviate_client=reader.client)
weaviate_response = weaviate_index.query("Which article is most relevant to biology?")
print(weaviate_response.response)
- The following error occurred
ValueError: One of documents or index_struct must be provided.