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

LLM generated correct code but execution returned unexpected error message #338

Open
xiaohanwu001 opened this issue Jan 23, 2025 · 0 comments

Comments

@xiaohanwu001
Copy link

xiaohanwu001 commented Jan 23, 2025

I'm doing text to sql and this is the tool I defined:

Image

I initialized an agent with qwen2.5 and ran a simple query
agent = CodeAgent( tools=[db_query_tool], model=HfApiModel("Qwen/Qwen2.5-Coder-32B-Instruct"), ) agent.run("how many albums are in the Album table?")

The agent generated the correct code, but the execution of the code returned an error message:
Image

I mean if we just take the code out and run it, it is supposed to execute without error and print out 347.
Because album_count is [(347,)], album_count[0] is (347,), and running album_count[0] should not give any error.
So why is the code not able to be executed by the agent?

@xiaohanwu001 xiaohanwu001 changed the title LLM struggling to deal with text-to-sql outputs LLM generated correct code but execution returned unexpected error message Jan 23, 2025
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

1 participant