mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	remove error messages in toBeSummarizedMsgs
This commit is contained in:
		@@ -424,6 +424,9 @@ export const useChatStore = create<ChatStore>()(
 | 
			
		||||
          session.lastSummarizeIndex,
 | 
			
		||||
        );
 | 
			
		||||
        
 | 
			
		||||
        // remove error messages if any
 | 
			
		||||
        toBeSummarizedMsgs = toBeSummarizedMsgs.filter((msg) => !msg.isError);
 | 
			
		||||
  
 | 
			
		||||
        const historyMsgLength = countMessages(toBeSummarizedMsgs);
 | 
			
		||||
 | 
			
		||||
        if (historyMsgLength > modelConfig?.max_tokens ?? 4000) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user