Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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:
|