From 009a67239a1df546fd22933a6b28eda03cd02a00 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Thu, 11 Apr 2024 02:40:30 +0200 Subject: Add ReplicateImage Provider, Fix BingCreateImages Provider --- g4f/Provider/bing/create_images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'g4f/Provider/bing') diff --git a/g4f/Provider/bing/create_images.py b/g4f/Provider/bing/create_images.py index cb357708..44303c21 100644 --- a/g4f/Provider/bing/create_images.py +++ b/g4f/Provider/bing/create_images.py @@ -151,7 +151,7 @@ async def create_images(session: ClientSession, prompt: str, proxy: str = None, if response.status != 200: raise RuntimeError(f"Polling images faild. Code: {response.status}") text = await response.text() - if not text: + if not text or "GenerativeImagesStatusPage" in text: await asyncio.sleep(1) else: break -- cgit v1.2.3 From 934edc86ba5249a0ce7d22ccc310561cf7d2866d Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Thu, 11 Apr 2024 03:19:05 +0200 Subject: Fix unittests, update Bing Urls --- g4f/Provider/bing/conversation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'g4f/Provider/bing') diff --git a/g4f/Provider/bing/conversation.py b/g4f/Provider/bing/conversation.py index e9cdfe31..ef48cd91 100644 --- a/g4f/Provider/bing/conversation.py +++ b/g4f/Provider/bing/conversation.py @@ -34,9 +34,9 @@ async def create_conversation(session: ClientSession, headers: dict, tone: str) Conversation: An instance representing the created conversation. """ if tone == "Copilot": - url = "https://copilot.microsoft.com/turing/conversation/create?bundleVersion=1.1634.3-nodesign2" + url = "https://copilot.microsoft.com/turing/conversation/create?bundleVersion=1.1686.0" else: - url = "https://www.bing.com/turing/conversation/create?bundleVersion=1.1626.1" + url = "https://www.bing.com/turing/conversation/create?bundleVersion=1.1686.0" async with session.get(url, headers=headers) as response: if response.status == 404: raise RateLimitError("Response 404: Do less requests and reuse conversations") -- cgit v1.2.3