mm_llm 1.1.0 → 1.3.1

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 CHANGED
@@ -1,33 +1,15 @@
1
1
  'use strict';
2
2
 
3
- const { LLM } = require('./lib/llm');
4
- const { Memory } = require('./lib/memory');
5
- const { Sqlite } = require('./lib/sqlite');
3
+ const LLM = require('./lib/llm');
4
+ const Memory = require('./lib/memory');
5
+ const Sqlite = require('./lib/sqlite');
6
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
- }
7
+ const admin_module = require('./lib/admin');
25
8
 
26
9
  module.exports = {
27
10
  LLM,
28
11
  Memory,
29
12
  Sqlite,
30
13
  Manager,
31
- admin,
32
- llmAdmin
14
+ ...admin_module
33
15
  };
package/lib/admin.js ADDED
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ const { reg } = require('mm_admin');
4
+ const Manager = require('./manager');
5
+
6
+ /**
7
+ * 大模型管理器实例池(Admin 工厂)
8
+ */
9
+ let admin = reg('mm_llm');
10
+ admin.setClass(Manager);
11
+
12
+ /**
13
+ * 获取指定作用域的大模型管理器(同作用域复用)
14
+ * @param {string} [scope='os'] 作用域名称
15
+ * @param {Object} [config] 管理器配置,仅在首次创建实例时生效
16
+ * @returns {Manager} 大模型管理器实例
17
+ */
18
+ function llmAdmin(scope, config) {
19
+ return admin.get(scope || 'os', config);
20
+ }
21
+
22
+ module.exports = { admin, llmAdmin };