diff options
author | abc <98614666+xtekky@users.noreply.github.com> | 2023-10-14 15:36:24 +0200 |
---|---|---|
committer | abc <98614666+xtekky@users.noreply.github.com> | 2023-10-14 15:36:24 +0200 |
commit | 1f8293250e5fd4a76997d5b6d37711bf184d4905 (patch) | |
tree | b064fe6f8c46583f3390e6784b47e53a6f17eb08 /g4f/Provider/ChatBase.py | |
parent | g4f `v-0.1.6.3` (diff) | |
download | gpt4free-1f8293250e5fd4a76997d5b6d37711bf184d4905.tar gpt4free-1f8293250e5fd4a76997d5b6d37711bf184d4905.tar.gz gpt4free-1f8293250e5fd4a76997d5b6d37711bf184d4905.tar.bz2 gpt4free-1f8293250e5fd4a76997d5b6d37711bf184d4905.tar.lz gpt4free-1f8293250e5fd4a76997d5b6d37711bf184d4905.tar.xz gpt4free-1f8293250e5fd4a76997d5b6d37711bf184d4905.tar.zst gpt4free-1f8293250e5fd4a76997d5b6d37711bf184d4905.zip |
Diffstat (limited to 'g4f/Provider/ChatBase.py')
-rw-r--r-- | g4f/Provider/ChatBase.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/g4f/Provider/ChatBase.py b/g4f/Provider/ChatBase.py index ce5160d8..3d45b40b 100644 --- a/g4f/Provider/ChatBase.py +++ b/g4f/Provider/ChatBase.py @@ -9,7 +9,6 @@ from .base_provider import AsyncGeneratorProvider class ChatBase(AsyncGeneratorProvider): url = "https://www.chatbase.co" supports_gpt_35_turbo = True - supports_gpt_4 = True working = True @classmethod @@ -20,12 +19,8 @@ class ChatBase(AsyncGeneratorProvider): proxy: str = None, **kwargs ) -> AsyncResult: - if model == "gpt-4": - chat_id = "quran---tafseer-saadi-pdf-wbgknt7zn" - elif model == "gpt-3.5-turbo" or not model: - chat_id = "chatbase--1--pdf-p680fxvnm" - else: - raise ValueError(f"Model are not supported: {model}") + chat_id = 'z2c2HSfKnCTh5J4650V0I' + headers = { "User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36", "Accept" : "*/*", @@ -36,21 +31,19 @@ class ChatBase(AsyncGeneratorProvider): "Sec-Fetch-Mode" : "cors", "Sec-Fetch-Site" : "same-origin", } - async with ClientSession( - headers=headers - ) as session: + async with ClientSession(headers=headers) as session: data = { "messages": messages, "captchaCode": "hadsa", "chatId": chat_id, "conversationId": f"kcXpqEnqUie3dnJlsRi_O-{chat_id}" } + async with session.post("https://www.chatbase.co/api/fe/chat", json=data, proxy=proxy) as response: response.raise_for_status() async for stream in response.content.iter_any(): yield stream.decode() - @classmethod @property def params(cls): |