summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
Diffstat (limited to 'g4f')
-rw-r--r--g4f/Provider/Bing.py1
-rw-r--r--g4f/Provider/ChatBase.py1
-rw-r--r--g4f/Provider/ChatForAi.py3
-rw-r--r--g4f/Provider/ChatgptX.py3
-rw-r--r--g4f/Provider/FakeGpt.py3
-rw-r--r--g4f/Provider/FreeGpt.py1
-rw-r--r--g4f/Provider/GPTalk.py3
-rw-r--r--g4f/Provider/GptForLove.py1
-rw-r--r--g4f/Provider/You.py3
-rw-r--r--g4f/Provider/Yqcloud.py1
-rw-r--r--g4f/Provider/base_provider.py3
11 files changed, 17 insertions, 6 deletions
diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py
index c54a3ae5..ca14510c 100644
--- a/g4f/Provider/Bing.py
+++ b/g4f/Provider/Bing.py
@@ -32,6 +32,7 @@ default_cookies = {
class Bing(AsyncGeneratorProvider):
url = "https://bing.com/chat"
working = True
+ supports_message_history = True
supports_gpt_4 = True
@staticmethod
diff --git a/g4f/Provider/ChatBase.py b/g4f/Provider/ChatBase.py
index 7a2e2ff8..ada51fed 100644
--- a/g4f/Provider/ChatBase.py
+++ b/g4f/Provider/ChatBase.py
@@ -9,6 +9,7 @@ from .base_provider import AsyncGeneratorProvider
class ChatBase(AsyncGeneratorProvider):
url = "https://www.chatbase.co"
supports_gpt_35_turbo = True
+ supports_message_history = True
working = True
list_incorrect_responses = ["support@chatbase",
"about Chatbase"]
diff --git a/g4f/Provider/ChatForAi.py b/g4f/Provider/ChatForAi.py
index 718affeb..7a4e9264 100644
--- a/g4f/Provider/ChatForAi.py
+++ b/g4f/Provider/ChatForAi.py
@@ -11,6 +11,7 @@ from .base_provider import AsyncGeneratorProvider
class ChatForAi(AsyncGeneratorProvider):
url = "https://chatforai.store"
working = True
+ supports_message_history = True
supports_gpt_35_turbo = True
@classmethod
@@ -69,4 +70,4 @@ class ChatForAi(AsyncGeneratorProvider):
def generate_signature(timestamp: int, message: str, id: str):
buffer = f"{timestamp}:{id}:{message}:7YN8z6d6"
- return hashlib.sha256(buffer.encode()).hexdigest() \ No newline at end of file
+ return hashlib.sha256(buffer.encode()).hexdigest()
diff --git a/g4f/Provider/ChatgptX.py b/g4f/Provider/ChatgptX.py
index 9a8711b9..75ff0da5 100644
--- a/g4f/Provider/ChatgptX.py
+++ b/g4f/Provider/ChatgptX.py
@@ -12,6 +12,7 @@ from .helper import format_prompt
class ChatgptX(AsyncGeneratorProvider):
url = "https://chatgptx.de"
supports_gpt_35_turbo = True
+ supports_message_history = True
working = True
@classmethod
@@ -96,4 +97,4 @@ class ChatgptX(AsyncGeneratorProvider):
except:
raise RuntimeError(f"Broken line: {line.decode()}")
if content:
- yield content \ No newline at end of file
+ yield content
diff --git a/g4f/Provider/FakeGpt.py b/g4f/Provider/FakeGpt.py
index 5bce1280..a89425d3 100644
--- a/g4f/Provider/FakeGpt.py
+++ b/g4f/Provider/FakeGpt.py
@@ -10,6 +10,7 @@ from .helper import format_prompt
class FakeGpt(AsyncGeneratorProvider):
url = "https://chat-shared2.zhile.io"
+ supports_message_history = True
supports_gpt_35_turbo = True
working = True
_access_token = None
@@ -91,4 +92,4 @@ class FakeGpt(AsyncGeneratorProvider):
raise RuntimeError("No valid response")
def random_string(length: int = 10):
- return ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length)) \ No newline at end of file
+ return ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length))
diff --git a/g4f/Provider/FreeGpt.py b/g4f/Provider/FreeGpt.py
index 00d9137d..758e411b 100644
--- a/g4f/Provider/FreeGpt.py
+++ b/g4f/Provider/FreeGpt.py
@@ -12,6 +12,7 @@ domains = [
class FreeGpt(AsyncGeneratorProvider):
url = "https://freegpts1.aifree.site/"
+ supports_message_history = True
supports_gpt_35_turbo = True
working = True
diff --git a/g4f/Provider/GPTalk.py b/g4f/Provider/GPTalk.py
index c6b57d91..a5644fc4 100644
--- a/g4f/Provider/GPTalk.py
+++ b/g4f/Provider/GPTalk.py
@@ -11,6 +11,7 @@ from .helper import format_prompt
class GPTalk(AsyncGeneratorProvider):
url = "https://gptalk.net"
supports_gpt_35_turbo = True
+ supports_message_history = True
working = True
_auth = None
@@ -81,4 +82,4 @@ class GPTalk(AsyncGeneratorProvider):
break
message = json.loads(line[6:-1])["content"]
yield message[len(last_message):]
- last_message = message \ No newline at end of file
+ last_message = message
diff --git a/g4f/Provider/GptForLove.py b/g4f/Provider/GptForLove.py
index 28939592..4b31809c 100644
--- a/g4f/Provider/GptForLove.py
+++ b/g4f/Provider/GptForLove.py
@@ -9,6 +9,7 @@ from .helper import format_prompt
class GptForLove(AsyncGeneratorProvider):
url = "https://ai18.gptforlove.com"
+ supports_message_history = True
supports_gpt_35_turbo = True
working = True
diff --git a/g4f/Provider/You.py b/g4f/Provider/You.py
index 1afd18be..34972586 100644
--- a/g4f/Provider/You.py
+++ b/g4f/Provider/You.py
@@ -10,6 +10,7 @@ from .base_provider import AsyncGeneratorProvider, format_prompt
class You(AsyncGeneratorProvider):
url = "https://you.com"
working = True
+ supports_message_history = True
supports_gpt_35_turbo = True
@@ -37,4 +38,4 @@ class You(AsyncGeneratorProvider):
start = b'data: {"youChatToken": '
async for line in response.iter_lines():
if line.startswith(start):
- yield json.loads(line[len(start):-1]) \ No newline at end of file
+ yield json.loads(line[len(start):-1])
diff --git a/g4f/Provider/Yqcloud.py b/g4f/Provider/Yqcloud.py
index 2829c5bf..12eb7bbb 100644
--- a/g4f/Provider/Yqcloud.py
+++ b/g4f/Provider/Yqcloud.py
@@ -10,6 +10,7 @@ from .base_provider import AsyncGeneratorProvider, format_prompt
class Yqcloud(AsyncGeneratorProvider):
url = "https://chat9.yqcloud.top/"
working = True
+ supports_message_history = True
supports_gpt_35_turbo = True
@staticmethod
diff --git a/g4f/Provider/base_provider.py b/g4f/Provider/base_provider.py
index c54b98e5..47ea6ff8 100644
--- a/g4f/Provider/base_provider.py
+++ b/g4f/Provider/base_provider.py
@@ -15,6 +15,7 @@ class BaseProvider(ABC):
supports_stream: bool = False
supports_gpt_35_turbo: bool = False
supports_gpt_4: bool = False
+ supports_message_history: bool = False
@staticmethod
@abstractmethod
@@ -135,4 +136,4 @@ class AsyncGeneratorProvider(AsyncProvider):
messages: Messages,
**kwargs
) -> AsyncResult:
- raise NotImplementedError() \ No newline at end of file
+ raise NotImplementedError()