From 0b5d1d3d18736899d5665af846a2eb88873bc8f0 Mon Sep 17 00:00:00 2001 From: Bagus Indrayana Date: Thu, 17 Aug 2023 23:36:33 +0800 Subject: add provider --- g4f/Provider/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'g4f/Provider/__init__.py') diff --git a/g4f/Provider/__init__.py b/g4f/Provider/__init__.py index 81d1ad64..432ae672 100644 --- a/g4f/Provider/__init__.py +++ b/g4f/Provider/__init__.py @@ -25,6 +25,7 @@ from .You import You from .Yqcloud import Yqcloud from .Equing import Equing from .FastGpt import FastGpt +from .Wuguokai import Wuguokai __all__ = [ "BaseProvider", @@ -53,5 +54,6 @@ __all__ = [ "You", "Yqcloud", "Equing", - "FastGpt" + "FastGpt", + "Wuguokai" ] -- cgit v1.2.3 From 126496d3cacd06a4fa8cbb4e5bde417ce6bb5b4a Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Fri, 25 Aug 2023 06:41:32 +0200 Subject: Add OpenaiChat and Hugchat Provider Add tests for providers with auth Improve async support / 2x faster Shared get_cookies by domain function --- g4f/Provider/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'g4f/Provider/__init__.py') diff --git a/g4f/Provider/__init__.py b/g4f/Provider/__init__.py index e27dee5d..5ad9f156 100644 --- a/g4f/Provider/__init__.py +++ b/g4f/Provider/__init__.py @@ -14,9 +14,11 @@ from .EasyChat import EasyChat from .Forefront import Forefront from .GetGpt import GetGpt from .H2o import H2o +from .Hugchat import Hugchat from .Liaobots import Liaobots from .Lockchat import Lockchat from .Opchatgpts import Opchatgpts +from .OpenaiChat import OpenaiChat from .Raycast import Raycast from .Theb import Theb from .Vercel import Vercel @@ -44,10 +46,12 @@ __all__ = [ "Forefront", "GetGpt", "H2o", + "Hugchat", "Liaobots", "Lockchat", "Opchatgpts", "Raycast", + "OpenaiChat", "Theb", "Vercel", "Wewordle", -- cgit v1.2.3 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/__init__.py | 123 ++++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 61 deletions(-) (limited to 'g4f/Provider/__init__.py') diff --git a/g4f/Provider/__init__.py b/g4f/Provider/__init__.py index 7b2cd1e5..61ae4dc4 100644 --- a/g4f/Provider/__init__.py +++ b/g4f/Provider/__init__.py @@ -1,65 +1,66 @@ -from .Acytoo import Acytoo -from .Aichat import Aichat -from .Ails import Ails -from .AiService import AiService -from .AItianhu import AItianhu -from .Bard import Bard +from .Acytoo import Acytoo +from .Aichat import Aichat +from .Ails import Ails +from .AiService import AiService +from .AItianhu import AItianhu +from .Bard import Bard +from .Bing import Bing +from .ChatgptAi import ChatgptAi +from .ChatgptLogin import ChatgptLogin +from .DeepAi import DeepAi +from .DfeHub import DfeHub +from .EasyChat import EasyChat +from .Forefront import Forefront +from .GetGpt import GetGpt +from .H2o import H2o +from .Hugchat import Hugchat +from .Liaobots import Liaobots +from .Lockchat import Lockchat +from .Opchatgpts import Opchatgpts +from .OpenaiChat import OpenaiChat +from .Raycast import Raycast +from .Theb import Theb +from .Vercel import Vercel +from .Wewordle import Wewordle +from .You import You +from .Yqcloud import Yqcloud +from .Equing import Equing +from .FastGpt import FastGpt +from .V50 import V50 +from .Wuguokai import Wuguokai + from .base_provider import BaseProvider -from .Bing import Bing -from .ChatgptAi import ChatgptAi -from .ChatgptLogin import ChatgptLogin -from .DeepAi import DeepAi -from .DfeHub import DfeHub -from .EasyChat import EasyChat -from .Forefront import Forefront -from .GetGpt import GetGpt -from .H2o import H2o -from .Hugchat import Hugchat -from .Liaobots import Liaobots -from .Lockchat import Lockchat -from .Opchatgpts import Opchatgpts -from .OpenaiChat import OpenaiChat -from .Raycast import Raycast -from .Theb import Theb -from .Vercel import Vercel -from .Wewordle import Wewordle -from .You import You -from .Yqcloud import Yqcloud -from .Equing import Equing -from .FastGpt import FastGpt -from .V50 import V50 -from .Wuguokai import Wuguokai __all__ = [ - "BaseProvider", - "Acytoo", - "Aichat", - "Ails", - "AiService", - "AItianhu", - "Bard", - "Bing", - "ChatgptAi", - "ChatgptLogin", - "DeepAi", - "DfeHub", - "EasyChat", - "Forefront", - "GetGpt", - "H2o", - "Hugchat", - "Liaobots", - "Lockchat", - "Opchatgpts", - "Raycast", - "OpenaiChat", - "Theb", - "Vercel", - "Wewordle", - "You", - "Yqcloud", - "Equing", - "FastGpt", - "Wuguokai" - "V50" + 'BaseProvider', + 'Acytoo', + 'Aichat', + 'Ails', + 'AiService', + 'AItianhu', + 'Bard', + 'Bing', + 'ChatgptAi', + 'ChatgptLogin', + 'DeepAi', + 'DfeHub', + 'EasyChat', + 'Forefront', + 'GetGpt', + 'H2o', + 'Hugchat', + 'Liaobots', + 'Lockchat', + 'Opchatgpts', + 'Raycast', + 'OpenaiChat', + 'Theb', + 'Vercel', + 'Wewordle', + 'You', + 'Yqcloud', + 'Equing', + 'FastGpt', + 'Wuguokai', + 'V50' ] -- cgit v1.2.3 From 7294abc890c377d75c6c8c932620c2e2c8b3f0f9 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Mon, 28 Aug 2023 01:43:45 +0200 Subject: Add async support for H2o Add format_prompt helper Fix create_completion in AsyncGeneratorProvider Move get_cookies from constructor to function Add ow HuggingChat implement Remove need auth form Liabots Add staic cache for access_token in OpenaiChat Add OpenAssistant provider Support stream and async in You Support async and add userId in Yqcloud Add log_time module --- g4f/Provider/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'g4f/Provider/__init__.py') diff --git a/g4f/Provider/__init__.py b/g4f/Provider/__init__.py index 61ae4dc4..06643665 100644 --- a/g4f/Provider/__init__.py +++ b/g4f/Provider/__init__.py @@ -13,11 +13,12 @@ from .EasyChat import EasyChat from .Forefront import Forefront from .GetGpt import GetGpt from .H2o import H2o -from .Hugchat import Hugchat +from .HuggingChat import HuggingChat from .Liaobots import Liaobots from .Lockchat import Lockchat from .Opchatgpts import Opchatgpts from .OpenaiChat import OpenaiChat +from .OpenAssistant import OpenAssistant from .Raycast import Raycast from .Theb import Theb from .Vercel import Vercel @@ -48,12 +49,13 @@ __all__ = [ 'Forefront', 'GetGpt', 'H2o', - 'Hugchat', + 'HuggingChat', 'Liaobots', 'Lockchat', 'Opchatgpts', 'Raycast', 'OpenaiChat', + 'OpenAssistant', 'Theb', 'Vercel', 'Wewordle', -- cgit v1.2.3 From 3e6b1d6bef04881d8f46ab06331b5e3c5e2e3471 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Fri, 1 Sep 2023 23:39:57 +0200 Subject: Set working=True in Liaobots, Fix bing provider, Update readme --- g4f/Provider/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'g4f/Provider/__init__.py') diff --git a/g4f/Provider/__init__.py b/g4f/Provider/__init__.py index 06643665..fce66d0c 100644 --- a/g4f/Provider/__init__.py +++ b/g4f/Provider/__init__.py @@ -30,7 +30,7 @@ from .FastGpt import FastGpt from .V50 import V50 from .Wuguokai import Wuguokai -from .base_provider import BaseProvider +from .base_provider import BaseProvider, AsyncProvider, AsyncGeneratorProvider __all__ = [ 'BaseProvider', -- cgit v1.2.3 From 901595b10f08972ee3ac5fc08c346dbb561a7d62 Mon Sep 17 00:00:00 2001 From: msi-JunXiang Date: Sun, 3 Sep 2023 16:26:26 +0800 Subject: type hints Use `from __future__ import annotations avoid `dict` and `list` cause "TypeErro: 'type' object is not subscriptable". Refer to the following Stack Overflow discussions for more information: 1. https://stackoverflow.com/questions/75202610/typeerror-type-object-is-not-subscriptable-python 2. https://stackoverflow.com/questions/59101121/type-hint-for-a-dict-gives-typeerror-type-object-is-not-subscriptable --- g4f/Provider/__init__.py | 1 + 1 file changed, 1 insertion(+) (limited to 'g4f/Provider/__init__.py') diff --git a/g4f/Provider/__init__.py b/g4f/Provider/__init__.py index fce66d0c..fa1bdb87 100644 --- a/g4f/Provider/__init__.py +++ b/g4f/Provider/__init__.py @@ -1,3 +1,4 @@ +from __future__ import annotations from .Acytoo import Acytoo from .Aichat import Aichat from .Ails import Ails -- cgit v1.2.3