Files
ragflow_api_test/add_chunk.py

21 lines
569 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 0.提供1个对话框
# 1.下拉选择rag_object.list_datasets()中的一个数据集
# 2.根据选择的数据集下拉选择rag_object.list_documents()中的一个文档
# 3.按钮选择txt文件将其内容添加到选中的文档中doc.add_chunk
# from ragflow_sdk import RAGFlow
# api_key = "ragflow-I5ZDNjMWNhNTdlMjExZjBiOTEwMzI0ZT"
# base_url = "http://192.168.107.165:8099"
# rag_object = RAGFlow(api_key=api_key, base_url=base_url)
# datasets = rag_object.list_datasets()
# for ds in datasets:
# print(ds.name, ds.id)
#dataset = dataset[0]