-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtest.js
More file actions
48 lines (34 loc) · 943 Bytes
/
test.js
File metadata and controls
48 lines (34 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
'use strict';
const lowcode = require('./index');
const init = require('./init');
const log = function() { console.log(...arguments) };
async function run() {
const cmd = process.argv && process.argv[2] || '';
log({cmd});
switch (cmd){
case 'init':
// step 1: 测试 将文本等数据向量化
log("init.vectors return: ", await init.vectors({
"oriDirectory": "./train_data/" // 预训练数据根目录
}));
break;
case 'rag':
// step 2: 测试基于向量搜索
log("lowcode.main return: ", await lowcode.main({
"openid": "wedaQdTHDHjkhdaHFDH32dhalj",
"isRAG": true,
"text": "解释下微搭的生命周期"
}));
break;
case 'chat':
// step 2: 测试基于向量搜索
log("lowcode.main return: ", await lowcode.main({
"openid": "wedaQdTHDHjkhdaHFDH32dhalj",
"text": "最近工作压力有点大"
}));
break;
default:
log("no command");
}
}
run();