Skip to content

Commit d6ad6cd

Browse files
committed
feat: implement the core main agent logic, configuration, and skill management system.
1 parent 2f38301 commit d6ad6cd

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

astrbot/core/astr_main_agent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ def from_provider_settings(
181181
"max_context_length": int(ps.get("max_context_length", -1)),
182182
"dequeue_context_length": int(ps.get("dequeue_context_length", 1)),
183183
"llm_safety_mode": bool(ps.get("llm_safety_mode", True)),
184-
"safety_mode_strategy": str(ps.get("safety_mode_strategy", "system_prompt")),
184+
"safety_mode_strategy": str(
185+
ps.get("safety_mode_strategy", "system_prompt")
186+
),
185187
"computer_use_runtime": str(ps.get("computer_use_runtime", "local")),
186188
"sandbox_cfg": ps.get("sandbox", {}) or {},
187189
"add_cron_tools": bool(proactive_cfg.get("add_cron_tools", True)),

astrbot/core/skills/skill_manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ def build_skills_prompt(skills: list[SkillInfo]) -> str:
9191
name = "unknown-skill"
9292
description = str(getattr(skill, "description", "") or "").strip()
9393
# 清理换行符,防止 Indirect Prompt Injection
94-
description = (description or "No description").replace("\n", " ").replace("\r", " ")
94+
description = (
95+
(description or "No description").replace("\n", " ").replace("\r", " ")
96+
)
9597
path = str(getattr(skill, "path", "") or "").strip()
9698
path = path or "<skills_root>/<skill_name>/SKILL.md"
9799
# 清理路径中的危险字符

0 commit comments

Comments
 (0)