You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a LLMBasedSQLTemplateMatcher class that takes in a user query text and provides top_k matching templates by substituting the entities.
classLLMBasedSQLTemplateMatcher(SQLTemplateMatcher):
""" LLMBasedSQLTemplateMatcher uses LLM to find the best matching template. Given a query, it will extract the key entities and use LLM to find best SQL template and generates a subsituted SQL query. Args: templates: A list of SQL templates. ddl_schema: The DDL schema for available tables. similarity_threshold: The similarity threshold to be used for fuzzy matching. """def__init__(self, templates: List[SQLTemplate],
ddl_schema: Optional[str] =None,
similarity_threshold: float=0.4,
debug: bool=False) ->None:
super().__init__(debug=debug)
self.templates=templatesself.ddl_schema=ddl_schemaself.similarity_threshold=similarity_thresholddefmatch(self, query: str, top_k=1, **kwargs) ->List[str]:
pass
The text was updated successfully, but these errors were encountered:
Description
Implement a
LLMBasedSQLTemplateMatcher
class that takes in a user query text and providestop_k
matching templates by substituting the entities.The text was updated successfully, but these errors were encountered: