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

Function generate_sql_query

front/front.py:28–35  ·  view source on GitHub ↗
(description)

Source from the content-addressed store, hash-verified

26
27
28def generate_sql_query(description):
29 prompt = f"Generate a SQL query to {description}."
30 response = openai.Completion.create(
31 engine="davinci-codex",
32 prompt=prompt,
33 max_tokens=100
34 )
35 return response.choices[0].text.strip()
36
37
38def optimize_sql_query(sql_query, database_structure):

Callers 1

indexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected