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

@@ -50,10 +50,10 @@ export const adaptChatItem_openAI = ({
export function countOpenAIToken({
messages,
model
model = 'gpt-3.5-turbo'
}: {
messages: ChatItemType[];
model: `${OpenAiChatEnum}`;
model?: string;
}) {
const diffVal = model.startsWith('gpt-3.5-turbo') ? 3 : 2;
@@ -74,7 +74,7 @@ export const openAiSliceTextByToken = ({
text,
length
}: {
model: `${OpenAiChatEnum}`;
model: string;
text: string;
length: number;
}) => {