延长判断字符15个
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
				
			This commit is contained in:
		
							parent
							
								
									0781e8bd86
								
							
						
					
					
						commit
						dee9dd7b08
					
				| @ -453,8 +453,8 @@ func (s *LLMService) handleStreamingResponse(req *http.Request, data map[string] | |||||||
| 					if len(segments) > 1 { | 					if len(segments) > 1 { | ||||||
| 
 | 
 | ||||||
| 						format_message := strings.Join(segments[:len(segments)-1], "") | 						format_message := strings.Join(segments[:len(segments)-1], "") | ||||||
| 						// 检查initialSessage的字符长度是否超过10个 | 						// 检查initialSessage的字符长度是否超过15个 | ||||||
| 						if utf8.RuneCountInString(format_message) > 10 { | 						if utf8.RuneCountInString(format_message) > 15 { | ||||||
| 							initialSessage = segments[len(segments)-1] | 							initialSessage = segments[len(segments)-1] | ||||||
| 							// 如果超过10个字符,将其添加到new_message中并清空initialSessage | 							// 如果超过10个字符,将其添加到new_message中并清空initialSessage | ||||||
| 							new_message = strings.Join(segments[:len(segments)-1], "") | 							new_message = strings.Join(segments[:len(segments)-1], "") | ||||||
| @ -464,10 +464,10 @@ func (s *LLMService) handleStreamingResponse(req *http.Request, data map[string] | |||||||
| 						} | 						} | ||||||
| 					} else { | 					} else { | ||||||
| 
 | 
 | ||||||
| 						if utf8.RuneCountInString(initialSessage) > 10 { | 						if utf8.RuneCountInString(initialSessage) > 15 { | ||||||
| 							new_message = initialSessage | 							new_message = initialSessage | ||||||
| 							initialSessage = "" | 							initialSessage = "" | ||||||
| 						} else if utf8.RuneCountInString(initialSessage) <= 10 && strings.HasSuffix(initialSessage, "。") { | 						} else if utf8.RuneCountInString(initialSessage) <= 15 && strings.HasSuffix(initialSessage, "。") { | ||||||
| 							new_message = initialSessage | 							new_message = initialSessage | ||||||
| 							initialSessage = "" | 							initialSessage = "" | ||||||
| 						} else { | 						} else { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Song367
						Song367