Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
vinid committed Sep 29, 2024
1 parent 270ea97 commit 77d8dcf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions textgrad/engine_experimental/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,27 @@ 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")

self.model_string = model_string
self.system_prompt = system_prompt
self.is_multimodal = is_multimodal

# cache resolution
if isinstance(cache, dc.Cache):
self.cache = cache
elif cache is True:
Expand Down

0 comments on commit 77d8dcf

Please sign in to comment.