File size: 669 Bytes
976ca99
b5d65bf
9a820c4
976ca99
b5d65bf
b1cb355
976ca99
b5d65bf
 
c05db2e
b5d65bf
c05db2e
976ca99
 
c05db2e
1a3fd24
c05db2e
 
 
 
976ca99
 
c05db2e
 
976ca99
9a820c4
 
976ca99
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
27
28
import gradio as gr
from src.agent import SecurityAgent

# Initialize agent
agent = SecurityAgent()

def process_prompt(prompt):
    try:
        response = agent.generate(prompt)
        return response
    except Exception as e:
        return f"Error: {str(e)}"

# Create Gradio interface
with gr.Blocks() as demo:
    gr.Markdown("# Secure Code Assistant")
    input_prompt = gr.Textbox(label="Enter your request")
    output_response = gr.Textbox(label="Response")
    submit_btn = gr.Button("Submit")

    submit_btn.click(
        fn=process_prompt,
        inputs=input_prompt,
        outputs=output_response
    )

if __name__ == "__main__":
    demo.launch()