From a4a1c2d258ff3f92cea5f6d310af3b07a7d751a6 Mon Sep 17 00:00:00 2001 From: josh-ashkinaze Date: Sat, 6 Jul 2024 17:06:25 -0400 Subject: [PATCH] reformat Structure --- docs/conf.py | 4 ++-- plurals/deliberation.py | 53 ++++++++++++++++++++--------------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 6f5c08f..180e43e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,8 +4,8 @@ # -- Project information ----------------------------------------------------- project = 'Plurals' -author = 'Your Name' -release = '0.1' +author = 'Joshua Ashkinaze' +release = '0.0.1' # -- General configuration --------------------------------------------------- extensions = [ diff --git a/plurals/deliberation.py b/plurals/deliberation.py index 0543e5a..a2dabef 100644 --- a/plurals/deliberation.py +++ b/plurals/deliberation.py @@ -47,38 +47,37 @@ def moderate_responses(self, responses: List[str], original_task: str) -> str: class Structure(ABC): + """ + Structure is an abstract class for processing tasks through a group of agents. As such, it is not meant to be + instantiated directly but rather to be subclassed by concrete structures such as an Ensemble. + + Args: + agents (List[Agent]): A list of agents to include in the structure. + task_description (Optional[str]): The task description for the agents to process. + shuffle (bool): Whether to shuffle the order of the agents. + cycles (int): The number of times to process the task. + last_n (int): The number of previous responses to include in the task description. + combination_instructions (Optional[str]): The instructions for combining responses. + moderator (Optional[Moderator]): A moderator to moderate the responses. + + Attributes: + defaults (Dict[str, Any]): Default instructions for the structure. + task_description (Optional[str]): The task description for the agents to process. + agents (List[Agent]): A list of agents to include in the structure. + combination_instructions (str): The instructions for combining responses. + shuffle (bool): Whether to shuffle the order of the agents. + last_n (int): The number of previous responses to include in the task description. + cycles (int): The number of times to process the task. + responses (List[str]): A list of responses from the agents. + final_response (Optional[str]): The final response from the agents. + moderator (Optional[Moderator]): A moderator to moderate the responses. + moderated (bool): Whether the structure is moderated. + """ def __init__(self, agents: List[Agent], task_description: Optional[str] = None, shuffle: bool = False, cycles: int = 1, last_n: int = 1, combination_instructions: Optional[str] = "default", moderator: Optional[Moderator] = None): - """ - Structure is an abstract class for processing tasks through a group of agents. As such, it is not meant to be - instantiated directly but rather to be subclassed by concrete structures such as an Ensemble. - - Args: - agents (List[Agent]): A list of agents to include in the structure. - task_description (Optional[str]): The task description for the agents to process. - shuffle (bool): Whether to shuffle the order of the agents. - cycles (int): The number of times to process the task. - last_n (int): The number of previous responses to include in the task description. - combination_instructions (Optional[str]): The instructions for combining responses. - moderator (Optional[Moderator]): A moderator to moderate the responses. - - Attributes: - defaults (Dict[str, Any]): Default instructions for the structure. - task_description (Optional[str]): The task description for the agents to process. - agents (List[Agent]): A list of agents to include in the structure. - combination_instructions (str): The instructions for combining responses. - shuffle (bool): Whether to shuffle the order of the agents. - last_n (int): The number of previous responses to include in the task description. - cycles (int): The number of times to process the task. - responses (List[str]): A list of responses from the agents. - final_response (Optional[str]): The final response from the agents. - moderator (Optional[Moderator]): A moderator to moderate the responses. - moderated (bool): Whether the structure is moderated. - """ - self.defaults = DEFAULTS self.task_description = task_description self.agents = agents