From 8298e7810af12c8b911cabb217ccc5b0174ed578 Mon Sep 17 00:00:00 2001 From: Timor Morrien Date: Mon, 8 Jan 2024 14:05:47 +0100 Subject: [PATCH] Add if check to problematic place --- app/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/config.py b/app/config.py index 24c2b8ec..ec653b0c 100644 --- a/app/config.py +++ b/app/config.py @@ -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