diff --git a/backend/apps/webui/main.py b/backend/apps/webui/main.py index 28b1b4aac..b23ac782b 100644 --- a/backend/apps/webui/main.py +++ b/backend/apps/webui/main.py @@ -259,6 +259,9 @@ async def generate_function_chat_completion(form_data, user): if isinstance(line, BaseModel): line = line.model_dump_json() line = f"data: {line}" + if isinstance(line, dict): + line = f"data: {json.dumps(line)}" + try: line = line.decode("utf-8") except: