This commit is contained in:
Timothy J. Baek 2024-06-30 22:28:43 -07:00
parent c52e16a844
commit 7955c9ba3b

View File

@ -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: