perf: 生成对话框时机

This commit is contained in:
archer
2023-04-23 14:07:17 +08:00
parent 9682c82713
commit c2c73ed23c
25 changed files with 299 additions and 327 deletions

View File

@@ -1,5 +1,5 @@
import { DataItem } from '@/service/mongo';
import { getOpenAIApi } from '@/service/utils/chat';
import { getOpenAIApi } from '@/service/utils/auth';
import { httpsAgent } from '@/service/utils/tools';
import { getOpenApiKey } from '../utils/openai';
import type { ChatCompletionRequestMessage } from 'openai';

View File

@@ -1,5 +1,5 @@
import { SplitData } from '@/service/mongo';
import { getOpenAIApi } from '@/service/utils/chat';
import { getOpenAIApi } from '@/service/utils/auth';
import { httpsAgent } from '@/service/utils/tools';
import { getOpenApiKey } from '../utils/openai';
import type { ChatCompletionRequestMessage } from 'openai';

View File

@@ -14,7 +14,7 @@ export const pushChatBill = async ({
isPay: boolean;
modelName: string;
userId: string;
chatId?: string;
chatId?: '' | string;
text: string;
}) => {
let billId;
@@ -42,7 +42,7 @@ export const pushChatBill = async ({
userId,
type: 'chat',
modelName,
chatId,
chatId: chatId ? chatId : undefined,
textLen: text.length,
tokenLen: tokens,
price