diff --git a/docs/docs/installation/advanced_usage/More_proxyllms.md b/docs/docs/installation/advanced_usage/More_proxyllms.md index 956ecf810..9b7d04799 100644 --- a/docs/docs/installation/advanced_usage/More_proxyllms.md +++ b/docs/docs/installation/advanced_usage/More_proxyllms.md @@ -213,7 +213,7 @@ uv run dbgpt start webserver --config configs/dbgpt-proxy-tongyi.toml # Use uv to install dependencies needed for Zhipu (ChatGLM) proxy uv sync --all-packages \ --extra "base" \ ---extra "proxy_zhipu" \ +--extra "proxy_zhipuai" \ --extra "rag" \ --extra "storage_chromadb" \ --extra "dbgpts" diff --git a/packages/dbgpt-core/src/dbgpt/agent/expand/actions/insert_action.py b/packages/dbgpt-core/src/dbgpt/agent/expand/actions/insert_action.py index 424eb7a7f..f62734b72 100644 --- a/packages/dbgpt-core/src/dbgpt/agent/expand/actions/insert_action.py +++ b/packages/dbgpt-core/src/dbgpt/agent/expand/actions/insert_action.py @@ -31,7 +31,6 @@ def find_excel_files(directory: str) -> list[str]: """ # 检查目录是否存在 if not os.path.isdir(directory): - print(f"错误: 目录 '{directory}' 不存在") return [] # 存储结果的列表 @@ -49,10 +48,6 @@ def find_excel_files(directory: str) -> list[str]: return file_paths -# 待分析的所有Excel文件所在目录 -excel_files = find_excel_files(excel_path) - - class Excel2TableInput(BaseModel): create_sql_list: List[str] = Field( ..., @@ -71,7 +66,8 @@ class Excel2TableAction(Action[Excel2TableInput]): def __init__(self, file_paths: List[str] = [], **kwargs): """Initialize Excel2TableAction with list of file paths.""" super().__init__(**kwargs) - self.file_paths = excel_files + # 待分析的所有Excel文件所在目录 + self.file_paths = find_excel_files(excel_path) @property def resource_need(self) -> Optional[ResourceType]: @@ -343,36 +339,6 @@ class Excel2TableAction(Action[Excel2TableInput]): ) -def find_excel_files(directory: str) -> list[str]: - """ - 查找指定目录下所有.csv和.xlsx文件,并返回它们的绝对路径 - - 参数: - directory: 要搜索的目录路径 - - 返回: - 包含所有.csv和.xlsx文件绝对路径的列表,如果目录不存在则返回空列表 - """ - # 检查目录是否存在 - if not os.path.isdir(directory): - print(f"错误: 目录 '{directory}' 不存在") - return [] - - # 存储结果的列表 - file_paths = [] - - # 遍历目录及其子目录 - for root, dirs, files in os.walk(directory): - for file in files: - # 检查文件扩展名 - if file.lower().endswith((".csv", ".xlsx")): - # 获取文件的绝对路径并添加到列表 - absolute_path = os.path.abspath(os.path.join(root, file)) - file_paths.append(absolute_path) - - return file_paths - - def read_excel_headers_and_data( file_path: str, ) -> Tuple[List[str], List[Dict[str, Any]]]: diff --git a/packages/dbgpt-core/src/dbgpt/agent/expand/excel_table_agent.py b/packages/dbgpt-core/src/dbgpt/agent/expand/excel_table_agent.py index 67b77e7b8..fc1905154 100644 --- a/packages/dbgpt-core/src/dbgpt/agent/expand/excel_table_agent.py +++ b/packages/dbgpt-core/src/dbgpt/agent/expand/excel_table_agent.py @@ -28,7 +28,6 @@ def find_excel_files(directory: str) -> list[str]: """ # 检查目录是否存在 if not os.path.isdir(directory): - print(f"错误: 目录 '{directory}' 不存在") return [] # 存储结果的列表