Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

数据库对话 sql server连接特别慢,而且生成sql是正确 生成sql 加入返回数量只会在后面加limit 50 不支持sql server语法。 #5107

Open
sy960923 opened this issue Nov 26, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@sy960923
Copy link

希望能提供支持sql server数据库和es引擎的数据库查询方法

@sy960923 sy960923 added the enhancement New feature or request label Nov 26, 2024
@CRIOWN
Copy link

CRIOWN commented Nov 27, 2024

改默认提示词 text2sql.py 默认是 You are a MySQL expert

@sy960923
Copy link
Author

改默认提示词 text2sql.py 默认是 You are a MySQL expert

db = SQLDatabase.from_uri(sqlalchemy_connect_str) 这一行代码连接sql server 数据库特别慢,是什么原因呢?     

sqlalchemy_connect_str=f'mssql+pyodbc://{username}:{password}@{server}/{database}?driver={driver}'
提示词也改成这个
image
还是不行的

@CRIOWN
Copy link

CRIOWN commented Nov 29, 2024

连接慢不太清楚 可以单独测试一下这个连接
可以开详细日志模式 看一下哪里出的问题
有可能出问题的地方太多了
语句是执行报错 还是没到执行这一步
模型支不支持agent和工具调用

@Alan-zhong
Copy link

image
请问我这怎么解决呀,生成的sql后面会多一些错误语句

@CRIOWN
Copy link

CRIOWN commented Dec 25, 2024

最简单的办法就是通过提示词规范它 给它一个完整的示例

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants