Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| def process_code(code, prompt): | |
| # Placeholder logic – we'll replace this later | |
| if "print" in code: | |
| fixed_code = code.replace("print", "console.log") | |
| else: | |
| fixed_code = code + "\n# No changes made." | |
| return fixed_code | |
| with gr.Blocks() as demo: | |
| gr.Markdown("## 🧠 CodeFixPro - AI Code Debugger & Modifier Agent") | |
| with gr.Row(): | |
| code_input = gr.Code(label="Paste your code here", language="python", lines=20) | |
| prompt_input = gr.Textbox(label="Enter your prompt (e.g., 'Convert to async')") | |
| run_btn = gr.Button("Fix / Modify Code") | |
| code_output = gr.Code(label="Output Code", language="python", lines=20) | |
| run_btn.click(process_code, inputs=[code_input, prompt_input], outputs=code_output) | |
| demo.launch() |