From 5fe062ba4bdcd1cefc4fa28f8d5f76ebd368b296 Mon Sep 17 00:00:00 2001 From: Psionik K <73710933+psionic-k@users.noreply.github.com> Date: Sat, 15 Feb 2025 10:27:11 +0900 Subject: [PATCH] drive-by kagi string trimming update This was an opportunistic update, but it seems this model is obviously out of use and will be abandoned soon * gptel-kagi.el: --- gptel-kagi.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/gptel-kagi.el b/gptel-kagi.el index 2f5c1632..c86b8586 100644 --- a/gptel-kagi.el +++ b/gptel-kagi.el @@ -98,13 +98,10 @@ (user-error "No user prompt found!") (let ((prompts (if (or gptel-mode gptel-track-response) - (string-trim - (buffer-substring-no-properties (prop-match-beginning prop) - (prop-match-end prop)) - (format "[\t\r\n ]*\\(?:%s\\)?[\t\r\n ]*" - (regexp-quote (gptel-prompt-prefix-string))) - (format "[\t\r\n ]*\\(?:%s\\)?[\t\r\n ]*" - (regexp-quote (gptel-response-prefix-string)))) + (or (gptel--trim-prefixes + (buffer-substring-no-properties (prop-match-beginning prop) + (prop-match-end prop))) + "") (string-trim (buffer-substring-no-properties (point-min) (point-max)))))) (pcase-exhaustive (gptel--model-name gptel-model) ("fastgpt" (setq prompts (list :query (if (prop-match-p prop) prompts ""))))