gpt4free/g4f/gui/server/provider.py
ⲘrṨhส∂ow 3982f39424
'Refactored by Sourcery' (#1125)
Co-authored-by: Sourcery AI <>
2023-10-23 09:46:25 +02:00

15 lines
333 B
Python

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