llama-index-llms-openai 0.5.1__tar.gz → 0.5.3__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.5.1 → llama_index_llms_openai-0.5.3}/PKG-INFO +1 -1
- {llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/llama_index/llms/openai/base.py +4 -14
- {llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/pyproject.toml +1 -1
- {llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/.gitignore +0 -0
- {llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/LICENSE +0 -0
- {llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/README.md +0 -0
- {llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/llama_index/llms/openai/__init__.py +0 -0
- {llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/llama_index/llms/openai/py.typed +0 -0
- {llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/llama_index/llms/openai/responses.py +0 -0
- {llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/llama_index/llms/openai/utils.py +0 -0
{llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/llama_index/llms/openai/base.py
RENAMED
|
@@ -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,
|
|
@@ -79,7 +77,7 @@ from llama_index.llms.openai.utils import (
|
|
|
79
77
|
update_tool_calls,
|
|
80
78
|
is_json_schema_supported,
|
|
81
79
|
)
|
|
82
|
-
from openai import AsyncOpenAI
|
|
80
|
+
from openai import AsyncOpenAI
|
|
83
81
|
from openai import OpenAI as SyncOpenAI
|
|
84
82
|
from openai.types.chat.chat_completion_chunk import (
|
|
85
83
|
ChatCompletionChunk,
|
|
@@ -534,10 +532,7 @@ class OpenAI(FunctionCallingLLM):
|
|
|
534
532
|
if len(response.choices) > 0:
|
|
535
533
|
delta = response.choices[0].delta
|
|
536
534
|
else:
|
|
537
|
-
|
|
538
|
-
continue
|
|
539
|
-
else:
|
|
540
|
-
delta = ChoiceDelta()
|
|
535
|
+
delta = ChoiceDelta()
|
|
541
536
|
|
|
542
537
|
if delta is None:
|
|
543
538
|
continue
|
|
@@ -803,10 +798,7 @@ class OpenAI(FunctionCallingLLM):
|
|
|
803
798
|
continue
|
|
804
799
|
delta = response.choices[0].delta
|
|
805
800
|
else:
|
|
806
|
-
|
|
807
|
-
continue
|
|
808
|
-
else:
|
|
809
|
-
delta = ChoiceDelta()
|
|
801
|
+
delta = ChoiceDelta()
|
|
810
802
|
first_chat_chunk = False
|
|
811
803
|
|
|
812
804
|
if delta is None:
|
|
@@ -980,10 +972,8 @@ class OpenAI(FunctionCallingLLM):
|
|
|
980
972
|
|
|
981
973
|
tool_selections = []
|
|
982
974
|
for tool_call in tool_calls:
|
|
983
|
-
if not isinstance(tool_call, get_args(OpenAIToolCall)):
|
|
984
|
-
raise ValueError("Invalid tool_call object")
|
|
985
975
|
if tool_call.type != "function":
|
|
986
|
-
raise ValueError("Invalid tool type. Unsupported by OpenAI")
|
|
976
|
+
raise ValueError("Invalid tool type. Unsupported by OpenAI llm")
|
|
987
977
|
|
|
988
978
|
# this should handle both complete and partial jsons
|
|
989
979
|
try:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/llama_index/llms/openai/__init__.py
RENAMED
|
File without changes
|
{llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/llama_index/llms/openai/py.typed
RENAMED
|
File without changes
|
{llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/llama_index/llms/openai/responses.py
RENAMED
|
File without changes
|
{llama_index_llms_openai-0.5.1 → llama_index_llms_openai-0.5.3}/llama_index/llms/openai/utils.py
RENAMED
|
File without changes
|