llama-index-llms-openai 0.5.3__py3-none-any.whl → 0.5.5__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.
@@ -160,7 +160,7 @@ class OpenAI(FunctionCallingLLM):
160
160
 
161
161
  llm = OpenAI(model="gpt-3.5-turbo")
162
162
 
163
- stream = llm.stream("Hi, write a short story")
163
+ stream = llm.stream_complete("Hi, write a short story")
164
164
 
165
165
  for r in stream:
166
166
  print(r.delta, end="")
@@ -60,6 +60,7 @@ O1_MODELS: Dict[str, int] = {
60
60
  "gpt-5-mini-2025-08-07": 400000,
61
61
  "gpt-5-nano": 400000,
62
62
  "gpt-5-nano-2025-08-07": 400000,
63
+ "gpt-5-chat-latest": 400000,
63
64
  }
64
65
 
65
66
  O1_MODELS_WITHOUT_FUNCTION_CALLING = {
@@ -344,6 +345,21 @@ def to_openai_message_dict(
344
345
  if isinstance(block, TextBlock):
345
346
  content.append({"type": "text", "text": block.text})
346
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
+ )
347
363
  elif isinstance(block, ImageBlock):
348
364
  if block.url:
349
365
  content.append(
@@ -462,6 +478,7 @@ def to_openai_responses_message_dict(
462
478
  mimetype = block._guess_mimetype()
463
479
  else:
464
480
  b64_string = block.data.decode("utf-8")
481
+ mimetype = block._guess_mimetype()
465
482
  content.append(
466
483
  {
467
484
  "type": "input_file",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llama-index-llms-openai
3
- Version: 0.5.3
3
+ Version: 0.5.5
4
4
  Summary: llama-index llms openai integration
5
5
  Author: llama-index
6
6
  License-Expression: MIT
@@ -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.5.dist-info/METADATA,sha256=kWnQxDOIUCPzM45LdsUaqmAc1LjPxuoT64mDReA8qgs,3038
7
+ llama_index_llms_openai-0.5.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
+ llama_index_llms_openai-0.5.5.dist-info/licenses/LICENSE,sha256=JPQLUZD9rKvCTdu192Nk0V5PAwklIg6jANii3UmTyMs,1065
9
+ llama_index_llms_openai-0.5.5.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=IdvbjJ2y5zWDkntoPgBZ2pGbcrYIbGbg1smoju2XkUI,29243
6
- llama_index_llms_openai-0.5.3.dist-info/METADATA,sha256=a5nEdBPXZklHOyjLKvEHNcVn2d5JYXHrhsyqrq_jM30,3038
7
- llama_index_llms_openai-0.5.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
- llama_index_llms_openai-0.5.3.dist-info/licenses/LICENSE,sha256=JPQLUZD9rKvCTdu192Nk0V5PAwklIg6jANii3UmTyMs,1065
9
- llama_index_llms_openai-0.5.3.dist-info/RECORD,,