Avoid repetition of the choices of the summary choices
This commit is contained in:
parent
fa402763fa
commit
eb846635a0
|
@ -314,6 +314,8 @@ https://www.example.com"
|
|||
(setq kagi-summarizer-engine "steve")
|
||||
(expect (kagi-summarize dummy-https-url) :to-equal dummy-output)
|
||||
(kagi-test--expect-object #'kagi--call-summarizer "engine" :to-equal "cecil"))
|
||||
(it "returns a summary when the summary style is requested"
|
||||
(expect (kagi-summarize just-enough-text-input nil nil 'summary) :to-equal dummy-output))
|
||||
(it "returns a summary when the take-away style is requested"
|
||||
(expect (kagi-summarize just-enough-text-input nil nil 'takeaway) :to-equal dummy-output))
|
||||
(it "uses the summary style when an invalid format is given"
|
||||
|
|
3
kagi.el
3
kagi.el
|
@ -553,7 +553,8 @@ to `kagi-summarizer-default-language'."
|
|||
|
||||
(defun kagi--summarizer-format (hint)
|
||||
"Return a valid summary type based on the type given in HINT."
|
||||
(let ((choices '(summary takeaway)))
|
||||
(let* ((custom-type (cdr (get 'kagi-summarizer-default-summary-format 'custom-type)))
|
||||
(choices (mapcar (lambda (e) (car (last e))) custom-type)))
|
||||
(cond ((seq-contains-p choices hint) hint)
|
||||
((seq-contains-p choices kagi-summarizer-default-summary-format)
|
||||
kagi-summarizer-default-summary-format)
|
||||
|
|
Loading…
Reference in a new issue