role zero的quick think system prompt增加role info

This commit is contained in:
Yizhou Chi 2024-08-14 10:16:28 +08:00
parent d4d581f391
commit f8c690804c
3 changed files with 10 additions and 4 deletions

View file

@ -151,6 +151,8 @@ For requests that are unclear, lack sufficient detail, or are outside the system
2. If the request is a "how-to" question that asks for a general study plan, approach or strategy, it should be categorized as QUICK.
{examples}
{role_info}
"""
QUICK_THINK_PROMPT = """

View file

@ -254,7 +254,7 @@ class RoleZero(Role):
def format_quick_system_prompt(self) -> str:
"""Format the system prompt for quick thinking."""
return QUICK_THINK_SYSTEM_PROMPT.format(examples=QUICK_THINK_EXAMPLES)
return QUICK_THINK_SYSTEM_PROMPT.format(examples=QUICK_THINK_EXAMPLES, role_info=super()._get_prefix())
async def _quick_think(self) -> Tuple[Message, str]:
answer = ""

View file

@ -49,13 +49,17 @@ class TeamLeader(RoleZero):
return team_info
def format_quick_system_prompt(self) -> str:
qt_system_prompt = super().format_quick_system_prompt()
return qt_system_prompt + QUICK_THINK_SYSTEM_PROMPT.format(
role_info=super()._get_prefix(),
quick_system_prompt = super().format_quick_system_prompt()
return quick_system_prompt + QUICK_THINK_SYSTEM_PROMPT.format(
role_info="", # rolezero's quick think system prompt will include role_info
team_info=self._get_team_info(),
)
async def _quick_think(self) -> Message:
self.llm.system_prompt = QUICK_THINK_SYSTEM_PROMPT.format(
role_info=self._get_role_info(),
team_info=self._get_team_info(),
)
return await super()._quick_think()
async def _think(self) -> bool: