mirror of
https://github.com/open-webui/open-webui
synced 2024-11-26 22:09:51 +00:00
fix for qwen models
This commit is contained in:
parent
0de6419a29
commit
850a70ce45
@ -579,8 +579,10 @@ async def handle_nonstreaming_response(request: Request, response: Response,
|
||||
is_ollama = True
|
||||
is_openai = not is_ollama
|
||||
|
||||
log.debug(f"smonux 1: { response_dict=} ")
|
||||
|
||||
while (is_ollama and "tool_calls" in response_dict.get("message", {})) or \
|
||||
(is_openai and response_dict["choices"][0]["finish_reason"] == "tool_calls"):
|
||||
(is_openai and "tool_calls" in response_dict["choices"][0].get("message",{}) ):
|
||||
if is_ollama:
|
||||
message = response_dict.get("message", {})
|
||||
tool_calls = message.get("tool_calls", [])
|
||||
|
Loading…
Reference in New Issue
Block a user