mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 11:57:51 +01:00
Update misc.py
Include empty delta object on openai_chat_chunk_message_template per OpenAI API documentation. https://platform.openai.com/docs/api-reference/chat/streaming#chat/streaming
This commit is contained in:
@@ -149,6 +149,7 @@ def openai_chat_chunk_message_template(
|
|||||||
template["choices"][0]["delta"] = {"content": message}
|
template["choices"][0]["delta"] = {"content": message}
|
||||||
else:
|
else:
|
||||||
template["choices"][0]["finish_reason"] = "stop"
|
template["choices"][0]["finish_reason"] = "stop"
|
||||||
|
template["choices"][0]["delta"] = {}
|
||||||
|
|
||||||
if usage:
|
if usage:
|
||||||
template["usage"] = usage
|
template["usage"] = usage
|
||||||
|
|||||||
Reference in New Issue
Block a user