richardr1126 commited on
Commit
8a36c39
1 Parent(s): 2554574

Another prompt try

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -130,7 +130,13 @@ def extract_db_code(text):
130
  return [match.strip() for match in matches]
131
 
132
  def generate_dummy_db(db_info, question):
133
- pre_prompt = "Generate a SQLite database with dummy data for this database from the DB Layout."
 
 
 
 
 
 
134
  prompt = pre_prompt + "\n\nDB Layout:" + db_info + "\n\nQuestion: " + question
135
 
136
  while True:
@@ -138,7 +144,6 @@ def generate_dummy_db(db_info, question):
138
  response = openai.ChatCompletion.create(
139
  model="gpt-3.5-turbo",
140
  messages=[
141
- {"role": "system", "content": "You are a SQLite dummy database generator. For each input do the following:\n1. Breakdown the Question into small pieces and analyze what it is asking for. \n2. Create the specified dummy database using the same exact table and column names used from the DB Layout.\n3. Insert dummy data relevant to the Question.\n4. Output the datbase code in a code block."},
142
  {"role": "user", "content": prompt}
143
  ],
144
  #temperature=0.7,
 
130
  return [match.strip() for match in matches]
131
 
132
  def generate_dummy_db(db_info, question):
133
+ pre_prompt = """
134
+ Generate a SQLite database with dummy data for this database from the DB Layout. Your task is to generate just a database, no queries. For each input do the following:
135
+ 1. Breakdown the Question into small pieces and explain what the question is asking for.
136
+ 2. Write code to create the specified dummy database using the same exact table and column names used from the DB Layout.
137
+ 3. Write code to insert dummy data relevant to the Question.
138
+ 4. Output the datbase code in a single code block. Don't write any queries or SELECT statements in the code.
139
+ """
140
  prompt = pre_prompt + "\n\nDB Layout:" + db_info + "\n\nQuestion: " + question
141
 
142
  while True:
 
144
  response = openai.ChatCompletion.create(
145
  model="gpt-3.5-turbo",
146
  messages=[
 
147
  {"role": "user", "content": prompt}
148
  ],
149
  #temperature=0.7,