-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[BUG] text2sql不生效 #5172
Comments
The issue of 'text2sql' not triggering any database requests in Langchain-Chatchat could be due to several reasons. Here are some potential causes and solutions:
If these steps do not resolve the issue, further investigation into the logs or error messages would be necessary to diagnose the problem. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Thought: The user is asking to view the data in an application table. I need to use the text2sql tool to convert this natural language request into an SQL query. Action: {
"action": "text2sql",
"action_input": {
"query": {
"title": "Query",
"description": "View the data in the application table.",
"type": "string"
}
}
}
```2025-01-03 10:18:09.267 | ERROR | chatchat.server.utils:wrap_done:46 - ValidationError: Caught exception: 1 validation error for text2sqlSchema
query
str type expected (type=type_error.str)
text2sql:
model_name: glm4-chat
use: true
sqlalchemy_connect_str: mysql+pymysql://user:password@123.123.123.123:3306/monitor
read_only: true
top_k: 50
return_intermediate_steps: true
table_names: ["monitor_domain","monitor_domain_detail","monitor_application"]
table_comments: {"monitor_application":"应用表,存储了应用的基本信息","monitor_domain_detail":"域名解析详情表"}
如上所展示,配置的数据可以正常连接 但是提问有些问题
|
问题描述 / Problem Description
启用了text2sql后提问没有任何请求数据的操作
复现问题的步骤 / Steps to Reproduce
text2sql:
model_name: glm4-chat
use: true
sqlalchemy_connect_str: mysql+pymysql://user:9!12ddddaas@127.0.0.1:3306/monitor
read_only: true
top_k: 50
return_intermediate_steps: true
table_names: ["monitor_domain","monitor_domain_detail","monitor_application"]
table_comments: {"monitor_application":"这是一个应用表,存储了应用的基本信息","monitor_domain":"这是一个域名信息表"}
预期的结果 / Expected Result
描述应该出现的结果 / Describe the expected result.
应该能查询到表信息或请求数据库
实际结果 / Actual Result
描述实际发生的结果 / Describe the actual result.
INFO: 127.0.0.1:59514 - "GET /knowledge_base/list_knowledge_bases HTTP/1.1" 200 OK
2025-01-02 11:36:44,180 httpx 20636 INFO HTTP Request: GET http://127.0.0.1:7861/knowledge_base/list_knowledge_bases "HTTP/1.1 200 OK"
INFO: 127.0.0.1:59528 - "POST /knowledge_base/local_kb/samples/chat/completions HTTP/1.1" 200 OK
2025-01-02 11:36:44,412 httpx 20636 INFO HTTP Request: POST http://127.0.0.1:7861/knowledge_base/local_kb/samples/chat/completions "HTTP/1.1 200 OK"
2025-01-02 11:36:44,524 httpx 20562 INFO HTTP Request: POST http://127.0.0.1:9997/v1/embeddings "HTTP/1.1 200 OK"
2025-01-02 11:36:44,635 httpx 20562 INFO HTTP Request: POST http://127.0.0.1:9997/v1/embeddings "HTTP/1.1 200 OK"
2025-01-02 11:36:45,291 httpx 20562 INFO HTTP Request: POST http://127.0.0.1:9997/v1/embeddings "HTTP/1.1 200 OK"
/root/miniconda3/envs/chatchat/lib/python3.8/site-packages/langchain_core/vectorstores.py:342: UserWarning: No relevant docs were retrieved using the relevance score threshold 2.0
warnings.warn(
2025-01-02 11:36:45,398 httpx 20562 INFO HTTP Request: POST http://127.0.0.1:9997/v1/chat/completions "HTTP/1.1 200 OK"
环境信息 / Environment Information
附加信息 / Additional Information
添加与问题相关的任何其他信息 / Add any other information related to the issue.
The text was updated successfully, but these errors were encountered: