Merge pull request #10555 from pwnless/dev

fix: ollama backend native tool calling
This commit is contained in:
Timothy Jaeryang Baek 2025-02-21 21:09:51 -08:00 committed by GitHub
commit 8fb6b03ddc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -124,7 +124,7 @@ def convert_messages_openai_to_ollama(messages: list[dict]) -> list[dict]:
tool_call_id = message.get("tool_call_id", None)
# 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
new_message["content"] = content