Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit da2113c

Browse filesBrowse files
chore(internal): fix list file params
1 parent b425fb9 commit da2113c
Copy full SHA for da2113c

File tree

1 file changed

+9
-1
lines changed
Filter options

1 file changed

+9
-1
lines changed

‎src/openai/_utils/_utils.py

Copy file name to clipboardExpand all lines: src/openai/_utils/_utils.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,16 @@ def _extract_items(
7676
from .._files import assert_is_file_content
7777

7878
# We have exhausted the path, return the entry we found.
79-
assert_is_file_content(obj, key=flattened_key)
8079
assert flattened_key is not None
80+
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)
8189
return [(flattened_key, cast(FileTypes, obj))]
8290

8391
index += 1

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.