branch: elpa/gptel commit 5f72e98cfa1edd10bd8d06d7ada41869bafce014 Author: Karthik Chikmagalur <karthikchikmaga...@gmail.com> Commit: Karthik Chikmagalur <karthikchikmaga...@gmail.com>
gptel-anthropic: Encode object args in tools correctly * gptel-anthropic.el (gptel--parse-tools): Ensure that the `:required' property of object-type tool arguments is included in the tool as sent to Claude. --- gptel-anthropic.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gptel-anthropic.el b/gptel-anthropic.el index 7408a1fe15..50842e8c06 100644 --- a/gptel-anthropic.el +++ b/gptel-anthropic.el @@ -223,7 +223,9 @@ TOOLS is a list of `gptel-tool' structs, which see." ,@(if enum (list :enum (vconcat enum))) ,@(cond ((equal type "object") - (list :properties (plist-get arg :properties))) + (list + :properties (plist-get arg :properties) + :required (or (plist-get arg :required) []))) ((equal type "array") (list :items (plist-get arg :items))))))) :required