remove:移除做梦功能
This commit is contained in:
@@ -29,7 +29,6 @@ from .official_configs import (
|
||||
VoiceConfig,
|
||||
MemoryConfig,
|
||||
DebugConfig,
|
||||
DreamConfig,
|
||||
WebUIConfig,
|
||||
DatabaseConfig,
|
||||
)
|
||||
@@ -86,9 +85,6 @@ class Config(ConfigBase):
|
||||
message_receive: MessageReceiveConfig = Field(default_factory=MessageReceiveConfig)
|
||||
"""消息接收配置类"""
|
||||
|
||||
dream: DreamConfig = Field(default_factory=DreamConfig)
|
||||
"""做梦配置类"""
|
||||
|
||||
tool: ToolConfig = Field(default_factory=ToolConfig)
|
||||
"""工具配置类"""
|
||||
|
||||
|
||||
@@ -1440,79 +1440,6 @@ class LPMMKnowledgeConfig(ConfigBase):
|
||||
"""是否启用PPR,低配机器可关闭"""
|
||||
|
||||
|
||||
class DreamConfig(ConfigBase):
|
||||
"""Dream配置类"""
|
||||
|
||||
__ui_label__ = "做梦"
|
||||
__ui_icon__ = "moon"
|
||||
|
||||
interval_minutes: int = Field(
|
||||
default=30,
|
||||
ge=1,
|
||||
json_schema_extra={
|
||||
"x-widget": "input",
|
||||
"x-icon": "clock",
|
||||
},
|
||||
)
|
||||
"""做梦时间间隔(分钟),默认30分钟"""
|
||||
|
||||
max_iterations: int = Field(
|
||||
default=20,
|
||||
ge=1,
|
||||
json_schema_extra={
|
||||
"x-widget": "input",
|
||||
"x-icon": "hash",
|
||||
},
|
||||
)
|
||||
"""做梦最大轮次,默认20轮"""
|
||||
|
||||
first_delay_seconds: int = Field(
|
||||
default=1800,
|
||||
ge=0,
|
||||
json_schema_extra={
|
||||
"x-widget": "input",
|
||||
"x-icon": "timer",
|
||||
},
|
||||
)
|
||||
"""程序启动后首次做梦前的延迟时间(秒),默认1800秒"""
|
||||
|
||||
dream_send: str = Field(
|
||||
default="",
|
||||
json_schema_extra={
|
||||
"x-widget": "input",
|
||||
"x-icon": "send",
|
||||
},
|
||||
)
|
||||
"""做梦结果推送目标,格式为 "platform:user_id,为空则不发送"""
|
||||
|
||||
dream_time_ranges: list[str] = Field(
|
||||
default_factory=lambda: ["23:00-10:00"],
|
||||
json_schema_extra={
|
||||
"x-widget": "custom",
|
||||
"x-icon": "moon",
|
||||
},
|
||||
)
|
||||
"""_wrap_做梦时间段配置列表"""
|
||||
|
||||
dream_visible: bool = Field(
|
||||
default=False,
|
||||
json_schema_extra={
|
||||
"x-widget": "switch",
|
||||
"x-icon": "eye",
|
||||
},
|
||||
)
|
||||
"""做梦结果发送后是否存储到上下文"""
|
||||
|
||||
def model_post_init(self, context: Optional[dict] = None) -> None:
|
||||
if self.interval_minutes < 1:
|
||||
raise ValueError(f"interval_minutes 必须至少为1,当前值: {self.interval_minutes}")
|
||||
if self.max_iterations < 1:
|
||||
raise ValueError(f"max_iterations 必须至少为1,当前值: {self.max_iterations}")
|
||||
if self.first_delay_seconds < 0:
|
||||
raise ValueError(f"first_delay_seconds 不能为负数,当前值: {self.first_delay_seconds}")
|
||||
return super().model_post_init(context)
|
||||
|
||||
|
||||
class WebUIConfig(ConfigBase):
|
||||
"""WebUI配置类"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user