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

how to train data once there is some errors #299

Closed
njalan opened this issue Mar 21, 2024 · 8 comments · Fixed by #319
Closed

how to train data once there is some errors #299

njalan opened this issue Mar 21, 2024 · 8 comments · Fixed by #319
Assignees

Comments

@njalan
Copy link

njalan commented Mar 21, 2024

Can we have a chance to set answer is wrong for training data once there are some errors in the answer.

@zainhoda zainhoda self-assigned this Mar 21, 2024
@zainhoda
Copy link
Contributor

Yes, we should add manual and automated (LLM-based) error correction

@andreped
Copy link
Contributor

andreped commented Mar 21, 2024

Yes, we should add manual and automated (LLM-based) error correction

I think simply passing the error message that is produced when attempting to extract the records to the LLM for a second iteration is a simple solution that should work (together with the rest of the context, current user question and previous sql query as well, of course).

This can be done several times, if of interest, to iteratively converge to the right SQL query. The number of retries could be a parameter that is set through the config.

@zainhoda I can make a PR for this, if the solution sounds sufficient :]

@zainhoda
Copy link
Contributor

Thanks for the offer @andreped! I actually have both of these (manual and automated correction) mostly completed in a local branch and it works quite well. I'm just adding a bunch of options to the built-in UI and I'll include it in the next release

@andreped
Copy link
Contributor

Thanks for the offer @andreped! I actually have both of these (manual and automated correction) mostly completed in a local branch and it works quite well. I'm just adding a bunch of options to the built-in UI and I'll include it in the next release

Beat me to it then 😅 That's great! Looking forward to testing it with the upcoming release!

@njalan
Copy link
Author

njalan commented Mar 22, 2024

@zainhoda @andreped Thanks your help. May I know when will be the next release?

@andreped
Copy link
Contributor

@zainhoda Are you able to make this release today? We wanted this feature included before upgrading our Vanna version :]

@zainhoda zainhoda linked a pull request Mar 27, 2024 that will close this issue
@andreped
Copy link
Contributor

@zainhoda Where do we allow generate_sql to retry if it fails by passing the error message?

I fail to see where in the code this logic happens. I saw the PR mentioned above and I can see that there is some retry logic for the VannaFlaskApp, but how does this affect me when I am just using Vanna as a library?

I am using vanna==0.3.4 and Azure OpenAI and Chroma clients.

@zainhoda
Copy link
Contributor

@andreped you’re right — right now it’s in the flask app only. Do you have a proposal for where and how this would fit in the base package?

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

Successfully merging a pull request may close this issue.

3 participants