Skip to content

Commit 5c59b2f

Browse files
authored
Merge pull request #81 from chatchat-space/fix/removeMysqlClient
完善了源码部署文档,修复了部分安装时可能会发现的问题。
2 parents e01a8e4 + 33d343b commit 5c59b2f

File tree

5 files changed

+1123
-1272
lines changed

5 files changed

+1123
-1272
lines changed

chatchat-server/chatchat/server/agent/tools_factory/querysql.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from langchain_community.tools.sql_database.tool import QuerySQLDataBaseTool
2-
from langchain_community.utilities.sql_database import SQLDatabase
31
from pydantic import Field
2+
43
from chatchat.server.utils import get_tool_config, build_logger
54
from .tools_registry import BaseToolOutput, regist_tool
65

@@ -14,6 +13,9 @@ def query_sql_data(query: str = Field(description="Execute a SQL query against t
1413
If the query is not correct, an error message will be returned.
1514
If an error is returned, rewrite the query, check the query, and try again.
1615
"""
16+
from langchain_community.tools.sql_database.tool import QuerySQLDataBaseTool
17+
from langchain_community.utilities.sql_database import SQLDatabase
18+
1719
db_endpoint = get_tool_config("text2sql")["sqlalchemy_connect_str"]
1820
db = SQLDatabase.from_uri(db_endpoint)
1921
tool = QuerySQLDataBaseTool(db=db)

chatchat-server/chatchat/server/knowledge_base/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def docs2texts(
363363
if not docs:
364364
return []
365365

366-
logger.info(f"文档切分示例: {docs[0]}")
366+
print(f"文档切分示例: {docs[0]}")
367367
if zh_title_enhance:
368368
docs = func_zh_title_enhance(docs)
369369
self.splited_docs = docs

0 commit comments

Comments
 (0)