Skip to content

Commit a8a8026

Browse files
authored
Merge pull request #10 from emacs-openai/feature/expose
feat: Use expose variables
2 parents 55e5b54 + 0caeaf1 commit a8a8026

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

README.md

+9-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,14 @@ 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-model` - ID of the model to use.
94+
- `codegpt-max-tokens` - The maximum number of tokens to generate in the completion.
95+
- `codegpt-temperature` - What sampling temperature to use.
96+
8997
## Contribute
9098

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

codegpt.el

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

61+
(defcustom codegpt-model "text-davinci-003"
62+
"ID of the model to use."
63+
:type 'string
64+
:group 'codegpt)
65+
66+
(defcustom codegpt-max-tokens 4000
67+
"The maximum number of tokens to generate in the completion."
68+
:type 'integer
69+
:group 'codegpt)
70+
71+
(defcustom codegpt-temperature 1.0
72+
"What sampling temperature to use."
73+
:type 'number
74+
:group 'openai)
75+
6176
;;
6277
;;; Application
6378

@@ -91,7 +106,10 @@ boundaries of that region in buffer."
91106
(insert (string-trim result) "\n")
92107
(fill-region original-point (point))))
93108
(unless codegpt-focus-p
94-
(select-window original-window))))
109+
(select-window original-window)))
110+
:model codegpt-model
111+
:max-tokens codegpt-max-tokens
112+
:temperature codegpt-temperature)
95113
(unless codegpt-focus-p
96114
(select-window original-window)))))
97115

0 commit comments

Comments
 (0)