Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
close #632
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Cheong committed Aug 2, 2023
1 parent 5e37e6f commit 7126349
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/EdgeGPT/chathub.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,19 @@ async def ask_stream(
)
== "GenerateContentQuery"
):
async with ImageGenAsync(
all_cookies=self.cookies,
) as image_generator:
images = await image_generator.get_images(
response["arguments"][0]["messages"][0]["text"],
)
for i, image in enumerate(images):
resp_txt = f"{resp_txt}\n![image{i}]({image})"
draw = True
try:
async with ImageGenAsync(
all_cookies=self.cookies,
) as image_generator:
images = await image_generator.get_images(
response["arguments"][0]["messages"][0]["text"],
)
for i, image in enumerate(images):
resp_txt = f"{resp_txt}\n![image{i}]({image})"
draw = True
except Exception as e:
print(e)
continue
if (
(
response["arguments"][0]["messages"][0]["contentOrigin"]
Expand Down

0 comments on commit 7126349

Please sign in to comment.