Skip to content

Commit

Permalink
Add if check to problematic place
Browse files Browse the repository at this point in the history
  • Loading branch information
Hialus committed Jan 8, 2024
1 parent 5a5c3e0 commit 8298e78
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ def new_add_text_to_chat_mode(chat_mode):
else:
print("new_add_text_to_chat_mode", chat_mode.items())
for c in chat_mode["choices"]:
c["text"] = c["message"]["content"]
if "message" in c and "content" in c["message"]:
c["text"] = c["message"]["content"]
else:
c["text"] = ""
return chat_mode


Expand Down

0 comments on commit 8298e78

Please sign in to comment.