summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/ChatgptDemoAi.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/ChatgptDemoAi.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 '')
-rw-r--r--g4f/Provider/not_working/ChatgptDemoAi.py (renamed from g4f/Provider/ChatgptDemoAi.py)7
1 files changed, 4 insertions, 3 deletions
diff --git a/g4f/Provider/ChatgptDemoAi.py b/g4f/Provider/not_working/ChatgptDemoAi.py
index a8c98b65..6cdd0c7a 100644
--- a/g4f/Provider/ChatgptDemoAi.py
+++ b/g4f/Provider/not_working/ChatgptDemoAi.py
@@ -3,9 +3,9 @@ from __future__ import annotations
import json
from aiohttp import ClientSession
-from ..typing import AsyncResult, Messages
-from .base_provider import AsyncGeneratorProvider
-from .helper import get_random_string
+from ...typing import AsyncResult, Messages
+from ..base_provider import AsyncGeneratorProvider
+from ..helper import get_random_string
class ChatgptDemoAi(AsyncGeneratorProvider):
url = "https://chat.chatgptdemo.ai"
@@ -49,6 +49,7 @@ class ChatgptDemoAi(AsyncGeneratorProvider):
async with session.post(f"{cls.url}/wp-json/mwai-ui/v1/chats/submit", json=data, proxy=proxy) as response:
response.raise_for_status()
async for chunk in response.content:
+ response.raise_for_status()
if chunk.startswith(b"data: "):
data = json.loads(chunk[6:])
if data["type"] == "live":