mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-20 06:05:12 +01:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user