feat:新增planner控制prompt
This commit is contained in:
@@ -33,6 +33,9 @@ def init_prompt():
|
||||
{time_block}
|
||||
{identity_block}
|
||||
你现在需要根据聊天内容,选择的合适的action来参与聊天。
|
||||
请你根据以下行事风格来决定action:
|
||||
{plan_style}
|
||||
|
||||
{chat_context_description},以下是具体的聊天内容
|
||||
{chat_content_block}
|
||||
|
||||
@@ -388,6 +391,7 @@ class ActionPlanner:
|
||||
action_options_text=action_options_block,
|
||||
moderation_prompt=moderation_prompt_block,
|
||||
identity_block=identity_block,
|
||||
plan_style = global_config.personality.plan_style
|
||||
)
|
||||
return prompt, message_id_list
|
||||
except Exception as e:
|
||||
|
||||
@@ -640,7 +640,7 @@ class DefaultReplyer:
|
||||
|
||||
action_descriptions = ""
|
||||
if available_actions:
|
||||
action_descriptions = "你可以做以下这些动作:\n"
|
||||
action_descriptions = "除了进行回复之外,你可以做以下这些动作,不过这些动作由另一个模型决定,:\n"
|
||||
for action_name, action_info in available_actions.items():
|
||||
action_description = action_info.description
|
||||
action_descriptions += f"- {action_name}: {action_description}\n"
|
||||
@@ -658,7 +658,7 @@ class DefaultReplyer:
|
||||
choosen_action_descriptions += f"- {action_name}: {action_description},原因:{reasoning}\n"
|
||||
|
||||
if choosen_action_descriptions:
|
||||
action_descriptions += "根据聊天情况,你决定在回复的同时做以下这些动作:\n"
|
||||
action_descriptions += "根据聊天情况,另一个模型决定在回复的同时做以下这些动作:\n"
|
||||
action_descriptions += choosen_action_descriptions
|
||||
|
||||
return action_descriptions
|
||||
|
||||
@@ -46,6 +46,8 @@ class PersonalityConfig(ConfigBase):
|
||||
|
||||
reply_style: str = ""
|
||||
"""表达风格"""
|
||||
|
||||
plan_style: str = ""
|
||||
|
||||
compress_personality: bool = True
|
||||
"""是否压缩人格,压缩后会精简人格信息,节省token消耗并提高回复性能,但是会丢失一些信息,如果人设不长,可以关闭"""
|
||||
|
||||
Reference in New Issue
Block a user