We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b425fb9 commit da2113cCopy full SHA for da2113c
src/openai/_utils/_utils.py
@@ -76,8 +76,16 @@ def _extract_items(
76
from .._files import assert_is_file_content
77
78
# We have exhausted the path, return the entry we found.
79
- assert_is_file_content(obj, key=flattened_key)
80
assert flattened_key is not None
+
81
+ if is_list(obj):
82
+ files: list[tuple[str, FileTypes]] = []
83
+ for entry in obj:
84
+ assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "")
85
+ files.append((flattened_key + "[]", cast(FileTypes, entry)))
86
+ return files
87
88
+ assert_is_file_content(obj, key=flattened_key)
89
return [(flattened_key, cast(FileTypes, obj))]
90
91
index += 1
0 commit comments