llama-index-llms-openai 0.3.7__py3-none-any.whl → 0.3.8__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.
@@ -267,6 +267,10 @@ class OpenAI(FunctionCallingLLM):
267
267
  if model in O1_MODELS:
268
268
  temperature = 1.0
269
269
 
270
+ supports_content_blocks = kwargs.pop(
271
+ "supports_content_blocks", model in ALL_AVAILABLE_MODELS
272
+ )
273
+
270
274
  super().__init__(
271
275
  model=model,
272
276
  temperature=temperature,
@@ -286,7 +290,7 @@ class OpenAI(FunctionCallingLLM):
286
290
  pydantic_program_mode=pydantic_program_mode,
287
291
  output_parser=output_parser,
288
292
  strict=strict,
289
- supports_content_blocks=model in ALL_AVAILABLE_MODELS,
293
+ supports_content_blocks=supports_content_blocks,
290
294
  **kwargs,
291
295
  )
292
296
 
@@ -263,7 +263,10 @@ def to_openai_message_dict(
263
263
  content_txt = ""
264
264
  for block in message.blocks:
265
265
  if isinstance(block, TextBlock):
266
- if message.role.value in ("assistant", "tool", "system") or not supports_content_blocks:
266
+ if (
267
+ message.role.value in ("assistant", "tool", "system")
268
+ or not supports_content_blocks
269
+ ):
267
270
  # Despite the docs say otherwise, when role is ASSISTANT, SYSTEM
268
271
  # or TOOL, 'content' cannot be a list and must be string instead.
269
272
  content_txt += block.text
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: llama-index-llms-openai
3
- Version: 0.3.7
3
+ Version: 0.3.8
4
4
  Summary: llama-index llms openai integration
5
5
  License: MIT
6
6
  Author: llama-index
@@ -0,0 +1,6 @@
1
+ llama_index/llms/openai/__init__.py,sha256=vm3cIBSGkBFlE77GyfyN0EhpJcnJZN95QMhPN53EkbE,148
2
+ llama_index/llms/openai/base.py,sha256=z176ueUBn4ZeKlDxqqTyUZ_1VrauaFAt6H4jl5bm_MI,36409
3
+ llama_index/llms/openai/utils.py,sha256=a5BvfhjUO1lbKWR5kptQs9WaJ6Ykg_kSWWZQRpk-T3g,18383
4
+ llama_index_llms_openai-0.3.8.dist-info/METADATA,sha256=ewX0c-U-io6xgRtyHQgXkax6m5FNtvk5Y3OCvoTORBs,3320
5
+ llama_index_llms_openai-0.3.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
6
+ llama_index_llms_openai-0.3.8.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- llama_index/llms/openai/__init__.py,sha256=vm3cIBSGkBFlE77GyfyN0EhpJcnJZN95QMhPN53EkbE,148
2
- llama_index/llms/openai/base.py,sha256=bCJz2CqXRSI1Dfqv4QcvP69xm2i7uYkcZWhi5tOXk9E,36289
3
- llama_index/llms/openai/utils.py,sha256=aF2gP-Aef7rMUIYp9bG2Ke45pNszl_Jagga781Hul-A,18335
4
- llama_index_llms_openai-0.3.7.dist-info/METADATA,sha256=DLhC9DQyyPLbvbASGtZikZvrLmvyodZGXNcR2i7DG-4,3320
5
- llama_index_llms_openai-0.3.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
6
- llama_index_llms_openai-0.3.7.dist-info/RECORD,,