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

Method optimizeSQL

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

Source from the content-addressed store, hash-verified

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)
163 question = self.optimize_prompt_template.format(sql=sql, structure=db_structure, index=db_index)
164
165 sql = self.llm.generate_response(input_text=question)
166 return sql
167
168 def processSQL(self, sql: Optional[str], dbID: Optional[str] = None):
169 if str(sql).__contains__('\n'):

Callers

nothing calls this directly

Calls 2

generate_responseMethod · 0.80

Tested by

no test coverage detected