"This operator generates variations of SQL based on existing SQLs, including data replacement, function transformation, and difficulty transformation, to generate more diverse SQLs.\n\n"
"Input parameters:\n"
"- input_sql_key: The name of the SQL column\n"
"- input_db_id_key: The name of the database ID column\n\n"
)
else:
return"SQL variation generator for Text2SQL tasks."
defparse_response(self,response):
ifnotresponse:
return""
pattern=r"```sql\s*(.*?)\s*```"
sql_blocks=re.findall(pattern,response,re.DOTALL)
ifsql_blocks:
last_sql=sql_blocks[-1].strip()
returnlast_sql
else:
self.logger.warning("No SQL code block found in the response")
"This operator generates prompts for Text2SQL tasks by extracting schema information from databases and combining it with natural language questions. The prompt template can be customized.\n\n"
"Input parameters:\n"
"- input_question_key: The name of the question column\n"
"- input_db_id_key: The name of the database ID column\n"
"- output_prompt_key: The name of the output prompt column\n\n"