diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-02-09 05:53:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-09 05:53:47 +0100 |
commit | 999bc2d617a70ad70d185ba59c108d01794f9b5f (patch) | |
tree | d27a53d1549b352c8ab723680d51f01db6ae9d5c /g4f/Provider/bing/create_images.py | |
parent | Merge pull request #1554 from Masha/patch-1 (diff) | |
parent | Add example for Image Upload & Generation (diff) | |
download | gpt4free-999bc2d617a70ad70d185ba59c108d01794f9b5f.tar gpt4free-999bc2d617a70ad70d185ba59c108d01794f9b5f.tar.gz gpt4free-999bc2d617a70ad70d185ba59c108d01794f9b5f.tar.bz2 gpt4free-999bc2d617a70ad70d185ba59c108d01794f9b5f.tar.lz gpt4free-999bc2d617a70ad70d185ba59c108d01794f9b5f.tar.xz gpt4free-999bc2d617a70ad70d185ba59c108d01794f9b5f.tar.zst gpt4free-999bc2d617a70ad70d185ba59c108d01794f9b5f.zip |
Diffstat (limited to 'g4f/Provider/bing/create_images.py')
-rw-r--r-- | g4f/Provider/bing/create_images.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/g4f/Provider/bing/create_images.py b/g4f/Provider/bing/create_images.py index e1031e61..b31e9408 100644 --- a/g4f/Provider/bing/create_images.py +++ b/g4f/Provider/bing/create_images.py @@ -23,7 +23,7 @@ from ..helper import get_cookies, get_connector from ...webdriver import WebDriver, get_driver_cookies, get_browser from ...base_provider import ProviderType from ...image import ImageResponse -from ...errors import MissingRequirementsError, MissingAccessToken +from ...errors import MissingRequirementsError, MissingAuthError BING_URL = "https://www.bing.com" TIMEOUT_LOGIN = 1200 @@ -210,7 +210,7 @@ class CreateImagesBing: try: self.cookies = get_cookies_from_browser(self.proxy) except MissingRequirementsError as e: - raise MissingAccessToken(f'Missing "_U" cookie. {e}') + raise MissingAuthError(f'Missing "_U" cookie. {e}') yield asyncio.run(self.create_async(prompt)) async def create_async(self, prompt: str) -> ImageResponse: @@ -225,7 +225,7 @@ class CreateImagesBing: """ cookies = self.cookies or get_cookies(".bing.com", False) if "_U" not in cookies: - raise MissingAccessToken('Missing "_U" cookie') + raise MissingAuthError('Missing "_U" cookie') proxy = os.environ.get("G4F_PROXY") async with create_session(cookies, proxy) as session: images = await create_images(session, prompt, self.proxy) |