gptel: checkdoc linting and indentation rules

* gptel.el (gptel-use-header-line, gptel--parse-buffer):
Docstrings.

* gptel-transient.el (gptel--transient-read-variable): Docstring.

* gptel-openai.el (gptel-make-openai, gptel-make-azure): Add
indent declaration.

* gptel-ollama.el (gptel-make-ollama): Add indent declaration.

* gptel-kagi.el (gptel-make-kagi): Add indent declaration.

* gptel-gemini.el (gptel-make-gemini): Add indent declaration.
This commit is contained in:
Karthik Chikmagalur 2024-01-19 14:19:22 -08:00
parent 7b19cdf117
commit d0c685e501
6 changed files with 15 additions and 8 deletions

View file

@ -135,6 +135,7 @@ alist, like:
KEY (optional) is a variable whose value is the API key, or
function that returns the key."
(declare (indent 1))
(let ((backend (gptel--make-gemini
:name name
:host host

View file

@ -156,6 +156,7 @@ Example:
-------
(gptel-make-kagi \"Kagi\" :key my-kagi-key)"
(declare (indent 1))
stream ;Silence byte-compiler
(let ((backend (gptel--make-kagi
:name name

View file

@ -138,6 +138,7 @@ Example:
:host \"localhost:11434\"
:models \\='(\"mistral:latest\")
:stream t)"
(declare (indent 1))
(let ((backend (gptel--make-ollama
:name name
:host host

View file

@ -142,6 +142,7 @@ alist, like:
KEY (optional) is a variable whose value is the API key, or
function that returns the key."
(declare (indent 1))
(let ((backend (gptel--make-openai
:name name
:host host
@ -201,6 +202,7 @@ Example:
\"/openai/deployments/DEPLOYMENT_NAME/completions?api-version=2023-05-15\"
:stream t
:models \\='(\"gpt-3.5-turbo\" \"gpt-4\"))"
(declare (indent 1))
(let ((backend (gptel--make-openai
:name name
:host host

View file

@ -257,7 +257,10 @@ Customize `gptel-directives' for task-specific prompts."
;; ** Infixes for model parameters
(defun gptel--transient-read-variable (prompt initial-input history)
"Read value from minibuffer and interpret the result as a Lisp object."
"Read value from minibuffer and interpret the result as a Lisp object.
PROMPT, INITIAL-INPUT and HISTORY are as in the Transient reader
documention."
(ignore-errors
(read-from-minibuffer prompt initial-input read-expression-map t history)))
@ -402,7 +405,7 @@ will get progressively longer!"
(list (line-beginning-position) (line-end-position))))))
((member "y" args)
(unless (car-safe kill-ring)
(user-error "`kill-ring' is empty! Nothing to send."))
(user-error "`kill-ring' is empty! Nothing to send"))
(if current-prefix-arg
(read-from-kill-ring "Prompt from kill-ring: ")
(current-kill 0))))))

View file

@ -297,8 +297,7 @@ is only inserted in dedicated gptel buffers before the AI's response."
:type '(alist :key-type symbol :value-type string))
(defcustom gptel-use-header-line t
"Whether `gptel-mode' should use header-line for status
information.
"Whether `gptel-mode' should use header-line for status information.
When set to nil, use the mode line for (minimal) status
information and the echo area for messages."
@ -806,6 +805,7 @@ streamed, as in `gptel-stream'. Do not set this if you are
specifying a custom CALLBACK!
Model parameters can be let-bound around calls to this function."
(declare (indent 1))
(let* ((gptel-stream stream)
(start-marker
(cond
@ -985,8 +985,7 @@ there."
(gptel--parse-buffer gptel-backend max-entries)))))
(cl-defgeneric gptel--parse-buffer (backend max-entries)
"Parse the current buffer backwards from point and return a list
of prompts.
"Parse current buffer backwards from point and return a list of prompts.
BACKEND is the LLM backend in use.