Find answers from the community

Home
Members
vegaviazhang
v
vegaviazhang
Offline, last seen 4 months ago
Joined September 25, 2024
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:

Plain Text
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.
7 comments
v
M
j