Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.
Go agentagenticaichatbotdsh-pluginembeddingsevaluationgenerative-aigolangknowledge-basellmmulti-tenantollamaopenaiquestion-answeringragrerankingsemantic-searchvector-searchwiki
refactor: Refactor rune handling for correct chunk merging
begoniezhao5f7c23a1b949
diff --git a/internal/application/service/chat_pipline/merge.go b/internal/application/service/chat_pipline/merge.goindex 68d1b77c5..c1ed13ee8 100644--- a/internal/application/service/chat_pipline/merge.go+++ b/internal/application/service/chat_pipline/merge.go@@ -101,9 +101,9 @@ func (p *PluginMerge) OnEvent(ctx context.Context,}// Merge overlapping chunksif chunks[i].EndAt > lastChunk.EndAt {- content := string([]rune(chunks[i].Content))- offset := len(content) - (chunks[i].EndAt - lastChunk.EndAt)- lastChunk.Content = lastChunk.Content + content[offset:]+ contentRunes := []rune(chunks[i].Content)+ offset := len(contentRunes) - (chunks[i].EndAt - lastChunk.EndAt)+ lastChunk.Content = lastChunk.Content + string(contentRunes[offset:])lastChunk.EndAt = chunks[i].EndAtlastChunk.SubChunkID = append(lastChunk.SubChunkID, chunks[i].ID)