summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/bing/upload_image.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-13 18:10:43 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-13 18:10:43 +0100
commitceed364cb1ade47a29ccf698074be01b520fc82c (patch)
treefd1ddf447d186ee5e4c8977e5b937e4161392b4c /g4f/Provider/bing/upload_image.py
parentImprove FreeChatgpt Provider (diff)
downloadgpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.tar
gpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.tar.gz
gpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.tar.bz2
gpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.tar.lz
gpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.tar.xz
gpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.tar.zst
gpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.zip
Diffstat (limited to 'g4f/Provider/bing/upload_image.py')
-rw-r--r--g4f/Provider/bing/upload_image.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/g4f/Provider/bing/upload_image.py b/g4f/Provider/bing/upload_image.py
index d92451fa..1af902ef 100644
--- a/g4f/Provider/bing/upload_image.py
+++ b/g4f/Provider/bing/upload_image.py
@@ -6,7 +6,7 @@ import json
import math
from ...typing import ImageType
from aiohttp import ClientSession
-from ...image import to_image, process_image, to_base64
+from ...image import to_image, process_image, to_base64, ImageResponse
image_config = {
"maxImagePixels": 360000,
@@ -19,7 +19,7 @@ async def upload_image(
image: ImageType,
tone: str,
proxy: str = None
-) -> dict:
+) -> ImageResponse:
image = to_image(image)
width, height = image.size
max_image_pixels = image_config['maxImagePixels']
@@ -55,7 +55,7 @@ async def upload_image(
else "https://www.bing.com/images/blob?bcid="
+ result['bcid']
)
- return result
+ return ImageResponse(result["imageUrl"], "", result)
def build_image_upload_api_payload(image_bin: str, tone: str):
payload = {