From 687a49153a440a7d35e9d4945b18d6d2bced6fd7 Mon Sep 17 00:00:00 2001 From: Logan Markewich Date: Thu, 19 Dec 2024 12:07:14 -0600 Subject: [PATCH] Tweak o1 function calling reqs --- .../llama_index/llms/openai/utils.py | 11 ++++++++--- .../llms/llama-index-llms-openai/pyproject.toml | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py b/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py index 9a28550036d83..6e48083d24960 100644 --- a/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py +++ b/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py @@ -42,6 +42,13 @@ "o1-mini-2024-09-12": 128000, } +O1_MODELS_WITHOUT_FUNCTION_CALLING = { + "o1-preview", + "o1-preview-2024-09-12", + "o1-mini", + "o1-mini-2024-09-12", +} + GPT4_MODELS: Dict[str, int] = { # stable model names: # resolves to gpt-4-0314 before 2023-06-27, @@ -247,9 +254,7 @@ def is_function_calling_model(model: str) -> bool: is_chat_model_ = is_chat_model(model) is_old = "0314" in model or "0301" in model - - # TODO: This is temporary for openai's beta - is_o1_beta = "o1" in model + is_o1_beta = model in O1_MODELS_WITHOUT_FUNCTION_CALLING return is_chat_model_ and not is_old and not is_o1_beta diff --git a/llama-index-integrations/llms/llama-index-llms-openai/pyproject.toml b/llama-index-integrations/llms/llama-index-llms-openai/pyproject.toml index 6bf3eeeaa001f..158800c91dfc0 100644 --- a/llama-index-integrations/llms/llama-index-llms-openai/pyproject.toml +++ b/llama-index-integrations/llms/llama-index-llms-openai/pyproject.toml @@ -29,7 +29,7 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-llms-openai" readme = "README.md" -version = "0.3.11" +version = "0.3.12" [tool.poetry.dependencies] python = ">=3.9,<4.0"