CodeFixPro / app.py
ParthBhuptani's picture
Update app.py
fb05735 verified
raw
history blame contribute delete
831 Bytes
import gradio as gr
from agents.error_fixer import fix_code
from agents.code_modifier import modify_code
def process_code(code, prompt):
# Placeholder logic – we'll replace this later
if prompt.strip() == "":
return fix_code(code)
else:
return modify_code(code, prompt)
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()