forked from EduCraft/curriculum-project-hub
feat: make agent roles and skills dynamic
This commit is contained in:
@@ -391,10 +391,20 @@ function formatRoleSlashCommandHelp(role: RoleEntry): string {
|
||||
if (role.defaultModel !== undefined) {
|
||||
lines.push(`- 默认模型: ${role.defaultModel}`);
|
||||
}
|
||||
lines.push(`- 工具范围: ${roleToolsDescription(role)}`, "", `帮助: /help ${role.id} 或 /${role.id} help`);
|
||||
lines.push(
|
||||
`- 工具范围: ${roleToolsDescription(role)}`,
|
||||
`- Skills: ${roleSkillsDescription(role)}`,
|
||||
"",
|
||||
`帮助: /help ${role.id} 或 /${role.id} help`,
|
||||
);
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
function roleSkillsDescription(role: RoleEntry): string {
|
||||
if (role.skills === undefined || role.skills.length === 0) return "无";
|
||||
return role.skills.map((skill) => `${skill.name}@${skill.version}`).join(", ");
|
||||
}
|
||||
|
||||
function roleToolsDescription(role: RoleEntry): string {
|
||||
if (role.tools === undefined) return "全部已注册工具";
|
||||
if (role.tools.length === 0) return "无";
|
||||
|
||||
Reference in New Issue
Block a user