llama-index-llms-openai 0.2.11__tar.gz → 0.2.12__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.1
2
2
  Name: llama-index-llms-openai
3
- Version: 0.2.11
3
+ Version: 0.2.12
4
4
  Summary: llama-index llms openai integration
5
5
  License: MIT
6
6
  Author: llama-index
@@ -488,7 +488,8 @@ class OpenAI(FunctionCallingLLM):
488
488
  additional_kwargs = {}
489
489
  if is_function:
490
490
  tool_calls = update_tool_calls(tool_calls, delta.tool_calls)
491
- additional_kwargs["tool_calls"] = tool_calls
491
+ if tool_calls:
492
+ additional_kwargs["tool_calls"] = tool_calls
492
493
 
493
494
  yield ChatResponse(
494
495
  message=ChatMessage(
@@ -738,7 +739,8 @@ class OpenAI(FunctionCallingLLM):
738
739
  additional_kwargs = {}
739
740
  if is_function:
740
741
  tool_calls = update_tool_calls(tool_calls, delta.tool_calls)
741
- additional_kwargs["tool_calls"] = tool_calls
742
+ if tool_calls:
743
+ additional_kwargs["tool_calls"] = tool_calls
742
744
 
743
745
  yield ChatResponse(
744
746
  message=ChatMessage(
@@ -285,7 +285,7 @@ def from_openai_message(openai_message: ChatCompletionMessage) -> ChatMessage:
285
285
  # function_call = None # deprecated in OpenAI v 1.1.0
286
286
 
287
287
  additional_kwargs: Dict[str, Any] = {}
288
- if openai_message.tool_calls is not None:
288
+ if openai_message.tool_calls:
289
289
  tool_calls: List[ChatCompletionMessageToolCall] = openai_message.tool_calls
290
290
  additional_kwargs.update(tool_calls=tool_calls)
291
291
 
@@ -29,7 +29,7 @@ exclude = ["**/BUILD"]
29
29
  license = "MIT"
30
30
  name = "llama-index-llms-openai"
31
31
  readme = "README.md"
32
- version = "0.2.11"
32
+ version = "0.2.12"
33
33
 
34
34
  [tool.poetry.dependencies]
35
35
  python = ">=3.8.1,<4.0"