teaevo commited on
Commit
d266202
·
1 Parent(s): bbb2bb6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -119,13 +119,18 @@ def sqlquery(input):
119
 
120
  conversation_history.append((input, sql_response))
121
 
 
 
 
 
 
122
  html = "<div class='chatbot'>"
123
  for user_msg, resp_msg in conversation_history:
124
  html += f"<div class='user_msg'>{user_msg}</div>"
125
  html += f"<div class='resp_msg'>{resp_msg}</div>"
126
  html += "</div>"
127
  return html
128
-
129
  #return sql_response
130
 
131
 
@@ -168,5 +173,5 @@ combine_interface = gr.TabbedInterface(
168
  )
169
 
170
  if __name__ == '__main__':
171
- #combine_interface.launch()
172
- iface.launch(debug=True)
 
119
 
120
  conversation_history.append((input, sql_response))
121
 
122
+ # Build conversation string
123
+ conversation = "\n".join([f"User: {user_msg}\nBot: {resp_msg}" for user_msg, resp_msg in conversation_history])
124
+ return conversation
125
+
126
+ '''
127
  html = "<div class='chatbot'>"
128
  for user_msg, resp_msg in conversation_history:
129
  html += f"<div class='user_msg'>{user_msg}</div>"
130
  html += f"<div class='resp_msg'>{resp_msg}</div>"
131
  html += "</div>"
132
  return html
133
+ '''
134
  #return sql_response
135
 
136
 
 
173
  )
174
 
175
  if __name__ == '__main__':
176
+ combine_interface.launch()
177
+ #iface.launch(debug=True)