checklist-agent / app /services /file_generator.py
alexorlov's picture
Upload app/services/file_generator.py with huggingface_hub
de5fcc2 verified
raw
history blame contribute delete
667 Bytes
from datetime import date
def post_process_markdown(markdown: str, session_id: str) -> str:
"""Clean up and ensure consistent markdown formatting."""
lines = markdown.strip().split("\n")
# Ensure it starts with the expected header
if not lines[0].startswith("# "):
lines.insert(0, "# Чеклист созвона с клиентом")
content = "\n".join(lines)
# Ensure footer exists
footer = "\n---\n\n*Сгенерировано автоматически с помощью AI Checklist Agent*\n"
if "Сгенерировано автоматически" not in content:
content += footer
return content