fix(kb): 处理excel清洗问题

(cherry picked from commit 1a0ceebc3340848171e2cc14d0a7b04c2dda4748)
This commit is contained in:
sophie committed 2026-08-20 15:01:23 +08:00
1 parent 7736a6991e
commit 87ac58c394
4 files changed
+166 -75

No files matched your search

+7 -1
View File
@@ -708,7 +708,13 @@ def _run_one(
elif tables is not None:
_announce("table linearize")
t0 = time.perf_counter()
text = table_linearize.run(tables, ctx)
# Excel/CSV 在此按完整原始行组段;不可依赖后续通用 chunk 的字符切分,
# 否则 Dify 段可能在一条表格记录中间断开。
text = table_linearize.run(
tables,
ctx,
segment_max_chars=cfg.table.segment_max_chars,
)
_mark("edkb-table-linearize", t0)
trace_steps.append("edkb-table-linearize")