openai-sdk-helpers 0.5.1__py3-none-any.whl → 0.5.2__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.
@@ -450,6 +450,9 @@ class ResponseBase(Generic[T]):
450
450
  When use_vector_store is True, this method automatically creates
451
451
  a vector store and adds a file_search tool for document retrieval.
452
452
  Images are always base64-encoded regardless of this setting.
453
+ When multiple content strings are provided, file attachments are
454
+ included only with the first message to avoid duplicating input
455
+ files across messages.
453
456
 
454
457
  Examples
455
458
  --------
@@ -473,8 +476,17 @@ class ResponseBase(Generic[T]):
473
476
  self, all_files, use_vector_store
474
477
  )
475
478
 
476
- # Add each content as a separate message with the same attachments
477
- for raw_content in contents:
479
+ attachments: list[
480
+ ResponseInputFileParam
481
+ | ResponseInputFileContentParam
482
+ | ResponseInputImageContentParam
483
+ ] = []
484
+ attachments.extend(vector_file_refs)
485
+ attachments.extend(base64_files)
486
+ attachments.extend(image_contents)
487
+
488
+ # Add each content as a separate message.
489
+ for index, raw_content in enumerate(contents):
478
490
  processed_text = raw_content.strip()
479
491
  input_content: list[
480
492
  ResponseInputTextParam
@@ -483,14 +495,8 @@ class ResponseBase(Generic[T]):
483
495
  | ResponseInputImageContentParam
484
496
  ] = [ResponseInputTextParam(type="input_text", text=processed_text)]
485
497
 
486
- # Add vector store file references
487
- input_content.extend(vector_file_refs)
488
-
489
- # Add base64 files
490
- input_content.extend(base64_files)
491
-
492
- # Add images
493
- input_content.extend(image_contents)
498
+ if index == 0:
499
+ input_content.extend(attachments)
494
500
 
495
501
  message = cast(
496
502
  ResponseInputItemParam,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openai-sdk-helpers
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: Composable helpers for OpenAI SDK agents, prompts, and storage
5
5
  Author: openai-sdk-helpers maintainers
6
6
  License: MIT
@@ -40,7 +40,7 @@ openai_sdk_helpers/prompt/vector_planner.jinja,sha256=szzuJu6ZawYWuARgQn4DykBLig
40
40
  openai_sdk_helpers/prompt/vector_search.jinja,sha256=KPEYQDRKsUesadSyQcBBiqYQEDL1NLN6BQsqw-GcKMA,249
41
41
  openai_sdk_helpers/prompt/vector_writer.jinja,sha256=q5osfexGvt1xn8ZPtBWUP36n_1HK_Ziu8dkmCZDVamc,342
42
42
  openai_sdk_helpers/response/__init__.py,sha256=YFrGpnMIfatnLWXAZgZDMvDx7Yjsqjat8W9INxKuPxY,1728
43
- openai_sdk_helpers/response/base.py,sha256=pz4JT_7K8_pwjoogag1znvO-_NC0HV5xAgkHkWqX_8k,37559
43
+ openai_sdk_helpers/response/base.py,sha256=jywi1EqMFSKVzAmrULn1NNqN11OYRtN8RjY3ezw4IuQ,37849
44
44
  openai_sdk_helpers/response/configuration.py,sha256=jxneKd7oj08D40ceOWETB3TeUHd7Cnz-ooQp0akI9fA,10465
45
45
  openai_sdk_helpers/response/files.py,sha256=O--boEPdFGsf9pHXPuNtG0aVJG2ZzwR4L1CZDW0hBP4,14450
46
46
  openai_sdk_helpers/response/messages.py,sha256=qX3sW79rLuJEys28zyv5MovZikwGOaLevzdVN0VYMRE,10104
@@ -88,8 +88,8 @@ openai_sdk_helpers/vector_storage/__init__.py,sha256=L5LxO09puh9_yBB9IDTvc1CvVkA
88
88
  openai_sdk_helpers/vector_storage/cleanup.py,sha256=sZ4ZSTlnjF52o9Cc8A9dTX37ZYXXDxS_fdIpoOBWvrg,3666
89
89
  openai_sdk_helpers/vector_storage/storage.py,sha256=t_ukacaXRa9EXE4-3BxsrB4Rjhu6nTu7NA9IjCJBIpQ,24259
90
90
  openai_sdk_helpers/vector_storage/types.py,sha256=jTCcOYMeOpZWvcse0z4T3MVs-RBOPC-fqWTBeQrgafU,1639
91
- openai_sdk_helpers-0.5.1.dist-info/METADATA,sha256=mOcLvFFUKvKuK-wOiK2A-fZcGe2y-oJdUBVEY9RkXcw,24185
92
- openai_sdk_helpers-0.5.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
93
- openai_sdk_helpers-0.5.1.dist-info/entry_points.txt,sha256=gEOD1ZeXe8d2OP-KzUlG-b_9D9yUZTCt-GFW3EDbIIY,63
94
- openai_sdk_helpers-0.5.1.dist-info/licenses/LICENSE,sha256=CUhc1NrE50bs45tcXF7OcTQBKEvkUuLqeOHgrWQ5jaA,1067
95
- openai_sdk_helpers-0.5.1.dist-info/RECORD,,
91
+ openai_sdk_helpers-0.5.2.dist-info/METADATA,sha256=xpFtABEk1-jSCL63qbJ4LRzrje5jHfHXwcLSrwuQ-6g,24185
92
+ openai_sdk_helpers-0.5.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
93
+ openai_sdk_helpers-0.5.2.dist-info/entry_points.txt,sha256=gEOD1ZeXe8d2OP-KzUlG-b_9D9yUZTCt-GFW3EDbIIY,63
94
+ openai_sdk_helpers-0.5.2.dist-info/licenses/LICENSE,sha256=CUhc1NrE50bs45tcXF7OcTQBKEvkUuLqeOHgrWQ5jaA,1067
95
+ openai_sdk_helpers-0.5.2.dist-info/RECORD,,