diff --git a/service/llm_service.go b/service/llm_service.go index 4e8c24d..8ed3cc6 100644 --- a/service/llm_service.go +++ b/service/llm_service.go @@ -467,7 +467,7 @@ func (s *LLMService) handleStreamingResponse(req *http.Request, data map[string] if utf8.RuneCountInString(initialSessage) > 15 { new_message = initialSessage initialSessage = "" - } else if utf8.RuneCountInString(initialSessage) <= 15 && strings.HasSuffix(initialSessage, "。") { + } else if utf8.RuneCountInString(initialSessage) <= 15 && containsPunctuation(initialSessage) { new_message = initialSessage initialSessage = "" } else { @@ -485,8 +485,8 @@ func (s *LLMService) handleStreamingResponse(req *http.Request, data map[string] s_msg := strings.TrimSpace(new_message) // Trim punctuation from the message new_message = trimPunctuation(s_msg) - // fmt.Println("new_message", new_message) - + fmt.Println("new_message", new_message) + // println(new_message) // 最多重试一次 for i := 0; i < 1; i++ { speechResp, err := s.SynthesizeSpeech(new_message, audio_type)