feat: verwendete Prompts im Archiv ausklappbar anzeigen
Speichert OpenRouter- und SDXL-Prompts pro Archiv-Eintrag und zeigt sie auf der Übersichtsseite in aufklappbaren Details an. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -255,6 +255,7 @@ def render_template(name: str, context: dict) -> str:
|
||||
def build_archiv_entries(archive: list[dict]) -> list[dict]:
|
||||
entries = []
|
||||
for item in sorted(archive, key=lambda e: e["date"], reverse=True):
|
||||
prompts = item.get("prompts")
|
||||
entries.append(
|
||||
{
|
||||
"date": item["date"],
|
||||
@@ -264,6 +265,7 @@ def build_archiv_entries(archive: list[dict]) -> list[dict]:
|
||||
"url": f"/archiv/{item['date']}.html",
|
||||
"image": f"/img/{item['date']}.jpg" if item.get("has_image") else None,
|
||||
"topics": item.get("topics", []),
|
||||
"prompts": prompts if isinstance(prompts, dict) else None,
|
||||
}
|
||||
)
|
||||
return entries
|
||||
@@ -343,6 +345,12 @@ def main() -> int:
|
||||
"theme": theme,
|
||||
"topics": [topic["name"] for topic in selected_topics],
|
||||
"has_image": hero_image is not None,
|
||||
"prompts": {
|
||||
"content_system": build_system_prompt(),
|
||||
"content_user": build_user_prompt(selected_topics),
|
||||
"image_prompt": llm_json["image_prompt"],
|
||||
"image_negative_prompt": llm_json["image_negative_prompt"],
|
||||
},
|
||||
}
|
||||
archive = [entry for entry in archive if entry.get("date") != date_iso]
|
||||
archive.append(archive_entry)
|
||||
|
||||
Reference in New Issue
Block a user