mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-01 03:21:02 +00:00
3982f39424
Co-authored-by: Sourcery AI <>
15 lines
333 B
Python
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)
|