mm_llm 1.3.0 → 1.3.2
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/index.js +6 -33
- package/lib/admin.js +23 -0
- package/lib/llm.js +228 -639
- package/lib/llm_execute.js +216 -0
- package/lib/llm_message.js +224 -0
- package/lib/manager.js +1 -1
- package/lib/memory.js +1 -1
- package/lib/sqlite.js +9 -475
- package/lib/sqlite_config.js +197 -0
- package/lib/sqlite_quota.js +123 -0
- package/lib/sqlite_session.js +189 -0
- package/package.json +7 -7
- package/tool/llm/index.js +487 -5
- package/tool/llm/tool.json +135 -3
- package/tool/llm_admin/index.js +36 -0
- package/tool/llm_admin/tool.json +11 -0
- package/lib/llm_tool_logic.js +0 -231
- package/lib/tools/index.js +0 -16
- package/lib/tools/llm/index.js +0 -7
package/index.js
CHANGED
|
@@ -1,40 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const Manager = require('./lib/manager');
|
|
7
|
-
const { reg } = require('mm_admin');
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 大模型管理器实例(mm_admin 注册实例)
|
|
11
|
-
* 支持:require('mm_llm').llmAdmin(scope, config) -> manager.get('name')
|
|
12
|
-
*/
|
|
13
|
-
const admin = reg('mm_llm');
|
|
14
|
-
admin.setClass(Manager);
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* 获取指定作用域的大模型管理器
|
|
18
|
-
* @param {string} scope 作用域
|
|
19
|
-
* @param {Object} config 管理器配置
|
|
20
|
-
* @returns {LLMManager} 大模型管理器实例
|
|
21
|
-
*/
|
|
22
|
-
function llmAdmin(scope, config) {
|
|
23
|
-
return admin.get(scope || 'os', config);
|
|
24
|
-
}
|
|
1
|
+
const LLM = require('./lib/llm.js');
|
|
2
|
+
const Memory = require('./lib/memory.js');
|
|
3
|
+
const Sqlite = require('./lib/sqlite.js');
|
|
4
|
+
const Manager = require('./lib/manager.js');
|
|
5
|
+
const adminLib = require('./lib/admin.js');
|
|
25
6
|
|
|
26
7
|
module.exports = {
|
|
27
8
|
LLM,
|
|
28
9
|
Memory,
|
|
29
10
|
Sqlite,
|
|
30
11
|
Manager,
|
|
31
|
-
|
|
32
|
-
llmAdmin
|
|
12
|
+
...adminLib
|
|
33
13
|
};
|
|
34
|
-
|
|
35
|
-
/* mm-tool-logic-export 工具能力层:其它模块可 require("<pkg>").tools.<name> 直接引用 */
|
|
36
|
-
Object.defineProperty(module.exports, 'tools', { enumerable: true, configurable: true,
|
|
37
|
-
get: function () { return require('./lib/tools'); } });
|
|
38
|
-
|
|
39
|
-
/* S2 能力下沉:业务实现可在模块之间直接引用(不经过工具注册面) */
|
|
40
|
-
Object.defineProperty(module.exports, 'llmToolLogic', { enumerable: true, value: require('./lib/llm_tool_logic.js') });
|
package/lib/admin.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const { reg } = require('mm_admin');
|
|
2
|
+
const Manager = require('./manager.js');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 大模型管理器实例池(Admin 工厂)
|
|
6
|
+
*/
|
|
7
|
+
let admin = reg('llm');
|
|
8
|
+
admin.setClass(Manager);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 获取指定作用域的大模型管理器(同作用域复用)
|
|
12
|
+
* @param {string} [scope='os'] 作用域名称
|
|
13
|
+
* @param {Object} [config] 管理器配置,仅在首次创建实例时生效
|
|
14
|
+
* @returns {Manager} 大模型管理器实例
|
|
15
|
+
*/
|
|
16
|
+
function llmAdmin(scope, config) {
|
|
17
|
+
return admin.get(scope || 'os', config);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = {
|
|
21
|
+
admin,
|
|
22
|
+
llmAdmin
|
|
23
|
+
};
|