summaryrefslogblamecommitdiffstats
path: root/g4f/gui/server/provider.py
blob: 230b5f5fe82cd09a65e2952198d0c4032e9b12f0 (plain) (tree)
1
2
3
4
5
          
                            
 

                                                       













                                                               
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
        
        if provider in g4f.Provider.ProviderUtils.convert:
            return g4f.Provider.ProviderUtils.convert[provider]
        
        else:
            return None
        
    else:
        return None