llama-index-llms-openai 0.6.12__tar.gz → 0.6.14__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.12
3
+ Version: 0.6.14
4
4
  Summary: llama-index llms openai integration
5
5
  Author: llama-index
6
6
  License-Expression: MIT
@@ -1,4 +1,5 @@
1
1
  import functools
2
+ import re
2
3
  from json.decoder import JSONDecodeError
3
4
  from typing import (
4
5
  TYPE_CHECKING,
@@ -1070,7 +1071,14 @@ class OpenAI(FunctionCallingLLM):
1070
1071
  )
1071
1072
 
1072
1073
  llm_kwargs = llm_kwargs or {}
1073
- llm_kwargs["response_format"] = _type_to_response_format(output_cls)
1074
+ response_format = _type_to_response_format(output_cls)
1075
+ if isinstance(response_format, dict):
1076
+ json_schema = response_format.get("json_schema")
1077
+ if isinstance(json_schema, dict) and "name" in json_schema:
1078
+ json_schema["name"] = re.sub(
1079
+ r"[^a-zA-Z0-9_-]", "_", str(json_schema["name"])
1080
+ )
1081
+ llm_kwargs["response_format"] = response_format
1074
1082
  if "tool_choice" in llm_kwargs:
1075
1083
  del llm_kwargs["tool_choice"]
1076
1084
  return llm_kwargs
@@ -70,6 +70,7 @@ O1_MODELS: Dict[str, int] = {
70
70
  "gpt-5.1-chat-latest": 128000,
71
71
  "gpt-5.2": 400000,
72
72
  "gpt-5.2-2025-12-11": 400000,
73
+ "gpt-5.2-chat-latest": 128000,
73
74
  }
74
75
 
75
76
  RESPONSES_API_ONLY_MODELS = {
@@ -27,7 +27,7 @@ dev = [
27
27
 
28
28
  [project]
29
29
  name = "llama-index-llms-openai"
30
- version = "0.6.12"
30
+ version = "0.6.14"
31
31
  description = "llama-index llms openai integration"
32
32
  authors = [{name = "llama-index"}]
33
33
  requires-python = ">=3.9,<4.0"