Replies: 2 comments
-
🤖 您好, 要从RedisDocumentStore读取文档并将其转换为在LlamaIndex框架的SummaryIndex中使用的节点,您可以按照以下步骤操作:
ref_doc_info = docstore.get_ref_doc_info(ref_doc_id)
_add_nodes_to_index(index_struct, nodes)
text_node = TextNode(
text=summary_response.response,
relationships={
NodeRelationship.SOURCE: RelatedNodeInfo(node_id=doc_id)
},
)
_insert([text_node]) 请注意,您需要将 源代码: 关于 SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
def query_service_stream(self, question, top_k): 总是报错: raise RuntimeError("Session and connector has to use same event loop") |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question Validation
Question
我已经通过add_document将文档存储到redis中,如何将文档读取出来?
conn = redis.Redis(host=redis_host, port=redis_port, db=redis_db, password=redis_password)
docstore = RedisDocumentStore.from_redis_client(redis_client=conn, namespace="llama_index2")
storage_context = StorageContext.from_defaults(docstore=docs_store)
为什么已经读取为storage context了,还需要传入nodes,或者如何将docstore转换为nodes呢?
summary_index = SummaryIndex(nodes, storage_context=storage_context)
Beta Was this translation helpful? Give feedback.
All reactions