mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 22:14:28 +01:00
linted changes
This commit is contained in:
@@ -11,7 +11,8 @@ class AIConfig:
|
||||
ai_role (str): The description of the AI's role.
|
||||
ai_goals (list): The list of objectives the AI is supposed to complete.
|
||||
"""
|
||||
def __init__(self, ai_name:str="", ai_role:str="", ai_goals:list=[]) -> None:
|
||||
|
||||
def __init__(self, ai_name: str="", ai_role: str="", ai_goals: list=[]) -> None:
|
||||
"""
|
||||
Initialize a class instance
|
||||
|
||||
@@ -30,7 +31,7 @@ class AIConfig:
|
||||
SAVE_FILE = "../ai_settings.yaml"
|
||||
|
||||
@classmethod
|
||||
def load(cls:object, config_file:str=SAVE_FILE) -> object:
|
||||
def load(cls: object, config_file: str=SAVE_FILE) -> object:
|
||||
"""
|
||||
Returns class object with parameters (ai_name, ai_role, ai_goals) loaded from yaml file if yaml file exists,
|
||||
else returns class with no parameters.
|
||||
@@ -54,7 +55,7 @@ class AIConfig:
|
||||
|
||||
return cls(ai_name, ai_role, ai_goals)
|
||||
|
||||
def save(self, config_file:str=SAVE_FILE) -> None:
|
||||
def save(self, config_file: str=SAVE_FILE) -> None:
|
||||
"""
|
||||
Saves the class parameters to the specified file yaml file path as a yaml file.
|
||||
|
||||
@@ -88,6 +89,7 @@ class AIConfig:
|
||||
full_prompt += f"\n\n{data.load_prompt()}"
|
||||
return full_prompt
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import doctest
|
||||
doctest.testmod()
|
||||
@@ -62,5 +62,3 @@ def write_tests(code: str, focus: List[str]) -> str:
|
||||
|
||||
result_string = call_ai_function(function_string, args, description_string)
|
||||
return result_string
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user