1
0
Fork 0

Started with takeaway summary support

This commit is contained in:
Bram Schoenmakers 2024-02-02 21:31:05 +01:00
parent 58a8560b8c
commit eb3d486534
Signed by: bram
GPG key ID: 0CCD19DFDC63258F

16
kagi.el
View file

@ -162,6 +162,19 @@ same text will be charged.)"
:type 'boolean
:group 'kagi)
(defconst kagi--summarizer-summary-formats '((paragraph . "summary")
(takeaway . "takeaway"))
"Mapping from summary type symbol to the expected API string.")
(defcustom kagi-summarizer-default-summary-format 'paragraph
"The summary format that should be returned.
Symbol paragraph returns a paragraph of prose. Symbol takeaway
returns a bullet list."
:type '(choice (const :tag "Paragraph" paragraph)
(const :tag "Bullet-list" takeaway))
:group 'kagi)
(defface kagi-bold '((t :inherit bold))
"Face for bold parts in the Kagi output."
:group 'kagi)
@ -324,7 +337,8 @@ list of conses."
(append items
`(("engine" . ,kagi-summarizer-engine)
("summary_type" . "summary")
("cache" . ,kagi-summarizer-cache))
("cache" . ,kagi-summarizer-cache)
("summary_type" . ,kagi-summarizer-default-summary-format))
;; prevent a nil in the result list, causing (json-encode)
;; to generate a wrong request object.