refactor: Reorganize package configurations and fix bindings

This commit is contained in:
User
2026-06-30 22:10:17 +08:00
parent 8328d2a8ff
commit 97d0a4a3e4
4 changed files with 24 additions and 20 deletions

View File

@@ -35,7 +35,7 @@
:stream t
:models '(kimi-for-coding)
:header (lambda (_)
(when-let ((key (gptel--get-api-key)))
(when-let* ((key (gptel--get-api-key)))
`(("User-Agent" . "RooCode/3.30.3")
("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline")
("X-Title" . "Roo Code")
@@ -53,7 +53,8 @@
(string-trim clean)))
(defun my-gptel-save-session ()
"Save current gptel session to ~/gptel/sessions/ with AI-generated filename.
"Save current gptel session to ~/gptel/sessions/ with AI-generated
filename.
The filename is prefixed with a YYYYMMDD-HHmmss timestamp and generated
from the last 1500 characters of the buffer."
(interactive)
@@ -63,11 +64,15 @@ from the last 1500 characters of the buffer."
(content (with-current-buffer buf
(buffer-substring-no-properties (point-min) (point-max))))
(tail (substring content (max 0 (- (length content) 1500))))
(prompt-text (format "Based on the following conversation, generate a short kebab-case filename (3 to 5 lowercase English words, hyphen-separated, no file extension). Output ONLY the filename, nothing else.\n\n%s"
(prompt-text (format "Based on the following conversation, generate a short kebab-case
filename (3 to 5 lowercase English words, hyphen-separated, no file
extension). Output ONLY the filename, nothing else.\n\n%s"
tail)))
(message "Generating filename with AI...")
(let ((fsm (gptel-request prompt-text
:system "You are a filename generator. Output ONLY a short kebab-case filename (3-5 lowercase English words separated by hyphens). No explanations, no quotes, no punctuation, no file extension."
:system "You are a filename generator. Output ONLY a short kebab-case
filename (3-5 lowercase English words separated by hyphens). No
explanations, no quotes, no punctuation, no file extension."
:stream nil
:callback
(lambda (response info)
@@ -132,7 +137,7 @@ from the last 1500 characters of the buffer."
:models '((kimi-for-coding))
:request-params '(:temperature 0.6 :thinking (:type "disabled"))
:header (lambda (_)
(when-let ((key (gptel--get-api-key)))
(when-let* ((key (gptel--get-api-key)))
`(("User-Agent" . "RooCode/3.30.3")
("HTTP-Referer" . "https://github.com/RooVetGit/Roo-Cline")
("X-Title" . "Roo Code")