perf: bill

This commit is contained in:
archer
2023-07-13 22:53:44 +08:00
parent 726de0396b
commit f3715731c4
67 changed files with 915 additions and 1254 deletions

View File

@@ -3,7 +3,7 @@ import { jsonRes } from '@/service/response';
import { authUser } from '@/service/utils/auth';
import { PgClient } from '@/service/pg';
import { withNextCors } from '@/service/utils/tools';
import { openaiEmbedding } from '../plugin/openaiEmbedding';
import { getVector } from '../plugin/vector';
import type { KbTestItemType } from '@/types/plugin';
export type Props = {
@@ -27,7 +27,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
throw new Error('缺少用户ID');
}
const vector = await openaiEmbedding({
const vector = await getVector({
userId,
input: [text]
});