llama-index-llms-openai 0.3.9__tar.gz → 0.3.10__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.3.9
3
+ Version: 0.3.10
4
4
  Summary: llama-index llms openai integration
5
5
  License: MIT
6
6
  Author: llama-index
@@ -285,6 +285,10 @@ def to_openai_message_dict(
285
285
  msg = f"Unsupported content block type: {type(block).__name__}"
286
286
  raise ValueError(msg)
287
287
 
288
+ # NOTE: Sending a blank string to openai will cause an error.
289
+ # This will commonly happen with tool calls.
290
+ content_txt = None if content_txt == "" else content_txt
291
+
288
292
  # NOTE: Despite what the openai docs say, if the role is ASSISTANT, SYSTEM
289
293
  # or TOOL, 'content' cannot be a list and must be string instead.
290
294
  # Furthermore, if all blocks are text blocks, we can use the content_txt
@@ -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.3.9"
32
+ version = "0.3.10"
33
33
 
34
34
  [tool.poetry.dependencies]
35
35
  python = ">=3.9,<4.0"