Skip to content

Commit aa4767f

Browse files
improve function calling check for legacy openai agents (#17015)
1 parent 795bebc commit aa4767f

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

llama-index-integrations/agent/llama-index-agent-openai-legacy/llama_index/agent/openai_legacy/context_retriever_agent.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from llama_index.core.tools import BaseTool
2121
from llama_index.core.utils import print_text
2222
from llama_index.llms.openai import OpenAI
23-
from llama_index.llms.openai.utils import is_function_calling_model
2423

2524
# inspired by DEFAULT_QA_PROMPT_TMPL from llama_index/prompts/default_prompts.py
2625
DEFAULT_QA_PROMPT_TMPL = (
@@ -122,7 +121,7 @@ def from_tools_and_retriever(
122121

123122
memory = memory or memory_cls.from_defaults(chat_history=chat_history, llm=llm)
124123

125-
if not is_function_calling_model(llm.model):
124+
if not llm.metadata.is_function_calling_model:
126125
raise ValueError(
127126
f"Model name {llm.model} does not support function calling API."
128127
)

llama-index-integrations/agent/llama-index-agent-openai-legacy/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ exclude = ["**/BUILD"]
2828
license = "MIT"
2929
name = "llama-index-agent-openai-legacy"
3030
readme = "README.md"
31-
version = "0.3.0"
31+
version = "0.3.1"
3232

3333
[tool.poetry.dependencies]
3434
python = ">=3.9,<4.0"

llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"gpt-4o": 128000,
5555
"gpt-4o-2024-05-13": 128000,
5656
"gpt-4o-2024-08-06": 128000,
57+
"gpt-4o-2024-11-20": 128000,
5758
# Intended for research and evaluation
5859
"chatgpt-4o-latest": 128000,
5960
"gpt-4o-mini": 128000,

llama-index-integrations/llms/llama-index-llms-openai/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ exclude = ["**/BUILD"]
2929
license = "MIT"
3030
name = "llama-index-llms-openai"
3131
readme = "README.md"
32-
version = "0.3.0"
32+
version = "0.3.1"
3333

3434
[tool.poetry.dependencies]
3535
python = ">=3.9,<4.0"

0 commit comments

Comments
 (0)