diff --git a/bot/openai_utils.py b/bot/openai_utils.py index cd3168eb..152575f6 100644 --- a/bot/openai_utils.py +++ b/bot/openai_utils.py @@ -22,7 +22,7 @@ class ChatGPT: def __init__(self, model="gpt-3.5-turbo"): - assert model in {"text-davinci-003", "gpt-3.5-turbo-16k", "gpt-3.5-turbo", "gpt-4", "gpt-4-1106-preview"}, f"Unknown model: {model}" + assert model in {"text-davinci-003", "gpt-3.5-turbo-16k", "gpt-3.5-turbo", "gpt-4", "gpt-4-turbo-preview"}, f"Unknown model: {model}" self.model = model async def send_message(self, message, dialog_messages=[], chat_mode="assistant"): @@ -33,7 +33,7 @@ async def send_message(self, message, dialog_messages=[], chat_mode="assistant") answer = None while answer is None: try: - if self.model in {"gpt-3.5-turbo-16k", "gpt-3.5-turbo", "gpt-4", "gpt-4-1106-preview"}: + if self.model in {"gpt-3.5-turbo-16k", "gpt-3.5-turbo", "gpt-4", "gpt-4-turbo-preview"}: messages = self._generate_prompt_messages(message, dialog_messages, chat_mode) r = await openai.ChatCompletion.acreate( model=self.model, @@ -73,7 +73,7 @@ async def send_message_stream(self, message, dialog_messages=[], chat_mode="assi answer = None while answer is None: try: - if self.model in {"gpt-3.5-turbo-16k", "gpt-3.5-turbo", "gpt-4", "gpt-4-1106-preview"}: + if self.model in {"gpt-3.5-turbo-16k", "gpt-3.5-turbo", "gpt-4", "gpt-4-turbo-preview"}: messages = self._generate_prompt_messages(message, dialog_messages, chat_mode) r_gen = await openai.ChatCompletion.acreate( model=self.model, @@ -161,7 +161,7 @@ def _count_tokens_from_messages(self, messages, answer, model="gpt-3.5-turbo"): elif model == "gpt-4": tokens_per_message = 3 tokens_per_name = 1 - elif model == "gpt-4-1106-preview": + elif model == "gpt-4-turbo-preview": tokens_per_message = 3 tokens_per_name = 1 else: diff --git a/config/models.yml b/config/models.yml index dc35f2d6..a6415993 100644 --- a/config/models.yml +++ b/config/models.yml @@ -1,9 +1,14 @@ -available_text_models: ["gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4-1106-preview", "gpt-4", "text-davinci-003"] +available_text_models: [ + "gpt-3.5-turbo", + # "gpt-3.5-turbo-16k", + "gpt-4-turbo-preview", + # "gpt-4", +] info: gpt-3.5-turbo: type: chat_completion - name: ChatGPT + name: ChatGPT 3.5 Turbo description: ChatGPT is that well-known model. It's fast and cheap. Ideal for everyday tasks. If there are some tasks it can't handle, try the GPT-4. price_per_1000_input_tokens: 0.0015 @@ -27,6 +32,7 @@ info: Fast: 5 Cheap: 5 +# Info here https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo gpt-4: type: chat_completion name: GPT-4 @@ -40,9 +46,9 @@ info: Fast: 2 Cheap: 2 - gpt-4-1106-preview: + gpt-4-turbo-preview: type: chat_completion - name: GPT-4 Turbo + name: GPT-4 Turbo Preview description: GPT-4 Turbo is a faster and cheaper version of GPT-4. It's as smart as GPT-4, so you should use it instead of GPT-4. price_per_1000_input_tokens: 0.01 @@ -72,4 +78,4 @@ info: whisper: type: audio - price_per_1_min: 0.006 \ No newline at end of file + price_per_1_min: 0.006