优化系统提示词:移除冗余的工具列表,自动创建skills目录
- 移除 ToolsSection:工具定义已通过 API 的 tools 参数传递,无需在提示词中重复 - SkillsLoader 启动时自动创建 ~/.picobot/skills 目录
This commit is contained in:
parent
6c50f433d1
commit
8219e7c928
@ -39,7 +39,6 @@ impl SystemPromptBuilder {
|
||||
sections: vec![
|
||||
Box::new(ToolHonestySection),
|
||||
Box::new(NoToolNarrationSection),
|
||||
Box::new(ToolsSection),
|
||||
Box::new(YourTaskSection),
|
||||
Box::new(SafetySection),
|
||||
Box::new(WorkspaceSection),
|
||||
|
||||
@ -70,6 +70,15 @@ impl SkillsLoader {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
state.loaded_skills.clear();
|
||||
|
||||
// Ensure ~/.picobot/skills directory exists
|
||||
if !self.picobot_skills_dir.exists() {
|
||||
if let Err(e) = std::fs::create_dir_all(&self.picobot_skills_dir) {
|
||||
tracing::warn!(dir = %self.picobot_skills_dir.display(), error = %e, "Failed to create skills directory");
|
||||
} else {
|
||||
tracing::info!(dir = %self.picobot_skills_dir.display(), "Created skills directory");
|
||||
}
|
||||
}
|
||||
|
||||
// Load from ~/.picobot/skills
|
||||
if self.picobot_skills_dir.exists() {
|
||||
let loaded = self.load_skills_from_dir(&self.picobot_skills_dir);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user