summaryrefslogtreecommitdiffstats
path: root/g4f/gui/server/provider.py
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/gui/server/provider.py')
-rw-r--r--g4f/gui/server/provider.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/g4f/gui/server/provider.py b/g4f/gui/server/provider.py
index 286f881b..11202d38 100644
--- a/g4f/gui/server/provider.py
+++ b/g4f/gui/server/provider.py
@@ -1,17 +1,14 @@
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)
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