Merge remote-tracking branch 'upstream/r-dev' into r-dev
# Conflicts: # src/memory_system/chat_history_summarizer.py # src/memory_system/memory_retrieval.py # src/memory_system/retrieval_tools/__init__.py
This commit is contained in:
@@ -36,7 +36,6 @@ from .official_configs import (
|
||||
ResponsePostProcessConfig,
|
||||
ResponseSplitterConfig,
|
||||
TelemetryConfig,
|
||||
ToolConfig,
|
||||
VoiceConfig,
|
||||
WebUIConfig,
|
||||
)
|
||||
@@ -90,9 +89,6 @@ class Config(ConfigBase):
|
||||
message_receive: MessageReceiveConfig = Field(default_factory=MessageReceiveConfig)
|
||||
"""消息接收配置类"""
|
||||
|
||||
tool: ToolConfig = Field(default_factory=ToolConfig)
|
||||
"""工具配置类"""
|
||||
|
||||
voice: VoiceConfig = Field(default_factory=VoiceConfig)
|
||||
"""语音配置类"""
|
||||
|
||||
|
||||
@@ -280,6 +280,18 @@ def try_migrate_legacy_bot_config_dict(data: dict[str, Any]) -> MigrationResult:
|
||||
migrated_any = True
|
||||
reasons.append("experimental.chat_prompts")
|
||||
|
||||
chat = _as_dict(data.get("chat"))
|
||||
if chat is not None and "think_mode" in chat:
|
||||
chat.pop("think_mode", None)
|
||||
migrated_any = True
|
||||
reasons.append("chat.think_mode_removed")
|
||||
|
||||
tool = _as_dict(data.get("tool"))
|
||||
if tool is not None:
|
||||
data.pop("tool", None)
|
||||
migrated_any = True
|
||||
reasons.append("tool_section_removed")
|
||||
|
||||
# ExpressionConfig 中的 manual_reflect_operator_id:
|
||||
# 旧版本可能是 ""(字符串),新版本期望 Optional[TargetItem]。
|
||||
# 空字符串视为未配置,转换为 None/删除键以避免校验错误。
|
||||
|
||||
@@ -236,20 +236,6 @@ class ChatConfig(ConfigBase):
|
||||
)
|
||||
"""上下文长度"""
|
||||
|
||||
think_mode: Literal["classic", "deep", "dynamic"] = Field(
|
||||
default="dynamic",
|
||||
json_schema_extra={
|
||||
"x-widget": "select",
|
||||
"x-icon": "brain",
|
||||
},
|
||||
)
|
||||
"""
|
||||
思考模式配置
|
||||
- classic: 默认think_level为0(轻量回复,不需要思考和回忆)
|
||||
- deep: 默认think_level为1(深度回复,需要进行回忆和思考)
|
||||
- dynamic: think_level由planner动态给出(根据planner返回的think_level决定)
|
||||
"""
|
||||
|
||||
plan_reply_log_max_per_chat: int = Field(
|
||||
default=1024,
|
||||
json_schema_extra={
|
||||
@@ -669,21 +655,6 @@ class ExpressionConfig(ConfigBase):
|
||||
"""是否在回复前尝试对上下文中的黑话进行解释(关闭可减少一次LLM调用,仅影响回复前的黑话匹配与解释,不影响黑话学习)"""
|
||||
|
||||
|
||||
class ToolConfig(ConfigBase):
|
||||
"""工具配置类"""
|
||||
|
||||
__ui_parent__ = "emoji"
|
||||
|
||||
enable_tool: bool = Field(
|
||||
default=False,
|
||||
json_schema_extra={
|
||||
"x-widget": "switch",
|
||||
"x-icon": "wrench",
|
||||
},
|
||||
)
|
||||
"""是否在聊天中启用工具"""
|
||||
|
||||
|
||||
class VoiceConfig(ConfigBase):
|
||||
"""语音识别配置类"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user