Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Jul 14, 2023
1 parent b8c82e5 commit 8f62e66
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion examples/plot_sin_wave.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,20 @@ async def main():
output = await session.generate_response(user_request)

print(output.content)
print(output.files)

try:
from PIL import Image # type: ignore
except ImportError:
print("Please install it with `pip install codeinterpreterapi[image_support]` to display images.")
exit(1)

from io import BytesIO
file = output.files[0]
img_io = BytesIO(file.content)
img = Image.open(img_io)

# Display the image
img.show()


if __name__ == "__main__":
Expand Down

0 comments on commit 8f62e66

Please sign in to comment.