diff options
Diffstat (limited to 'g4f/Provider/ChatgptFree.py')
-rw-r--r-- | g4f/Provider/ChatgptFree.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/g4f/Provider/ChatgptFree.py b/g4f/Provider/ChatgptFree.py index b345b48a..28c37948 100644 --- a/g4f/Provider/ChatgptFree.py +++ b/g4f/Provider/ChatgptFree.py @@ -2,7 +2,7 @@ from __future__ import annotations import re -from ..requests import StreamSession +from ..requests import StreamSession, raise_for_status from ..typing import Messages from .base_provider import AsyncProvider from .helper import format_prompt @@ -50,7 +50,7 @@ class ChatgptFree(AsyncProvider): if not cls._nonce: async with session.get(f"{cls.url}/") as response: - response.raise_for_status() + await raise_for_status(response) response = await response.text() result = re.search(r'data-post-id="([0-9]+)"', response) @@ -75,5 +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() + await raise_for_status(response) return (await response.json())["data"]
\ No newline at end of file |