Show welcome message when starting the FastGPT shell
This commit is contained in:
parent
eb767d1e0d
commit
ad6cd1cf6c
3 changed files with 31 additions and 2 deletions
|
@ -120,6 +120,7 @@ In order to use the Kagi API, follow these steps:
|
|||
|----------------------------------------+---------------------------------------------------------|
|
||||
| kagi-api-token | The Kagi API token. |
|
||||
| kagi-fastgpt-api-url | The Kagi FastGPT API entry point. |
|
||||
| kagi-fastgpt-welcome-function | A function returning a welcome string. |
|
||||
| kagi-summarizer-api-url | The Kagi Summarizer API entry point. |
|
||||
| kagi-summarizer-cache | Determines whether the Summarizer should cache results. |
|
||||
| kagi-summarizer-default-language | Default target language of the summary. |
|
||||
|
@ -261,6 +262,12 @@ Needless to say, the tests won't make actual API calls. Otherwise it wouldn't be
|
|||
|
||||
The full changelog can be found in README.org.
|
||||
|
||||
** 0.6pre
|
||||
|
||||
*** New
|
||||
|
||||
- Show a welcome message when starting the FastGPT shell (=kagi-fastgpt-shell=). This can be customized with =kagi-fastgpt-welcome-function=, a variable with a function that returns a welcome string.
|
||||
|
||||
** 0.5
|
||||
|
||||
*** Breaking changes
|
||||
|
@ -289,7 +296,7 @@ The full changelog can be found in README.org.
|
|||
- Fixed language code for Czech summaries.
|
||||
- Handle error responses when calling the FastGPT API.
|
||||
|
||||
** 0.4
|
||||
** 0.4 :noexport:
|
||||
|
||||
*** Breaking changes
|
||||
|
||||
|
|
24
kagi.el
24
kagi.el
|
@ -400,6 +400,26 @@ retrieving a result from Lisp code."
|
|||
(text-mode)
|
||||
(display-buffer buffer-name))))
|
||||
|
||||
(defun kagi--fastgpt-welcome-message (_config)
|
||||
"Return a string to be shown at the start of a new FastGPT shell.
|
||||
|
||||
This can be overridden by setting a different function in
|
||||
`kagi-fastgpt-welcome-function'."
|
||||
(format "Welcome to Kagi FastGPT.
|
||||
|
||||
- Enter `help' for more info.
|
||||
- Press `C-c RET' to open a URL.
|
||||
|
||||
"))
|
||||
|
||||
(defcustom kagi-fastgpt-welcome-function #'kagi--fastgpt-welcome-message
|
||||
"A function returning a welcome string.
|
||||
|
||||
The function takes one argument: a shell-maker configuration
|
||||
object (created with `make-shell-maker-config')."
|
||||
:type 'function
|
||||
:group 'kagi)
|
||||
|
||||
(defvar kagi-fastgpt--config
|
||||
(make-shell-maker-config
|
||||
:name "FastGPT"
|
||||
|
@ -419,7 +439,9 @@ retrieving a result from Lisp code."
|
|||
(defun kagi-fastgpt-shell ()
|
||||
"Start an FastGPT shell."
|
||||
(interactive)
|
||||
(shell-maker-start kagi-fastgpt--config))
|
||||
(shell-maker-start kagi-fastgpt--config
|
||||
nil
|
||||
kagi-fastgpt-welcome-function))
|
||||
|
||||
(defun kagi--get-text-for-prompt ()
|
||||
"Return the text to insert in a prompt.
|
||||
|
|
BIN
kagi.info
BIN
kagi.info
Binary file not shown.
Loading…
Reference in a new issue