Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
fix: image generation
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdanielpark authored Mar 9, 2024
1 parent 0bab1e7 commit 8be2c0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ generated_images = response.generated_images # Check generated images [Dict]
GeminiImage.save_sync(generated_images, save_path="cached_folder")

# You can use byte type image dict as follow:
# bytes_images_dict = GeminiImage.fetch_bytes_sync(generated_images) # Get bytes images dict
# GeminiImage.save_images_sync(bytes_images_dict, path="save_path") # Save to path
# bytes_images_dict = GeminiImage.fetch_images_dict_sync(generated_images, cookies) # Get bytes images dict
# GeminiImage.save_images_sync(bytes_images_dict, path="cached_folder") # Save to path
```
*Async*
```python
Expand Down Expand Up @@ -187,7 +187,7 @@ async def fetch_and_save_images_async(prompt: str):
response = await GeminiClient.generate_content_async(prompt)

generated_images = response.generated_images # Check response images [Dict]
bytes_images_dict = await GeminiImage.fetch_images_dict(generated_images) # Get bytes images dict asynchronously
bytes_images_dict = await GeminiImage.fetch_images_dict(generated_images, cookies) # Get bytes images dict asynchronously
await GeminiImage.save_images(bytes_images_dict, path="cached_folder") # Save to path asynchronously

# Run the async function
Expand Down Expand Up @@ -216,7 +216,7 @@ response_images = response.web_images # Check response images [Dict]
GeminiImage.save_sync(response_images, save_path="cached_folder")

# You can use byte type image dict as follow:
# bytes_images_dict = GeminiImage.fetch_bytes_sync(response_images) # Get bytes images dict
# bytes_images_dict = GeminiImage.fetch_bytes_sync(response_images, cookies) # Get bytes images dict
# GeminiImage.save_images_sync(bytes_images_dict, path="cached_folder") # Save to path
```
*Async*
Expand Down Expand Up @@ -247,7 +247,7 @@ async def fetch_and_save_images_async(prompt: str):
response = await GeminiClient.generate_content_async(prompt)

response_images = response.web_images # Check response images [Dict]
bytes_images_dict = await GeminiImage.fetch_images_dict(response_images) # Get bytes images dict asynchronously
bytes_images_dict = await GeminiImage.fetch_images_dict(response_images, cookies) # Get bytes images dict asynchronously
await GeminiImage.save_images(bytes_images_dict, path="cached_folder") # Save to path asynchronously

# Run the async function
Expand Down

0 comments on commit 8be2c0f

Please sign in to comment.