summaryrefslogtreecommitdiffstats
path: root/g4f/gui/server/provider.py
blob: 11202d38110392fb44eb7f55eda4e923535bf21f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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