summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/ChatgptFree.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-03-12 02:06:06 +0100
committerGitHub <noreply@github.com>2024-03-12 02:06:06 +0100
commit6ef282de3a3245acbfecd08ae48dba85ff91d031 (patch)
tree0236c9678eea8f9c78ed7c09f3d86eaf3d7c691c /g4f/Provider/ChatgptFree.py
parentUpdate .gitignore (diff)
downloadgpt4free-6ef282de3a3245acbfecd08ae48dba85ff91d031.tar
gpt4free-6ef282de3a3245acbfecd08ae48dba85ff91d031.tar.gz
gpt4free-6ef282de3a3245acbfecd08ae48dba85ff91d031.tar.bz2
gpt4free-6ef282de3a3245acbfecd08ae48dba85ff91d031.tar.lz
gpt4free-6ef282de3a3245acbfecd08ae48dba85ff91d031.tar.xz
gpt4free-6ef282de3a3245acbfecd08ae48dba85ff91d031.tar.zst
gpt4free-6ef282de3a3245acbfecd08ae48dba85ff91d031.zip
Diffstat (limited to 'g4f/Provider/ChatgptFree.py')
-rw-r--r--g4f/Provider/ChatgptFree.py10
1 files changed, 1 insertions, 9 deletions
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