更新测试案例
This commit is contained in:
parent
61b0e49fed
commit
a1b7a4da56
@ -38,13 +38,13 @@ def 知识库问答(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pro
|
|||||||
|
|
||||||
# < --------------------读取文件--------------- >
|
# < --------------------读取文件--------------- >
|
||||||
file_manifest = []
|
file_manifest = []
|
||||||
spl = ["txt", "doc", "docx", "email", "epub", "html", "image", "json", "md", "msg", "odt", "pdf", "ppt", "pptx", "rtf", "text"]
|
spl = ["txt", "doc", "docx", "email", "epub", "html", "json", "md", "msg", "pdf", "ppt", "pptx", "rtf"]
|
||||||
for sp in spl:
|
for sp in spl:
|
||||||
_, file_manifest_tmp, _ = get_files_from_everything(txt, type=f'.{sp}')
|
_, file_manifest_tmp, _ = get_files_from_everything(txt, type=f'.{sp}')
|
||||||
file_manifest += file_manifest_tmp
|
file_manifest += file_manifest_tmp
|
||||||
|
|
||||||
if len(file_manifest) == 0:
|
if len(file_manifest) == 0:
|
||||||
chatbot.append(["没有找到任何可读取文件", "当前支持的格式包括: txt, md, tex"])
|
chatbot.append(["没有找到任何可读取文件", "当前支持的格式包括: txt, md, docx, pptx, pdf, json等"])
|
||||||
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
|
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -162,14 +162,14 @@ def test_Markdown多语言():
|
|||||||
|
|
||||||
def test_Langchain知识库():
|
def test_Langchain知识库():
|
||||||
from crazy_functions.Langchain知识库 import 知识库问答
|
from crazy_functions.Langchain知识库 import 知识库问答
|
||||||
txt = "README.md"
|
txt = "./"
|
||||||
chatbot = ChatBotWithCookies(llm_kwargs)
|
chatbot = ChatBotWithCookies(llm_kwargs)
|
||||||
for cookies, cb, hist, msg in silence_stdout(知识库问答)(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port):
|
for cookies, cb, hist, msg in silence_stdout(知识库问答)(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port):
|
||||||
cli_printer.print(cb) # print(cb)
|
cli_printer.print(cb) # print(cb)
|
||||||
|
|
||||||
chatbot = ChatBotWithCookies(cookies)
|
chatbot = ChatBotWithCookies(cookies)
|
||||||
from crazy_functions.Langchain知识库 import 读取知识库作答
|
from crazy_functions.Langchain知识库 import 读取知识库作答
|
||||||
txt = "摘要?"
|
txt = "What is the installation method?"
|
||||||
for cookies, cb, hist, msg in silence_stdout(读取知识库作答)(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port):
|
for cookies, cb, hist, msg in silence_stdout(读取知识库作答)(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port):
|
||||||
cli_printer.print(cb) # print(cb)
|
cli_printer.print(cb) # print(cb)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user