mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	Merge pull request #6186 from siliconflow/fix-truc-of-reasoning-model
	
		
			
	
		
	
	
		
	
		
			Some checks are pending
		
		
	
	
		
			
				
	
				Run Tests / test (push) Waiting to run
				
			
		
		
	
	
				
					
				
			
		
			Some checks are pending
		
		
	
	Run Tests / test (push) Waiting to run
				
			Fix formatting of reasoning model on SiliconFlow
This commit is contained in:
		@@ -174,8 +174,8 @@ export class SiliconflowApi implements LLMApi {
 | 
			
		||||
 | 
			
		||||
            // Skip if both content and reasoning_content are empty or null
 | 
			
		||||
            if (
 | 
			
		||||
              (!reasoning || reasoning.trim().length === 0) &&
 | 
			
		||||
              (!content || content.trim().length === 0)
 | 
			
		||||
              (!reasoning || reasoning.length === 0) &&
 | 
			
		||||
              (!content || content.length === 0)
 | 
			
		||||
            ) {
 | 
			
		||||
              return {
 | 
			
		||||
                isThinking: false,
 | 
			
		||||
@@ -183,12 +183,12 @@ export class SiliconflowApi implements LLMApi {
 | 
			
		||||
              };
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (reasoning && reasoning.trim().length > 0) {
 | 
			
		||||
            if (reasoning && reasoning.length > 0) {
 | 
			
		||||
              return {
 | 
			
		||||
                isThinking: true,
 | 
			
		||||
                content: reasoning,
 | 
			
		||||
              };
 | 
			
		||||
            } else if (content && content.trim().length > 0) {
 | 
			
		||||
            } else if (content && content.length > 0) {
 | 
			
		||||
              return {
 | 
			
		||||
                isThinking: false,
 | 
			
		||||
                content: content,
 | 
			
		||||
 
 | 
			
		||||
@@ -576,7 +576,7 @@ export function streamWithThink(
 | 
			
		||||
        try {
 | 
			
		||||
          const chunk = parseSSE(text, runTools);
 | 
			
		||||
          // Skip if content is empty
 | 
			
		||||
          if (!chunk?.content || chunk.content.trim().length === 0) {
 | 
			
		||||
          if (!chunk?.content || chunk.content.length === 0) {
 | 
			
		||||
            return;
 | 
			
		||||
          }
 | 
			
		||||
          // Check if thinking mode changed
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user