From efd75a11b871d61ac31b0e274acdfb33daba361d Mon Sep 17 00:00:00 2001 From: abc <98614666+xtekky@users.noreply.github.com> Date: Sun, 27 Aug 2023 17:37:44 +0200 Subject: ~ | code styling --- g4f/Provider/OpenaiChat.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'g4f/Provider/OpenaiChat.py') diff --git a/g4f/Provider/OpenaiChat.py b/g4f/Provider/OpenaiChat.py index cca258b3..c023c898 100644 --- a/g4f/Provider/OpenaiChat.py +++ b/g4f/Provider/OpenaiChat.py @@ -3,16 +3,17 @@ try: from revChatGPT.V1 import AsyncChatbot except ImportError: has_module = False + from .base_provider import AsyncGeneratorProvider, get_cookies -from ..typing import AsyncGenerator +from ..typing import AsyncGenerator class OpenaiChat(AsyncGeneratorProvider): - url = "https://chat.openai.com" - needs_auth = True - working = has_module + url = "https://chat.openai.com" + needs_auth = True + working = has_module supports_gpt_35_turbo = True - supports_gpt_4 = True - supports_stream = True + supports_gpt_4 = True + supports_stream = True @classmethod async def create_async_generator( @@ -36,8 +37,8 @@ class OpenaiChat(AsyncGeneratorProvider): ) if not access_token: - cookies = cookies if cookies else get_cookies("chat.openai.com") - response = await bot.session.get("https://chat.openai.com/api/auth/session", cookies=cookies) + cookies = cookies if cookies else get_cookies("chat.openai.com") + response = await bot.session.get("https://chat.openai.com/api/auth/session", cookies=cookies) access_token = response.json()["accessToken"] bot.set_access_token(access_token) -- cgit v1.2.3