summaryrefslogtreecommitdiffstats
path: root/g4f/gui/server/provider.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g4f/gui/server/provider.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/g4f/gui/server/provider.py b/g4f/gui/server/provider.py
new file mode 100644
index 00000000..286f881b
--- /dev/null
+++ b/g4f/gui/server/provider.py
@@ -0,0 +1,17 @@
+import g4f
+
+def get_provider(provider: str) -> g4f.Provider.BaseProvider:
+
+ 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
+
+ else:
+ return None