llama-index-llms-openai 0.6.11__py3-none-any.whl → 0.6.13__py3-none-any.whl

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,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
@@ -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,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llama-index-llms-openai
3
- Version: 0.6.11
3
+ Version: 0.6.13
4
4
  Summary: llama-index llms openai integration
5
5
  Author: llama-index
6
6
  License-Expression: MIT
@@ -0,0 +1,9 @@
1
+ llama_index/llms/openai/__init__.py,sha256=8nmgixeXifQ4eVSgtCic54WxXqrrpXQPL4rhACWCSFs,229
2
+ llama_index/llms/openai/base.py,sha256=_qz2DdX1NnoQ03u1LSEpNeIsKsCODrYbAJFFPE-tk9s,45313
3
+ llama_index/llms/openai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ llama_index/llms/openai/responses.py,sha256=h3-CHAjoG975I2vA4JOwqdto2YCrm8LIOibXn6c6dWE,38020
5
+ llama_index/llms/openai/utils.py,sha256=x7phvKKQxBfGHaARmDW_03BYtmvALJ0v50cXYIvNHC8,33919
6
+ llama_index_llms_openai-0.6.13.dist-info/METADATA,sha256=FPN4stCKE8kLGnnbrP0tXRw4Bik_JFesUyNnuowaXWM,3040
7
+ llama_index_llms_openai-0.6.13.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
8
+ llama_index_llms_openai-0.6.13.dist-info/licenses/LICENSE,sha256=JPQLUZD9rKvCTdu192Nk0V5PAwklIg6jANii3UmTyMs,1065
9
+ llama_index_llms_openai-0.6.13.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- llama_index/llms/openai/__init__.py,sha256=8nmgixeXifQ4eVSgtCic54WxXqrrpXQPL4rhACWCSFs,229
2
- llama_index/llms/openai/base.py,sha256=7L0zXvLW2h5w2XzZJ6sglcJf_rhNw6EannKcDYAS0qU,44949
3
- llama_index/llms/openai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- llama_index/llms/openai/responses.py,sha256=R7Y0GRptw5tXKQKiz9Mt-lrB6VLNG6HruMvZXiFUrYM,38012
5
- llama_index/llms/openai/utils.py,sha256=x7phvKKQxBfGHaARmDW_03BYtmvALJ0v50cXYIvNHC8,33919
6
- llama_index_llms_openai-0.6.11.dist-info/METADATA,sha256=yJ7gSElqj_xMYQq8vXGsemqbJg5v0fcInLwN3zTrUtU,3040
7
- llama_index_llms_openai-0.6.11.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
8
- llama_index_llms_openai-0.6.11.dist-info/licenses/LICENSE,sha256=JPQLUZD9rKvCTdu192Nk0V5PAwklIg6jANii3UmTyMs,1065
9
- llama_index_llms_openai-0.6.11.dist-info/RECORD,,