Merge pull request #19369 from Lucky-Lodhi2004/fix-tool-call-ollama

Fix #19357 - [Bug]: Tool call fails when using Ollama backend
This commit is contained in:
Sameer Kankute 2026-01-20 08:01:34 +05:30 committed by GitHub
commit d319517963
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -1071,9 +1071,9 @@ def _extract_reasoning_content(message: dict) -> Tuple[Optional[str], Optional[s
"""
message_content = message.get("content")
if "reasoning_content" in message:
return message["reasoning_content"], message["content"]
return message["reasoning_content"], message_content
elif "reasoning" in message:
return message["reasoning"], message["content"]
return message["reasoning"], message_content
elif isinstance(message_content, str):
return _parse_content_for_reasoning(message_content)
return None, message_content

View file

@ -7255,4 +7255,4 @@ def __getattr__(name: str) -> Any:
global _encoding_cache
_encoding_cache = _encoding
return _encoding
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")