diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-04-18 21:13:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-18 21:13:26 +0200 |
commit | 718ea7c187b0852aacc18bf890fcc105dfff2665 (patch) | |
tree | 84f59d4ea5a679382df3f71ff3de027aad2a8fd4 /g4f/providers | |
parent | Merge pull request #1848 from hlohaus/nem (diff) | |
parent | Add Ecosia Provider, Add OpenaiAccount alias (diff) | |
download | gpt4free-718ea7c187b0852aacc18bf890fcc105dfff2665.tar gpt4free-718ea7c187b0852aacc18bf890fcc105dfff2665.tar.gz gpt4free-718ea7c187b0852aacc18bf890fcc105dfff2665.tar.bz2 gpt4free-718ea7c187b0852aacc18bf890fcc105dfff2665.tar.lz gpt4free-718ea7c187b0852aacc18bf890fcc105dfff2665.tar.xz gpt4free-718ea7c187b0852aacc18bf890fcc105dfff2665.tar.zst gpt4free-718ea7c187b0852aacc18bf890fcc105dfff2665.zip |
Diffstat (limited to 'g4f/providers')
-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 cb60d78f..685a6f98 100644 --- a/g4f/providers/base_provider.py +++ b/g4f/providers/base_provider.py @@ -269,16 +269,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: |