File size: 831 Bytes
ad34409
a6a3b0b
fb05735
ad34409
 
 
fb05735
a6a3b0b
ad34409
fb05735
ad34409
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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()