feat(chat): 实现可配置的主动思考范围并优化逻辑
- 将主动思考的prompt移至代码内部,并区分私聊和群聊场景。 - 增加`The_scope_that_proactive_thinking_can_trigger`配置项,允许用户将主动思考限制在“全部”、“私聊”或“群聊”范围。 - 删除了旧的`proactive_thinking_prompt_template`配置。 - 优化了主动思考的触发条件,现在会根据新的范围配置进行检查。 - 清理了代码中多余的空行和未使用的导入。
This commit is contained in:
@@ -81,7 +81,7 @@ class ChatConfig(ValidatedConfigBase):
|
||||
timestamp_display_mode: Literal["normal", "normal_no_YMD", "relative"] = Field(default="normal_no_YMD", description="时间戳显示模式")
|
||||
enable_proactive_thinking: bool = Field(default=False, description="启用主动思考")
|
||||
proactive_thinking_interval: int = Field(default=1500, description="主动思考间隔")
|
||||
proactive_thinking_prompt_template: str = Field(default="", description="主动思考提示模板")
|
||||
The_scope_that_proactive_thinking_can_trigger: str = Field(default="all", description="主动思考可以触发的范围")
|
||||
|
||||
def get_current_talk_frequency(self, chat_stream_id: Optional[str] = None) -> float:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user