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.
- {llama_index_llms_openai-0.6.12 → llama_index_llms_openai-0.6.14}/PKG-INFO +1 -1
- {llama_index_llms_openai-0.6.12 → llama_index_llms_openai-0.6.14}/llama_index/llms/openai/base.py +9 -1
- {llama_index_llms_openai-0.6.12 → llama_index_llms_openai-0.6.14}/llama_index/llms/openai/utils.py +1 -0
- {llama_index_llms_openai-0.6.12 → llama_index_llms_openai-0.6.14}/pyproject.toml +1 -1
- {llama_index_llms_openai-0.6.12 → llama_index_llms_openai-0.6.14}/.gitignore +0 -0
- {llama_index_llms_openai-0.6.12 → llama_index_llms_openai-0.6.14}/LICENSE +0 -0
- {llama_index_llms_openai-0.6.12 → llama_index_llms_openai-0.6.14}/README.md +0 -0
- {llama_index_llms_openai-0.6.12 → llama_index_llms_openai-0.6.14}/llama_index/llms/openai/__init__.py +0 -0
- {llama_index_llms_openai-0.6.12 → llama_index_llms_openai-0.6.14}/llama_index/llms/openai/py.typed +0 -0
- {llama_index_llms_openai-0.6.12 → llama_index_llms_openai-0.6.14}/llama_index/llms/openai/responses.py +0 -0
{llama_index_llms_openai-0.6.12 → llama_index_llms_openai-0.6.14}/llama_index/llms/openai/base.py
RENAMED
|
@@ -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
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llama_index_llms_openai-0.6.12 → llama_index_llms_openai-0.6.14}/llama_index/llms/openai/py.typed
RENAMED
|
File without changes
|
|
File without changes
|