From 8125570fc4ca94b085857eadc563eafc2c0564a5 Mon Sep 17 00:00:00 2001 From: Martin Bielik Date: Tue, 21 Mar 2023 18:36:38 +0100 Subject: openai configuration --- py/chat.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'py/chat.py') diff --git a/py/chat.py b/py/chat.py index 7cd7985..eb80e92 100644 --- a/py/chat.py +++ b/py/chat.py @@ -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 -- cgit v1.2.3