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