diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2023-03-22 22:14:25 +0100 |
|---|---|---|
| committer | Martin Bielik <mx.bielik@gmail.com> | 2023-03-22 22:14:25 +0100 |
| commit | 08036fb76c437b705d916708d903c7c6c2eef0ba (patch) | |
| tree | f8d1c4f3f652c13c265d2f75e104f3b3907c4551 /README.md | |
| parent | 9b707d99b106c6535e476f00095053b470428bcc (diff) | |
| download | vim-ai-08036fb76c437b705d916708d903c7c6c2eef0ba.tar.gz | |
completion configuration
Diffstat (limited to '')
| -rw-r--r-- | README.md | 51 |
1 files changed, 51 insertions, 0 deletions
@@ -87,6 +87,57 @@ nnoremap <leader>a :AI<CR> xnoremap <leader>a :AI<CR> ``` +### Completion configuration + +Request to the OpenAI API can be configured for each command. +To customize the default configuration, initialize the config variable with a selection of options. For example: + +```vim +let g:vim_ai_chat = { +\ "options": { +\ "model": "gpt-4", +\ "temperature": 0.2, +\ }, +\} +``` + +Below are listed available options along with default values: + +```vim +" :AI +" - https://platform.openai.com/docs/api-reference/completions +let g:vim_ai_complete = { +\ "options": { +\ "model": "text-davinci-003", +\ "max_tokens": 1000, +\ "temperature": 0.1, +\ "request_timeout": 10, +\ }, +\} + +" :AIEdit +" - https://platform.openai.com/docs/api-reference/completions +let g:vim_ai_edit = { +\ "options": { +\ "model": "text-davinci-003", +\ "max_tokens": 1000, +\ "temperature": 0.1, +\ "request_timeout": 10, +\ }, +\} + +" :AIChat +" - https://platform.openai.com/docs/api-reference/chat +let g:vim_ai_chat = { +\ "options": { +\ "model": "gpt-3.5-turbo", +\ "max_tokens": 1000, +\ "temperature": 1, +\ "request_timeout": 10, +\ }, +\} +``` + ### Custom commands To customize and re-use prompts it is useful to put some context to the language model. You can do it with prepending text to `:AI` command. |