mirror of
https://github.com/csunny/DB-GPT.git
synced 2026-02-21 22:27:14 +00:00
chore: update docs typo (#2964)
Co-authored-by: alan.cl <alan.cl@antgroup.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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]]]:
|
||||
|
||||
@@ -28,7 +28,6 @@ def find_excel_files(directory: str) -> list[str]:
|
||||
"""
|
||||
# 检查目录是否存在
|
||||
if not os.path.isdir(directory):
|
||||
print(f"错误: 目录 '{directory}' 不存在")
|
||||
return []
|
||||
|
||||
# 存储结果的列表
|
||||
|
||||
Reference in New Issue
Block a user