From 9aee63f624f4e27312e14b81cc8620243c72faaa Mon Sep 17 00:00:00 2001 From: Song367 <601337784@qq.com> Date: Thu, 14 Aug 2025 18:27:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A015=E4=B8=AA=E5=AD=97=EF=BC=8C?= =?UTF-8?q?=E6=9C=AB=E5=B0=BE=E6=A0=87=E7=82=B9=E7=AC=A6=E5=8F=B7=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/llm_service.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)