summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorMartin Bielik <mx.bielik@gmail.com>2023-06-11 12:53:56 +0200
committerMartin Bielik <mx.bielik@gmail.com>2023-06-11 12:53:56 +0200
commit531a1f646144d195fc58c2756d0109d793e0ae96 (patch)
tree1d1368dc5f43cfe0efec6c1e54ae45b7eaee96dc /py
parenta167e4888887784adac99a5a15c1a956e7af8de0 (diff)
downloadvim-ai-531a1f646144d195fc58c2756d0109d793e0ae96.tar.gz
optional max_tokens, fixes #42
Diffstat (limited to '')
-rw-r--r--py/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/py/utils.py b/py/utils.py
index 09dfaa3..8539347 100644
--- a/py/utils.py
+++ b/py/utils.py
@@ -27,9 +27,10 @@ def load_api_key():
return api_key.strip()
def make_openai_options(options):
+ max_tokens = int(options['max_tokens'])
return {
'model': options['model'],
- 'max_tokens': int(options['max_tokens']),
+ 'max_tokens': max_tokens if max_tokens > 0 else None,
'temperature': float(options['temperature']),
}