Function: gptel--create-prompt

gptel--create-prompt is a natively compiled function defined in gptel-request.el.

This function is obsolete since 0.9.9; use gptel--create-prompt-buffer instead.

Signature

(gptel--create-prompt &optional PROMPT-END)

Documentation

Return a full conversation prompt from the contents of this buffer.

If gptel--num-messages-to-send is set, limit to that many recent exchanges.

If PROMPT-END (a marker) is provided, end the prompt contents there. This defaults to (point).

Source Code

;; Defined in /nix/store/q3r7g81pvghw7a523kjk2k2zih3pfk8z-emacs-packages-deps/share/emacs/site-lisp/elpa/gptel-20261002.545/gptel-request.el
(defun gptel--create-prompt (&optional prompt-end)
  "Return a full conversation prompt from the contents of this buffer.

If `gptel--num-messages-to-send' is set, limit to that many
recent exchanges.

If PROMPT-END (a marker) is provided, end the prompt contents
there.  This defaults to (point)."
  (with-current-buffer (gptel--create-prompt-buffer prompt-end)
    (unwind-protect
        (gptel--parse-buffer
         gptel-backend (and gptel--num-messages-to-send
                            (* 2 gptel--num-messages-to-send)))
      (kill-buffer (current-buffer)))))