@nocobase/plugin-ai 2.0.0-alpha.6 → 2.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/20eb4245a9dcee89.js +10 -0
- package/dist/client/ai-employees/chatbox/SearchSwitch.d.ts +10 -0
- package/dist/client/ai-employees/chatbox/hooks/useChatConversationOptions.d.ts +13 -0
- package/dist/client/ai-employees/chatbox/hooks/useChatMessageActions.d.ts +1 -1
- package/dist/client/ai-employees/chatbox/stores/chat-conversations.d.ts +4 -0
- package/dist/client/ai-employees/types.d.ts +11 -0
- package/dist/client/index.js +2 -2
- package/dist/externalVersion.js +11 -11
- package/dist/locale/en-US.json +3 -1
- package/dist/locale/zh-CN.json +3 -1
- package/dist/node_modules/@langchain/anthropic/package.json +1 -1
- package/dist/node_modules/@langchain/core/package.json +1 -1
- package/dist/node_modules/@langchain/deepseek/package.json +1 -1
- package/dist/node_modules/@langchain/google-genai/package.json +1 -1
- package/dist/node_modules/@langchain/openai/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/node_modules/zod-to-json-schema/package.json +1 -1
- package/dist/server/ai-employees/ai-employee.d.ts +2 -1
- package/dist/server/ai-employees/ai-employee.js +11 -1
- package/dist/server/ai-employees/built-in/data-organizer/index.d.ts +37 -0
- package/dist/server/ai-employees/built-in/data-organizer/index.js +63 -0
- package/dist/server/ai-employees/built-in/data-organizer/profile.d.ts +27 -0
- package/dist/server/ai-employees/built-in/data-organizer/profile.js +60 -0
- package/dist/server/ai-employees/built-in/data-organizer/prompt.d.ts +12 -0
- package/dist/server/ai-employees/built-in/data-organizer/prompt.js +75 -0
- package/dist/server/ai-employees/built-in/insights-analyst/index.d.ts +37 -0
- package/dist/server/ai-employees/built-in/insights-analyst/index.js +59 -0
- package/dist/server/ai-employees/built-in/insights-analyst/profile.d.ts +27 -0
- package/dist/server/ai-employees/built-in/insights-analyst/profile.js +60 -0
- package/dist/server/ai-employees/built-in/insights-analyst/prompt.d.ts +12 -0
- package/dist/server/ai-employees/built-in/insights-analyst/prompt.js +122 -0
- package/dist/server/ai-employees/built-in/nocobase-assistant/index.d.ts +34 -0
- package/dist/server/ai-employees/built-in/nocobase-assistant/index.js +50 -0
- package/dist/server/ai-employees/built-in/nocobase-assistant/profile.d.ts +27 -0
- package/dist/server/ai-employees/built-in/nocobase-assistant/profile.js +60 -0
- package/dist/server/ai-employees/built-in/nocobase-assistant/prompt.d.ts +12 -0
- package/dist/server/ai-employees/built-in/nocobase-assistant/prompt.js +52 -0
- package/dist/server/ai-employees/built-in/research-analyst/index.d.ts +37 -0
- package/dist/server/ai-employees/built-in/research-analyst/index.js +63 -0
- package/dist/server/ai-employees/built-in/research-analyst/profile.d.ts +27 -0
- package/dist/server/ai-employees/built-in/research-analyst/profile.js +60 -0
- package/dist/server/ai-employees/built-in/research-analyst/prompt.d.ts +12 -0
- package/dist/server/ai-employees/built-in/research-analyst/prompt.js +66 -0
- package/dist/server/ai-employees/built-in/translator/index.d.ts +37 -0
- package/dist/server/ai-employees/built-in/translator/index.js +63 -0
- package/dist/server/ai-employees/built-in/translator/profile.d.ts +27 -0
- package/dist/server/ai-employees/built-in/translator/profile.js +60 -0
- package/dist/server/ai-employees/built-in/translator/prompt.d.ts +12 -0
- package/dist/server/ai-employees/built-in/translator/prompt.js +78 -0
- package/dist/server/llm-providers/dashscope.js +8 -1
- package/dist/server/llm-providers/provider.js +4 -4
- package/dist/server/manager/ai-chat-conversation.js +1 -1
- package/dist/server/manager/built-in-manager.js +15 -1
- package/dist/server/migrations/{20250923221103-setup-build-in.js → 20250923221104-setup-build-in.js} +1 -1
- package/dist/server/resource/aiConversations.d.ts +1 -0
- package/dist/server/resource/aiConversations.js +59 -10
- package/dist/server/resource/aiEmployees.js +3 -2
- package/package.json +2 -2
- package/dist/client/7c160c7af898454b.js +0 -10
- /package/dist/server/migrations/{20250923221103-setup-build-in.d.ts → 20250923221104-setup-build-in.d.ts} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var prompt_exports = {};
|
|
28
|
+
__export(prompt_exports, {
|
|
29
|
+
default: () => prompt_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(prompt_exports);
|
|
32
|
+
var prompt_default = {
|
|
33
|
+
"en-US": `**## IDENTITY & PERSONA**
|
|
34
|
+
You are Cole, an AI specialist for the NocoBase platform. Your personality is **knowledgeable, patient, and clear**. You act as an expert guide, here to help users navigate and master NocoBase. Your goal is to provide accurate, easy-to-understand instructions and explanations drawn directly from the provided knowledge base, helping solve problems efficiently.
|
|
35
|
+
|
|
36
|
+
**## CORE MISSION**
|
|
37
|
+
Your mission is to accurately answer any question about installing, configuring, or using NocoBase. You will achieve this by querying an exclusive knowledge base you have been provided with, synthesizing the relevant information, and presenting it in a clear and actionable format.
|
|
38
|
+
|
|
39
|
+
**## YOUR PROCESS & ABILITIES**
|
|
40
|
+
1. **Analyze Questions:** You will first carefully analyze requests to understand the specific NocoBase feature, issue, or process being asked about.
|
|
41
|
+
2. **Query the Knowledge Base:** You will formulate precise queries to search your internal NocoBase knowledge base to find the most relevant articles, guides, and documentation.
|
|
42
|
+
3. **Synthesize and Respond:** You will not just provide raw text. You will read and understand the search results and then construct coherent answers in your own words. You will break down complex steps into easy-to-follow lists and use code blocks for any commands or code snippets.
|
|
43
|
+
4. **Clarify When Needed:** If questions are ambiguous or if the knowledge base contains multiple potential answers, you will ask for clarification to ensure you provide the most accurate information. For example: "Are you asking about Docker installation or building from source?"
|
|
44
|
+
|
|
45
|
+
**## RULES OF ENGAGEMENT & CONSTRAINTS**
|
|
46
|
+
* **Language:** You SHOULD prioritize communicating in the user's language: {{$nLang}}. Respond in the same language as the user's prompt to ensure clarity. If the language is unclear or unsupported, you may default to English.
|
|
47
|
+
* **Source of Truth:** Your answers are based SOLELY on the knowledge base you are provided with. You will not use general information from the web or invent solutions.
|
|
48
|
+
* **Stay on Topic:** Your expertise is strictly limited to NocoBase. You will politely decline to answer questions outside this scope.
|
|
49
|
+
* **Informational Role:** You are here to provide information and instructions. You cannot execute commands, access user systems, or perform actions within NocoBase instances.
|
|
50
|
+
* **Prioritize Clarity:** You will always prioritize providing clear, well-formatted, and helpful responses. You will use bullet points, numbered lists, and code blocks to make instructions as easy to understand as possible.
|
|
51
|
+
`
|
|
52
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: {
|
|
10
|
+
username: string;
|
|
11
|
+
description: string;
|
|
12
|
+
profile: {
|
|
13
|
+
'en-US': {
|
|
14
|
+
avatar: string;
|
|
15
|
+
nickname: string;
|
|
16
|
+
position: string;
|
|
17
|
+
bio: string;
|
|
18
|
+
greeting: string;
|
|
19
|
+
about: string;
|
|
20
|
+
};
|
|
21
|
+
'zh-CN': {
|
|
22
|
+
avatar: string;
|
|
23
|
+
nickname: string;
|
|
24
|
+
position: string;
|
|
25
|
+
bio: string;
|
|
26
|
+
greeting: string;
|
|
27
|
+
about: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
skillSettings: {
|
|
31
|
+
skills: {
|
|
32
|
+
name: string;
|
|
33
|
+
autoCall: boolean;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var research_analyst_exports = {};
|
|
38
|
+
__export(research_analyst_exports, {
|
|
39
|
+
default: () => research_analyst_default
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(research_analyst_exports);
|
|
42
|
+
var import_profile = __toESM(require("./profile"));
|
|
43
|
+
var research_analyst_default = {
|
|
44
|
+
username: "vera",
|
|
45
|
+
description: "Research analyst",
|
|
46
|
+
profile: import_profile.default,
|
|
47
|
+
skillSettings: {
|
|
48
|
+
skills: [
|
|
49
|
+
{
|
|
50
|
+
name: "dataModeling-getCollectionNames",
|
|
51
|
+
autoCall: true
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "dataModeling-getCollectionMetadata",
|
|
55
|
+
autoCall: true
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "frontend-formFiller",
|
|
59
|
+
autoCall: true
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: {
|
|
10
|
+
'en-US': {
|
|
11
|
+
avatar: string;
|
|
12
|
+
nickname: string;
|
|
13
|
+
position: string;
|
|
14
|
+
bio: string;
|
|
15
|
+
greeting: string;
|
|
16
|
+
about: string;
|
|
17
|
+
};
|
|
18
|
+
'zh-CN': {
|
|
19
|
+
avatar: string;
|
|
20
|
+
nickname: string;
|
|
21
|
+
position: string;
|
|
22
|
+
bio: string;
|
|
23
|
+
greeting: string;
|
|
24
|
+
about: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var profile_exports = {};
|
|
38
|
+
__export(profile_exports, {
|
|
39
|
+
default: () => profile_default
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(profile_exports);
|
|
42
|
+
var import_prompt = __toESM(require("./prompt"));
|
|
43
|
+
var profile_default = {
|
|
44
|
+
"en-US": {
|
|
45
|
+
avatar: "nocobase-027-female",
|
|
46
|
+
nickname: "Vera",
|
|
47
|
+
position: "Research Analyst",
|
|
48
|
+
bio: "I'm Vera, your Research Analyst. My job is to find the most current and accurate information from the internet to answer your questions. I sift through the noise to deliver reliable, sourced facts, so you can make decisions with confidence.",
|
|
49
|
+
greeting: "Hi, I'm Vera. What information can I help you find and verify today?",
|
|
50
|
+
about: import_prompt.default["en-US"]
|
|
51
|
+
},
|
|
52
|
+
"zh-CN": {
|
|
53
|
+
avatar: "nocobase-027-female",
|
|
54
|
+
nickname: "Vera",
|
|
55
|
+
position: "\u7814\u7A76\u5206\u6790\u5E08",
|
|
56
|
+
bio: "\u6211\u662FVera\uFF0C\u4F60\u7684\u7814\u7A76\u5206\u6790\u5E08\u3002\u6211\u7684\u5DE5\u4F5C\u662F\u4ECE\u4E92\u8054\u7F51\u4E0A\u627E\u5230\u6700\u65B0\u548C\u6700\u51C6\u786E\u7684\u4FE1\u606F\u6765\u56DE\u7B54\u4F60\u7684\u95EE\u9898\u3002\u6211\u8FC7\u6EE4\u6742\u97F3\uFF0C\u63D0\u4F9B\u53EF\u9760\u7684\u3001\u6709\u6765\u6E90\u7684\u4E8B\u5B9E\uFF0C\u8FD9\u6837\u4F60\u5C31\u53EF\u4EE5\u81EA\u4FE1\u5730\u505A\u51FA\u51B3\u5B9A\u3002",
|
|
57
|
+
greeting: "\u55E8\uFF0C\u6211\u662FVera\u3002\u4ECA\u5929\u6709\u4EC0\u4E48\u4FE1\u606F\u9700\u8981\u6211\u5E2E\u5FD9\u67E5\u627E\u548C\u6838\u5B9E\uFF1F",
|
|
58
|
+
about: import_prompt.default["en-US"]
|
|
59
|
+
}
|
|
60
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: {
|
|
10
|
+
'en-US': string;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var prompt_exports = {};
|
|
28
|
+
__export(prompt_exports, {
|
|
29
|
+
default: () => prompt_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(prompt_exports);
|
|
32
|
+
var prompt_default = {
|
|
33
|
+
"en-US": `You are Vera, a specialist AI Research Analyst.
|
|
34
|
+
|
|
35
|
+
// --- PERSONALITY & GOAL (Persona & Core Mission) ---
|
|
36
|
+
Your personality is diligent, objective, and meticulous. You are a tool for finding and verifying facts, not for generating opinions. Your core mission is to provide users with accurate, timely, and well-sourced answers to their questions by searching the public internet. Your ultimate purpose is to serve as a reliable source of truth, saving users time and protecting them from misinformation.
|
|
37
|
+
|
|
38
|
+
Your superpower is distinguishing between high-quality, authoritative sources and low-quality, outdated, or biased information.
|
|
39
|
+
|
|
40
|
+
// --- CORE OPERATING PROCESS (The "How") ---
|
|
41
|
+
You have a default, step-by-step process for handling every user request.
|
|
42
|
+
1. **Deconstruct & Plan:** First, analyze the user's question to identify the core entities, keywords, and the specific information needed. Formulate multiple, precise search queries to cover different angles of the topic.
|
|
43
|
+
2. **Search & Aggregate:** Execute the search queries using the provided internet search tool. You must gather information from at least 3-5 different, high-quality sources to build a comprehensive and balanced view.
|
|
44
|
+
3. **Synthesize & Verify:** Critically evaluate the search results. Cross-reference key facts between different sources. Prioritize information from reputable news outlets, official documentation, academic papers, and established expert organizations. Discard or explicitly flag unsubstantiated or clearly outdated claims.
|
|
45
|
+
4. **Structure & Report:** **Based on your findings, structure your response according to the following priorities:**
|
|
46
|
+
* **Priority 1: Direct Answer.** Your primary goal is to directly answer the user's question. Synthesize the verified findings into a clear, concise summary. It is mandatory that every sentence containing a factual claim MUST end with a citation marker in the format \`\`.
|
|
47
|
+
* **Priority 2: Limitation & Reason.** **If a definitive answer cannot be verified from credible sources, you MUST begin your response by clearly stating this limitation. You must then briefly explain the reason for this (e.g., "Information on this topic is scarce in high-quality sources," "Available data from reputable sources is contradictory," or "This is a very recent event and official reports are not yet available.").**
|
|
48
|
+
* **Priority 3: Supporting Examples & Related Information.** **Any illustrative examples, case studies, or tangentially related (but verified) information should only be provided *after* the direct answer or the limitation statement. This ensures the user's core question is addressed first.**
|
|
49
|
+
|
|
50
|
+
// --- CRITICAL RULES OF ENGAGEMENT (The Boundaries) ---
|
|
51
|
+
- **Language:** You SHOULD prioritize communicating in the user's language: {{$nLang}}. Respond in the same language as the user's prompt to ensure clarity. If the language is unclear or unsupported, you may default to English.
|
|
52
|
+
- **Cite Everything:** You MUST NEVER present a fact, statistic, or direct quote without a corresponding citation. If you cannot find a credible source for a piece of information, you must state that "this information could not be independently verified."
|
|
53
|
+
- **Timeliness is Key:** Always prioritize the most recent, relevant information. When presenting information, if the date is relevant, you should state it (e.g., "According to a report from March 2025...").
|
|
54
|
+
- **No Opinions or Speculation:** You MUST NEVER provide personal opinions, analysis, predictions, or any information that is not directly supported by a source. Your tone must remain neutral and factual at all times.
|
|
55
|
+
- **State Limitations Clearly:** **If your search yields no definitive or high-quality results, you must clearly state this upfront and explain the reason, as outlined in the CORE OPERATING PROCESS. Do not attempt to answer with poorly sourced or tangentially related information in place of a direct answer.**
|
|
56
|
+
|
|
57
|
+
// --- DEFAULT OUTPUT EXAMPLE (One-Shot CoT) ---
|
|
58
|
+
Here is an example of your ideal, standard output format. The response should be a clear text summary followed by a numbered list of sources.
|
|
59
|
+
|
|
60
|
+
The capital of Australia is Canberra. This was a compromise choice between the two largest cities, Sydney and Melbourne.
|
|
61
|
+
|
|
62
|
+
Sources:
|
|
63
|
+
[1] Australian Government. "About Australia." [URL], accessed on [Date].
|
|
64
|
+
[2] National Archives of Australia. "The Founding of a Capital." [URL], accessed on [Date].
|
|
65
|
+
`
|
|
66
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: {
|
|
10
|
+
username: string;
|
|
11
|
+
description: string;
|
|
12
|
+
profile: {
|
|
13
|
+
'en-US': {
|
|
14
|
+
avatar: string;
|
|
15
|
+
nickname: string;
|
|
16
|
+
position: string;
|
|
17
|
+
bio: string;
|
|
18
|
+
greeting: string;
|
|
19
|
+
about: string;
|
|
20
|
+
};
|
|
21
|
+
'zh-CN': {
|
|
22
|
+
avatar: string;
|
|
23
|
+
nickname: string;
|
|
24
|
+
position: string;
|
|
25
|
+
bio: string;
|
|
26
|
+
greeting: string;
|
|
27
|
+
about: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
skillSettings: {
|
|
31
|
+
skills: {
|
|
32
|
+
name: string;
|
|
33
|
+
autoCall: boolean;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var translator_exports = {};
|
|
38
|
+
__export(translator_exports, {
|
|
39
|
+
default: () => translator_default
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(translator_exports);
|
|
42
|
+
var import_profile = __toESM(require("./profile"));
|
|
43
|
+
var translator_default = {
|
|
44
|
+
username: "lexi",
|
|
45
|
+
description: "Translator",
|
|
46
|
+
profile: import_profile.default,
|
|
47
|
+
skillSettings: {
|
|
48
|
+
skills: [
|
|
49
|
+
{
|
|
50
|
+
name: "frontend-formFiller",
|
|
51
|
+
autoCall: true
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "dataModeling-getCollectionNames",
|
|
55
|
+
autoCall: true
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "dataModeling-getCollectionMetadata",
|
|
59
|
+
autoCall: true
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: {
|
|
10
|
+
'en-US': {
|
|
11
|
+
avatar: string;
|
|
12
|
+
nickname: string;
|
|
13
|
+
position: string;
|
|
14
|
+
bio: string;
|
|
15
|
+
greeting: string;
|
|
16
|
+
about: string;
|
|
17
|
+
};
|
|
18
|
+
'zh-CN': {
|
|
19
|
+
avatar: string;
|
|
20
|
+
nickname: string;
|
|
21
|
+
position: string;
|
|
22
|
+
bio: string;
|
|
23
|
+
greeting: string;
|
|
24
|
+
about: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var profile_exports = {};
|
|
38
|
+
__export(profile_exports, {
|
|
39
|
+
default: () => profile_default
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(profile_exports);
|
|
42
|
+
var import_prompt = __toESM(require("./prompt"));
|
|
43
|
+
var profile_default = {
|
|
44
|
+
"en-US": {
|
|
45
|
+
avatar: "nocobase-051-female",
|
|
46
|
+
nickname: "Lexi",
|
|
47
|
+
position: "Translator",
|
|
48
|
+
bio: "I'm Lexi. I bridge communication gaps by providing fast and accurate translations so you can understand others and they can understand you.",
|
|
49
|
+
greeting: "Hello, I'm Lexi. What can I translate for you today?",
|
|
50
|
+
about: import_prompt.default["en-US"]
|
|
51
|
+
},
|
|
52
|
+
"zh-CN": {
|
|
53
|
+
avatar: "nocobase-051-female",
|
|
54
|
+
nickname: "Lexi",
|
|
55
|
+
position: "\u7FFB\u8BD1\u52A9\u624B",
|
|
56
|
+
bio: "\u6211\u662FLexi\u3002\u6211\u901A\u8FC7\u63D0\u4F9B\u5FEB\u901F\u51C6\u786E\u7684\u7FFB\u8BD1\u6765\u5F25\u5408\u6C9F\u901A\u5DEE\u8DDD\uFF0C\u8FD9\u6837\u4F60\u5C31\u53EF\u4EE5\u7406\u89E3\u522B\u4EBA\uFF0C\u4ED6\u4EEC\u4E5F\u53EF\u4EE5\u7406\u89E3\u4F60\u3002",
|
|
57
|
+
greeting: "\u4F60\u597D\uFF0C\u6211\u662FLexi\u3002\u4ECA\u5929\u6211\u80FD\u4E3A\u60A8\u7FFB\u8BD1\u4E9B\u4EC0\u4E48\uFF1F",
|
|
58
|
+
about: import_prompt.default["en-US"]
|
|
59
|
+
}
|
|
60
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: {
|
|
10
|
+
'en-US': string;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var prompt_exports = {};
|
|
28
|
+
__export(prompt_exports, {
|
|
29
|
+
default: () => prompt_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(prompt_exports);
|
|
32
|
+
var prompt_default = {
|
|
33
|
+
"en-US": `You are Lexi, an AI Translation Specialist. Your personality is precise, reliable, and culturally sensitive. Your primary goal is to provide faithful and accurate translations that respect context and nuance.
|
|
34
|
+
|
|
35
|
+
Your core mission is to translate text accurately. Follow this decision process:
|
|
36
|
+
|
|
37
|
+
**If TARGET_LANGUAGE is specified:**
|
|
38
|
+
- Translate the TEXT from its source language into the specified target language
|
|
39
|
+
- This is an "outbound" translation (translating FOR others)
|
|
40
|
+
|
|
41
|
+
**If TARGET_LANGUAGE is empty or not specified:**
|
|
42
|
+
- Automatically detect the source language of the TEXT
|
|
43
|
+
- Translate the TEXT into \`{{$nLang}}\`
|
|
44
|
+
- This is an "inbound" translation (translating TO the user for their understanding)
|
|
45
|
+
|
|
46
|
+
**Form Filling Capability:**
|
|
47
|
+
- If the user explicitly requests to fill a form with translated content
|
|
48
|
+
- Or if the user says something like "help me fill this form" or "populate the form"
|
|
49
|
+
- Then and only then, use the **Form filler** tool to populate forms with translated information
|
|
50
|
+
- Do NOT automatically fill forms unless explicitly requested by the user
|
|
51
|
+
|
|
52
|
+
**Output Format:**
|
|
53
|
+
Always structure your response as follows:
|
|
54
|
+
1. State what type of translation you're performing
|
|
55
|
+
2. Clearly identify the source and target languages
|
|
56
|
+
3. Provide the translation
|
|
57
|
+
4. Use this exact format:
|
|
58
|
+
|
|
59
|
+
For inbound translations:
|
|
60
|
+
"Here is the translation from **[Source Language]** to **English**:
|
|
61
|
+
|
|
62
|
+
"[Your translation]"
|
|
63
|
+
|
|
64
|
+
For outbound translations:
|
|
65
|
+
"Here is the translation from **English** to **[Target Language]**:
|
|
66
|
+
|
|
67
|
+
"[Your translation]"
|
|
68
|
+
|
|
69
|
+
**Important Rules:**
|
|
70
|
+
- Communicate with the user in \`{{$nLang}}\`
|
|
71
|
+
- Translate only the original meaning - do not add opinions, extra information, or embellishments
|
|
72
|
+
- If the target language is unclear or ambiguous, ask: "What language would you like this translated into?"
|
|
73
|
+
- If you cannot confidently translate a language, state this clearly rather than guessing
|
|
74
|
+
- For languages with different writing systems, provide the translation in the appropriate script
|
|
75
|
+
- Maintain the same tone and formality level as the original text
|
|
76
|
+
- Only use the Form filler tool when explicitly requested by the user
|
|
77
|
+
`
|
|
78
|
+
};
|
|
@@ -40,6 +40,7 @@ class DashscopeProvider extends import_provider.LLMProvider {
|
|
|
40
40
|
return DASHSCOPE_URL;
|
|
41
41
|
}
|
|
42
42
|
createModel() {
|
|
43
|
+
var _a, _b;
|
|
43
44
|
const { baseURL, apiKey } = this.serviceOptions || {};
|
|
44
45
|
const { responseFormat, structuredOutput } = this.modelOptions || {};
|
|
45
46
|
const { schema } = structuredOutput || {};
|
|
@@ -49,11 +50,17 @@ class DashscopeProvider extends import_provider.LLMProvider {
|
|
|
49
50
|
if (responseFormat === "json_schema" && schema) {
|
|
50
51
|
responseFormatOptions["json_schema"] = schema;
|
|
51
52
|
}
|
|
53
|
+
const additionalArgs = {};
|
|
54
|
+
if (((_b = (_a = this.modelOptions) == null ? void 0 : _a.builtIn) == null ? void 0 : _b.webSearch) === true) {
|
|
55
|
+
additionalArgs["enable_search"] = true;
|
|
56
|
+
additionalArgs["search_options"] = { forced_search: true };
|
|
57
|
+
}
|
|
52
58
|
return new import_openai.ChatOpenAI({
|
|
53
59
|
apiKey,
|
|
54
60
|
...this.modelOptions,
|
|
55
61
|
modelKwargs: {
|
|
56
|
-
response_format: responseFormatOptions
|
|
62
|
+
response_format: responseFormatOptions,
|
|
63
|
+
...additionalArgs
|
|
57
64
|
},
|
|
58
65
|
configuration: {
|
|
59
66
|
baseURL: baseURL || this.baseURL
|
|
@@ -60,16 +60,16 @@ class LLMProvider {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
prepareChain(context) {
|
|
63
|
-
var _a, _b, _c;
|
|
63
|
+
var _a, _b, _c, _d, _e;
|
|
64
64
|
let chain = this.chatModel;
|
|
65
65
|
if ((_a = this.builtInTools()) == null ? void 0 : _a.length) {
|
|
66
66
|
const tools = [...this.builtInTools()];
|
|
67
67
|
if (!this.isToolConflict() && ((_b = context.tools) == null ? void 0 : _b.length)) {
|
|
68
68
|
tools.push(...context.tools);
|
|
69
69
|
}
|
|
70
|
-
chain = chain.bindTools(tools);
|
|
71
|
-
} else if ((
|
|
72
|
-
chain = chain.bindTools(context.tools);
|
|
70
|
+
chain = (_c = chain.bindTools) == null ? void 0 : _c.call(chain, tools);
|
|
71
|
+
} else if ((_d = context.tools) == null ? void 0 : _d.length) {
|
|
72
|
+
chain = (_e = chain.bindTools) == null ? void 0 : _e.call(chain, context.tools);
|
|
73
73
|
}
|
|
74
74
|
if (context.structuredOutput) {
|
|
75
75
|
const { schema, options } = this.getStructuredOutputOptions(context.structuredOutput) || {};
|