Improve variable names & defs

Fix shadow names
Convert unused method parameters to private
Fix variable referenced before assignment
Improve parameter docs
This commit is contained in:
bugfloyd
2023-04-15 15:18:17 +02:00
parent 431aeecd95
commit 37a0f0ce5e
3 changed files with 22 additions and 22 deletions

View File

@@ -287,8 +287,8 @@ class OpenAIHelper:
:param messages: the messages to send
:return: the number of tokens required
"""
model = self.config['model']
try:
model = self.config['model']
encoding = tiktoken.encoding_for_model(model)
except KeyError:
encoding = tiktoken.get_encoding("gpt-3.5-turbo")