diff --git a/packages/plugins/@nocobase/plugin-ai/src/client/ai-employees/context/flow-models.tsx b/packages/plugins/@nocobase/plugin-ai/src/client/ai-employees/context/flow-models.tsx index 3564f99a9c2..fc9f671c43a 100644 --- a/packages/plugins/@nocobase/plugin-ai/src/client/ai-employees/context/flow-models.tsx +++ b/packages/plugins/@nocobase/plugin-ai/src/client/ai-employees/context/flow-models.tsx @@ -114,7 +114,8 @@ const toCollection = async (model: CollectionBlockModel) => { collection: { ...collection, }, - prompt: `You can use the tools dataSourceQuery to query data from a data source and dataSourceCounting to get record counts. + prompt: `Before querying, first call getSkill with skillName="data-query" to load the data-query skill and make dataSourceQuery and dataSourceCounting available. +After the skill is loaded, use dataSourceQuery to query data from a data source and dataSourceCounting to get record counts. When analyzing user messages, if any words or phrases are related or similar to a known collectionName, prioritize retrieving relevant data before responding. When the user asks about quantities, totals, or record counts, you must first call dataSourceCounting to obtain accurate numbers before answering. Always apply dataScope.filter when calling dataSourceQuery or dataSourceCounting. Ensure that the filter structure is properly transformed to match the tools’ input format. diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/ai/skills/data-query/SKILLS.md b/packages/plugins/@nocobase/plugin-data-source-manager/src/ai/skills/data-query/SKILLS.md index cb368c5a679..56aaa591672 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/ai/skills/data-query/SKILLS.md +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/ai/skills/data-query/SKILLS.md @@ -3,7 +3,6 @@ scope: GENERAL name: data-query description: Inspect schemas, retrieve records, and run aggregate queries on specified datasources tools: - - getSkill - dataQuery - dataSourceQuery - dataSourceCounting