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

Function optimize_sql_query

front/front.py:38–45  ·  view source on GitHub ↗
(sql_query, database_structure)

Source from the content-addressed store, hash-verified

36
37
38def optimize_sql_query(sql_query, database_structure):
39 prompt = f"Optimize the following SQL query:\n\n{sql_query}\n\nusing the database structure:\n\n{database_structure}"
40 response = openai.Completion.create(
41 engine="davinci",
42 prompt=prompt,
43 max_tokens=100
44 )
45 return response.choices[0].text.strip()
46
47
48if __name__ == '__main__':

Callers 1

indexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected