llama-index-llms-openai 0.3.20__tar.gz → 0.3.21__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.3.20 → llama_index_llms_openai-0.3.21}/PKG-INFO +1 -1
- {llama_index_llms_openai-0.3.20 → llama_index_llms_openai-0.3.21}/llama_index/llms/openai/utils.py +7 -2
- {llama_index_llms_openai-0.3.20 → llama_index_llms_openai-0.3.21}/pyproject.toml +1 -1
- {llama_index_llms_openai-0.3.20 → llama_index_llms_openai-0.3.21}/README.md +0 -0
- {llama_index_llms_openai-0.3.20 → llama_index_llms_openai-0.3.21}/llama_index/llms/openai/__init__.py +0 -0
- {llama_index_llms_openai-0.3.20 → llama_index_llms_openai-0.3.21}/llama_index/llms/openai/base.py +0 -0
- {llama_index_llms_openai-0.3.20 → llama_index_llms_openai-0.3.21}/llama_index/llms/openai/py.typed +0 -0
{llama_index_llms_openai-0.3.20 → llama_index_llms_openai-0.3.21}/llama_index/llms/openai/utils.py
RENAMED
|
@@ -323,11 +323,16 @@ def to_openai_message_dict(
|
|
|
323
323
|
raise ValueError(msg)
|
|
324
324
|
|
|
325
325
|
# NOTE: Sending a null value (None) for Tool Message to OpenAI will cause error
|
|
326
|
-
# It's only Allowed to send None if it's an Assistant Message
|
|
326
|
+
# It's only Allowed to send None if it's an Assistant Message and either a function call or tool calls were performed
|
|
327
327
|
# Reference: https://platform.openai.com/docs/api-reference/chat/create
|
|
328
328
|
content_txt = (
|
|
329
329
|
None
|
|
330
|
-
if content_txt == ""
|
|
330
|
+
if content_txt == ""
|
|
331
|
+
and message.role == MessageRole.ASSISTANT
|
|
332
|
+
and (
|
|
333
|
+
"function_call" in message.additional_kwargs
|
|
334
|
+
or "tool_calls" in message.additional_kwargs
|
|
335
|
+
)
|
|
331
336
|
else content_txt
|
|
332
337
|
)
|
|
333
338
|
|
|
File without changes
|
|
File without changes
|
{llama_index_llms_openai-0.3.20 → llama_index_llms_openai-0.3.21}/llama_index/llms/openai/base.py
RENAMED
|
File without changes
|
{llama_index_llms_openai-0.3.20 → llama_index_llms_openai-0.3.21}/llama_index/llms/openai/py.typed
RENAMED
|
File without changes
|