from datetime import datetime import gradio as gr def build_report(project_name: str, objective: str, notes: str, constraints: str) -> str: project_name = (project_name or "Untitled Project").strip() objective = (objective or "No objective provided.").strip() notes = (notes or "No notes provided.").strip() constraints = (constraints or "No constraints provided.").strip() generated_at = datetime.utcnow().strftime("%Y-%m-%d %H:%M UTC") return f"""# {project_name} Review Report Generated: {generated_at} ## Objective {objective} ## Notes {notes} ## Constraints {constraints} ## Consolidated Assessment Evaluate the project through feasibility, safety, maintainability, and deployment readiness. ## Recommended Next Steps 1. Define the smallest useful deliverable. 2. Separate configuration from application code. 3. Validate every user-provided input. 4. Add logging and explicit error handling. 5. Document assumptions, dependencies, and environment variables. """ with gr.Blocks(title="Profit Loop Space") as demo: gr.Markdown("# Profit Loop Space") gr.Markdown("Structured project review and deployment planning scaffold for Hugging Face Spaces.") project_name = gr.Textbox(label="Project name", placeholder="Example: Research Dashboard") objective = gr.Textbox(label="Objective", lines=3, placeholder="What should this project accomplish?") notes = gr.Textbox(label="Notes", lines=6, placeholder="Paste notes, parameters, or project context.") constraints = gr.Textbox(label="Constraints", lines=4, placeholder="Runtime, dependency, budget, safety, or deadline constraints.") button = gr.Button("Generate Review") output = gr.Markdown() button.click( fn=build_report, inputs=[project_name, objective, notes, constraints], outputs=output, ) if __name__ == "__main__": demo.launch()