Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def devops_agent(query):
|
| 4 |
+
query = query.lower()
|
| 5 |
+
if "pod status" in query:
|
| 6 |
+
return "β
All Kubernetes pods are running."
|
| 7 |
+
elif "restart jenkins" in query:
|
| 8 |
+
return "π Jenkins restarted successfully."
|
| 9 |
+
elif "deploy" in query:
|
| 10 |
+
return "π Deployment triggered via CI/CD pipeline."
|
| 11 |
+
elif "check logs" in query:
|
| 12 |
+
return "π Logs retrieved: No errors found."
|
| 13 |
+
elif "disk usage" in query:
|
| 14 |
+
return "π½ Disk usage: 72% used, 28% free."
|
| 15 |
+
else:
|
| 16 |
+
return "π€ Sorry, I didnβt understand that DevOps command."
|
| 17 |
+
|
| 18 |
+
gr.Interface(
|
| 19 |
+
fn=devops_agent,
|
| 20 |
+
inputs=gr.Textbox(lines=2, placeholder="e.g. Check pod status"),
|
| 21 |
+
outputs="text",
|
| 22 |
+
title="π οΈ DevOps AI Agent",
|
| 23 |
+
description="Enter a natural language DevOps command. The agent will simulate a response."
|
| 24 |
+
).launch()
|