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

qwen2 agent 数据库对话功能报错,请问怎么解决? #5143

Open
Alan-zhong opened this issue Dec 18, 2024 · 4 comments
Open

qwen2 agent 数据库对话功能报错,请问怎么解决? #5143

Alan-zhong opened this issue Dec 18, 2024 · 4 comments

Comments

@Alan-zhong
Copy link

image

Copy link

dosubot bot commented Dec 18, 2024

The ProgrammingError you're encountering suggests there might be an issue with the SQL syntax or compatibility with the MySQL server version. Here are a few steps you can take to resolve this:

  1. Check SQL Syntax: Ensure that the SQL query syntax is correct. The query SELECT email FROM users WHERE name = 'alice' seems straightforward, but verify that there are no hidden characters or formatting issues.

  2. MySQL Compatibility: Make sure that the SQL query is compatible with the version of MySQL you are using. Some SQL functions or syntax might differ between MySQL versions.

  3. Error Handling: The qwen2 agent might not have specific error handling for ProgrammingError related to SQL syntax. You might need to add custom error handling to catch and log these errors for further analysis.

  4. Database Configuration: Double-check the database configuration settings in the text2sql configuration to ensure they are correctly set up for your MySQL version [1].

If the issue persists, consider testing the query directly in a MySQL client to see if it executes without errors, which can help isolate whether the problem is with the query itself or the way it's being executed by the qwen2 agent.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@Alan-zhong
Copy link
Author

image
这是对应mysql数据库

@948024326
Copy link

建议自己改源码手动写工具debug试试

@zhgyuhuii
Copy link

进入你的环境 修改.conda\envs\chat\Lib\site-packages\langchain_experimental\sql\下的base.py文件
intermediate_steps.append({"sql_cmd": sql_cmd}) # input: sql exec if SQL_QUERY in sql_cmd: sql_cmd = sql_cmd.split(SQL_QUERY)[1].strip() if SQL_RESULT in sql_cmd: sql_cmd = sql_cmd.split(SQL_RESULT)[0].strip() if "sql" in sql_cmd: sql_cmd = sql_cmd.split("sql")[-1].strip().replace("```","")

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

No branches or pull requests

3 participants