fix: elements -> all_elements 提取完整原始文本元素层

This commit is contained in:
2026-05-25 22:03:53 +08:00
parent 6d5cfaf29a
commit c9344a2715
+2 -2
View File
@@ -151,7 +151,7 @@ def process_input(state: AgentState) -> Dict:
# 同时更新工作对话历史中的最后一条 # 同时更新工作对话历史中的最后一条
conv_history[-1]["content"] = user_input conv_history[-1]["content"] = user_input
# 批注检测(圈选/箭头标记) # 批注检测(圈选/箭头标记)
elements = ocr_result.get("elements", []) elements = ocr_result.get("all_elements", [])
if elements: if elements:
try: try:
from backend.annotation_detector import detect_annotations from backend.annotation_detector import detect_annotations
@@ -663,7 +663,7 @@ def _format_ocr_context(state: AgentState) -> str:
) )
# 所有原始文本(用于表格匹配等需要全文的场景) # 所有原始文本(用于表格匹配等需要全文的场景)
elements = ocr_result.get("elements", []) elements = ocr_result.get("all_elements", [])
if elements: if elements:
parts.append("\n全部文本元素(含坐标):") parts.append("\n全部文本元素(含坐标):")
for e in elements: for e in elements: