瀏覽代碼

Merge pull request #10555 from pwnless/dev

fix: ollama backend native tool calling
Timothy Jaeryang Baek 2 月之前
父節點
當前提交
8fb6b03ddc
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      backend/open_webui/utils/payload.py

+ 1 - 1
backend/open_webui/utils/payload.py

@@ -124,7 +124,7 @@ def convert_messages_openai_to_ollama(messages: list[dict]) -> list[dict]:
         tool_call_id = message.get("tool_call_id", None)
         tool_call_id = message.get("tool_call_id", None)
 
 
         # Check if the content is a string (just a simple message)
         # Check if the content is a string (just a simple message)
-        if isinstance(content, str):
+        if isinstance(content, str) and not tool_calls:
             # If the content is a string, it's pure text
             # If the content is a string, it's pure text
             new_message["content"] = content
             new_message["content"] = content