mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-09-27 13:46:37 +08:00
change max tokens
This commit is contained in:
parent
f682b1f4de
commit
cd0366392a
@ -374,7 +374,7 @@ export async function handle(
|
||||
const payload = {
|
||||
anthropic_version: "bedrock-2023-05-31",
|
||||
max_tokens:
|
||||
typeof max_tokens === "number" && max_tokens > 0 ? max_tokens : 4096,
|
||||
typeof max_tokens === "number" && max_tokens > 0 ? max_tokens : 8000,
|
||||
temperature:
|
||||
typeof temperature === "number" && temperature >= 0 && temperature <= 1
|
||||
? temperature
|
||||
|
@ -31,7 +31,7 @@ export class BedrockApi implements LLMApi {
|
||||
messages,
|
||||
temperature: modelConfig.temperature,
|
||||
stream: !!modelConfig.stream,
|
||||
max_tokens: (modelConfig as any).max_tokens || 4096, // Cast to access max_tokens from ModelConfig
|
||||
max_tokens: (modelConfig as any).max_tokens || 8000, // Cast to access max_tokens from ModelConfig
|
||||
}),
|
||||
signal: controller.signal,
|
||||
headers: getHeaders(), // getHeaders should handle Bedrock (no auth needed)
|
||||
|
@ -244,7 +244,7 @@ export class ChatGPTApi implements LLMApi {
|
||||
|
||||
// add max_tokens to vision model
|
||||
if (visionModel) {
|
||||
requestPayload["max_tokens"] = Math.max(modelConfig.max_tokens, 4000);
|
||||
requestPayload["max_tokens"] = Math.max(modelConfig.max_tokens, 8000);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -867,7 +867,7 @@ export const useChatStore = createPersistStore(
|
||||
|
||||
const historyMsgLength = countMessages(toBeSummarizedMsgs);
|
||||
|
||||
if (historyMsgLength > (modelConfig?.max_tokens || 4000)) {
|
||||
if (historyMsgLength > (modelConfig?.max_tokens || 8000)) {
|
||||
const n = toBeSummarizedMsgs.length;
|
||||
toBeSummarizedMsgs = toBeSummarizedMsgs.slice(
|
||||
Math.max(0, n - modelConfig.historyMessageCount),
|
||||
|
@ -68,7 +68,7 @@ export const DEFAULT_CONFIG = {
|
||||
providerName: "OpenAI" as ServiceProvider,
|
||||
temperature: 0.5,
|
||||
top_p: 1,
|
||||
max_tokens: 4000,
|
||||
max_tokens: 8000,
|
||||
presence_penalty: 0,
|
||||
frequency_penalty: 0,
|
||||
sendMemory: true,
|
||||
|
Loading…
Reference in New Issue
Block a user