Files
wecom_it_smart_desk/archives/verify_prompt.py
T
2026-08-11 14:17:39 +08:00

15 lines
562 B
Python

import sys, json
d = json.load(sys.stdin)
nodes = d.get('graph', {}).get('nodes', [])
llms = [n for n in nodes if n.get('data', {}).get('type') == 'llm']
print(f'Total LLM nodes: {len(llms)}')
for n in llms:
title = n['data']['title']
sys_prompt = [p for p in n['data'].get('prompt_template', []) if p.get('role') == 'system']
if sys_prompt:
text = sys_prompt[0].get('text', '')
print(f' {title}: sys_prompt_len={len(text)}, contains_json={"JSON" in text or "json" in text}')
else:
print(f' {title}: NO system prompt')