diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-04-18 20:18:51 +0200 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-04-18 20:18:51 +0200 |
commit | 7e543f4747914f280454f09b070ead500fb72277 (patch) | |
tree | 94e4680f009d25d2437895262e50316c2020b80e /g4f/providers | |
parent | Add missing styling on phone (diff) | |
download | gpt4free-7e543f4747914f280454f09b070ead500fb72277.tar gpt4free-7e543f4747914f280454f09b070ead500fb72277.tar.gz gpt4free-7e543f4747914f280454f09b070ead500fb72277.tar.bz2 gpt4free-7e543f4747914f280454f09b070ead500fb72277.tar.lz gpt4free-7e543f4747914f280454f09b070ead500fb72277.tar.xz gpt4free-7e543f4747914f280454f09b070ead500fb72277.tar.zst gpt4free-7e543f4747914f280454f09b070ead500fb72277.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/providers/base_provider.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/g4f/providers/base_provider.py b/g4f/providers/base_provider.py index 86789ec2..fa3f15a9 100644 --- a/g4f/providers/base_provider.py +++ b/g4f/providers/base_provider.py @@ -264,16 +264,18 @@ class AsyncGeneratorProvider(AsyncProvider): AsyncResult: An asynchronous generator yielding results. """ raise NotImplementedError() - + class ProviderModelMixin: default_model: str models: list[str] = [] model_aliases: dict[str, str] = {} - + @classmethod def get_models(cls) -> list[str]: + if not cls.models: + return [cls.default_model] return cls.models - + @classmethod def get_model(cls, model: str) -> str: if not model and cls.default_model is not None: |