Skip to content

Commit fb2ae7d

Browse files
committed
feat: Use expose variables
1 parent 55e5b54 commit fb2ae7d

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ to your questions, right within the editor.
2222
This package is available from [JCS-ELPA](https://jcs-emacs.github.io/jcs-elpa/).
2323
Install from these repositories then you should be good to go!
2424

25-
Normall, you don't need to add `(require 'codegpt)` to your confiugration since
25+
Normally, you don't need to add `(require 'codegpt)` to your confiugration since
2626
most `codegpt` commands are autoload and can be called without loading the module!
2727

2828
#### use-package
@@ -86,6 +86,13 @@ List of supported commands,
8686
| `codegpt-explain` | Explain the selected code |
8787
| `codegpt-improve` | Improve, refactor or optimize it |
8888

89+
## 📝 Customization
90+
91+
#### 🧪 Variables
92+
93+
* `codegpt-max-tokens` - The maximum number of tokens to generate in the completion.
94+
* `codegpt-temperature` - What sampling temperature to use.
95+
8996
## Contribute
9097

9198
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)

codegpt.el

+13-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@
5858
:type 'list
5959
:group 'codegpt)
6060

61+
(defcustom codegpt-max-tokens 4000
62+
"The maximum number of tokens to generate in the completion."
63+
:type 'integer
64+
:group 'codegpt)
65+
66+
(defcustom codegpt-temperature 1.0
67+
"What sampling temperature to use."
68+
:type 'number
69+
:group 'openai)
70+
6171
;;
6272
;;; Application
6373

@@ -91,7 +101,9 @@ boundaries of that region in buffer."
91101
(insert (string-trim result) "\n")
92102
(fill-region original-point (point))))
93103
(unless codegpt-focus-p
94-
(select-window original-window))))
104+
(select-window original-window)))
105+
:max-tokens codegpt-max-tokens
106+
:temperature codegpt-temperature)
95107
(unless codegpt-focus-p
96108
(select-window original-window)))))
97109

0 commit comments

Comments
 (0)