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