From ceed364cb1ade47a29ccf698074be01b520fc82c Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Sat, 13 Jan 2024 18:10:43 +0100 Subject: Fix process_image in Bing Add ImageResponse to Bing Fix cursor styling in gui --- g4f/Provider/bing/upload_image.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'g4f/Provider/bing') 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 = { -- cgit v1.2.3