branch: externals/llm
commit f2739a8d0a64505efe31e4e5872ebe9efd1779e2
Author: Andrew Hyatt <[email protected]>
Commit: GitHub <[email protected]>

    Fix for tool use in Ollama (#217)
    
    I think Ollama may have pushed out a breaking change in how tool calls
    were returned. This fixes Ollama tool calling.
---
 NEWS.org      | 2 ++
 llm-ollama.el | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/NEWS.org b/NEWS.org
index 1e89e48aaf..91c98a582d 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,3 +1,5 @@
+* Version 0.27.4
+- Fix bug (or perhaps breaking change) in Ollama tool use.
 * Version 0.27.3
 - Add reasoning output for Gemini.
 - Add Claude 4.5 Sonnet and Haiku to support models, fix model matching for 
other Claude models.
diff --git a/llm-ollama.el b/llm-ollama.el
index 9047f264b3..9725bd2fd4 100644
--- a/llm-ollama.el
+++ b/llm-ollama.el
@@ -218,7 +218,7 @@ These are just the text inside the tag, not the tag 
itself."))
 
 (cl-defmethod llm-provider-extract-tool-uses ((_ llm-ollama) response)
   (mapcar (lambda (call)
-            (let ((function (cdar call)))
+            (let ((function (cdadr call)))
               (make-llm-provider-utils-tool-use
                :name (assoc-default 'name function)
                :args (assoc-default 'arguments function))))

Reply via email to