feat: self vector search
This commit is contained in:
@@ -24,11 +24,8 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
|
||||
|
||||
await connectToDatabase();
|
||||
|
||||
// 凭证校验
|
||||
const { userId } = await authUser({ req });
|
||||
|
||||
// find model
|
||||
const kb = await KB.findById(kbId, 'model');
|
||||
// auth user and get kb
|
||||
const [{ userId }, kb] = await Promise.all([authUser({ req }), KB.findById(kbId, 'model')]);
|
||||
|
||||
if (!kb) {
|
||||
throw new Error("Can't find database");
|
||||
|
||||
Reference in New Issue
Block a user