From 4f5dd9ebcfd81df146273a0053100dec11b16f98 Mon Sep 17 00:00:00 2001 From: binary-husky Date: Sat, 5 Oct 2024 09:53:21 +0000 Subject: [PATCH] add temp solution for llama-index compat --- crazy_functional.py | 33 +++++++++++++++++++++++++-------- requirements.txt | 1 - 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/crazy_functional.py b/crazy_functional.py index 1ddd8c20..de07c1bb 100644 --- a/crazy_functional.py +++ b/crazy_functional.py @@ -6,7 +6,6 @@ from loguru import logger def get_crazy_functions(): from crazy_functions.读文章写摘要 import 读文章写摘要 from crazy_functions.生成函数注释 import 批量生成函数注释 - from crazy_functions.Rag_Interface import Rag问答 from crazy_functions.SourceCode_Analyse import 解析项目本身 from crazy_functions.SourceCode_Analyse import 解析一个Python项目 from crazy_functions.SourceCode_Analyse import 解析一个Matlab项目 @@ -52,13 +51,6 @@ def get_crazy_functions(): from crazy_functions.SourceCode_Comment import 注释Python项目 function_plugins = { - "Rag智能召回": { - "Group": "对话", - "Color": "stop", - "AsButton": False, - "Info": "将问答数据记录到向量库中,作为长期参考。", - "Function": HotReload(Rag问答), - }, "虚空终端": { "Group": "对话|编程|学术|智能体", "Color": "stop", @@ -707,6 +699,31 @@ def get_crazy_functions(): logger.error(trimmed_format_exc()) logger.error("Load function plugin failed") + try: + from crazy_functions.Rag_Interface import Rag问答 + + function_plugins.update( + { + "Rag智能召回": { + "Group": "对话", + "Color": "stop", + "AsButton": False, + "Info": "将问答数据记录到向量库中,作为长期参考。", + "Function": HotReload(Rag问答), + }, + } + ) + except: + logger.error(trimmed_format_exc()) + logger.error("Load function plugin failed") + + + + + + + + # try: # from crazy_functions.高级功能函数模板 import 测试图表渲染 # function_plugins.update({ diff --git a/requirements.txt b/requirements.txt index 35e6a4fd..bd8da700 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,6 @@ zhipuai==2.0.1 tiktoken>=0.3.3 requests[socks] pydantic==2.5.2 -llama-index==0.10.5 protobuf==3.20 transformers>=4.27.1,<4.42 scipdf_parser>=0.52