diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-04-06 23:44:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-06 23:44:08 +0200 |
commit | a0e826fcff2be1359e6521fc3eafd0722485f881 (patch) | |
tree | ae2f427a29b4a78bb3dd9990c361d32c96d1f731 | |
parent | Update ChatForAi.py (diff) | |
download | gpt4free-a0e826fcff2be1359e6521fc3eafd0722485f881.tar gpt4free-a0e826fcff2be1359e6521fc3eafd0722485f881.tar.gz gpt4free-a0e826fcff2be1359e6521fc3eafd0722485f881.tar.bz2 gpt4free-a0e826fcff2be1359e6521fc3eafd0722485f881.tar.lz gpt4free-a0e826fcff2be1359e6521fc3eafd0722485f881.tar.xz gpt4free-a0e826fcff2be1359e6521fc3eafd0722485f881.tar.zst gpt4free-a0e826fcff2be1359e6521fc3eafd0722485f881.zip |
Diffstat (limited to '')
-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 |