From dee9dd7b08653317a88d90eea7c01e32fbfe6df3 Mon Sep 17 00:00:00 2001 From: Song367 <601337784@qq.com> Date: Wed, 25 Jun 2025 14:47:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=B6=E9=95=BF=E5=88=A4=E6=96=AD=E5=AD=97?= =?UTF-8?q?=E7=AC=A615=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/llm_service.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/llm_service.go b/service/llm_service.go index a4559bb..9d2bfbb 100644 --- a/service/llm_service.go +++ b/service/llm_service.go @@ -453,8 +453,8 @@ func (s *LLMService) handleStreamingResponse(req *http.Request, data map[string] if len(segments) > 1 { format_message := strings.Join(segments[:len(segments)-1], "") - // 检查initialSessage的字符长度是否超过10个 - if utf8.RuneCountInString(format_message) > 10 { + // 检查initialSessage的字符长度是否超过15个 + if utf8.RuneCountInString(format_message) > 15 { initialSessage = segments[len(segments)-1] // 如果超过10个字符,将其添加到new_message中并清空initialSessage new_message = strings.Join(segments[:len(segments)-1], "") @@ -464,10 +464,10 @@ func (s *LLMService) handleStreamingResponse(req *http.Request, data map[string] } } else { - if utf8.RuneCountInString(initialSessage) > 10 { + if utf8.RuneCountInString(initialSessage) > 15 { new_message = initialSessage initialSessage = "" - } else if utf8.RuneCountInString(initialSessage) <= 10 && strings.HasSuffix(initialSessage, "。") { + } else if utf8.RuneCountInString(initialSessage) <= 15 && strings.HasSuffix(initialSessage, "。") { new_message = initialSessage initialSessage = "" } else {