change output limit
This commit is contained in:
+2
-2
@@ -2,7 +2,7 @@ import { ChatBody, Message } from '@/types/chat';
|
||||
import { DEFAULT_SYSTEM_PROMPT } from '@/utils/app/const';
|
||||
import { OpenAIError, OpenAIStream } from '@/utils/server';
|
||||
import tiktokenModel from '@dqbd/tiktoken/encoders/cl100k_base.json';
|
||||
import { init, Tiktoken } from '@dqbd/tiktoken/lite/init';
|
||||
import { Tiktoken, init } from '@dqbd/tiktoken/lite/init';
|
||||
// @ts-expect-error
|
||||
import wasm from '../../node_modules/@dqbd/tiktoken/lite/tiktoken_bg.wasm?module';
|
||||
|
||||
@@ -35,7 +35,7 @@ const handler = async (req: Request): Promise<Response> => {
|
||||
const message = messages[i];
|
||||
const tokens = encoding.encode(message.content);
|
||||
|
||||
if (tokenCount + tokens.length + 1000 > model.tokenLimit) {
|
||||
if (tokenCount + tokens.length + 2000 > model.tokenLimit) {
|
||||
break;
|
||||
}
|
||||
tokenCount += tokens.length;
|
||||
|
||||
Reference in New Issue
Block a user