Merge branch 'expo' into 'sela'

open-source sela

See merge request agents/exp_optimizer!28
This commit is contained in:
林义章 2024-10-18 08:27:49 +00:00
commit f0704553e0
37 changed files with 3341 additions and 21 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: