summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/bing
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-01-13 18:12:21 +0100
committerGitHub <noreply@github.com>2024-01-13 18:12:21 +0100
commit691fac6db61cf91afbe9abe45e8bd3d47f985e01 (patch)
treefd1ddf447d186ee5e4c8977e5b937e4161392b4c /g4f/Provider/bing
parentMerge pull request #1465 from hlohaus/upp (diff)
parentFix process_image in Bing (diff)
downloadgpt4free-691fac6db61cf91afbe9abe45e8bd3d47f985e01.tar
gpt4free-691fac6db61cf91afbe9abe45e8bd3d47f985e01.tar.gz
gpt4free-691fac6db61cf91afbe9abe45e8bd3d47f985e01.tar.bz2
gpt4free-691fac6db61cf91afbe9abe45e8bd3d47f985e01.tar.lz
gpt4free-691fac6db61cf91afbe9abe45e8bd3d47f985e01.tar.xz
gpt4free-691fac6db61cf91afbe9abe45e8bd3d47f985e01.tar.zst
gpt4free-691fac6db61cf91afbe9abe45e8bd3d47f985e01.zip
Diffstat (limited to 'g4f/Provider/bing')
-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 = {