gptel-transient: Truncate system prompt when messaging

* gptel-transient.el (gptel-system-prompt--setup): Truncate the
chosen system prompt when displaying it as a message. (#249)
This commit is contained in:
Karthik Chikmagalur 2024-03-13 15:29:08 -07:00
parent 07992f79cc
commit 12340eda46

View file

@ -208,7 +208,9 @@ which see."
")") ")")
'face 'shadow)) 'face 'shadow))
`(lambda () (interactive) `(lambda () (interactive)
(message "Directive: %s" ,prompt) (message "Directive: %s"
,(string-replace "\n" ""
(truncate-string-to-width prompt 100 nil nil t)))
(setq gptel--system-message ,prompt)) (setq gptel--system-message ,prompt))
:transient 'transient--do-return) :transient 'transient--do-return)
into prompt-suffixes into prompt-suffixes