summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorkqlio67 <kqlio67@users.noreply.github.com>2024-11-06 17:39:14 +0100
committerkqlio67 <kqlio67@users.noreply.github.com>2024-11-06 17:39:14 +0100
commit6dd378d2aca256f45ff7b2fd23c59497aad82045 (patch)
treec07a20b0e2e3c1643065cef96910ae8acc84a5eb /g4f
parentUpdate (g4f/Provider/not_working/) (diff)
downloadgpt4free-6dd378d2aca256f45ff7b2fd23c59497aad82045.tar
gpt4free-6dd378d2aca256f45ff7b2fd23c59497aad82045.tar.gz
gpt4free-6dd378d2aca256f45ff7b2fd23c59497aad82045.tar.bz2
gpt4free-6dd378d2aca256f45ff7b2fd23c59497aad82045.tar.lz
gpt4free-6dd378d2aca256f45ff7b2fd23c59497aad82045.tar.xz
gpt4free-6dd378d2aca256f45ff7b2fd23c59497aad82045.tar.zst
gpt4free-6dd378d2aca256f45ff7b2fd23c59497aad82045.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/Bing.py2
-rw-r--r--g4f/Provider/__init__.py3
-rw-r--r--g4f/Provider/needs_auth/BingCreateImages.py (renamed from g4f/Provider/BingCreateImages.py)12
-rw-r--r--g4f/Provider/needs_auth/GeminiPro.py (renamed from g4f/Provider/GeminiPro.py)12
-rw-r--r--g4f/Provider/needs_auth/OpenaiChat.py1
-rw-r--r--g4f/Provider/needs_auth/WhiteRabbitNeo.py (renamed from g4f/Provider/WhiteRabbitNeo.py)10
-rw-r--r--g4f/Provider/needs_auth/__init__.py32
7 files changed, 37 insertions, 35 deletions
diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py
index f04b1a54..cdc2b9d9 100644
--- a/g4f/Provider/Bing.py
+++ b/g4f/Provider/Bing.py
@@ -17,7 +17,7 @@ from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
from .helper import get_random_hex
from .bing.upload_image import upload_image
from .bing.conversation import Conversation, create_conversation, delete_conversation
-from .BingCreateImages import BingCreateImages
+from .needs_auth.BingCreateImages import BingCreateImages
from .. import debug
class Tones:
diff --git a/g4f/Provider/__init__.py b/g4f/Provider/__init__.py
index f297f4dc..19ddaa53 100644
--- a/g4f/Provider/__init__.py
+++ b/g4f/Provider/__init__.py
@@ -20,7 +20,6 @@ from .Allyfy import Allyfy
from .AiMathGPT import AiMathGPT
from .Airforce import Airforce
from .Bing import Bing
-from .BingCreateImages import BingCreateImages
from .Blackbox import Blackbox
from .ChatGpt import ChatGpt
from .Chatgpt4Online import Chatgpt4Online
@@ -32,7 +31,6 @@ from .DDG import DDG
from .DeepInfraChat import DeepInfraChat
from .Free2GPT import Free2GPT
from .FreeGpt import FreeGpt
-from .GeminiPro import GeminiPro
from .GizAI import GizAI
from .HuggingChat import HuggingChat
from .Liaobots import Liaobots
@@ -46,7 +44,6 @@ from .ReplicateHome import ReplicateHome
from .RubiksAI import RubiksAI
from .TeachAnything import TeachAnything
from .Upstage import Upstage
-from .WhiteRabbitNeo import WhiteRabbitNeo
from .You import You
import sys
diff --git a/g4f/Provider/BingCreateImages.py b/g4f/Provider/needs_auth/BingCreateImages.py
index 7a206c8f..80984d40 100644
--- a/g4f/Provider/BingCreateImages.py
+++ b/g4f/Provider/needs_auth/BingCreateImages.py
@@ -1,11 +1,11 @@
from __future__ import annotations
-from ..cookies import get_cookies
-from ..image import ImageResponse
-from ..errors import MissingAuthError
-from ..typing import AsyncResult, Messages, Cookies
-from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
-from .bing.create_images import create_images, create_session
+from ...cookies import get_cookies
+from ...image import ImageResponse
+from ...errors import MissingAuthError
+from ...typing import AsyncResult, Messages, Cookies
+from ..base_provider import AsyncGeneratorProvider, ProviderModelMixin
+from ..bing.create_images import create_images, create_session
class BingCreateImages(AsyncGeneratorProvider, ProviderModelMixin):
label = "Microsoft Designer in Bing"
diff --git a/g4f/Provider/GeminiPro.py b/g4f/Provider/needs_auth/GeminiPro.py
index 06bf69ee..5c170ae5 100644
--- a/g4f/Provider/GeminiPro.py
+++ b/g4f/Provider/needs_auth/GeminiPro.py
@@ -4,11 +4,11 @@ import base64
import json
from aiohttp import ClientSession, BaseConnector
-from ..typing import AsyncResult, Messages, ImageType
-from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
-from ..image import to_bytes, is_accepted_format
-from ..errors import MissingAuthError
-from .helper import get_connector
+from ...typing import AsyncResult, Messages, ImageType
+from ..base_provider import AsyncGeneratorProvider, ProviderModelMixin
+from ...image import to_bytes, is_accepted_format
+from ...errors import MissingAuthError
+from ..helper import get_connector
class GeminiPro(AsyncGeneratorProvider, ProviderModelMixin):
label = "Gemini API"
@@ -104,4 +104,4 @@ class GeminiPro(AsyncGeneratorProvider, ProviderModelMixin):
lines.append(chunk)
else:
data = await response.json()
- yield data["candidates"][0]["content"]["parts"][0]["text"] \ No newline at end of file
+ yield data["candidates"][0]["content"]["parts"][0]["text"]
diff --git a/g4f/Provider/needs_auth/OpenaiChat.py b/g4f/Provider/needs_auth/OpenaiChat.py
index f02121e3..3a0d6b29 100644
--- a/g4f/Provider/needs_auth/OpenaiChat.py
+++ b/g4f/Provider/needs_auth/OpenaiChat.py
@@ -55,6 +55,7 @@ class OpenaiChat(AsyncGeneratorProvider, ProviderModelMixin):
label = "OpenAI ChatGPT"
url = "https://chatgpt.com"
working = True
+ needs_auth = True
supports_gpt_4 = True
supports_message_history = True
supports_system_message = True
diff --git a/g4f/Provider/WhiteRabbitNeo.py b/g4f/Provider/needs_auth/WhiteRabbitNeo.py
index 339434e6..82275c1c 100644
--- a/g4f/Provider/WhiteRabbitNeo.py
+++ b/g4f/Provider/needs_auth/WhiteRabbitNeo.py
@@ -2,10 +2,10 @@ from __future__ import annotations
from aiohttp import ClientSession, BaseConnector
-from ..typing import AsyncResult, Messages, Cookies
-from ..requests.raise_for_status import raise_for_status
-from .base_provider import AsyncGeneratorProvider
-from .helper import get_cookies, get_connector, get_random_string
+from ...typing import AsyncResult, Messages, Cookies
+from ...requests.raise_for_status import raise_for_status
+from ..base_provider import AsyncGeneratorProvider
+from ..helper import get_cookies, get_connector, get_random_string
class WhiteRabbitNeo(AsyncGeneratorProvider):
url = "https://www.whiterabbitneo.com"
@@ -54,4 +54,4 @@ class WhiteRabbitNeo(AsyncGeneratorProvider):
await raise_for_status(response)
async for chunk in response.content.iter_any():
if chunk:
- yield chunk.decode(errors="ignore") \ No newline at end of file
+ yield chunk.decode(errors="ignore")
diff --git a/g4f/Provider/needs_auth/__init__.py b/g4f/Provider/needs_auth/__init__.py
index 0626a837..e979f86d 100644
--- a/g4f/Provider/needs_auth/__init__.py
+++ b/g4f/Provider/needs_auth/__init__.py
@@ -1,18 +1,22 @@
from .gigachat import *
-from .DeepInfra import DeepInfra
-from .DeepInfraImage import DeepInfraImage
-from .Gemini import Gemini
-from .Raycast import Raycast
-from .Theb import Theb
-from .ThebApi import ThebApi
-from .OpenaiChat import OpenaiChat
-from .Poe import Poe
-from .Openai import Openai
-from .Groq import Groq
-#from .OpenaiAccount import OpenaiAccount
-from .PerplexityApi import PerplexityApi
-from .Replicate import Replicate
-from .MetaAI import MetaAI
#from .MetaAIAccount import MetaAIAccount
+#from .OpenaiAccount import OpenaiAccount
+
+from .BingCreateImages import BingCreateImages
+from .DeepInfra import DeepInfra
+from .DeepInfraImage import DeepInfraImage
+from .Gemini import Gemini
+from .GeminiPro import GeminiPro
+from .Groq import Groq
from .HuggingFace import HuggingFace
+from .MetaAI import MetaAI
+from .Openai import Openai
+from .OpenaiChat import OpenaiChat
+from .PerplexityApi import PerplexityApi
+from .Poe import Poe
+from .Raycast import Raycast
+from .Replicate import Replicate
+from .Theb import Theb
+from .ThebApi import ThebApi
+from .WhiteRabbitNeo import WhiteRabbitNeo