Replies: 5 comments 5 replies
-
Initial discussion at: |
Beta Was this translation helpful? Give feedback.
-
Possible use case:
For LLM-based matcher, we can provide in-context (all-shot prompting?) list of templates (query+sql) and let the LLM give us scored output which we can use. UsagePossible usage could be from larch import SQLTemplate
from larch.search import FuzzySQLTemplateMatcher
templates = [
SQLTemplate(
query="What is the capital of Nepal?",
sql="select * from country c where c.country=="Nepal";
]
matcher = FuzzySQLTemplateMatcher(templates=templates, ...)
query = "Capital of Nepal"
matched_templates = matcher(query=query, ...) |
Beta Was this translation helpful? Give feedback.
-
cc: @connectwithprakash @anisbhsl
I think we can have We can use And once the matching is done for top_k, just return a list of this matched template which user will decide how to use. |
Beta Was this translation helpful? Give feedback.
-
This is good. Can someone quickly use this for in-context NLP -> SQL generation? I was thinking, roughly:
|
Beta Was this translation helpful? Give feedback.
-
@anisbhsl @NISH1001 But whenever we have multiple entity to extract it does not work. The problem as follows: Query = Regex will give us We need to know beforehand that the extracted text are for which variable i.e. |
Beta Was this translation helpful? Give feedback.
-
We want to discuss about possible feature addition to
larch
that will help in figuring out "correct" SQL template based on the input user query. Why you'd ask? Because -- although larch haslarch.search.SQLAgentSearchEngine
-- the SQL agent has so much tendency to hallucinate and give incorrect SQL query, and we want to ground the SQL query generation part to be highly precise.Beta Was this translation helpful? Give feedback.
All reactions