mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-20 02:31:08 +08:00
use max_completion_tokens
This commit is contained in:
@@ -200,6 +200,7 @@ export class ChatGPTApi implements LLMApi {
|
|||||||
options.config.model.startsWith("o1") ||
|
options.config.model.startsWith("o1") ||
|
||||||
options.config.model.startsWith("o3") ||
|
options.config.model.startsWith("o3") ||
|
||||||
options.config.model.startsWith("o4-mini");
|
options.config.model.startsWith("o4-mini");
|
||||||
|
const isGpt5 = options.config.model.startsWith("gpt-5");
|
||||||
if (isDalle3) {
|
if (isDalle3) {
|
||||||
const prompt = getMessageTextContent(
|
const prompt = getMessageTextContent(
|
||||||
options.messages.slice(-1)?.pop() as any,
|
options.messages.slice(-1)?.pop() as any,
|
||||||
@@ -251,6 +252,10 @@ export class ChatGPTApi implements LLMApi {
|
|||||||
requestPayload["max_completion_tokens"] = modelConfig.max_tokens;
|
requestPayload["max_completion_tokens"] = modelConfig.max_tokens;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isGpt5) {
|
||||||
|
requestPayload["max_completion_tokens"] = modelConfig.max_tokens;
|
||||||
|
}
|
||||||
|
|
||||||
// add max_tokens to vision model
|
// add max_tokens to vision model
|
||||||
if (visionModel && !isO1OrO3) {
|
if (visionModel && !isO1OrO3) {
|
||||||
requestPayload["max_tokens"] = Math.max(modelConfig.max_tokens, 4000);
|
requestPayload["max_tokens"] = Math.max(modelConfig.max_tokens, 4000);
|
||||||
|
Reference in New Issue
Block a user