branch: elpa/gptel
commit c530f8a6ac4f76ecda3f71294dee9b8d503246c1
Author: Psionic K <73710933+psioni...@users.noreply.github.com>
Commit: GitHub <nore...@github.com>

    gptel-openai: Encode object args in tools correctly (#600)
    
    gptel.el (gptel--parse-tools): Ensure that the
---
 gptel.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gptel.el b/gptel.el
index d6c8801ce6..c95bd85dcf 100644
--- a/gptel.el
+++ b/gptel.el
@@ -1575,8 +1575,10 @@ implementation, used by OpenAI-compatible APIs and 
Ollama."
                              ,@(if enum (list :enum (vconcat enum)))
                              ,@(cond
                                 ((equal type "object")
-                                 (list :parameters (plist-get arg :parameters)
-                                  :additionalProperties :json-false))
+                                 (list :properties (plist-get arg :properties)
+                                       :required (or (plist-get arg :required)
+                                                     (vector))
+                                       :additionalProperties :json-false))
                                 ((equal type "array")
                                  ;; TODO(tool) If the item type is an object,
                                  ;; add :additionalProperties to it

Reply via email to