Skip to content

Commit

Permalink
reformat Structure
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-ashkinaze committed Jul 6, 2024
1 parent c104997 commit a4a1c2d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

# -- Project information -----------------------------------------------------
project = 'Plurals'
author = 'Your Name'
release = '0.1'
author = 'Joshua Ashkinaze'
release = '0.0.1'

# -- General configuration ---------------------------------------------------
extensions = [
Expand Down
53 changes: 26 additions & 27 deletions plurals/deliberation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a4a1c2d

Please sign in to comment.