diff --git a/crazy_functions/Langchain知识库.py b/crazy_functions/Langchain知识库.py index 3edb215..ccd7b2d 100644 --- a/crazy_functions/Langchain知识库.py +++ b/crazy_functions/Langchain知识库.py @@ -38,13 +38,13 @@ def 知识库问答(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_pro # < --------------------读取文件--------------- > 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: _, file_manifest_tmp, _ = get_files_from_everything(txt, type=f'.{sp}') file_manifest += file_manifest_tmp 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) # 刷新界面 return diff --git a/crazy_functions/crazy_functions_test.py b/crazy_functions/crazy_functions_test.py index 3d9e103..fd7d91d 100644 --- a/crazy_functions/crazy_functions_test.py +++ b/crazy_functions/crazy_functions_test.py @@ -162,14 +162,14 @@ def test_Markdown多语言(): def test_Langchain知识库(): from crazy_functions.Langchain知识库 import 知识库问答 - txt = "README.md" + txt = "./" chatbot = ChatBotWithCookies(llm_kwargs) 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) chatbot = ChatBotWithCookies(cookies) 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): cli_printer.print(cb) # print(cb)