From 4a3b663ccd44735d77c372b5f629a728f0b90591 Mon Sep 17 00:00:00 2001 From: abc <98614666+xtekky@users.noreply.github.com> Date: Mon, 16 Oct 2023 00:47:10 +0100 Subject: ~ | remove non-working providers --- g4f/Provider/GptChatly.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'g4f/Provider/GptChatly.py') 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": "*/*", -- cgit v1.2.3