branch: elpa/gptel commit 0cdc06c0940fc7f059342450578d8c20fbad6e65 Author: Karthik Chikmagalur <karthikchikmaga...@gmail.com> Commit: Karthik Chikmagalur <karthikchikmaga...@gmail.com>
gptel-gemini: Construct request data without backquotes * gptel-gemini.el (gptel--request-data): Creating a backquoted construct to hold the payload is causing issues with self-evaluating forms (#941). See (info "(elisp) Self-Evaluating Forms") Construct the payload plist explicitly instead. --- gptel-gemini.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gptel-gemini.el b/gptel-gemini.el index f29e32324b..54aada753d 100644 --- a/gptel-gemini.el +++ b/gptel-gemini.el @@ -114,15 +114,15 @@ list." (cl-defmethod gptel--request-data ((backend gptel-gemini) prompts) "JSON encode PROMPTS for sending to Gemini." (let ((prompts-plist - `(:contents [,@prompts] - :safetySettings [(:category "HARM_CATEGORY_HARASSMENT" - :threshold "BLOCK_NONE") - (:category "HARM_CATEGORY_SEXUALLY_EXPLICIT" - :threshold "BLOCK_NONE") - (:category "HARM_CATEGORY_DANGEROUS_CONTENT" - :threshold "BLOCK_NONE") - (:category "HARM_CATEGORY_HATE_SPEECH" - :threshold "BLOCK_NONE")])) + (list :contents (vconcat prompts) + :safetySettings [(:category "HARM_CATEGORY_HARASSMENT" + :threshold "BLOCK_NONE") + (:category "HARM_CATEGORY_SEXUALLY_EXPLICIT" + :threshold "BLOCK_NONE") + (:category "HARM_CATEGORY_DANGEROUS_CONTENT" + :threshold "BLOCK_NONE") + (:category "HARM_CATEGORY_HATE_SPEECH" + :threshold "BLOCK_NONE")])) params) (if gptel--system-message (plist-put prompts-plist :system_instruction