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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llama-index-llms-openai
3
- Version: 0.5.1
3
+ Version: 0.5.3
4
4
  Summary: llama-index llms openai integration
5
5
  Author: llama-index
6
6
  License-Expression: MIT
@@ -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, AzureOpenAI, AsyncAzureOpenAI
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
- if isinstance(client, AzureOpenAI):
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
- if isinstance(aclient, AsyncAzureOpenAI):
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:
@@ -27,7 +27,7 @@ dev = [
27
27
 
28
28
  [project]
29
29
  name = "llama-index-llms-openai"
30
- version = "0.5.1"
30
+ version = "0.5.3"
31
31
  description = "llama-index llms openai integration"
32
32
  authors = [{name = "llama-index"}]
33
33
  requires-python = ">=3.9,<4.0"