"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "47a05a47b4dc813b0b0357660e19ed56cbab454f"
Commit f8ba0334 authored by Michael Poluektov's avatar Michael Poluektov
Browse files

fix: non streaming functions

parent a75a9c95
......@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment