Spaces:
Runtime error
Runtime error
File size: 714 Bytes
966f748 |
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 |
# gradio_ui.py
import gradio as gr
import requests
API_BASE = "http://localhost:8000" # Adjust to your FastAPI base URL
def execute_task(team: str, task: str, prompt: str):
response = requests.post(f"{API_BASE}/execute", json={
"team": team, "task": task, "prompt": prompt
})
return response.json().get("output", "No output")
iface = gr.Interface(
fn=execute_task,
inputs=[
gr.Dropdown(["Red", "Blue"], label="Team"),
gr.Dropdown(["Recon", "Exploit", "Analyze Logs", "Generate Rule"], label="Task"),
gr.Textbox(label="Prompt / Parameters")
],
outputs="text",
title="AI-Driven CyberOps Interface"
)
if __name__ == "__main__":
iface.launch()
|