llama-index-llms-openai 0.5.4__tar.gz → 0.5.6__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.5.4 → llama_index_llms_openai-0.5.6}/PKG-INFO +2 -2
- {llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/llama_index/llms/openai/base.py +1 -1
- {llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/llama_index/llms/openai/utils.py +16 -0
- {llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/pyproject.toml +2 -2
- {llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/.gitignore +0 -0
- {llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/LICENSE +0 -0
- {llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/README.md +0 -0
- {llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/llama_index/llms/openai/__init__.py +0 -0
- {llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/llama_index/llms/openai/py.typed +0 -0
- {llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/llama_index/llms/openai/responses.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: llama-index-llms-openai
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.6
|
|
4
4
|
Summary: llama-index llms openai integration
|
|
5
5
|
Author: llama-index
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
License-File: LICENSE
|
|
8
8
|
Requires-Python: <4.0,>=3.9
|
|
9
|
-
Requires-Dist: llama-index-core<0.
|
|
9
|
+
Requires-Dist: llama-index-core<0.15,>=0.13.0
|
|
10
10
|
Requires-Dist: openai<2,>=1.81.0
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
|
{llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/llama_index/llms/openai/utils.py
RENAMED
|
@@ -345,6 +345,21 @@ def to_openai_message_dict(
|
|
|
345
345
|
if isinstance(block, TextBlock):
|
|
346
346
|
content.append({"type": "text", "text": block.text})
|
|
347
347
|
content_txt += block.text
|
|
348
|
+
elif isinstance(block, DocumentBlock):
|
|
349
|
+
if not block.data:
|
|
350
|
+
file_buffer = block.resolve_document()
|
|
351
|
+
b64_string = block._get_b64_string(file_buffer)
|
|
352
|
+
mimetype = block._guess_mimetype()
|
|
353
|
+
else:
|
|
354
|
+
b64_string = block.data.decode("utf-8")
|
|
355
|
+
mimetype = block._guess_mimetype()
|
|
356
|
+
content.append(
|
|
357
|
+
{
|
|
358
|
+
"type": "input_file",
|
|
359
|
+
"filename": block.title,
|
|
360
|
+
"file_data": f"data:{mimetype};base64,{b64_string}",
|
|
361
|
+
}
|
|
362
|
+
)
|
|
348
363
|
elif isinstance(block, ImageBlock):
|
|
349
364
|
if block.url:
|
|
350
365
|
content.append(
|
|
@@ -463,6 +478,7 @@ def to_openai_responses_message_dict(
|
|
|
463
478
|
mimetype = block._guess_mimetype()
|
|
464
479
|
else:
|
|
465
480
|
b64_string = block.data.decode("utf-8")
|
|
481
|
+
mimetype = block._guess_mimetype()
|
|
466
482
|
content.append(
|
|
467
483
|
{
|
|
468
484
|
"type": "input_file",
|
|
@@ -27,13 +27,13 @@ dev = [
|
|
|
27
27
|
|
|
28
28
|
[project]
|
|
29
29
|
name = "llama-index-llms-openai"
|
|
30
|
-
version = "0.5.
|
|
30
|
+
version = "0.5.6"
|
|
31
31
|
description = "llama-index llms openai integration"
|
|
32
32
|
authors = [{name = "llama-index"}]
|
|
33
33
|
requires-python = ">=3.9,<4.0"
|
|
34
34
|
readme = "README.md"
|
|
35
35
|
license = "MIT"
|
|
36
|
-
dependencies = ["openai>=1.81.0,<2", "llama-index-core>=0.13.0,<0.
|
|
36
|
+
dependencies = ["openai>=1.81.0,<2", "llama-index-core>=0.13.0,<0.15"]
|
|
37
37
|
|
|
38
38
|
[tool.codespell]
|
|
39
39
|
check-filenames = true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/llama_index/llms/openai/__init__.py
RENAMED
|
File without changes
|
{llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/llama_index/llms/openai/py.typed
RENAMED
|
File without changes
|
{llama_index_llms_openai-0.5.4 → llama_index_llms_openai-0.5.6}/llama_index/llms/openai/responses.py
RENAMED
|
File without changes
|