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

Improve table name validation in InfoSQLDatabaseTool #308

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

joehaddad2000
Copy link
Contributor

  • Added logic to handle table names with schema prefixes.
  • Introduced available_names_tables_only to store table names without schema prefixes.
  • Updated validation to check against both full table names and names without schema prefixes.

@joehaddad2000
Copy link
Contributor Author

Fix for bug where follow-up questions were causing the LLM to fail in finding tables. The issue stemmed from inconsistent table naming conventions ("public.table" vs "table"). The LLM was unable to locate "public.table" when queried about "table".

- Extract table name validation logic to _validate_table_names method
- Improve handling of table names with and without schema prefixes
- Simplify _run method by using the new validation function
- Use set for valid tables to avoid duplicates
Copy link
Collaborator

@anthony2261 anthony2261 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@anthony2261 anthony2261 merged commit ae27d79 into RamiAwar:main Aug 28, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants