From a0e826fcff2be1359e6521fc3eafd0722485f881 Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Sat, 6 Apr 2024 23:44:08 +0200 Subject: Update ChatgptFree.py --- g4f/Provider/ChatgptFree.py | 6 +++--- 1 file 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 -- cgit v1.2.3