From 9033d902f05dfa6fea5d3dd533adf7dee6184910 Mon Sep 17 00:00:00 2001 From: Peter Nga Date: Thu, 5 Sep 2024 09:45:14 -0700 Subject: [PATCH 1/2] Add gpt-4o-2024-08-06 to token map --- vocode/streaming/agent/token_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/vocode/streaming/agent/token_utils.py b/vocode/streaming/agent/token_utils.py index bf014b2b7f..c4af79a24d 100644 --- a/vocode/streaming/agent/token_utils.py +++ b/vocode/streaming/agent/token_utils.py @@ -57,6 +57,7 @@ "gpt-4-turbo": 127940, "gpt-4o": 127940, "gpt-4o-2024-05-13": 127940, + "gpt-4o-2024-08-06": 127940, } From 8752469ab34970d9abfee7405c82430ddb9f6345 Mon Sep 17 00:00:00 2001 From: Peter Nga Date: Thu, 5 Sep 2024 09:58:40 -0700 Subject: [PATCH 2/2] Have all gpt-4o tokens use the same limit --- vocode/streaming/agent/token_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vocode/streaming/agent/token_utils.py b/vocode/streaming/agent/token_utils.py index c4af79a24d..7288f0d4dd 100644 --- a/vocode/streaming/agent/token_utils.py +++ b/vocode/streaming/agent/token_utils.py @@ -56,14 +56,14 @@ "gpt-4-0125-preview": 127940, "gpt-4-turbo": 127940, "gpt-4o": 127940, - "gpt-4o-2024-05-13": 127940, - "gpt-4o-2024-08-06": 127940, } def get_chat_gpt_max_tokens(model_name: str): if model_name.startswith("ft:"): model_name = model_name.split(":")[1] + if model_name.startswith("gpt-4o"): + model_name = "gpt-4o" if model_name in CHAT_GPT_MAX_TOKENS: return CHAT_GPT_MAX_TOKENS[model_name]