feat: 完成资源接入

This commit is contained in:
2026-09-24 11:58:25 +08:00
parent 5f5d733a9b
commit 57ed92aeba
26 changed files with 3471 additions and 121 deletions
+7
View File
@@ -45,7 +45,14 @@ class Settings:
default_factory=lambda: float(os.getenv("INTENT_MIN_CONFIDENCE", "0.7"))
)
# 动作自动修正次数,不含首次生成,0 表示不重试,与用户澄清轮数无关
max_action_retries: int = field(
default_factory=lambda: int(os.getenv("MAX_ACTION_RETRIES", "2"))
)
def __post_init__(self):
if type(self.max_action_retries) is not int or self.max_action_retries < 0:
raise ValueError("MAX_ACTION_RETRIES 必须是非负整数")
if not 0 <= self.intent_min_confidence <= 1:
raise ValueError("INTENT_MIN_CONFIDENCE 必须在 0 到 1 之间")