aslan-ng commited on
Commit
970251d
·
verified ·
1 Parent(s): e1e2259

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -740,7 +740,7 @@ agent = smolagents.CodeAgent(
740
  verbosity_level=2, # show steps in logs for class demo
741
  )
742
 
743
- chat = gr.Chatbot(height=420, type="messages") # make it explicit it's messages-format
744
 
745
  def respond(message, history):
746
  try:
@@ -751,11 +751,9 @@ def respond(message, history):
751
  if history is None:
752
  history = []
753
 
754
- # history is now a list of {"role": ..., "content": ...} dicts
755
- history = history + [
756
- {"role": "user", "content": message},
757
- {"role": "assistant", "content": out},
758
- ]
759
  return "", history
760
 
761
  with gr.Blocks(theme=gr.themes.Ocean()) as demo:
 
740
  verbosity_level=2, # show steps in logs for class demo
741
  )
742
 
743
+ chat = gr.Chatbot(height=420)
744
 
745
  def respond(message, history):
746
  try:
 
751
  if history is None:
752
  history = []
753
 
754
+ # MUST be list of lists, NOT tuples
755
+ history = history + [[message, out]]
756
+
 
 
757
  return "", history
758
 
759
  with gr.Blocks(theme=gr.themes.Ocean()) as demo: