From e0f468f6c1f7f07bb3987f0887d53ce9af92bb29 Mon Sep 17 00:00:00 2001 From: Elijah Tarr Date: Wed, 21 Jun 2023 01:37:16 -0700 Subject: [PATCH] Update model token mappings/cost to include 0613 models (#6122) Add `gpt-3.5-turbo-16k` to model token mappings, as per the following new OpenAI blog post: https://openai.com/blog/function-calling-and-other-api-updates Fixes #6118 Co-authored-by: Harrison Chase Co-authored-by: Dev 2049 --- langchain/llms/openai.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/langchain/llms/openai.py b/langchain/llms/openai.py index 3c35d09e..8fd350cb 100644 --- a/langchain/llms/openai.py +++ b/langchain/llms/openai.py @@ -517,10 +517,15 @@ class BaseOpenAI(BaseLLM): model_token_mapping = { "gpt-4": 8192, "gpt-4-0314": 8192, + "gpt-4-0613": 8192, "gpt-4-32k": 32768, "gpt-4-32k-0314": 32768, + "gpt-4-32k-0613": 32768, "gpt-3.5-turbo": 4096, "gpt-3.5-turbo-0301": 4096, + "gpt-3.5-turbo-0613": 4096, + "gpt-3.5-turbo-16k": 16385, + "gpt-3.5-turbo-16k-0613": 16385, "text-ada-001": 2049, "ada": 2049, "text-babbage-001": 2040,