llama-index-llms-openai 0.6.10__tar.gz → 0.6.12__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.6.10
3
+ Version: 0.6.12
4
4
  Summary: llama-index llms openai integration
5
5
  Author: llama-index
6
6
  License-Expression: MIT
@@ -78,6 +78,7 @@ from llama_index.llms.openai.utils import (
78
78
  to_openai_message_dicts,
79
79
  update_tool_calls,
80
80
  is_json_schema_supported,
81
+ is_chatcomp_api_supported,
81
82
  )
82
83
  from openai import AsyncOpenAI
83
84
  from openai import OpenAI as SyncOpenAI
@@ -299,6 +300,11 @@ class OpenAI(FunctionCallingLLM):
299
300
  if model in O1_MODELS:
300
301
  temperature = 1.0
301
302
 
303
+ if not is_chatcomp_api_supported(model):
304
+ raise ValueError(
305
+ f"Cannot use model {model} as it is only supported by the Responses API. Use the OpenAIResponses class for it."
306
+ )
307
+
302
308
  super().__init__(
303
309
  model=model,
304
310
  temperature=temperature,
@@ -415,7 +415,7 @@ class OpenAIResponses(FunctionCallingLLM):
415
415
  "previous_response_id": self._previous_response_id,
416
416
  "store": self.store,
417
417
  "temperature": self.temperature,
418
- "tools": [*initial_tools, *kwargs.pop("tools", [])],
418
+ "tools": [*initial_tools, *(kwargs.pop("tools", []) or [])],
419
419
  "top_p": self.top_p,
420
420
  "truncation": self.truncation,
421
421
  "user": self.user,
@@ -68,6 +68,13 @@ O1_MODELS: Dict[str, int] = {
68
68
  "gpt-5.1": 400000,
69
69
  "gpt-5.1-2025-11-13": 400000,
70
70
  "gpt-5.1-chat-latest": 128000,
71
+ "gpt-5.2": 400000,
72
+ "gpt-5.2-2025-12-11": 400000,
73
+ }
74
+
75
+ RESPONSES_API_ONLY_MODELS = {
76
+ "gpt-5.2-pro": 400000,
77
+ "gpt-5.2-pro-2025-12-11": 400000,
71
78
  }
72
79
 
73
80
  O1_MODELS_WITHOUT_FUNCTION_CALLING = {
@@ -208,9 +215,14 @@ JSON_SCHEMA_MODELS = [
208
215
  "gpt-4o",
209
216
  "gpt-4.1",
210
217
  "gpt-5",
218
+ "gpt-5.2",
211
219
  ]
212
220
 
213
221
 
222
+ def is_chatcomp_api_supported(model: str) -> bool:
223
+ return model not in RESPONSES_API_ONLY_MODELS
224
+
225
+
214
226
  def is_json_schema_supported(model: str) -> bool:
215
227
  try:
216
228
  from openai.resources.chat.completions import completions
@@ -27,7 +27,7 @@ dev = [
27
27
 
28
28
  [project]
29
29
  name = "llama-index-llms-openai"
30
- version = "0.6.10"
30
+ version = "0.6.12"
31
31
  description = "llama-index llms openai integration"
32
32
  authors = [{name = "llama-index"}]
33
33
  requires-python = ">=3.9,<4.0"