Files
aigc-home/docs/hel-892/qwen-edit-document-evidence/render_report.py
T

74 lines
2.5 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Render the actual source-bound definition as a readable Chinese handoff appendix."""
from __future__ import annotations
import json
from pathlib import Path
OUT = Path(__file__).resolve().parent
REPO = OUT.parents[2]
def main():
block = json.loads((OUT / "definition.json").read_bytes())
lines = [
"# Qwen图像编辑增强图固定参考中文说明",
"",
"本批接入现有详情抽屉;70新保存位置+3新注释,旧九图202保存位置+3注释不变,十图展示。155说明定稿0、实跑0,新增转换0,全量目标未完成。",
"",
"## 图特定说明与边界",
"",
block["notice"],
"",
*[line + "\n" for line in block["flow"][:14]],
"## 使用与常见误判",
"",
*[line + "\n" for line in block["steps"]],
"## 70处实际保存位置",
"",
]
for i, field in enumerate(block["fields"], 1):
lines += [
f"### {i}. {field['node_id']} · {field['label']}({field['field']})",
"",
field["effect"],
"",
f"作用域:{field['scope']};原定义节点{field['definition_node_id']};类{field['class_type']};源JSON类型{field['json_type']}。",
"",
"```json",
json.dumps(field["value"], ensure_ascii=False, indent=2),
"```",
"",
f"源位置:`{field['pointer']}`;具名保存:`{field['named_pointer']}`。",
"",
f"schema默认:{field['schema_default']};单位:{field['unit']}。",
"",
field["limits"],
"",
field["execution_note"],
"",
]
for index in field["evidence"]:
evidence = block["sources"][index]
lines += [
f"- {evidence['claim']}:{evidence['url']};"
f"完整提交{evidence['commit']};SHA256 `{evidence['sha256']}`;"
f"行{evidence['lines'][0]}~{evidence['lines'][1]}。"
]
lines.append("")
lines += ["## 三条不透明源注释", ""]
for note in block["comments"]:
lines += [
f"### 节点{note['node_id']} · `{note['pointer']}`",
"",
"```json",
json.dumps(note["text"], ensure_ascii=False),
"```",
"",
]
(OUT.parent / "Qwen图像编辑增强图固定参考中文说明.md").write_text("\n".join(lines) + "\n")
if __name__ == "__main__":
main()