fourthdimension
Project description
使用示例
FourthDimension支持批量导入一个文件目录下的所有文档,“path/”是存放文档的文件目录名称。
from fourthdimension import fd_client
myKbName = "myKbName"
fd_client.createKB(myKbName)
result = fd_client.importDocuments(myKbName, "path/", fd_client.Summarizing)
if result.getCode() != 0:
print("导入失败,错误信息:" + result.getMsg())
else:
print("导入成功。")
FdResult<List<Chunk>result = fd_client.query(myKbName, "my question")
if result.getCode() != 0:
print("查询失败,错误信息:" + result.getMsg())
else:
print(result.getData())
# 添加文档
result = fd_client.addDocument(myKbName, "/path/source_file_name", "/path/target_file_name", fd_client.SUMMARIZING)
# 修改文档
result = fd_client.updateDocument(myKbName, "/path/source_file_name", "/path/target_file_name", fd_client.SUMMARIZING)
# 删除文档
result = fd_client.deleteDocument(myKbName, "/path/target_file_name")
# 删除知识库
result = fd_client.deleteKB(myKbName)
result = fd_client.ruminate(myKbName, fd_client.SUMMARIZING)
if result.getCode() != 0:
print("反刍失败,错误信息:" + result.getMsg())
else:
print("反刍成功。")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for fourthdimension-2.0.3b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f102af3a3f00797d3d54372dea107c9f1d4d07345b16f4f3f11c00219465b4e5 |
|
MD5 | 01eec6d1c2ba2da0d860f71e21a58432 |
|
BLAKE2b-256 | 72e3c1be5f440dbd3db22516236231b75fb0f9fd478b76ee9533c9e645e39b5a |