feat: 知识库对外api

This commit is contained in:
archer
2023-04-08 20:27:43 +08:00
parent 9a145f223f
commit 52d00d0562
7 changed files with 230 additions and 17 deletions

View File

@@ -82,14 +82,14 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
vectorToBuffer(promptVector),
'LIMIT',
'0',
'20',
'30',
'DIALECT',
'2'
]);
const formatRedisPrompt: string[] = [];
// 格式化响应值,获取 qa
for (let i = 2; i < 42; i += 2) {
for (let i = 2; i < 61; i += 2) {
const text = redisData[i]?.[1];
if (text) {
formatRedisPrompt.push(text);