fix: render agent_description in SQL prompt template#1876
Open
Br1an67 wants to merge 1 commit into
Open
Conversation
The SQL code generation template never rendered the agent_description stored in memory, even though it was set during Agent initialization. The Python template includes this description but the SQL template did not, making the agent_description parameter a no-op for SQL mode. Add agent_description rendering at the top of generate_python_code_with_sql.tmpl, consistent with the Python template. Closes sinaptik-ai#1853
Contributor
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to bfda9db in 7 seconds. Click for details.
- Reviewed
72lines of code in2files - Skipped
0files when reviewing. - Skipped posting
0draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
Workflow ID: wflow_KPudFeNbCAj0U7DJ
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The SQL code generation template never rendered the
agent_descriptionstored in memory, making thedescriptionparameter passed toAgent()a no-op when using SQL mode. The Python template includes this description at the top, but the SQL template did not.Changes
Added
agent_descriptionrendering at the top ofgenerate_python_code_with_sql.tmpl, consistent with the Python template.Files changed:
pandasai/core/prompts/templates/generate_python_code_with_sql.tmpl— added agent_description blocktests/unit_tests/core/prompts/test_generate_python_code_with_sql_prompt.py— added tests for description renderingImportant
Fixes bug by rendering
agent_descriptionin SQL prompts, ensuringdescriptionparameter is effective.agent_descriptionwas not rendered in SQL prompts, makingdescriptionparameter ineffective.agent_descriptionrendering togenerate_python_code_with_sql.tmpl.test_template_renders_agent_descriptionintest_generate_python_code_with_sql_prompt.pyto verify description rendering.test_template_no_description_when_noneto ensure no rendering whenagent_descriptionisNone.This description was created by
for bfda9db. You can customize this summary. It will automatically update as commits are pushed.