Skip to content

Commit

Permalink
Merge branch 'stream-file-upload' of https://github.com/Hamza-nabil/g…
Browse files Browse the repository at this point in the history
…enerative-ai-python into stream-file-upload

Change-Id: Ib1a9ffcbad13ddecaca2350850101e7c0b74840a
  • Loading branch information
MarkDaoust committed Sep 27, 2024
2 parents a3a005a + 7b2c5ef commit a21a8c0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions google/generativeai/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ def upload_file(
mime_type, _ = mimetypes.guess_type(path)

if mime_type is None:
if mime_type is None:
raise ValueError(
"Unknown mime type: Could not determine the mimetype for your file\n"
" please set the `mime_type` argument"
)
raise ValueError(
"Unknown mime type: Could not determine the mimetype for your file\n"
" please set the `mime_type` argument"
)

if name is not None and "/" not in name:
name = f"files/{name}"
Expand Down

0 comments on commit a21a8c0

Please sign in to comment.