diff --git a/backend/api/sources/openai_web.py b/backend/api/sources/openai_web.py index d221f168..2ec61fae 100644 --- a/backend/api/sources/openai_web.py +++ b/backend/api/sources/openai_web.py @@ -408,7 +408,10 @@ async def complete(self, model: OpenaiWebChatModels, text_content: str, use_team if "[DONE]" in line: break try: - data = json.loads(line) + if not isinstance(line, dict): + data = json.loads(line) + else: + data = line if not _check_fields(data): if "error" in data: logger.warning(f"error in message stream: {line}")