From 63e2f426365df6186db057e617d1b9a7439ea114 Mon Sep 17 00:00:00 2001 From: 6vision Date: Wed, 4 Sep 2024 18:39:29 +0800 Subject: [PATCH] feat: support gpt-4o-2024-08-06 model --- bot/chatgpt/chat_gpt_session.py | 2 +- common/const.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bot/chatgpt/chat_gpt_session.py b/bot/chatgpt/chat_gpt_session.py index f7ff12f..aa34ba3 100644 --- a/bot/chatgpt/chat_gpt_session.py +++ b/bot/chatgpt/chat_gpt_session.py @@ -67,7 +67,7 @@ def num_tokens_from_messages(messages, model): elif model in ["gpt-4-0314", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0613", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-16k-0613", "gpt-35-turbo-16k", "gpt-4-turbo-preview", "gpt-4-1106-preview", const.GPT4_TURBO_PREVIEW, const.GPT4_VISION_PREVIEW, const.GPT4_TURBO_01_25, - const.GPT_4o, const.GPT_4o_MINI, const.LINKAI_4o, const.LINKAI_4_TURBO]: + const.GPT_4o, const.GPT_4O_0806, const.GPT_4o_MINI, const.LINKAI_4o, const.LINKAI_4_TURBO]: return num_tokens_from_messages(messages, model="gpt-4") elif model.startswith("claude-3"): return num_tokens_from_messages(messages, model="gpt-3.5-turbo") diff --git a/common/const.py b/common/const.py index 68d3795..e2e6a00 100644 --- a/common/const.py +++ b/common/const.py @@ -24,6 +24,7 @@ GPT35_0125 = "gpt-3.5-turbo-0125" GPT35_1106 = "gpt-3.5-turbo-1106" GPT_4o = "gpt-4o" +GPT_4O_0806 = "gpt-4o-2024-08-06" GPT4_TURBO = "gpt-4-turbo" GPT4_TURBO_PREVIEW = "gpt-4-turbo-preview" GPT4_TURBO_04_09 = "gpt-4-turbo-2024-04-09" @@ -58,7 +59,7 @@ GEMINI_15_PRO = "gemini-1.5-pro" MODEL_LIST = [ GPT35, GPT35_0125, GPT35_1106, "gpt-3.5-turbo-16k", - GPT_4o, GPT_4o_MINI, GPT4_TURBO, GPT4_TURBO_PREVIEW, GPT4_TURBO_01_25, GPT4_TURBO_11_06, GPT4, GPT4_32k, GPT4_06_13, GPT4_32k_06_13, + GPT_4o, GPT_4O_0806, GPT_4o_MINI, GPT4_TURBO, GPT4_TURBO_PREVIEW, GPT4_TURBO_01_25, GPT4_TURBO_11_06, GPT4, GPT4_32k, GPT4_06_13, GPT4_32k_06_13, WEN_XIN, WEN_XIN_4, XUNFEI, ZHIPU_AI, MOONSHOT, MiniMax, GEMINI, GEMINI_PRO, GEMINI_15_flash, GEMINI_15_PRO,