tommy24 commited on
Commit
aabf908
·
1 Parent(s): 5a08733

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -218,7 +218,7 @@ def function(Textbox, Textbox2, Textbox3, Dropdown):
218
  # reply = reply.replace(" ", "%20")
219
  # image_array = download_image(f"https://api.placid.app/u/pydav4ibo?quote[text]={reply}")
220
  data["messages"].append({"role": "assistant", "content": Textbox})
221
- assistant_response = chat_with_assistant(messages, functions)
222
  if assistant_response.get("function_call"):
223
  function_name = assistant_response["function_call"]["name"]
224
  function_args = json.loads(assistant_response["function_call"]["arguments"])
@@ -234,7 +234,7 @@ def function(Textbox, Textbox2, Textbox3, Dropdown):
234
  "content": str(result)
235
  })
236
 
237
- assistant_response = chat_with_assistant(messages, functions)
238
  return {assistant_response['content']}
239
  data["messages"].append(assistant_response)
240
  except Exception as e:
 
218
  # reply = reply.replace(" ", "%20")
219
  # image_array = download_image(f"https://api.placid.app/u/pydav4ibo?quote[text]={reply}")
220
  data["messages"].append({"role": "assistant", "content": Textbox})
221
+ assistant_response = chat_with_assistant(data["messages"], functions)
222
  if assistant_response.get("function_call"):
223
  function_name = assistant_response["function_call"]["name"]
224
  function_args = json.loads(assistant_response["function_call"]["arguments"])
 
234
  "content": str(result)
235
  })
236
 
237
+ assistant_response = chat_with_assistant(data["messages"], functions)
238
  return {assistant_response['content']}
239
  data["messages"].append(assistant_response)
240
  except Exception as e: