"""Simple dashboard to view prompt YAML files.""" import yaml from pathlib import Path from flask import Flask, render_template_string _DIR = Path(__file__).resolve().parent app = Flask(__name__) TEMPLATE = r""" Prompt Viewer

Prompt YAML Viewer

evals/prompts/ — {{ files | length }} files

{% for f in files %}
{{ f.name }}
{% endfor %}
{% for f in files %}
Scheme
{{ f.data.get('scheme', '-') }}
General Keys
{{ f.data.get('general_keys', []) | join(', ') or '-' }}
Physical Sub-Questions
{{ f.data.get('physical_sub_questions', '-') }}
{% if f.data.get('description') %}
Description
{{ f.data['description'] }}
{% endif %} {% if f.data.get('system_prompt') %}
System Prompt
{{ f.data['system_prompt'] }}
{% endif %} {% if f.data.get('eval_prompts') %}
Eval Prompts
{% for key, val in f.data['eval_prompts'].items() %}
{{ key }}
{{ val }}
{% endfor %}
{% endif %} {% if f.data.get('training_prompts') %}
Training Prompts
{% for key, val in f.data['training_prompts'].items() %}
{{ key }}
{{ val }}
{% endfor %}
{% endif %} {% if f.data.get('physical_template') %}
Physical Template
{{ f.data['physical_template'] }}
{% endif %} {% if f.data.get('sub_questions') %}
Sub-Questions Config
{{ f.sub_questions_str }}
{% endif %}
{% endfor %}
""" def load_yamls(): files = [] for p in sorted(_DIR.glob("*.yaml")): raw = p.read_text() data = yaml.safe_load(raw) or {} sq = data.get("sub_questions") sq_str = yaml.dump(sq, default_flow_style=False) if sq else "" files.append({"name": p.name, "data": data, "raw": raw, "sub_questions_str": sq_str}) return files @app.route("/") def index(): return render_template_string(TEMPLATE, files=load_yamls()) if __name__ == "__main__": app.run(host="127.0.0.1", port=5003, debug=True)