-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagents.py
More file actions
33 lines (27 loc) · 975 Bytes
/
agents.py
File metadata and controls
33 lines (27 loc) · 975 Bytes
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
# agents.py
from crewai import Agent
from crewai import LLM
from langchain_ollama import OllamaLLM
# local_llm: OllamaLLM
# _llm = OllamaLLM(model="phi3:mini", temperature=0)
# local_llm = LangChainLLMAgentWrapper(_llm)
def create_agents(local_llm):
log_agent = Agent(
role="Log Extraction Agent",
goal="Extract the primary error from system logs",
backstory="Expert in Spark and distributed system logs",
llm=local_llm # <-- must be OllamaLLM object
)
classification_agent = Agent(
role="Error Classification Agent",
goal="Classify type of error (OOM, timeout, etc.)",
backstory="Distributed systems expert",
llm=local_llm
)
remediation_agent = Agent(
role="Remediation Agent",
goal="Suggest actionable fixes for Spark OOM errors",
backstory="Senior Spark engineer",
llm=local_llm
)
return [log_agent, classification_agent, remediation_agent]