Skip to content

Commit d9ac1bf

Browse files
committed
fix bug in sql rec mode
1 parent c7ae48c commit d9ac1bf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

py-src/data_formulator/agents/agent_sql_data_rec.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,10 @@ def process_gpt_response(self, input_tables, messages, response):
209209

210210

211211
def run(self, input_tables, description, n=1):
212-
213-
data_summary = get_sql_table_statistics_str(self.conn, input_tables)
212+
data_summary = ""
213+
for table in input_tables:
214+
table_summary_str = get_sql_table_statistics_str(self.conn, table['name'])
215+
data_summary += f"[TABLE {table['name']}]\n\n{table_summary_str}\n\n"
214216

215217
user_query = f"[CONTEXT]\n\n{data_summary}\n\n[GOAL]\n\n{description}\n\n[OUTPUT]\n"
216218

py-src/data_formulator/app.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ def hello():
169169
}
170170
return json.dumps(spec)
171171

172-
173172
@app.route('/api/hello-stream')
174173
def streamed_response():
175174
def generate():

0 commit comments

Comments
 (0)