8000 gptel-transient: Ensure user enters a number when prompted by pabl0 · Pull Request #637 · karthink/gptel · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gptel-transient: Ensure user enters a number when prompted #637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

pabl0
Copy link
Contributor
@pabl0 pabl0 commented Feb 12, 2025
  • gptel-transient.el (gptel--transient-read-variable, gptel--transient-read-number): New function that uses standard `read-number' to read a numeric value, returning nil for default. Drop the read-variable function since we were only using it for prompting numbers.

  • gptel-transdient.el (gtpel--infix-num-messages-to-send, gptel--infix-max-tokens, gptel--infix-temperature): Use the new function as :reader.

This also fixes handling of history, which is broken with at least transient 0.8.4.

* gptel-transient.el (gptel--transient-read-variable,
gptel--transient-read-number): New function that uses
standard `read-number' to read a numeric value, returning
nil for default.  Drop the read-variable function since
we were only using it for prompting numbers.

* gptel-transdient.el (gtpel--infix-num-messages-to-send,
gptel--infix-max-tokens, gptel--infix-temperature):
Use the new function as :reader.
@karthink karthink merged commit 285856e into karthink:master Feb 13, 2025
@karthink
Copy link
Owner

Thank you @pabl0. I didn't realize the history feature was broken.

marcbowes pushed a commit to marcbowes/gptel that referenced this pull request Mar 19, 2025
)

* gptel-transient.el (gptel--transient-read-variable,
gptel--transient-read-number): New function that uses
standard `read-number' to read a numeric value, returning
nil for default.  Drop the read-variable function since
we were only using it for prompting numbers.

* gptel-transdient.el (gtpel--infix-num-messages-to-send,
gptel--infix-max-tokens, gptel--infix-temperature):
Use the new function as :reader.
@pabl0 pabl0 deleted the read-numbers branch March 22, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0