perf: code

This commit is contained in:
archer
2023-05-27 15:18:10 +08:00
parent 4f0bd677f2
commit a287ace126
23 changed files with 82 additions and 118 deletions

View File

@@ -1,6 +1,5 @@
import { Pool } from 'pg';
import type { QueryResultRow } from 'pg';
import { ModelDataStatusEnum } from '@/constants/model';
export const connectPg = async () => {
if (global.pgClient) {
@@ -180,8 +179,7 @@ export const insertKbItem = ({
{ key: 'kb_id', value: kbId },
{ key: 'q', value: item.q },
{ key: 'a', value: item.a },
{ key: 'vector', value: `[${item.vector}]` },
{ key: 'status', value: ModelDataStatusEnum.ready }
{ key: 'vector', value: `[${item.vector}]` }
])
});
};