fix:调整目录结构,优化hfc prompt,移除日程,移除动态和llm判断willing模式,
This commit is contained in:
@@ -2,7 +2,6 @@ import os
|
||||
import re
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Dict, List, Optional
|
||||
from dateutil import tz
|
||||
|
||||
import tomli
|
||||
import tomlkit
|
||||
@@ -167,13 +166,6 @@ class BotConfig:
|
||||
gender: str = "男" # 性别
|
||||
appearance: str = "用几句话描述外貌特征" # 外貌特征
|
||||
|
||||
# schedule
|
||||
ENABLE_SCHEDULE_GEN: bool = False # 是否启用日程生成
|
||||
PROMPT_SCHEDULE_GEN = "无日程"
|
||||
SCHEDULE_DOING_UPDATE_INTERVAL: int = 300 # 日程表更新间隔 单位秒
|
||||
SCHEDULE_TEMPERATURE: float = 0.5 # 日程表温度,建议0.5-1.0
|
||||
TIME_ZONE: str = "Asia/Shanghai" # 时区
|
||||
|
||||
# chat
|
||||
allow_focus_mode: bool = True # 是否允许专注聊天状态
|
||||
|
||||
@@ -374,24 +366,6 @@ class BotConfig:
|
||||
config.gender = identity_config.get("gender", config.gender)
|
||||
config.appearance = identity_config.get("appearance", config.appearance)
|
||||
|
||||
def schedule(parent: dict):
|
||||
schedule_config = parent["schedule"]
|
||||
config.ENABLE_SCHEDULE_GEN = schedule_config.get("enable_schedule_gen", config.ENABLE_SCHEDULE_GEN)
|
||||
config.PROMPT_SCHEDULE_GEN = schedule_config.get("prompt_schedule_gen", config.PROMPT_SCHEDULE_GEN)
|
||||
config.SCHEDULE_DOING_UPDATE_INTERVAL = schedule_config.get(
|
||||
"schedule_doing_update_interval", config.SCHEDULE_DOING_UPDATE_INTERVAL
|
||||
)
|
||||
logger.info(
|
||||
f"载入自定义日程prompt:{schedule_config.get('prompt_schedule_gen', config.PROMPT_SCHEDULE_GEN)}"
|
||||
)
|
||||
if config.INNER_VERSION in SpecifierSet(">=1.0.2"):
|
||||
config.SCHEDULE_TEMPERATURE = schedule_config.get("schedule_temperature", config.SCHEDULE_TEMPERATURE)
|
||||
time_zone = schedule_config.get("time_zone", config.TIME_ZONE)
|
||||
if tz.gettz(time_zone) is None:
|
||||
logger.error(f"无效的时区: {time_zone},使用默认值: {config.TIME_ZONE}")
|
||||
else:
|
||||
config.TIME_ZONE = time_zone
|
||||
|
||||
def emoji(parent: dict):
|
||||
emoji_config = parent["emoji"]
|
||||
config.EMOJI_CHECK_INTERVAL = emoji_config.get("check_interval", config.EMOJI_CHECK_INTERVAL)
|
||||
@@ -681,7 +655,6 @@ class BotConfig:
|
||||
"groups": {"func": groups, "support": ">=0.0.0"},
|
||||
"personality": {"func": personality, "support": ">=0.0.0"},
|
||||
"identity": {"func": identity, "support": ">=1.2.4"},
|
||||
"schedule": {"func": schedule, "support": ">=0.0.11", "necessary": False},
|
||||
"emoji": {"func": emoji, "support": ">=0.0.0"},
|
||||
"model": {"func": model, "support": ">=0.0.0"},
|
||||
"memory": {"func": memory, "support": ">=0.0.0", "necessary": False},
|
||||
|
||||
Reference in New Issue
Block a user