gpt4free/g4f/gui/server/provider.py
2023-10-10 15:11:17 +02:00

15 lines
336 B
Python

import g4f
from g4f import BaseProvider
def get_provider(provider: str) -> BaseProvider | None:
if isinstance(provider, str):
print(provider)
if provider == 'g4f.Provider.Auto':
return None
return g4f.Provider.ProviderUtils.convert.get(provider)
else:
return None