mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
fix: non streaming functions
This commit is contained in:
parent
a75a9c953a
commit
f8ba0334e8
1 changed files with 3 additions and 2 deletions
|
|
@ -97,18 +97,19 @@ def openai_chat_message_template(model: str):
|
|||
}
|
||||
|
||||
|
||||
def openai_chat_chunk_message_template(model: str, message: str):
|
||||
def openai_chat_chunk_message_template(model: str, message: str) -> dict:
|
||||
template = openai_chat_message_template(model)
|
||||
template["object"] = "chat.completion.chunk"
|
||||
template["choices"][0]["delta"] = {"content": message}
|
||||
return template
|
||||
|
||||
|
||||
def openai_chat_completion_message_template(model: str, message: str):
|
||||
def openai_chat_completion_message_template(model: str, message: str) -> dict:
|
||||
template = openai_chat_message_template(model)
|
||||
template["object"] = "chat.completion"
|
||||
template["choices"][0]["message"] = {"content": message, "role": "assistant"}
|
||||
template["choices"][0]["finish_reason"] = "stop"
|
||||
return template
|
||||
|
||||
|
||||
def get_gravatar_url(email):
|
||||
|
|
|
|||
Loading…
Reference in a new issue