From 6ef282de3a3245acbfecd08ae48dba85ff91d031 Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Tue, 12 Mar 2024 02:06:06 +0100 Subject: Remove all not working provider (#1679) Fix many providers Add selenium-wire to requierments --- g4f/Provider/ChatgptFree.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'g4f/Provider/ChatgptFree.py') diff --git a/g4f/Provider/ChatgptFree.py b/g4f/Provider/ChatgptFree.py index b9b25447..b345b48a 100644 --- a/g4f/Provider/ChatgptFree.py +++ b/g4f/Provider/ChatgptFree.py @@ -5,8 +5,7 @@ import re from ..requests import StreamSession from ..typing import Messages from .base_provider import AsyncProvider -from .helper import format_prompt, get_cookies - +from .helper import format_prompt class ChatgptFree(AsyncProvider): url = "https://chatgptfree.ai" @@ -25,12 +24,6 @@ class ChatgptFree(AsyncProvider): cookies: dict = None, **kwargs ) -> str: - - if not cookies: - cookies = get_cookies('chatgptfree.ai') - if not cookies: - raise RuntimeError(f"g4f.provider.{cls.__name__} requires cookies [refresh https://chatgptfree.ai on chrome]") - headers = { 'authority': 'chatgptfree.ai', 'accept': '*/*', @@ -82,6 +75,5 @@ class ChatgptFree(AsyncProvider): "bot_id": "0" } async with session.post(f"{cls.url}/wp-admin/admin-ajax.php", data=data, cookies=cookies) as response: - response.raise_for_status() return (await response.json())["data"] \ No newline at end of file -- cgit v1.2.3