diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2023-03-21 18:36:38 +0100 |
|---|---|---|
| committer | Martin Bielik <mx.bielik@gmail.com> | 2023-03-21 18:36:38 +0100 |
| commit | 8125570fc4ca94b085857eadc563eafc2c0564a5 (patch) | |
| tree | c67323c90c13c3c06e1364cf662e4ed467b514b3 /py/chat.py | |
| parent | e025530d25cedd1dcbd9d2102cd06296f3707da9 (diff) | |
| download | vim-ai-8125570fc4ca94b085857eadc563eafc2c0564a5.tar.gz | |
openai configuration
Diffstat (limited to 'py/chat.py')
| -rw-r--r-- | py/chat.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -6,6 +6,7 @@ vim.command(f"py3file {plugin_root}/py/utils.py") openai.api_key = load_api_key() +options = vim.eval("options") file_content = vim.eval('trim(join(getline(1, "$"), "\n"))') lines = file_content.splitlines() @@ -38,10 +39,12 @@ try: vim.command("redraw") response = openai.ChatCompletion.create( - model="gpt-3.5-turbo", messages=messages, stream=True, - request_timeout=request_timeout_seconds, + model=options['model'], + max_tokens=int(options['max_tokens']), + temperature=float(options['temperature']), + request_timeout=float(options['request_timeout']), ) generating_text = False |