summaryrefslogtreecommitdiffstats
path: root/g4f/gui/server/provider.py
blob: 286f881b790f12be6532276cc682a5b355b33fb7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import g4f

def get_provider(provider: str) -> g4f.Provider.BaseProvider:
    
    if isinstance(provider, str):
        print(provider)
        if provider == 'g4f.Provider.Auto':
            return None
        
        if provider in g4f.Provider.ProviderUtils.convert:
            return g4f.Provider.ProviderUtils.convert[provider]
        
        else:
            return None
        
    else:
        return None