fix issues

This commit is contained in:
黄伟韬 2024-08-20 19:45:13 +08:00
parent 502a0e2ad6
commit 1730897730
2 changed files with 3 additions and 7 deletions

View file

@ -68,8 +68,6 @@ class RoleZero(Role):
react_mode: Literal["react"] = "react"
max_react_loop: int = 20 # used for react mode
# Summary Mode
use_summary: bool = True
# Tools
tools: list[str] = [] # Use special symbol ["<all>"] to indicate use of all registered tools
tool_recommender: Optional[ToolRecommender] = None
@ -483,6 +481,8 @@ class RoleZero(Role):
return await self.rc.env.reply_to_human(content, sent_from=self)
async def _end(self):
self._set_state(-1)
# summary
memory = self.get_memories(k=self.memory_k)
summary_prompt = SUMMARY_PROMPY.format(
@ -503,6 +503,4 @@ class RoleZero(Role):
await self.reply_to_human(content=reply_content)
self.rc.memory.add(AIMessage(content=reply_content, cause_by=RunCommand))
self._set_state(-1)
return f"{reply_content} \n Plan.end executed Task is finished"
return reply_content

View file

@ -30,8 +30,6 @@ class TeamLeader(RoleZero):
experience_retriever: Annotated[ExpRetriever, Field(exclude=True)] = SimpleExpRetriever()
use_summary: bool = False
def _update_tool_execution(self):
self.tool_execution_map.update(
{