@maiyunnet/kebab 9.11.0 → 9.11.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/doc/kebab-rag.md +16 -16
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/core.js +7 -5
- package/lib/vector.d.ts +2 -2
- package/lib/vector.js +5 -5
- package/package.json +1 -1
- package/www/example/ctr/test.js +11 -8
package/doc/kebab-rag.md
CHANGED
|
@@ -1360,7 +1360,7 @@ index/variables/VER.md
|
|
|
1360
1360
|
|
|
1361
1361
|
# Variable: VER
|
|
1362
1362
|
|
|
1363
|
-
> `const` **VER**: `"9.11.
|
|
1363
|
+
> `const` **VER**: `"9.11.2"` = `'9.11.2'`
|
|
1364
1364
|
|
|
1365
1365
|
Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
|
|
1366
1366
|
|
|
@@ -3320,7 +3320,7 @@ lib/core/functions/clone.md
|
|
|
3320
3320
|
|
|
3321
3321
|
> **clone**\<`T`\>(`obj`): `T`
|
|
3322
3322
|
|
|
3323
|
-
Defined in: [lib/core.ts:
|
|
3323
|
+
Defined in: [lib/core.ts:1164](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1164)
|
|
3324
3324
|
|
|
3325
3325
|
完整的克隆一份数组/对象
|
|
3326
3326
|
|
|
@@ -3384,7 +3384,7 @@ lib/core/functions/debug.md
|
|
|
3384
3384
|
|
|
3385
3385
|
> **debug**(`message?`, ...`optionalParams`): `void`
|
|
3386
3386
|
|
|
3387
|
-
Defined in: [lib/core.ts:
|
|
3387
|
+
Defined in: [lib/core.ts:1198](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1198)
|
|
3388
3388
|
|
|
3389
3389
|
打印调试信息,线上环境不会打印
|
|
3390
3390
|
|
|
@@ -3419,7 +3419,7 @@ lib/core/functions/display.md
|
|
|
3419
3419
|
|
|
3420
3420
|
> **display**(`message?`, ...`optionalParams`): `void`
|
|
3421
3421
|
|
|
3422
|
-
Defined in: [lib/core.ts:
|
|
3422
|
+
Defined in: [lib/core.ts:1211](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1211)
|
|
3423
3423
|
|
|
3424
3424
|
向控制台直接显示内容,一般情况下禁止使用
|
|
3425
3425
|
|
|
@@ -3524,7 +3524,7 @@ lib/core/functions/getLog.md
|
|
|
3524
3524
|
|
|
3525
3525
|
> **getLog**(`opt`): `Promise`\<`false` \| \{ `list`: `any`[] \| `string`[][]; `total`: `number`; \}\>
|
|
3526
3526
|
|
|
3527
|
-
Defined in: [lib/core.ts:
|
|
3527
|
+
Defined in: [lib/core.ts:1076](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1076)
|
|
3528
3528
|
|
|
3529
3529
|
获取日志内容为一个数组
|
|
3530
3530
|
|
|
@@ -3659,7 +3659,7 @@ lib/core/functions/loadEnv.md
|
|
|
3659
3659
|
|
|
3660
3660
|
> **loadEnv**(`dir`): `Promise`\<`void`\>
|
|
3661
3661
|
|
|
3662
|
-
Defined in: [lib/core.ts:
|
|
3662
|
+
Defined in: [lib/core.ts:1263](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1263)
|
|
3663
3663
|
|
|
3664
3664
|
加载 .env 文件到 process.env,若文件不存在则跳过
|
|
3665
3665
|
|
|
@@ -3729,7 +3729,7 @@ lib/core/functions/ls.md
|
|
|
3729
3729
|
|
|
3730
3730
|
> **ls**(`opt`): `Promise`\<`object`[]\>
|
|
3731
3731
|
|
|
3732
|
-
Defined in: [lib/core.ts:
|
|
3732
|
+
Defined in: [lib/core.ts:1125](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1125)
|
|
3733
3733
|
|
|
3734
3734
|
获取目录内文件/文件夹列表
|
|
3735
3735
|
|
|
@@ -4090,7 +4090,7 @@ lib/core/functions/resolveEnvVars.md
|
|
|
4090
4090
|
|
|
4091
4091
|
> **resolveEnvVars**(`obj`): `void`
|
|
4092
4092
|
|
|
4093
|
-
Defined in: [lib/core.ts:
|
|
4093
|
+
Defined in: [lib/core.ts:1293](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1293)
|
|
4094
4094
|
|
|
4095
4095
|
将配置对象中的 ${ENV_VAR} 占位符替换为 process.env 的值
|
|
4096
4096
|
|
|
@@ -4532,7 +4532,7 @@ lib/core/functions/writeEventStreamHead.md
|
|
|
4532
4532
|
|
|
4533
4533
|
> **writeEventStreamHead**(`res`): `void`
|
|
4534
4534
|
|
|
4535
|
-
Defined in: [lib/core.ts:
|
|
4535
|
+
Defined in: [lib/core.ts:1233](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1233)
|
|
4536
4536
|
|
|
4537
4537
|
## Parameters
|
|
4538
4538
|
|
|
@@ -4557,7 +4557,7 @@ lib/core/functions/writeHead.md
|
|
|
4557
4557
|
|
|
4558
4558
|
> **writeHead**(`res`, `statusCode`, `headers?`): `void`
|
|
4559
4559
|
|
|
4560
|
-
Defined in: [lib/core.ts:
|
|
4560
|
+
Defined in: [lib/core.ts:1222](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1222)
|
|
4561
4561
|
|
|
4562
4562
|
让 res 发送头部(前提是头部没有被发送才能调用本方法
|
|
4563
4563
|
|
|
@@ -4598,7 +4598,7 @@ lib/core/functions/write.md
|
|
|
4598
4598
|
|
|
4599
4599
|
> **write**(`res`, `data`): `void`
|
|
4600
4600
|
|
|
4601
|
-
Defined in: [lib/core.ts:
|
|
4601
|
+
Defined in: [lib/core.ts:1245](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1245)
|
|
4602
4602
|
|
|
4603
4603
|
向 res 发送数据
|
|
4604
4604
|
|
|
@@ -19475,7 +19475,7 @@ Defined in: [lib/vector.ts:30](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
19475
19475
|
|
|
19476
19476
|
> **delete**(`data`): `Promise`\<`false` \| \{ `deletedCount`: `number`; \}\>
|
|
19477
19477
|
|
|
19478
|
-
Defined in: [lib/vector.ts:
|
|
19478
|
+
Defined in: [lib/vector.ts:120](https://github.com/maiyunnet/kebab/blob/master/lib/vector.ts#L120)
|
|
19479
19479
|
|
|
19480
19480
|
删除数据
|
|
19481
19481
|
|
|
@@ -19505,7 +19505,7 @@ Defined in: [lib/vector.ts:116](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19505
19505
|
|
|
19506
19506
|
> **insert**(`data`): `Promise`\<`false` \| \{ `insertCount`: `number`; `insertIds`: (`string` \| `number`)[]; \}\>
|
|
19507
19507
|
|
|
19508
|
-
Defined in: [lib/vector.ts:
|
|
19508
|
+
Defined in: [lib/vector.ts:89](https://github.com/maiyunnet/kebab/blob/master/lib/vector.ts#L89)
|
|
19509
19509
|
|
|
19510
19510
|
插入数据
|
|
19511
19511
|
|
|
@@ -19531,9 +19531,9 @@ Defined in: [lib/vector.ts:85](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
19531
19531
|
|
|
19532
19532
|
***
|
|
19533
19533
|
|
|
19534
|
-
###
|
|
19534
|
+
### search()
|
|
19535
19535
|
|
|
19536
|
-
> **
|
|
19536
|
+
> **search**(`data`): `Promise`\<`false` \| `object`[]\>
|
|
19537
19537
|
|
|
19538
19538
|
Defined in: [lib/vector.ts:35](https://github.com/maiyunnet/kebab/blob/master/lib/vector.ts#L35)
|
|
19539
19539
|
|
|
@@ -19596,7 +19596,7 @@ lib/vector/functions/get.md
|
|
|
19596
19596
|
|
|
19597
19597
|
> **get**(`ctrEtc`): [`Vector`](../classes/Vector.md)
|
|
19598
19598
|
|
|
19599
|
-
Defined in: [lib/vector.ts:
|
|
19599
|
+
Defined in: [lib/vector.ts:156](https://github.com/maiyunnet/kebab/blob/master/lib/vector.ts#L156)
|
|
19600
19600
|
|
|
19601
19601
|
创建一个 Vector 对象
|
|
19602
19602
|
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '9.11.
|
|
9
|
+
export const VER = '9.11.2';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/lib/core.js
CHANGED
|
@@ -858,7 +858,9 @@ export function log(opt, msg, fend = '') {
|
|
|
858
858
|
'cf': '',
|
|
859
859
|
'x': ''
|
|
860
860
|
};
|
|
861
|
-
|
|
861
|
+
/** --- 文件和内容统一使用同一时间点 --- */
|
|
862
|
+
const now = new Date();
|
|
863
|
+
const [y, m, d, h] = lTime.format(null, 'Y-m-d-H', now).split('-');
|
|
862
864
|
let path = kebab.LOG_CWD + hostname + fend + '/' + y + '/' + m + '/' + d + '/';
|
|
863
865
|
const rtn = await lFs.mkdir(path, 0o777);
|
|
864
866
|
if (!rtn) {
|
|
@@ -869,8 +871,8 @@ export function log(opt, msg, fend = '') {
|
|
|
869
871
|
// --- JSON Lines 格式 ---
|
|
870
872
|
path += h + '.jsonl';
|
|
871
873
|
const entry = lText.stringifyJson({
|
|
872
|
-
'time': lTime.format(null, 'H:i:s'),
|
|
873
|
-
'unix': lTime.stamp(),
|
|
874
|
+
'time': lTime.format(null, 'H:i:s', now),
|
|
875
|
+
'unix': lTime.stamp(now),
|
|
874
876
|
'url': urlFull + wpath + (Object.keys(get).length ? '?' + lText.queryStringify(get) : ''),
|
|
875
877
|
'cookie': cookie,
|
|
876
878
|
'session': session,
|
|
@@ -900,8 +902,8 @@ export function log(opt, msg, fend = '') {
|
|
|
900
902
|
}
|
|
901
903
|
}
|
|
902
904
|
await lFs.putContent(path, '"' +
|
|
903
|
-
lText.csvescape(lTime.format(null, 'H:i:s')) + '","' +
|
|
904
|
-
lText.csvescape(lTime.stamp().toString()) + '","' +
|
|
905
|
+
lText.csvescape(lTime.format(null, 'H:i:s', now)) + '","' +
|
|
906
|
+
lText.csvescape(lTime.stamp(now).toString()) + '","' +
|
|
905
907
|
lText.csvescape(urlFull + wpath + (Object.keys(get).length ? '?' + lText.queryStringify(get) : '')) + '","' +
|
|
906
908
|
lText.csvescape(lText.queryStringify(cookie)) + '","' +
|
|
907
909
|
lText.csvescape(lText.stringifyJson(session)) + '","' +
|
package/lib/vector.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare class Vector {
|
|
|
23
23
|
private readonly _etc;
|
|
24
24
|
constructor(etc: kebab.IConfigVector);
|
|
25
25
|
/** --- 搜索 --- */
|
|
26
|
-
|
|
26
|
+
search(data: {
|
|
27
27
|
/** --- 表名 --- */
|
|
28
28
|
'collection': string;
|
|
29
29
|
/** --- 查询的向量 --- */
|
|
@@ -39,7 +39,7 @@ export declare class Vector {
|
|
|
39
39
|
}): Promise<Array<{
|
|
40
40
|
'id': string | number;
|
|
41
41
|
'distance': number;
|
|
42
|
-
|
|
42
|
+
[key: string]: any;
|
|
43
43
|
}> | false>;
|
|
44
44
|
/** --- 插入数据 --- */
|
|
45
45
|
insert(data: {
|
package/lib/vector.js
CHANGED
|
@@ -8,7 +8,7 @@ export class Vector {
|
|
|
8
8
|
this._etc = etc;
|
|
9
9
|
}
|
|
10
10
|
/** --- 搜索 --- */
|
|
11
|
-
async
|
|
11
|
+
async search(data) {
|
|
12
12
|
const body = {
|
|
13
13
|
'dbName': this._etc.name,
|
|
14
14
|
'collectionName': data.collection,
|
|
@@ -27,15 +27,15 @@ export class Vector {
|
|
|
27
27
|
try {
|
|
28
28
|
const res = await lUndici.postJsonResponseJson(`http://${this._etc.host}:${this._etc.port}/v2/vectordb/entities/search`, body, { 'headers': { 'Authorization': `Bearer ${this._etc.user}:${this._etc.pwd}` } });
|
|
29
29
|
if (res?.code !== 0) {
|
|
30
|
-
lCore.log({}, '[VECTOR][
|
|
31
|
-
lCore.debug('[VECTOR][
|
|
30
|
+
lCore.log({}, '[VECTOR][search][error] ' + (res?.message ?? ''), '-error');
|
|
31
|
+
lCore.debug('[VECTOR][search]', res);
|
|
32
32
|
return false;
|
|
33
33
|
}
|
|
34
34
|
return res.data;
|
|
35
35
|
}
|
|
36
36
|
catch (e) {
|
|
37
|
-
lCore.log({}, '[VECTOR][
|
|
38
|
-
lCore.debug('[VECTOR][
|
|
37
|
+
lCore.log({}, '[VECTOR][search][error] ' + e.message, '-error');
|
|
38
|
+
lCore.debug('[VECTOR][search]', e);
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
}
|
package/package.json
CHANGED
package/www/example/ctr/test.js
CHANGED
|
@@ -1729,16 +1729,19 @@ exec: ${JSON.stringify(exec)}<br><br>`);
|
|
|
1729
1729
|
}
|
|
1730
1730
|
async vector() {
|
|
1731
1731
|
const vector = lVector.get(this);
|
|
1732
|
-
const res = await vector.
|
|
1732
|
+
const res = await vector.search({
|
|
1733
1733
|
'collection': 'ai_wiki_content',
|
|
1734
|
-
|
|
1735
|
-
'
|
|
1734
|
+
// --- 内积 ---
|
|
1735
|
+
'metric': 'IP',
|
|
1736
|
+
'fields': ['id', 'team_uid', 'wiki_uid'],
|
|
1737
|
+
'data': [-0.032358210533857346, 0.007840704172849655, -0.023857861757278442, 0.032358210533857346, -0.05684806779026985, -0.003219231264665723, 0.048410918563604355, 0.07286917418241501, 0.040036965161561966, 0.11034655570983887, 0.09656903892755508, -0.0008462825790047646, 0.010854536667466164, 0.024458257481455803, -0.05125490203499794, -0.007058608811348677, -0.006272563245147467, -0.09562104195356369, 0.02521665394306183, -0.001118830987252295, 0.007260057609528303, -0.012750525958836079, 0.1126849427819252, 0.013580020517110825, -0.01306652370840311, 0.08715229481458664, 0.05153929814696312, 0.03128381818532944, 0.017727496102452278, -0.01508101262152195, 0.01628970541059971, -0.04825291782617569, 0.0011129060294479132, -0.013271923176944256, 0.037540581077337265, 0.04278615117073059, -0.012426627799868584, 0.02406325936317444, -0.009590543806552887, -0.042817749083042145, 0.033748604357242584, 0.0010368690127506852, -0.01956028677523136, -0.0035865791141986847, -0.006667561363428831, 0.0034937546588480473, -0.03174201399087906, -0.02456885762512684, -0.013177122920751572, -0.06231483817100525, -0.024300258606672287, 0.004230425227433443, -0.03529699519276619, 0.005723516456782818, -0.01655830442905426, 0.06149324029684067, 0.011810431256890297, 0.01493881270289421, 0.024948054924607277, 0.03599219024181366, 0.0009173821308650076, 0.032358210533857346, 0.01091773621737957, 0.0009188633994199336, 0.03035162389278412, -0.04847411811351776, 0.013959218747913837, 0.04376574605703354, -0.05795406177639961, -0.06553801894187927, -0.003317980794236064, 0.02207247167825699, 0.018106695264577866, 0.030241023749113083, -0.0024331859312951565, 0.05675327032804489, 0.007422006689012051, 0.05311929062008858, -0.01582360826432705, -0.03959456831216812, -0.04847411811351776, 0.03551819175481796, -0.0408901609480381, -0.026069847866892815, 0.06705480813980103, 0.03984736651182175, 0.02845563367009163, -0.05975525081157684, -0.0036260788328945637, 0.11129455268383026, -0.016495103016495705, -0.00541146844625473, 0.050401706248521805, 0.02535885199904442, 0.0033851303160190582, -0.056879669427871704, -0.03627659007906914, 0.03517059609293938, 0.00837395153939724, 0.052297696471214294, -0.014054018072783947, 0.08133792877197266, -0.006892709992825985, -0.00874524936079979, -0.004230425227433443, 0.04098496213555336, -0.024632057175040245, -0.0563424713909626, -0.013919718563556671, 0.025659050792455673, 0.016684703528881073, -0.013516820967197418, -0.008271251805126667, -0.01406191848218441, 0.019528687000274658, 0.07236357778310776, 0.010459539480507374, -0.02433185838162899, -0.005107320379465818, -0.012576727196574211, -0.005213969852775335, -0.030146224424242973, 0.0488533154129982, -0.024553056806325912, 0.007240307983011007, 0.009479944594204426, 0.004649122711271048, -0.05675327032804489, 0.026164647191762924, 0.004617522936314344, 0.02488485537469387, 0.01042793970555067, -0.035960592329502106, -0.009345646016299725, 0.004684672690927982, -0.0408901609480381, 0.038836173713207245, 0.04310214892029762, -0.09947621822357178, -0.033337805420160294, -0.017016500234603882, 0.027002042159438133, 0.014812413603067398, 0.014417416416108608, 0.022167271003127098, -0.010096141137182713, -0.040637362748384476, -0.018438491970300674, 0.042912550270557404, -0.012979624792933464, -0.04515613615512848, -0.009377245791256428, -0.025311453267931938, 0.0543200820684433, 0.045819733291864395, -0.011091534979641438, 0.02915083058178425, 0.0036300288047641516, 0.021171877160668373, -0.03052542172372341, -0.04130095988512039, 0.00032439184724353254, 0.04787372052669525, 0.027191640809178352, 0.0221988707780838, -0.028787432238459587, 0.10396339744329453, -0.010585938580334187, 0.08001073449850082, -0.004447673913091421, 0.014030318707227707, 0.015792008489370346, -0.0022317369002848864, -0.030225224792957306, -0.003898627357557416, 0.06932999938726425, 0.02701784297823906, -0.0007356831920333207, -0.0358973927795887, 0.006264663301408291, 0.02567484974861145, 0.005561567842960358, -0.031157419085502625, -0.013453621417284012, 0.031663015484809875, -0.04913771525025368, 0.027681438252329826, 0.03779337927699089, -0.030225224792957306, 0.005597117356956005, 0.025327252224087715, 0.12722085416316986, 0.03984736651182175, 0.0448717400431633, -0.05097050219774246, -0.06361042708158493, -0.029166629537940025, 0.03700338304042816, 0.06756040453910828, 0.00017799584020394832, 0.050907302647829056, -0.00605926476418972, -0.0363713875412941, 0.01674790307879448, 0.014607015065848827, -0.02802903763949871, 0.06920360028743744, -0.05176049843430519, -0.021756473928689957, -0.017885494977235794, 0.0014190291985869408, 0.0026247596833854914, 0.02932462841272354, -0.008184351958334446, 0.004080326296389103, 0.009811743162572384, -0.061177242547273636, 0.007998703047633171, -0.013580020517110825, 0.01605270616710186, 0.000612740172073245, 0.011652432382106781, -0.054478082805871964, 0.02159847505390644, -0.03460180014371872, 0.030683420598506927, 0.020555680617690086, 0.02687564305961132, -0.0034206800628453493, 0.004305474925786257, -0.013374621979892254, 0.0058262161910533905, -0.05656367167830467, 0.010048741474747658, -0.02211987040936947, -0.06199884042143822, -0.01873869076371193, -0.016779502853751183, -0.02586445026099682, 0.05466768145561218, -0.027507640421390533, 0.03567619249224663, -0.020429281517863274, 0.0076866550371050835, -0.03984736651182175, 0.019512886181473732, -0.009100747294723988, 0.008792649023234844, 0.017569497227668762, -0.009400945156812668, -0.026670245453715324, 0.011818330734968185, -0.02025548182427883, -0.01744309812784195, -0.02387366071343422, 0.00969324354082346, 0.06165124103426933, -0.011952630244195461, 0.023052066564559937, 0.05523647740483284, -0.021867072209715843, -0.021456275135278702, -0.0006013839738443494, 0.006130364257842302, -0.036434587091207504, 0.00685716001316905, 0.01689010113477707, -0.036244988441467285, -0.06730760633945465, -0.005403568502515554, -0.025564251467585564, 0.005743266548961401, 0.002780783921480179, -0.011526033282279968, -0.0044200243428349495, -0.02022388204932213, -0.09928662329912186, 0.011684032157063484, 0.06022924929857254, -0.017032301053404808, -0.007769604679197073, -0.03131541609764099, 0.011518132872879505, -0.01905468851327896, -0.019734084606170654, 0.021124476566910744, 0.026306847110390663, 0.020603079348802567, -0.020002683624625206, 0.025595851242542267, -0.01426731701940298, 0.0767243504524231, -0.0021744624245911837, -0.021424675360322, -0.033369407057762146, 0.03719298169016838, 0.0508757047355175, 0.016668902710080147, 0.025374652817845345, 0.008571449667215347, -0.005067820660769939, -0.007161308079957962, -0.04888491705060005, 0.022609667852520943, 0.01202373020350933, 0.0005485530709847808, -0.021566875278949738, -0.1586310714483261, 0.061082445085048676, -0.05172890052199364, 0.036434587091207504, 0.03896257281303406, -0.009772242978215218, 0.04904291406273842, 0.037540581077337265, -0.0946730449795723, 0.0061106146313250065, -0.00447532394900918, 0.027792038396000862, 0.002166562480852008, 0.08468750864267349, 0.009985541924834251, 0.03747738152742386, 0.012632026337087154, 0.056500472128391266, -0.022909866645932198, -0.01957608573138714, -0.0031836815178394318, -0.027586638927459717, -0.016384504735469818, 0.0009914442198351026, 0.0221988707780838, -0.024458257481455803, 0.03722458332777023, 0.05223449692130089, -0.011273234151303768, -0.0010279815178364515, 0.07059399038553238, -0.0046649230644106865, 0.004811071790754795, 0.05770126357674599, 0.053593289107084274, -0.01547600980848074, -0.0046372730284929276, 0.034949395805597305, 0.07034119218587875, 0.015144212171435356, -0.022925665602087975, 0.009511544369161129, 0.0006428587366826832, 0.002308761468157172, 0.00038067903369665146, 0.034159399569034576, 0.011107334867119789, 0.0008280139300040901, -0.011146835051476955, 0.010933536104857922, -0.01294802501797676, -0.07710354775190353, -0.0019404261838644743, 0.034064602106809616, -0.04714692384004593, -0.0011306809028610587, -0.03343260660767555, -0.04079536348581314, 0.025232452899217606, 0.012663626112043858, 0.004522723611444235, -0.034949395805597305, 0.051096901297569275, -0.0012975673889741302, -0.018375292420387268, 0.0024391107726842165, 0.02548525109887123, -0.020524080842733383, 0.010973036289215088, 0.0005816341144964099, -0.009614244103431702, -0.012434527277946472, -0.006991459056735039, -0.008800548501312733, 0.014030318707227707, 0.01892828941345215, -0.02275186777114868, 0.047210123389959335, -0.03646618872880936, -0.02599084936082363, -0.0468941256403923, 0.010119841434061527, 0.02349446341395378, 0.07369077205657959, 0.03918377310037613, 0.008547750301659107, 0.017016500234603882, 0.012687326408922672, 0.035644590854644775, 0.04126935824751854, -0.008800548501312733, 0.045724932104349136, 0.009290345944464207, -0.02262546867132187, 0.011052035726606846, 0.0035628792829811573, -0.0021507623605430126, -0.000029701976018259302, 0.015792008489370346, 0.032927006483078, 0.03299020603299141, 0.00038783837226219475, -0.0002740296476986259, -0.033559005707502365, 0.025959249585866928, 0.04111136123538017, -0.009574743919074535, -0.02788683772087097, -0.0017972395289689302, -0.001406191848218441, -0.014196217060089111, -0.004842672031372786, 0.022309470921754837, 0.014978312887251377, 0.01034103985875845, -0.015649808570742607, -0.023210065439343452, -0.03965776786208153, 0.30361104011535645, -0.006853210274130106, -0.012189628556370735, 0.007963153533637524, -0.010862437076866627, -0.03747738152742386, -0.019402287900447845, -0.0588388592004776, 0.0034167300909757614, -0.03155241534113884, -0.03371700271964073, 0.0493905134499073, -0.0019295638194307685, -0.056974466890096664, -0.035360194742679596, 0.048695314675569534, 0.009432544931769371, -0.007524705957621336, 0.022056670859456062, 0.02053987979888916, 0.02377886138856411, 0.024505658075213432, 0.01378541998565197, 0.07154197990894318, 0.026891443878412247, -0.01758529804646969, 0.001917713787406683, 0.007678755093365908, 0.050622906535863876, 0.007485206238925457, 0.07305877655744553, 0.020334482192993164, -0.012600426562130451, -0.04240695387125015, -0.005435168277472258, 0.049106113612651825, 0.006402912549674511, -0.07324837148189545, 0.038330577313899994, -0.005676116794347763, 0.011905230581760406, 0.04528253525495529, -0.014093518257141113, -0.004605673253536224, -0.03659258782863617, -0.003258730983361602, 0.03558139130473137, 0.020366081967949867, -0.02174067310988903, 0.024126458913087845, -0.011992130428552628, -0.030651820823550224, 0.046009331941604614, -0.01325612235814333, 0.009345646016299725, 0.030272623524069786, -0.01826469413936138, -0.01221332885324955, -0.015886807814240456, -0.08601469546556473, -0.004396324511617422, -0.022404270246624947, -0.022657068446278572, 0.02248326875269413, 0.03747738152742386, 0.023431263864040375, -0.04130095988512039, -0.011944730766117573, 0.046230532228946686, -0.007896004244685173, 0.00656881183385849, -0.04218575358390808, 0.06269403547048569, -0.029387827962636948, 0.020160682499408722, -0.047905322164297104, 0.0006947022047825158, -0.025374652817845345, 0.011273234151303768, -0.02159847505390644, 0.0072719077579677105, -0.027002042159438133, 0.051697298884391785, -0.012497726827859879, -0.024900654330849648, -0.04038456454873085, 0.006300213281065226, 0.023478662595152855, -0.029356228187680244, 0.02535885199904442, 0.018564891070127487, 0.007619505748152733, 0.039752569049596786, -0.01706390082836151, -0.018343692645430565, -0.0031145568937063217, 0.00550626777112484, -0.047020524740219116, 0.03186841309070587, -0.01730090007185936, -0.030446423217654228, -0.027318041771650314, 0.030825620517134666, 0.04853731766343117, -0.01888089068233967, -0.03457019850611687, 0.01628970541059971, -0.004368674475699663, 0.022830866277217865, 0.007102058734744787, 0.036339789628982544, 0.029782826080918312, -0.007817004807293415, -0.02257806807756424, -0.011059935204684734, 0.03463339805603027, -0.005964465439319611, -0.006797910202294588, 0.03047802299261093, 0.027507640421390533, -0.062472835183143616, 0.03997376561164856, -0.03725618124008179, -0.01306652370840311, 0.022593868896365166, 0.007520756218582392, 0.019971083849668503, 0.0035549793392419815, -0.004747872240841389, 0.0051191700622439384, -0.005166569724678993, 0.01427521649748087, 0.025595851242542267, -0.001800202066078782, -0.030004024505615234, 0.024916455149650574, -0.04098496213555336, 0.004487174097448587, 0.004609622992575169, 0.031347017735242844, 0.006213313899934292, -0.03520219400525093, 0.029988225549459457, 0.011549732647836208, 0.005427268333733082, -0.02210407145321369, 0.03362220525741577, -0.006284413393586874, 0.03463339805603027, -0.015697209164500237, 0.028692632913589478, -0.039246972650289536, 0.013682720251381397, 0.09094426780939102, 0.005269269458949566, 0.004850571975111961, -0.014014518819749355, 0.038741376250982285, -0.042027756571769714, 0.03741418197751045, -0.01436211634427309, 0.028850631788372993, -0.012426627799868584, -0.006991459056735039, -0.011320633813738823, -0.022467469796538353, -0.005225819535553455, -0.00952734425663948, -0.029640628024935722, -0.000792957900557667, -0.017142899334430695, 0.010759737342596054, 0.11628732085227966, -0.030557021498680115, 0.03716138377785683, -0.006075064651668072, 0.008887448348104954, 0.003969727084040642, -0.013635320588946342, 0.015167911536991596, 0.013295622542500496, -0.02853463403880596, 0.02238846942782402, 0.00554971769452095, -0.017285099253058434, 0.03611858934164047, 0.03747738152742386, -0.0017636647680774331, -0.001444704132154584, -0.014701814390718937, 0.00601581484079361, -0.01586310751736164, -0.04047936573624611, -0.00694010965526104, -0.0018011895008385181, -0.013564220629632473, 0.005889415740966797, 0.0001756505371304229, -0.039626169949769974, 0.008429250679910183, -0.0076353056356310844, -0.00578276626765728, -0.0398789681494236, 0.029135029762983322, -0.03460180014371872, -0.0015849282499402761, 0.00876894872635603, -0.011004636064171791, 0.005415418650954962, 0.01269522588700056, 0.02275186777114868, -0.0008398638456128538, -0.0034424050245434046, -0.033148206770420074, 0.02409485913813114, 0.0344121977686882, 0.04177495837211609, -0.004554323386400938, 0.009163946844637394, -0.0533720888197422, 0.008800548501312733, -0.03205801174044609, -0.04569333419203758, 0.021756473928689957, 0.00536801852285862, 0.01489931344985962, 0.05463608354330063, 0.028787432238459587, 0.006963809486478567, 0.048695314675569534, -0.01957608573138714, -0.005036220885813236, -0.03741418197751045, 0.0065253619104623795, -0.043133750557899475, -0.057164065539836884, 0.01790129579603672, 0.003971701953560114, 0.056184474378824234, 0.01775909587740898, -0.02576964907348156, 0.0011780806817114353, -0.043828945606946945, 0.032642610371112823, 0.012963824905455112, -0.005936815403401852, -0.023052066564559937, 0.019971083849668503, 0.009306145831942558, -0.012347628362476826, 0.023684062063694, -0.05463608354330063, -0.022862466052174568, -0.008840048685669899, -0.0066912611946463585, -0.013935518451035023, -0.007343007251620293, -0.01670050248503685, 0.005557617638260126, 0.01267152652144432, -0.026670245453715324, -0.030051425099372864, -0.011889430694282055, -0.0031639316584914923, 0.050591304898262024, 0.014291016384959221, -0.015878908336162567, 0.05874405801296234, -0.0274286400526762, -0.11995290219783783, 0.010443739593029022, -0.014409516006708145, 0.025248253718018532, 0.03867817297577858, 0.048821717500686646, -0.0024786104913800955, -0.03529699519276619, -0.13385681807994843, 0.04288094863295555, 0.030541222542524338, 0.02164587378501892, 0.046325329691171646, -0.03251621127128601, -0.0029427327681332827, -0.06604361534118652, 0.10838736593723297, 0.0274286400526762, -0.032358210533857346, -0.0013824919005855918, -0.016684703528881073, -0.0012748551089316607, -0.0072284578345716, 0.03491779789328575, -0.013350922614336014, 0.013556321151554585, -0.0039480021223425865, 0.039246972650289536, 0.020966477692127228, 0.018011895939707756, 0.07596595585346222, 0.00987494271248579, 0.02423705905675888, -0.01295592449605465, 0.020618880167603493, 0.03561299294233322, -0.01193683035671711, -0.0244266577064991, 0.011115235276520252, 0.03308500722050667, -0.014772914350032806, -0.023478662595152855, 0.0017942771082744002, -0.054604481905698776, -0.0038453026209026575, -0.02253066934645176, 0.03681378439068794, -0.04025816544890404, -0.0011691931867972016, -0.03539179265499115, 0.14877192676067352, 0.040921762585639954, -0.058270059525966644, 0.00008764011727180332, -0.08563549816608429, 0.0023640613071620464, 0.018944090232253075, -0.07470196485519409, -0.009772242978215218, -0.02109287679195404, 0.003975651692599058, -0.08121152967214584, 0.061461642384529114, -0.009653743356466293, -0.008832148276269436, -0.02780783735215664, 0.017285099253058434, 0.010973036289215088, -0.00158394081518054, -0.03099942021071911, -0.017695896327495575, 0.07729315012693405, 0.02229367010295391, -0.03359060361981392]
|
|
1736
1738
|
});
|
|
1737
|
-
const echo = [`<pre>const res = await vector.
|
|
1738
|
-
'collection': '
|
|
1739
|
-
'metric': '
|
|
1740
|
-
'
|
|
1741
|
-
|
|
1739
|
+
const echo = [`<pre>const res = await vector.search({
|
|
1740
|
+
'collection': 'ai_wiki_content',
|
|
1741
|
+
'metric': 'IP',
|
|
1742
|
+
'fields': ['id', 'team_uid', 'wiki_uid'],
|
|
1743
|
+
'data': [-0.032358210533857346, 0.007840704172849655, -0.023857861757278442, 0.032358210533857346, -0.05684806779026985, -0.003219231264665723, 0.048410918563604355, 0.07286917418241501, 0.040036965161561966, ...]
|
|
1744
|
+
});</pre>res:<pre>${lText.stringifyJson(res, 4)}</pre>`];
|
|
1742
1745
|
return echo.join('') + '<br>' + this._getEnd();
|
|
1743
1746
|
}
|
|
1744
1747
|
async kv() {
|