From fbe82da2085361bf13a4fb9f285b5f0428a110dc Mon Sep 17 00:00:00 2001 From: Allen Shi <33379392+AllenJShi@users.noreply.github.com> Date: Mon, 9 Oct 2023 06:30:04 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20replace=20gpt-35-turbo=20in=20model=20na?= =?UTF-8?q?me=20to=20gpt-3.5-turbo=20so=20the=20name=20=E2=80=A6=20(#138)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: replace gpt-35-turbo in model name to gpt-3.5-turbo so the name string is in the current chat_model list * ref: reformatted with black --------- Co-authored-by: Chi Wang Co-authored-by: Qingyun Wu --- autogen/oai/completion.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autogen/oai/completion.py b/autogen/oai/completion.py index 55ca278f8..fa0161612 100644 --- a/autogen/oai/completion.py +++ b/autogen/oai/completion.py @@ -194,7 +194,8 @@ class Completion(openai_Completion): return response openai_completion = ( openai.ChatCompletion - if config["model"] in cls.chat_models or issubclass(cls, ChatCompletion) + if config["model"].replace("gpt-35-turbo", "gpt-3.5-turbo") in cls.chat_models + or issubclass(cls, ChatCompletion) else openai.Completion ) start_time = time.time()