1. role.py - 如果已经有plan,便不再重复生成

2. 修改prompt,让predictions.csv生成的格式与原gt格式一样
This commit is contained in:
Yizhou Chi 2024-09-02 15:15:53 +08:00
parent 0e5db1c364
commit f28908e4c5
5 changed files with 14 additions and 11 deletions

View file

@ -478,10 +478,10 @@ class Role(SerializationMixin, ContextMixin, BaseModel):
async def _plan_and_act(self) -> Message:
"""first plan, then execute an action sequence, i.e. _think (of a plan) -> _act -> _act -> ... Use llm to come up with the plan dynamically."""
# create initial plan and update it until confirmation
goal = self.rc.memory.get()[-1].content # retreive latest user requirement
await self.planner.update_plan(goal=goal)
if not self.planner.plan.goal:
# create initial plan and update it until confirmation
goal = self.rc.memory.get()[-1].content # retreive latest user requirement
await self.planner.update_plan(goal=goal)
# take on tasks until all finished
while self.planner.current_task: