summaryrefslogtreecommitdiff
path: root/py/complete.py
diff options
context:
space:
mode:
authorMartin Bielik <mx.bielik@gmail.com>2023-03-22 22:14:25 +0100
committerMartin Bielik <mx.bielik@gmail.com>2023-03-22 22:14:25 +0100
commit08036fb76c437b705d916708d903c7c6c2eef0ba (patch)
treef8d1c4f3f652c13c265d2f75e104f3b3907c4551 /py/complete.py
parent9b707d99b106c6535e476f00095053b470428bcc (diff)
downloadvim-ai-08036fb76c437b705d916708d903c7c6c2eef0ba.tar.gz
completion configuration
Diffstat (limited to '')
-rw-r--r--py/complete.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/py/complete.py b/py/complete.py
index f469592..f82707a 100644
--- a/py/complete.py
+++ b/py/complete.py
@@ -5,7 +5,7 @@ plugin_root = vim.eval("s:plugin_root")
vim.command(f"py3file {plugin_root}/py/utils.py")
prompt = vim.eval("prompt")
-options = vim.eval("options")
+options = make_options()
openai.api_key = load_api_key()
@@ -15,14 +15,7 @@ try:
print('Completing...')
vim.command("redraw")
- response = openai.Completion.create(
- stream=True,
- prompt=prompt,
- model=options['model'],
- max_tokens=int(options['max_tokens']),
- temperature=float(options['temperature']),
- request_timeout=float(options['request_timeout']),
- )
+ response = openai.Completion.create(stream=True, prompt=prompt, **options)
generating_text = False
for resp in response: