From cf266a56f30daae8b9af7c9bc3267c61b1973192 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Fri, 7 Nov 2025 00:20:02 -0500 Subject: Update --- src/wasp-ai.el | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'src/wasp-ai.el') diff --git a/src/wasp-ai.el b/src/wasp-ai.el index 2c696c56..31ca001a 100644 --- a/src/wasp-ai.el +++ b/src/wasp-ai.el @@ -80,49 +80,6 @@ ;; (funcall k data)))) t) -(defvar-local w/ai-callback nil) -(defun w/ai-old (question k &optional systemprompt user assistant) - "Ask QUESTION to ChatGPT and pass the answer to K. -Optionally use SYSTEMPROMPT and the USER and ASSISTANT prompts." - (let ((tmpfile (make-temp-file "wasp-ai")) - (tmpfilesystem (make-temp-file "wasp-ai-system")) - (tmpfileuser (make-temp-file "wasp-ai-user")) - (tmpfileassistant (make-temp-file "wasp-ai-assistant")) - (buf (generate-new-buffer w/ai-buffer))) - (with-temp-file tmpfile (insert question)) - (when systemprompt - (with-temp-file tmpfilesystem (insert systemprompt))) - (when user - (with-temp-file tmpfileuser - (if (stringp user) - (insert (s-concat user "\n")) - (--each user - (insert (s-concat it "\n")))))) - (when assistant - (with-temp-file tmpfileassistant - (if (stringp assistant) - (insert (s-concat assistant "\n")) - (--each assistant - (insert (s-concat it "\n")))))) - (with-current-buffer buf - (setq-local w/ai-callback k) - (erase-buffer)) - (make-process - :name w/ai-process - :buffer buf - :command - (list - "chatgpt" - tmpfile - (if systemprompt tmpfilesystem "systemprompt.txt") - (if user tmpfileuser "userprompt.txt") - (if assistant tmpfileassistant "assistantprompt.txt")) - :stderr (get-buffer-create w/ai-error-buffer) - :sentinel - (lambda (_ _) - (with-current-buffer buf - (funcall w/ai-callback (s-trim (buffer-string)))))))) - (defun w/ai (question k &optional systemprompt user assistant) "Ask QUESTION to ChatGPT and pass the answer to K. Optionally use SYSTEMPROMPT and the USER and ASSISTANT prompts." -- cgit v1.2.3