mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +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("o3") ||
 | 
			
		||||
      options.config.model.startsWith("o4-mini");
 | 
			
		||||
    const isGpt5 =  options.config.model.startsWith("gpt-5");
 | 
			
		||||
    if (isDalle3) {
 | 
			
		||||
      const prompt = getMessageTextContent(
 | 
			
		||||
        options.messages.slice(-1)?.pop() as any,
 | 
			
		||||
@@ -251,6 +252,10 @@ export class ChatGPTApi implements LLMApi {
 | 
			
		||||
        requestPayload["max_completion_tokens"] = modelConfig.max_tokens;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (isGpt5) {
 | 
			
		||||
	requestPayload["max_completion_tokens"] = modelConfig.max_tokens;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      // add max_tokens to vision model
 | 
			
		||||
      if (visionModel && !isO1OrO3) {
 | 
			
		||||
        requestPayload["max_tokens"] = Math.max(modelConfig.max_tokens, 4000);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user