diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-01-14 07:45:41 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-01-14 07:45:41 +0100 |
commit | 5756586cde6ed6da147119113fb5a5fd640d5f83 (patch) | |
tree | 64a9612c8c32e3c7eb4cdeb6f4ad63a08e5706b0 /g4f/models.py | |
parent | Fix process_image in Bing (diff) | |
download | gpt4free-5756586cde6ed6da147119113fb5a5fd640d5f83.tar gpt4free-5756586cde6ed6da147119113fb5a5fd640d5f83.tar.gz gpt4free-5756586cde6ed6da147119113fb5a5fd640d5f83.tar.bz2 gpt4free-5756586cde6ed6da147119113fb5a5fd640d5f83.tar.lz gpt4free-5756586cde6ed6da147119113fb5a5fd640d5f83.tar.xz gpt4free-5756586cde6ed6da147119113fb5a5fd640d5f83.tar.zst gpt4free-5756586cde6ed6da147119113fb5a5fd640d5f83.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/models.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/g4f/models.py b/g4f/models.py index 03deebf8..dd6e0a2c 100644 --- a/g4f/models.py +++ b/g4f/models.py @@ -31,12 +31,21 @@ from .Provider import ( @dataclass(unsafe_hash=True) class Model: + """ + Represents a machine learning model configuration. + + Attributes: + name (str): Name of the model. + base_provider (str): Default provider for the model. + best_provider (ProviderType): The preferred provider for the model, typically with retry logic. + """ name: str base_provider: str best_provider: ProviderType = None @staticmethod def __all__() -> list[str]: + """Returns a list of all model names.""" return _all_models default = Model( @@ -298,6 +307,12 @@ pi = Model( ) class ModelUtils: + """ + Utility class for mapping string identifiers to Model instances. + + Attributes: + convert (dict[str, Model]): Dictionary mapping model string identifiers to Model instances. + """ convert: dict[str, Model] = { # gpt-3.5 'gpt-3.5-turbo' : gpt_35_turbo, |