mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-19 03:25:32 +00:00
17 lines
372 B
Python
17 lines
372 B
Python
from __future__ import annotations
|
|
|
|
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
|