Add flag to toggle cached results from the Summarizer API
This commit is contained in:
parent
035fe3beb5
commit
d12fa61748
1 changed files with 12 additions and 1 deletions
13
kagi.el
13
kagi.el
|
@ -126,6 +126,16 @@ https://help.kagi.com/kagi/api/summarizer.html."
|
||||||
(const :tag "Chinese (simplified)" "ZH"))
|
(const :tag "Chinese (simplified)" "ZH"))
|
||||||
:group 'kagi)
|
:group 'kagi)
|
||||||
|
|
||||||
|
(defcustom kagi-api-summarizer-cache t
|
||||||
|
"Determines whether the Summarizer should cache results.
|
||||||
|
|
||||||
|
Repetitive queries won't be charged if caching is enabled (the
|
||||||
|
default). For sensitive texts, you may opt for disabling the
|
||||||
|
cache by setting this item to nil (but subsequent queries on the
|
||||||
|
same text will be charged.)"
|
||||||
|
:type 'boolean
|
||||||
|
:group 'kagi)
|
||||||
|
|
||||||
(defface kagi-bold '((t :inherit bold))
|
(defface kagi-bold '((t :inherit bold))
|
||||||
"Face for bold parts in the Kagi output."
|
"Face for bold parts in the Kagi output."
|
||||||
:group 'kagi)
|
:group 'kagi)
|
||||||
|
@ -241,7 +251,8 @@ configuration. The given ITEMS are appended to it, which is a
|
||||||
list of conses."
|
list of conses."
|
||||||
(append items
|
(append items
|
||||||
`(("engine" . ,kagi-api-summarizer-engine)
|
`(("engine" . ,kagi-api-summarizer-engine)
|
||||||
("summary_type" . "summary"))
|
("summary_type" . "summary")
|
||||||
|
("cache" . ,kagi-api-summarizer-cache))
|
||||||
|
|
||||||
;; prevent a nil in the result list, causing (json-encode)
|
;; prevent a nil in the result list, causing (json-encode)
|
||||||
;; to generate a wrong request object.
|
;; to generate a wrong request object.
|
||||||
|
|
Loading…
Reference in a new issue