gpt4free/g4f/gui/server/provider.py

15 lines
333 B
Python
Raw Normal View History

from __future__ import annotations
2023-10-09 22:46:02 +00:00
import g4f
2023-10-10 12:47:41 +00:00
from g4f import BaseProvider
2023-10-09 22:46:02 +00:00
2023-10-10 12:47:41 +00:00
def get_provider(provider: str) -> BaseProvider | None:
if not isinstance(provider, str):
2023-10-09 22:46:02 +00:00
return None
print(provider)
if provider == 'g4f.Provider.Auto':
return None
return g4f.Provider.ProviderUtils.convert.get(provider)