Provide a transient menu to create a new chat buffer with a specified backend/model, system message and other parameters. This should be available when gptel is called with a prefix-arg.
@algal This looks good. After trying it for a bit, I think we can simplify the behavior of M-x gptel:
M-x gptel always brings up a completing-read interface (without the REQUIRE-MATCH arg), with the default input being the backend-name, and the completion options being other gptel buffers.
This means M-x gptel will always require an additional press of the RET key, but that annoyance might be worth it. I'm assuming that most people want to set a suitable buffer name for the chat (that isn't *backend-name*) anyway.
Pressing RET with no input/selection returns backend-name.
You also don't need to use seq-filter to find the candidates then, and the completing-read will be replaced by
(read-buffer "Create or choose gptel buffer: "
backend-name nil ; DEFAULT and REQUIRE-MATCH
(lambda (b) ; PREDICATE
(buffer-local-value 'gptel-mode
(get-buffer (or (car-safe b) b)))))
The prefix-arg behavior will then be unnecessary, and we can use it to bring up a transient menu where the user can choose the gptel buffer name, backend, system message and other model parameters to use in the new session. This is a feature that's been asked for a couple of times, and I can add it after this PR.
Provide a transient menu to create a new chat buffer with a specified backend/model, system message and other parameters. This should be available when gptel is called with a prefix-arg.
@algal This looks good. After trying it for a bit, I think we can simplify the behavior of
M-x gptel
:M-x gptel
always brings up a completing-read interface (without theREQUIRE-MATCH
arg), with the default input being thebackend-name
, and the completion options being other gptel buffers.M-x gptel
will always require an additional press of the RET key, but that annoyance might be worth it. I'm assuming that most people want to set a suitable buffer name for the chat (that isn't*backend-name*
) anyway.backend-name
.You also don't need to use
seq-filter
to find the candidates then, and thecompleting-read
will be replaced byThe prefix-arg behavior will then be unnecessary, and we can use it to bring up a transient menu where the user can choose the gptel buffer name, backend, system message and other model parameters to use in the new session. This is a feature that's been asked for a couple of times, and I can add it after this PR.
What do you think?
Originally posted by @karthink in https://github.com/karthink/gptel/issues/311#issuecomment-2118400506