summaryrefslogtreecommitdiffstats
path: root/g4f/models.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-01-14 15:32:51 +0100
committerGitHub <noreply@github.com>2024-01-14 15:32:51 +0100
commit1ca80ed48b55d6462b4bd445e66d4f7de7442c2b (patch)
tree05a94b53b83461b8249de965e093b4fd3722e2d1 /g4f/models.py
parentMerge pull request #1466 from hlohaus/upp (diff)
parentChange doctypes style to Google (diff)
downloadgpt4free-1ca80ed48b55d6462b4bd445e66d4f7de7442c2b.tar
gpt4free-1ca80ed48b55d6462b4bd445e66d4f7de7442c2b.tar.gz
gpt4free-1ca80ed48b55d6462b4bd445e66d4f7de7442c2b.tar.bz2
gpt4free-1ca80ed48b55d6462b4bd445e66d4f7de7442c2b.tar.lz
gpt4free-1ca80ed48b55d6462b4bd445e66d4f7de7442c2b.tar.xz
gpt4free-1ca80ed48b55d6462b4bd445e66d4f7de7442c2b.tar.zst
gpt4free-1ca80ed48b55d6462b4bd445e66d4f7de7442c2b.zip
Diffstat (limited to 'g4f/models.py')
-rw-r--r--g4f/models.py15
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,