GPT 索引:使用带有向量存储的 ComposableGraph 的问题

问题描述 投票:0回答:0

我在实施具有可组合性的矢量商店时遇到问题

from llama_index.composability import ComposableGraph
index1 = GPTQdrantIndex(doc1, client=qdrant_client,collection_name="index1")
index1.set_text("S3document1")
index2 = GPTQdrantIndex(doc2, client=qdrant_client,collection_name="index2")
index2.set_text("S3document2")
# save index to disk
index1.save_to_disk('index_Qdrant1.json')
index2.save_to_disk('index_Qdrant2.json')

list_index2 = GPTListIndex([index1, index2]);

graph = ComposableGraph.build_from_index(list_index2)
graph.save_to_disk("save_path2.json")
graph = ComposableGraph.load_from_disk("save_path2.json")

query_configs = [
    {
        "index_struct_type": "qdrant",
        "query_mode": "default"   
    },
    {
        "index_struct_type": "keyword_table",
        "query_mode": "simple",
        "query_kwargs": {}
    },
]

response = graph.query("Who is this", query_configs=query_configs);
print(response)

错误

我也尝试过将 ComposableGraph 与其他 Vector Stores 一起使用,但没有成功

python openai-api gpt-3
© www.soinside.com 2019 - 2024. All rights reserved.