Skip to content

Commit

Permalink
💄 ui: improved the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
huangyz0918 committed Jun 5, 2024
1 parent f7b4941 commit 90b64c5
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions agent/function/tech_leader.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def user_requirement_understanding(self):
:return:
"""
if self.project.requirement:
self.console.log(f"[cyan]User Requirement:[/cyan] {self.project.requirement}")
self.console.print(f"[cyan]User Requirement:[/cyan] {self.project.requirement}")
else:
show_panel("STEP 0: User Requirements Understanding")
self.requirement = questionary.text("Hi, what are your requirements?").ask()
Expand All @@ -69,7 +69,7 @@ def user_requirement_understanding(self):
self.project.enhanced_requirement = self.requirement
if self.entry_file is None:
self.entry_file = gen_file_name(self.project, self.model)
self.console.log(f"The entry file is: {self.entry_file}")
self.console.print(f"[cyan]Entry File:[/cyan] {self.entry_file}")
update_project_state(self.project)

def dataset_selection(self):
Expand Down Expand Up @@ -114,10 +114,10 @@ def dataset_selection(self):
if self.project.plan.dataset is None:
raise SystemExit("There is no dataset information. Aborted.")
else:
self.console.log(f"[cyan]Data source:[/cyan] {self.project.plan.dataset}")
self.console.print(f"[cyan]Data Source:[/cyan] {self.project.plan.dataset}")
if self.project.plan.data_kind == 'csv_data':
csv_data_sample = read_csv_file(self.project.plan.dataset)
self.console.log(f"[cyan]Dataset examples:[/cyan] {csv_data_sample}")
self.console.print(f"[cyan]Dataset examples:[/cyan] {csv_data_sample}")
self.project.enhanced_requirement += f"\nDataset Sample: {csv_data_sample}"

self.project.enhanced_requirement += f"\nDataset: {self.project.plan.dataset}"
Expand Down Expand Up @@ -147,7 +147,10 @@ def task_model_selection(self):
else:
self.console.log("Seems you are not satisfied with the task type. Aborting the chain.")
return
self.project.enhanced_requirement += f"\n\nML task type: {self.project.plan.ml_task_type}"

self.project.enhanced_requirement += f"\n\nML task type: {self.project.plan.ml_task_type}"
else:
self.console.print(f"[cyan]ML Task:[/cyan] {self.project.plan.ml_task_type}")

# select the mode architecture
if self.project.plan.ml_model_arch is None:
Expand All @@ -165,8 +168,11 @@ def task_model_selection(self):
self.console.log("Seems you are not satisfied with the model architecture. Aborting the chain.")
return

self.project.enhanced_requirement += f"\nModel architecture: {self.project.plan.ml_model_arch}"
else:
self.console.print(f"[cyan]Model Architecture:[/cyan] {self.project.plan.ml_model_arch}")

update_project_state(self.project)
self.project.enhanced_requirement += f"\nModel architecture: {self.project.plan.ml_model_arch}"

def task_planning(self):
"""
Expand Down Expand Up @@ -199,6 +205,7 @@ def task_planning(self):
tasks = []
for t in self.project.plan.tasks:
tasks.append({'name': t.name, 'resources': [r.name for r in t.resources], 'description': t.description})
self.console.print(f"[cyan]Tasks:[/cyan]")
self.console.print(generate_plan_card_ascii({'tasks': tasks}), highlight=False)

def code_generation(self):
Expand Down

0 comments on commit 90b64c5

Please sign in to comment.