rknl commited on
Commit
4f0412e
·
verified ·
1 Parent(s): d721842

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -146,7 +146,12 @@ def reveal_coupon(query, grag_response):
146
  coupon = get_coupon(query, grag_response)
147
  return coupon
148
 
 
149
 
 
 
 
 
150
 
151
  with gr.Blocks() as demo:
152
  gr.Markdown("# Comfy Virtual Assistant")
@@ -165,7 +170,9 @@ with gr.Blocks() as demo:
165
 
166
  def respond(message, chat_history):
167
  bot_message = query_tqa(message, 2)
168
- chat_history.append((message, bot_message))
 
 
169
  time.sleep(1)
170
  return "", chat_history
171
 
 
146
  coupon = get_coupon(query, grag_response)
147
  return coupon
148
 
149
+ # from gradio import ChatMessage
150
 
151
+ # def chat_function(message, history):
152
+ # history.append(ChatMessage(role="user", content=message))
153
+ # history.append(ChatMessage(role="assistant", content="Hello, how can I help you?"))
154
+ # return history
155
 
156
  with gr.Blocks() as demo:
157
  gr.Markdown("# Comfy Virtual Assistant")
 
170
 
171
  def respond(message, chat_history):
172
  bot_message = query_tqa(message, 2)
173
+ # chat_history.append((message, bot_message))
174
+ chat_history.append(ChatMessage(role="user", content=message))
175
+ chat_history.append(ChatMessage(role="assistant", content=bot_message))
176
  time.sleep(1)
177
  return "", chat_history
178