Skip to content

Commit

Permalink
Add PngImagePlugin to imports. (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbanani authored Jul 8, 2024
1 parent 85ee8c1 commit fb033db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions google/generativeai/types/content_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@

if typing.TYPE_CHECKING:
import PIL.Image
import PIL.PngImagePlugin
import IPython.display

IMAGE_TYPES = (PIL.Image.Image, IPython.display.Image)
else:
IMAGE_TYPES = ()
try:
import PIL.Image
import PIL.PngImagePlugin

IMAGE_TYPES = IMAGE_TYPES + (PIL.Image.Image,)
except ImportError:
Expand Down

0 comments on commit fb033db

Please sign in to comment.