llama-index-llms-openai 0.3.40__tar.gz → 0.3.42__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.40 → llama_index_llms_openai-0.3.42}/PKG-INFO +1 -1
- {llama_index_llms_openai-0.3.40 → llama_index_llms_openai-0.3.42}/llama_index/llms/openai/base.py +1 -1
- {llama_index_llms_openai-0.3.40 → llama_index_llms_openai-0.3.42}/llama_index/llms/openai/utils.py +8 -8
- {llama_index_llms_openai-0.3.40 → llama_index_llms_openai-0.3.42}/pyproject.toml +1 -1
- {llama_index_llms_openai-0.3.40 → llama_index_llms_openai-0.3.42}/.gitignore +0 -0
- {llama_index_llms_openai-0.3.40 → llama_index_llms_openai-0.3.42}/LICENSE +0 -0
- {llama_index_llms_openai-0.3.40 → llama_index_llms_openai-0.3.42}/README.md +0 -0
- {llama_index_llms_openai-0.3.40 → llama_index_llms_openai-0.3.42}/llama_index/llms/openai/__init__.py +0 -0
- {llama_index_llms_openai-0.3.40 → llama_index_llms_openai-0.3.42}/llama_index/llms/openai/py.typed +0 -0
- {llama_index_llms_openai-0.3.40 → llama_index_llms_openai-0.3.42}/llama_index/llms/openai/responses.py +0 -0
{llama_index_llms_openai-0.3.40 → llama_index_llms_openai-0.3.42}/llama_index/llms/openai/base.py
RENAMED
|
@@ -909,7 +909,7 @@ class OpenAI(FunctionCallingLLM):
|
|
|
909
909
|
**kwargs: Any,
|
|
910
910
|
) -> Dict[str, Any]:
|
|
911
911
|
"""Predict and call the tool."""
|
|
912
|
-
tool_specs = [tool.metadata.to_openai_tool() for tool in tools]
|
|
912
|
+
tool_specs = [tool.metadata.to_openai_tool(skip_length_check=True) for tool in tools]
|
|
913
913
|
|
|
914
914
|
# if strict is passed in, use, else default to the class-level attribute, else default to True`
|
|
915
915
|
if strict is not None:
|
{llama_index_llms_openai-0.3.40 → llama_index_llms_openai-0.3.42}/llama_index/llms/openai/utils.py
RENAMED
|
@@ -309,14 +309,6 @@ def to_openai_message_dict(
|
|
|
309
309
|
if isinstance(block, TextBlock):
|
|
310
310
|
content.append({"type": "text", "text": block.text})
|
|
311
311
|
content_txt += block.text
|
|
312
|
-
elif isinstance(block, DocumentBlock):
|
|
313
|
-
if not block.data:
|
|
314
|
-
file_buffer = block.resolve_document()
|
|
315
|
-
b64_string = block._get_b64_string(data_buffer=file_buffer)
|
|
316
|
-
else:
|
|
317
|
-
b64_string = block.data.decode("utf-8")
|
|
318
|
-
mimetype = block.document_mimetype if block.document_mimetype is not None else "application/pdf"
|
|
319
|
-
content.append({"type": "input_file", "filename": block.title, "file_data": f"data:{mimetype};base64,{b64_string}"})
|
|
320
312
|
elif isinstance(block, ImageBlock):
|
|
321
313
|
if block.url:
|
|
322
314
|
content.append(
|
|
@@ -428,6 +420,14 @@ def to_openai_responses_message_dict(
|
|
|
428
420
|
if isinstance(block, TextBlock):
|
|
429
421
|
content.append({"type": "input_text", "text": block.text})
|
|
430
422
|
content_txt += block.text
|
|
423
|
+
elif isinstance(block, DocumentBlock):
|
|
424
|
+
if not block.data:
|
|
425
|
+
file_buffer = block.resolve_document()
|
|
426
|
+
b64_string = block._get_b64_string(file_buffer)
|
|
427
|
+
mimetype = block._guess_mimetype()
|
|
428
|
+
else:
|
|
429
|
+
b64_string = block.data.decode("utf-8")
|
|
430
|
+
content.append({"type": "input_file", "filename": block.title, "file_data": f"data:{mimetype};base64,{b64_string}"})
|
|
431
431
|
elif isinstance(block, ImageBlock):
|
|
432
432
|
if block.url:
|
|
433
433
|
content.append(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llama_index_llms_openai-0.3.40 → llama_index_llms_openai-0.3.42}/llama_index/llms/openai/py.typed
RENAMED
|
File without changes
|
|
File without changes
|