-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
Current implementation uses SQL agent to generate SQL statement when provided with user query. This is inconsistent and it is difficult to railguard the response. To prevent this, create a SQLTemplateMatcher as base class which will have following base classes
FuzzySQLTemplateMatcher: Rule based query to SQL statementLLMBasedSQLTemplateMatcher: LLM based query to SQL template matcher with entity extraction
Refer to this boilerplate for base class:
class SQLTemplateMatcher:
def __init__(self, ...):
...
def add_query_template(self, query, sql_statement):
...
def match(self, query) -> list:
return top k matched sql statements along with entity substition (or we can do subsition in another step)The constructor could take: table schema, sql templates
Deliverables
- Base Matcher Class
- LLM Based SQL Template Matcher
- Fuzzy SQL Template Matcher
### Tasks
- [ ] https://github.com/NASA-IMPACT/larch/issues/3
- [ ] https://github.com/NASA-IMPACT/larch/issues/4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels