gptel.el (gptel--old-header-line, gptel-mode,
gptel--transform-response): Make `gptel-mode' set up the header-line
with status, and restore the old header line when it's turned off.
Improve documentation and linting in other places. Add todos.
gptel.el (gptel--update-header-line, gptel-send, gptel--playback,
gptel--create-prompt): Add helper function to update the header-line,
and only call when `gptel-mode' is on. Use markers to track where the
response should be inserted, and insert it after (point) by default.
gptel.el (gptel): When calling `gptel' with a selected region, insert it
into a new session.
gptel-transient.el (gptel--suffix-send-existing,
gptel--suffix-send-new): Transient suffixes available when a region is
selected. These send the text as a prompt in a existing or new gptel
session.
gptel-transient (gptel-send-menu): Add new transient-prefix
`gptel-send-menu' for setting API options for the buffer
and (optionally) sending queries. Various infix options are supported.
2023-03-09: Some transient menus are generated dynamically, which
requires a more recent version of transient than the latest tagged
release. As a result, the dynamic generation code is commented out for
now.
gptel.el (gptel-response-filter-functions, gptel-send,
gptel--create-prompt, gptel--transform-response, gptel--convert-org,
gptel--convert-markdown->org): Add support for org-mode by transforming
the response manually. (Note: Asking ChatGPT to format its results in
org-mode markup produces inconsistent results.)
Additionally, the abnormal hook `gptel-resposne-filter-functions' is
added for arbitrary transformations of the response. Its implementation
seems needlessly complex, and in the future we should change it to
use `run-hook-wrapped' with a local accumulator.
gptel.el (gptel--system-message-alist, gptel--url-get-response,
gptel--url-parse-response): Tweak default programming prompt. Rename
`gptel--get-response' to the more specific `gptel--url-parse-response'.
Likewise `gptel--parse-response' -> `gptel--url-parse-response'.
gptel.el (gptel--system-message, gptel--system-message-alist,
gptel--model, gptel--temperature, gptel--max-tokens,
gptel--request-data): Add new buffer-local variables to hold API
parameters. Generating the full request data plist is now done in a
separate function, `gptel--request-data'.
gptel-curl.el (gptel-curl-get-response): Rename from `gptel--curl-get-response'
and autoload it to ease its use in `gptel-send'. Remove Version header
identifying gptel-curl as a separate package and make it require `gptel' instead.
gptel.el (gptel--prompt-markers, gptel-send, gptel--create-prompt,
gptel--numberize): Switch from using markers to text-properties to
distinguish queries from responses. The former method was very brittle.
Remove `gptel--prompt-markers', add the function `gptel--create-prompt'
and the variable `gptel--num-messages-to-send'. This variable limits the
context of the conversation that is sent with each request.
Conditionally solves #2.
gptel.el (gptel-use-curl, gptel-parse-response, gptel--playback,
gptel-send, gptel-playback): New user options `gptel-playback',
`gptel-use-curl`. The former controls whether the response is played
back in chunks, which is done by the function `gptel--playback'. The
response returned by `gptel-get-response' and `gptel--curl-get-response'
is now a plist with the content and status.
gptel-curl.el (gptel--curl-get-args, gptel--curl-get-response,
gptel--curl-sentinel): Add support for curl when available. Set it to
the default. `url-retrieve' is full of fangs that multibyte you.