diff options
author | Tekky <98614666+xtekky@users.noreply.github.com> | 2023-10-25 15:07:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-25 15:07:40 +0200 |
commit | a167970d766671ccb79613dbeacf5747f9c3f2bf (patch) | |
tree | 1e6c5479bd3793cfef48775229764c22881e5e8a | |
parent | Merge pull request #1152 from guspan-tanadi/Providerlinkpath-1 (diff) | |
parent | Indicated support of message history in GptForLove.py (diff) | |
download | gpt4free-a167970d766671ccb79613dbeacf5747f9c3f2bf.tar gpt4free-a167970d766671ccb79613dbeacf5747f9c3f2bf.tar.gz gpt4free-a167970d766671ccb79613dbeacf5747f9c3f2bf.tar.bz2 gpt4free-a167970d766671ccb79613dbeacf5747f9c3f2bf.tar.lz gpt4free-a167970d766671ccb79613dbeacf5747f9c3f2bf.tar.xz gpt4free-a167970d766671ccb79613dbeacf5747f9c3f2bf.tar.zst gpt4free-a167970d766671ccb79613dbeacf5747f9c3f2bf.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/Bing.py | 1 | ||||
-rw-r--r-- | g4f/Provider/ChatBase.py | 3 | ||||
-rw-r--r-- | g4f/Provider/ChatForAi.py | 3 | ||||
-rw-r--r-- | g4f/Provider/ChatgptX.py | 3 | ||||
-rw-r--r-- | g4f/Provider/FakeGpt.py | 3 | ||||
-rw-r--r-- | g4f/Provider/FreeGpt.py | 1 | ||||
-rw-r--r-- | g4f/Provider/GPTalk.py | 3 | ||||
-rw-r--r-- | g4f/Provider/GptForLove.py | 1 | ||||
-rw-r--r-- | g4f/Provider/You.py | 3 | ||||
-rw-r--r-- | g4f/Provider/Yqcloud.py | 1 | ||||
-rw-r--r-- | g4f/Provider/base_provider.py | 3 |
11 files changed, 18 insertions, 7 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 7190e617..d59717c0 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 = ["Hmm, I am not sure. Email support@chatbase.co for more info.", "I can only provide support and information about Chatbase"] @@ -60,4 +61,4 @@ class ChatBase(AsyncGeneratorProvider): ("stream", "bool"), ] param = ", ".join([": ".join(p) for p in params]) - return f"g4f.provider.{cls.__name__} supports: ({param})"
\ No newline at end of file + return f"g4f.provider.{cls.__name__} supports: ({param})" 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() |