Skip to content

Commit

Permalink
Merge pull request #182 from kyaukyuai/fix/project
Browse files Browse the repository at this point in the history
Refactor creating human message with task information
  • Loading branch information
kyaukyuai authored Mar 16, 2024
2 parents 35a7dd6 + 2b589f5 commit c4ba403
Show file tree
Hide file tree
Showing 3 changed files with 662 additions and 2,103 deletions.
5 changes: 4 additions & 1 deletion gpt_all_star/core/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ def create_system_message(message: str) -> SystemMessage:
return SystemMessage(content=message)

@staticmethod
def create_human_message(message: str, name: Optional[str] = None) -> HumanMessage:
def create_human_message(
message: str,
name: Optional[str] = None,
) -> HumanMessage:
return HumanMessage(content=message, name=name)

@staticmethod
Expand Down
8 changes: 7 additions & 1 deletion gpt_all_star/core/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,13 @@ def chat(self, message: str) -> None:
for task in step.additional_tasks():
tasks["plan"].append(task)

yield {"tasks": tasks}
yield {
"messages": [
Message.create_human_message(
message=str(tasks), name=self.supervisor.name
)
],
}

count = 1
while len(tasks["plan"]) > 0:
Expand Down
Loading

0 comments on commit c4ba403

Please sign in to comment.