llama-index-llms-openai 0.5.4__py3-none-any.whl → 0.5.6__py3-none-any.whl
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/base.py +1 -1
- llama_index/llms/openai/utils.py +16 -0
- {llama_index_llms_openai-0.5.4.dist-info → llama_index_llms_openai-0.5.6.dist-info}/METADATA +2 -2
- llama_index_llms_openai-0.5.6.dist-info/RECORD +9 -0
- llama_index_llms_openai-0.5.4.dist-info/RECORD +0 -9
- {llama_index_llms_openai-0.5.4.dist-info → llama_index_llms_openai-0.5.6.dist-info}/WHEEL +0 -0
- {llama_index_llms_openai-0.5.4.dist-info → llama_index_llms_openai-0.5.6.dist-info}/licenses/LICENSE +0 -0
llama_index/llms/openai/base.py
CHANGED
llama_index/llms/openai/utils.py
CHANGED
|
@@ -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",
|
{llama_index_llms_openai-0.5.4.dist-info → llama_index_llms_openai-0.5.6.dist-info}/METADATA
RENAMED
|
@@ -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
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
llama_index/llms/openai/__init__.py,sha256=8nmgixeXifQ4eVSgtCic54WxXqrrpXQPL4rhACWCSFs,229
|
|
2
|
+
llama_index/llms/openai/base.py,sha256=6EANUt_39Pukk6N6CYYVJx6CpoAG2jJsMau6MvV3JTI,41868
|
|
3
|
+
llama_index/llms/openai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
llama_index/llms/openai/responses.py,sha256=Tvlwhst3W_t7EQQCxtj8k-uW6iHmjQPMJ4dh23f-oWg,36182
|
|
5
|
+
llama_index/llms/openai/utils.py,sha256=3F6TN_IvYw35eCSXKI23EtWf1tScEWzslFS-tGB58Hw,29938
|
|
6
|
+
llama_index_llms_openai-0.5.6.dist-info/METADATA,sha256=9PMeDISUlcyJ2pI2Bw44iqxE93ijoigek14se5PfUjE,3038
|
|
7
|
+
llama_index_llms_openai-0.5.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
+
llama_index_llms_openai-0.5.6.dist-info/licenses/LICENSE,sha256=JPQLUZD9rKvCTdu192Nk0V5PAwklIg6jANii3UmTyMs,1065
|
|
9
|
+
llama_index_llms_openai-0.5.6.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
llama_index/llms/openai/__init__.py,sha256=8nmgixeXifQ4eVSgtCic54WxXqrrpXQPL4rhACWCSFs,229
|
|
2
|
-
llama_index/llms/openai/base.py,sha256=R8hwgLVWEYMLYnZsgwwPSOwoBaDaxC6xzfYE9pu4jGc,41859
|
|
3
|
-
llama_index/llms/openai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
llama_index/llms/openai/responses.py,sha256=Tvlwhst3W_t7EQQCxtj8k-uW6iHmjQPMJ4dh23f-oWg,36182
|
|
5
|
-
llama_index/llms/openai/utils.py,sha256=HQqxqfwsVLStjVU1UlZekXqfeLpSbVxcWo-hD8DOggQ,29276
|
|
6
|
-
llama_index_llms_openai-0.5.4.dist-info/METADATA,sha256=5W94TJDzRjiBSdPQV2RZ57lu92hFhI-lRPnCRfrqSII,3038
|
|
7
|
-
llama_index_llms_openai-0.5.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
-
llama_index_llms_openai-0.5.4.dist-info/licenses/LICENSE,sha256=JPQLUZD9rKvCTdu192Nk0V5PAwklIg6jANii3UmTyMs,1065
|
|
9
|
-
llama_index_llms_openai-0.5.4.dist-info/RECORD,,
|
|
File without changes
|
{llama_index_llms_openai-0.5.4.dist-info → llama_index_llms_openai-0.5.6.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|