MCPcopy Create free account
hub / github.com/CL-lau/SQL-GPT / SQL_ERROR_CHECK

Method SQL_ERROR_CHECK

gpt/llm.py:151–159  ·  view source on GitHub ↗
(self, sql: Optional[str], error: Optional[str], need_operate: Optional[bool] = False, only_sql: Optional[bool] = True, dbID: Optional[str] = None)

Source from the content-addressed store, hash-verified

149 return sql
150
151 def SQL_ERROR_CHECK(self, sql: Optional[str], error: Optional[str], need_operate: Optional[bool] = False, only_sql: Optional[bool] = True, dbID: Optional[str] = None):
152 question = self.error_prompt_template.format(sql=sql, error=error, structure="")
153
154 sql = self.llm.generate_response(input_text=question)
155
156 if need_operate:
157 result = self.sqlHelper.operate(sql)
158 return sql, result
159 return sql
160
161 def optimizeSQL(self, sql: Optional[str], only_sql: Optional[bool] = True, dbID: Optional[str] = None):
162 db_structure, db_index = self.SQL_operator.get_db_structure_and_index(sql)

Callers

nothing calls this directly

Calls 2

generate_responseMethod · 0.80
operateMethod · 0.80

Tested by

no test coverage detected