From eabe587787360dd60c8c354d0c6323712db7aec4 Mon Sep 17 00:00:00 2001 From: WGNW_MG <52302387+m4a1carbin4@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:46:50 +0900 Subject: [PATCH] community[patch]:Fix for get_openai_callback() return token_cost=0.0 when model is gpt-4o-11-20 (#28408) - **Description:** update MODEL_COST_PER_1K_TOKENS for new gpt-4o-11-20. - **Issue:** with latest gpt-4o-11-20, openai callback return token_cost=0.0 - **Dependencies:** None (just simple dict fix.) - **Twitter handle:** I Don't Use Twitter. - (However..., I have a YouTube channel. Could you upload this there, by any chance? https://www.youtube.com/@%EA%B2%9C%EC%B0%BD%EB%B6%80%EA%B3%A0%EB%AC%B8AI%EC%9E%90%EB%AC%B8%EC%84%BC%EC%84%B8) --- libs/community/langchain_community/callbacks/openai_info.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/community/langchain_community/callbacks/openai_info.py b/libs/community/langchain_community/callbacks/openai_info.py index 9e2c070ccd2..4976f6331f1 100644 --- a/libs/community/langchain_community/callbacks/openai_info.py +++ b/libs/community/langchain_community/callbacks/openai_info.py @@ -30,10 +30,12 @@ MODEL_COST_PER_1K_TOKENS = { "gpt-4o": 0.0025, "gpt-4o-2024-05-13": 0.005, "gpt-4o-2024-08-06": 0.0025, + "gpt-4o-2024-11-20": 0.0025, # GPT-4o output "gpt-4o-completion": 0.01, "gpt-4o-2024-05-13-completion": 0.015, "gpt-4o-2024-08-06-completion": 0.01, + "gpt-4o-2024-11-20-completion": 0.01, # GPT-4 input "gpt-4": 0.03, "gpt-4-0314": 0.03,