-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
43 lines (32 loc) · 1.5 KB
/
app.py
File metadata and controls
43 lines (32 loc) · 1.5 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import streamlit as st
from crewai import Crew, Process
from agents import create_devops_analyst
from tasks import create_analysis_task
st.title("🤖 AutoInfraOp: AI DevOps Agent")
st.markdown("Enter a public GitHub repository URL and the AI agent will analyze its infrastructure and create issues for any problems it finds.")
repo_url = st.text_input(
"GitHub Repository URL",
placeholder="e.g., https://github.com/Axikop/ProjectX"
)
if st.button("Analyze Repository"):
if repo_url:
with st.spinner("Agent is analyzing the repository... This might take a minute..."):
try:
# This is where I should set up and run my CrewAI
devops_agent = create_devops_analyst()
analysis_task = create_analysis_task(devops_agent, repo_url)
autoinfra_crew = Crew(
agents=[devops_agent],
tasks=[analysis_task],
process=Process.sequential,
verbose=2
)
result = autoinfra_crew.kickoff()
st.success("Analysis complete!")
st.markdown("### Final Result from the Agent:")
st.write(result)
st.info("Check the 'Issues' tab of the target repository to see the agent's work!")
except Exception as e:
st.error(f"An error occurred while running the agent: {e}")
else:
st.warning("Please enter a GitHub repository URL to start the analysis.")