Skip to content

Commit 96a9030

Browse files
authored
refactor: function names in Architect components (#31)
1 parent f7be90a commit 96a9030

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

primisai/nexus/architect/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def _update_system_messages(self, agent_messages: Dict[str, str]):
319319
if agent.name in agent_messages:
320320
agent.system_message = agent_messages[agent.name]
321321

322-
def build_and_validate(self) -> Supervisor:
322+
def build_component_and_validate(self) -> Supervisor:
323323
"""Build and validate all components, then assemble the workflow"""
324324
# 1. Build and validate main supervisor
325325
main_sup_builder = SupervisorBuilder(self.definition.main_supervisor, self.llm_config)

primisai/nexus/architect/expander.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self, llm_config: Dict[str, str]):
3636
"""
3737
self.ai = AI(llm_config)
3838

39-
def expand_workflow_query(self, user_query: str, nexus_guidelines: str) -> str:
39+
def decompose_and_plan_tasks(self, user_query: str, nexus_guidelines: str) -> str:
4040
"""
4141
Expand a high-level workflow query into detailed component pseudocode.
4242

primisai/nexus/architect/manager.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def _create_supervisor_instance(self, workflow_id: str, unique_suffix: int):
110110
"""Factory function to create a supervisor instance for evaluation."""
111111
run_id = f"{workflow_id}_{unique_suffix}"
112112
builder = WorkflowBuilder(self.system_messages, self.structured_workflow, self.llm_config, run_id)
113-
return builder.build_and_validate()
113+
return builder.build_component_and_validate()
114114

115115
def _save_workflow_to_file(self, accuracy: float, iteration: int) -> str:
116116
"""Builds the workflow with current system messages and saves it to a file."""
@@ -119,7 +119,7 @@ def _save_workflow_to_file(self, accuracy: float, iteration: int) -> str:
119119
output_path = os.path.join(self.output_dir, filename)
120120

121121
builder = WorkflowBuilder(self.system_messages, self.structured_workflow, self.llm_config, self.workflow_id)
122-
builder.build_and_validate()
122+
builder.build_component_and_validate()
123123
builder.save_workflow_to_file(output_path)
124124
logger.info(f"Workflow saved to: {output_path}")
125125
return output_path
@@ -133,8 +133,8 @@ def build_and_optimize(self) -> Dict[str, Any]:
133133
final accuracy, path to the saved file, and performance history.
134134
"""
135135
logger.info("Step 1: Designing initial workflow from user query...")
136-
expanded_workflow = self.expander.expand_workflow_query(self.user_query, prompts.nexus_guidelines)
137-
self.structured_workflow = self.structurer.structure_workflow(expanded_workflow)
136+
expanded_workflow = self.expander.decompose_and_plan_tasks(self.user_query, prompts.nexus_guidelines)
137+
self.structured_workflow = self.structurer.reasoning_workflow_design(expanded_workflow)
138138

139139
agents_names = [self.structured_workflow.main_supervisor.name] + [agent.name for agent in self.structured_workflow.agents]
140140
logger.info(f"Created agents: {', '.join(agents_names)}")
@@ -156,7 +156,6 @@ def build_and_optimize(self) -> Dict[str, Any]:
156156
self.workflow_id,
157157
iteration=i,
158158
is_factory=True)
159-
160159
accuracy = evaluation_results['accuracy']
161160
final_accuracy = accuracy
162161

primisai/nexus/architect/structurer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, llm_config: Dict[str, str]):
4545
with open(doc_path, "r", encoding="utf-8") as file:
4646
self.nexus_documentation = file.read()
4747

48-
def structure_workflow(self, expanded_workflow: str) -> WorkflowDefinition:
48+
def reasoning_workflow_design(self, expanded_workflow: str) -> WorkflowDefinition:
4949
"""
5050
Convert expanded workflow description into structured component definitions.
5151

0 commit comments

Comments
 (0)