mirror of
https://github.com/nocobase/nocobase.git
synced 2026-09-19 02:23:00 +08:00
fix(ai): ai employee can`t use skills (#9023)
This commit is contained in:
+1
-1
@@ -65,7 +65,7 @@ export default defineTools({
|
||||
ctx,
|
||||
sessionId: subSessionId,
|
||||
employee,
|
||||
model: employee.get('modelSettings') ?? ctx.action?.params?.values?.model,
|
||||
model: ctx.action?.params?.values?.model ?? employee.get('modelSettings'),
|
||||
question,
|
||||
skillSettings,
|
||||
writer,
|
||||
|
||||
@@ -1384,8 +1384,8 @@ If information is missing, clearly state it in the summary.</Important>`;
|
||||
private async getAvailableSkills(): Promise<SkillsEntry[]> {
|
||||
const { skillsManager } = this.plugin.ai;
|
||||
const aIEmployeeTools = await this.getAIEmployeeTools();
|
||||
const getSkills = aIEmployeeTools.find((it) => it.definition.name === 'getSkills');
|
||||
if (!getSkills) {
|
||||
const getSkill = aIEmployeeTools.find((it) => it.definition.name === 'getSkill');
|
||||
if (!getSkill) {
|
||||
return [];
|
||||
}
|
||||
const generalSkills = await skillsManager.listSkills({ scope: 'GENERAL' });
|
||||
|
||||
@@ -140,8 +140,6 @@ ${
|
||||
? `<skills>
|
||||
You have access to the following skills (tools groups). When a user's request matches a skill's description, use the **getSkill** tool to load that skill's detailed content and available tools
|
||||
|
||||
But if there is no tool named **getSkill** don't try to use **getSkill** tool to load skills
|
||||
|
||||
${availableSkills.map((skill) => `- **${skill.name}**: ${skill.description || 'No description'}`).join('\n')}
|
||||
</skills>
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user