From d719860e2af8a825a9e2eaf6dc97c375ff535cbb Mon Sep 17 00:00:00 2001 From: Commenter123321 <36051603+Commenter123321@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:47:41 +0200 Subject: make internet searching better --- g4f/gui/server/provider.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'g4f/gui/server/provider.py') diff --git a/g4f/gui/server/provider.py b/g4f/gui/server/provider.py index 286f881b..230b5f5f 100644 --- a/g4f/gui/server/provider.py +++ b/g4f/gui/server/provider.py @@ -1,6 +1,8 @@ import g4f +from g4f import BaseProvider -def get_provider(provider: str) -> g4f.Provider.BaseProvider: + +def get_provider(provider: str) -> BaseProvider | None: if isinstance(provider, str): print(provider) -- cgit v1.2.3 From 9239c5720002f31b67bdd1ee805e2cd9b528d085 Mon Sep 17 00:00:00 2001 From: Commenter123321 <36051603+Commenter123321@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:11:17 +0200 Subject: fix provider thing in gui x2 --- g4f/gui/server/provider.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'g4f/gui/server/provider.py') diff --git a/g4f/gui/server/provider.py b/g4f/gui/server/provider.py index 230b5f5f..11202d38 100644 --- a/g4f/gui/server/provider.py +++ b/g4f/gui/server/provider.py @@ -3,17 +3,12 @@ from g4f import BaseProvider def get_provider(provider: str) -> BaseProvider | None: - if isinstance(provider, str): print(provider) if provider == 'g4f.Provider.Auto': return None - if provider in g4f.Provider.ProviderUtils.convert: - return g4f.Provider.ProviderUtils.convert[provider] - - else: - return None + return g4f.Provider.ProviderUtils.convert.get(provider) else: return None -- cgit v1.2.3