feat(review): 取证层多源化 + 视觉多图(整体+2x2 象限)
- 新增 evidence_model.py:统一证据模型(source_type + images 列表),访问器兼容旧 image_b64/image_mime 单图字段 - phases/evidence.py:新增 collect() 多源分发 seam(仅 CAD)、capture_images() 整体+等分象限多图(结束复位视口)、sub_windows() - phases/review.py:多图逐张下采样喂 LLM,payload 增加 source_type - config.py:EVIDENCE_DETAIL_TILES=4 / EVIDENCE_MAX_IMAGES=5(默认开启多图) - 新增 tests/test_evidence_model.py,更新 evidence/review 断言与 fakes 归一
This commit is contained in:
1 parent
22db93b6f5
commit
1c9fc72839
10 files changed
+396
-32
No files matched your search
@@ -11,6 +11,7 @@
|
||||
|
||||
import json
|
||||
|
||||
from .. import evidence_model
|
||||
from ..cad_tools import READ_ONLY_TOOLS, is_write_tool
|
||||
from ..findings import parse_conclusion
|
||||
from ..llm_client import LlmClient, downsample_image_b64
|
||||
@@ -24,6 +25,7 @@ def evidence_payload(evidence):
|
||||
"""把证据整理成给 LLM 的 JSON(剔除 base64 图片,避免撑爆上下文)。"""
|
||||
frame = evidence.get("frame") or {}
|
||||
return {
|
||||
"source_type": evidence.get("source_type"),
|
||||
"frame_index": evidence.get("index"),
|
||||
"frame": {
|
||||
k: frame.get(k)
|
||||
@@ -72,9 +74,11 @@ def review_frame(ctx, evidence, system_prompt, log=print):
|
||||
+ json.dumps(payload, ensure_ascii=False, indent=2),
|
||||
}
|
||||
]
|
||||
image_b64 = evidence.get("image_b64")
|
||||
if image_b64:
|
||||
nb, nm = downsample_image_b64(image_b64, evidence.get("image_mime") or "image/png")
|
||||
for img in evidence_model.evidence_images(evidence):
|
||||
nb, nm = downsample_image_b64(img["b64"], img.get("mime") or "image/png")
|
||||
label = img.get("label")
|
||||
if label:
|
||||
user_content.append({"type": "text", "text": f"(截图:{label})"})
|
||||
user_content.append(LlmClient.image_content(nb, nm))
|
||||
|
||||
messages = [
|
||||
|
||||
Reference in new issue
Block a user