Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ to your questions, right within the editor.
This package is available from [JCS-ELPA](https://jcs-emacs.github.io/jcs-elpa/).
Install from these repositories then you should be good to go!

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

#### use-package
Expand Down Expand Up @@ -86,6 +86,14 @@ List of supported commands,
| `codegpt-explain` | Explain the selected code |
| `codegpt-improve` | Improve, refactor or optimize it |

## 📝 Customization

#### 🧪 Variables

- `codegpt-model` - ID of the model to use.
- `codegpt-max-tokens` - The maximum number of tokens to generate in the completion.
- `codegpt-temperature` - What sampling temperature to use.

## Contribute

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
Expand Down
20 changes: 19 additions & 1 deletion codegpt.el
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@
:type 'list
:group 'codegpt)

(defcustom codegpt-model "text-davinci-003"
"ID of the model to use."
:type 'string
:group 'codegpt)

(defcustom codegpt-max-tokens 4000
"The maximum number of tokens to generate in the completion."
:type 'integer
:group 'codegpt)

(defcustom codegpt-temperature 1.0
"What sampling temperature to use."
:type 'number
:group 'openai)

;;
;;; Application

Expand Down Expand Up @@ -91,7 +106,10 @@ boundaries of that region in buffer."
(insert (string-trim result) "\n")
(fill-region original-point (point))))
(unless codegpt-focus-p
(select-window original-window))))
(select-window original-window)))
:model codegpt-model
:max-tokens codegpt-max-tokens
:temperature codegpt-temperature)
(unless codegpt-focus-p
(select-window original-window)))))

Expand Down