llama-index-llms-openai 0.5.0__tar.gz → 0.5.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llama-index-llms-openai
3
- Version: 0.5.0
3
+ Version: 0.5.2
4
4
  Summary: llama-index llms openai integration
5
5
  Author: llama-index
6
6
  License-Expression: MIT
@@ -16,7 +16,6 @@ from typing import (
16
16
  Type,
17
17
  Union,
18
18
  cast,
19
- get_args,
20
19
  runtime_checkable,
21
20
  )
22
21
 
@@ -65,7 +64,6 @@ from llama_index.core.program.utils import FlexibleModel
65
64
  from llama_index.core.types import BaseOutputParser, PydanticProgramMode
66
65
  from llama_index.llms.openai.utils import (
67
66
  O1_MODELS,
68
- OpenAIToolCall,
69
67
  create_retry_decorator,
70
68
  from_openai_completion_logprobs,
71
69
  from_openai_message,
@@ -228,7 +226,7 @@ class OpenAI(FunctionCallingLLM):
228
226
  default=False,
229
227
  description="Whether to use strict mode for invoking tools/using schemas.",
230
228
  )
231
- reasoning_effort: Optional[Literal["low", "medium", "high"]] = Field(
229
+ reasoning_effort: Optional[Literal["low", "medium", "high", "minimal"]] = Field(
232
230
  default=None,
233
231
  description="The effort to use for reasoning models.",
234
232
  )
@@ -980,10 +978,8 @@ class OpenAI(FunctionCallingLLM):
980
978
 
981
979
  tool_selections = []
982
980
  for tool_call in tool_calls:
983
- if not isinstance(tool_call, get_args(OpenAIToolCall)):
984
- raise ValueError("Invalid tool_call object")
985
981
  if tool_call.type != "function":
986
- raise ValueError("Invalid tool type. Unsupported by OpenAI")
982
+ raise ValueError("Invalid tool type. Unsupported by OpenAI llm")
987
983
 
988
984
  # this should handle both complete and partial jsons
989
985
  try:
@@ -53,6 +53,13 @@ O1_MODELS: Dict[str, int] = {
53
53
  "o3-pro-2025-06-10": 200000,
54
54
  "o4-mini": 200000,
55
55
  "o4-mini-2025-04-16": 200000,
56
+ # gpt-5 is a reasoning model, putting it in the o models list
57
+ "gpt-5": 400000,
58
+ "gpt-5-2025-08-07": 400000,
59
+ "gpt-5-mini": 400000,
60
+ "gpt-5-mini-2025-08-07": 400000,
61
+ "gpt-5-nano": 400000,
62
+ "gpt-5-nano-2025-08-07": 400000,
56
63
  }
57
64
 
58
65
  O1_MODELS_WITHOUT_FUNCTION_CALLING = {
@@ -27,7 +27,7 @@ dev = [
27
27
 
28
28
  [project]
29
29
  name = "llama-index-llms-openai"
30
- version = "0.5.0"
30
+ version = "0.5.2"
31
31
  description = "llama-index llms openai integration"
32
32
  authors = [{name = "llama-index"}]
33
33
  requires-python = ">=3.9,<4.0"