From 77d8dcf8f6ae40dc987188806bece15172adae46 Mon Sep 17 00:00:00 2001 From: vinid Date: Sun, 29 Sep 2024 09:49:51 -0400 Subject: [PATCH] docstrings --- textgrad/engine_experimental/base.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/textgrad/engine_experimental/base.py b/textgrad/engine_experimental/base.py index 79c9da1..e50e613 100644 --- a/textgrad/engine_experimental/base.py +++ b/textgrad/engine_experimental/base.py @@ -40,6 +40,19 @@ def __init__(self, model_string: str, is_multimodal: bool = False, cache=Union[dc.Cache, bool]): + """ + Base class for the engines. + + :param model_string: The model string to use. + :type model_string: str + :param system_prompt: The system prompt to use. Defaults to "You are a helpful, creative, and smart assistant." + :type system_prompt: str + :param is_multimodal: Whether the model is multimodal. Defaults to False. + :type is_multimodal: bool + :param cache: The cache to use. Defaults to True. Note that cache can also be a diskcache.Cache object. + :type cache: Union[diskcache.Cache, bool] + """ + root = platformdirs.user_cache_dir("textgrad") default_cache_path = os.path.join(root, f"cache_model_{model_string}.db") @@ -47,6 +60,7 @@ def __init__(self, model_string: str, self.system_prompt = system_prompt self.is_multimodal = is_multimodal + # cache resolution if isinstance(cache, dc.Cache): self.cache = cache elif cache is True: