summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/ChatgptX.py
diff options
context:
space:
mode:
authorHeiner Lohaus <heiner@lohaus.eu>2023-10-08 13:59:56 +0200
committerHeiner Lohaus <heiner@lohaus.eu>2023-10-08 13:59:56 +0200
commit6401084fd0d23b75a883888f70cd705e4cacd202 (patch)
tree9750cb102284d9445d60c539f4e6d3586603e917 /g4f/Provider/ChatgptX.py
parentAdd Cromicle to provider list (diff)
downloadgpt4free-6401084fd0d23b75a883888f70cd705e4cacd202.tar
gpt4free-6401084fd0d23b75a883888f70cd705e4cacd202.tar.gz
gpt4free-6401084fd0d23b75a883888f70cd705e4cacd202.tar.bz2
gpt4free-6401084fd0d23b75a883888f70cd705e4cacd202.tar.lz
gpt4free-6401084fd0d23b75a883888f70cd705e4cacd202.tar.xz
gpt4free-6401084fd0d23b75a883888f70cd705e4cacd202.tar.zst
gpt4free-6401084fd0d23b75a883888f70cd705e4cacd202.zip
Diffstat (limited to 'g4f/Provider/ChatgptX.py')
-rw-r--r--g4f/Provider/ChatgptX.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/g4f/Provider/ChatgptX.py b/g4f/Provider/ChatgptX.py
index 5621613f..2944fb26 100644
--- a/g4f/Provider/ChatgptX.py
+++ b/g4f/Provider/ChatgptX.py
@@ -4,7 +4,7 @@ import re
import json
from aiohttp import ClientSession
-from typing import AsyncGenerator, Dict, List
+from ..typing import AsyncResult, Messages
from .base_provider import AsyncGeneratorProvider
from .helper import format_prompt
@@ -18,9 +18,9 @@ class ChatgptX(AsyncGeneratorProvider):
async def create_async_generator(
cls,
model: str,
- messages: List[Dict[str, str]],
+ messages: Messages,
**kwargs
- ) -> AsyncGenerator[str, None]:
+ ) -> AsyncResult:
headers = {
'accept-language': 'de-DE,de;q=0.9,en-DE;q=0.8,en;q=0.7,en-US',
'sec-ch-ua': '"Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"',
@@ -66,7 +66,7 @@ class ChatgptX(AsyncGeneratorProvider):
response.raise_for_status()
chat = await response.json()
if "response" not in chat or not chat["response"]:
- raise RuntimeError(f'Response: {data}')
+ raise RuntimeError(f'Response: {chat}')
headers = {
'authority': 'chatgptx.de',
'accept': 'text/event-stream',