diff options
author | abc <98614666+xtekky@users.noreply.github.com> | 2023-10-16 01:47:10 +0200 |
---|---|---|
committer | abc <98614666+xtekky@users.noreply.github.com> | 2023-10-16 01:47:10 +0200 |
commit | 4a3b663ccd44735d77c372b5f629a728f0b90591 (patch) | |
tree | f76dba66613f4e074862d57621ea888cd3e741f7 /g4f/Provider/GptChatly.py | |
parent | ~ | new `test_providers.py` (diff) | |
download | gpt4free-4a3b663ccd44735d77c372b5f629a728f0b90591.tar gpt4free-4a3b663ccd44735d77c372b5f629a728f0b90591.tar.gz gpt4free-4a3b663ccd44735d77c372b5f629a728f0b90591.tar.bz2 gpt4free-4a3b663ccd44735d77c372b5f629a728f0b90591.tar.lz gpt4free-4a3b663ccd44735d77c372b5f629a728f0b90591.tar.xz gpt4free-4a3b663ccd44735d77c372b5f629a728f0b90591.tar.zst gpt4free-4a3b663ccd44735d77c372b5f629a728f0b90591.zip |
Diffstat (limited to 'g4f/Provider/GptChatly.py')
-rw-r--r-- | g4f/Provider/GptChatly.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/g4f/Provider/GptChatly.py b/g4f/Provider/GptChatly.py index 1d9b76cf..80fe6349 100644 --- a/g4f/Provider/GptChatly.py +++ b/g4f/Provider/GptChatly.py @@ -1,29 +1,36 @@ +# cloudflare block + from __future__ import annotations from aiohttp import ClientSession from ..typing import Messages from .base_provider import AsyncProvider +from .helper import get_cookies class GptChatly(AsyncProvider): url = "https://gptchatly.com" supports_gpt_35_turbo = True supports_gpt_4 = True - working = True + working = False @classmethod async def create_async( cls, model: str, messages: Messages, - proxy: str = None, - **kwargs - ) -> str: + proxy: str = None, cookies: dict = None, **kwargs) -> str: + + if not cookies: + cookies = get_cookies('gptchatly.com') + + if model.startswith("gpt-4"): chat_url = f"{cls.url}/fetch-gpt4-response" else: chat_url = f"{cls.url}/fetch-response" + headers = { "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0", "Accept": "*/*", |