CodeFixPro / app.py
ParthBhuptani's picture
Update app.py
a6a3b0b verified
raw
history blame
834 Bytes
import gradio as gr
from agents.error_fixer import fix_code
def process_code(code, prompt):
# Placeholder logic – we'll replace this later
if prompt.lower().strip() == "":
return fix_code(code)
else:
return fix_code(code) + f"\n\n# Prompt modifications not implemented yet"
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()