samyakshrestha's picture
Initial commit
fa2cb8a
raw
history blame contribute delete
965 Bytes
from crewai import Agent, Crew, Process, Task, LLM
from crewai.project import CrewBase, agent, crew, task
from .tools_loader import get_tools
@CrewBase
class ShapCrew:
"""SHAP explainer crew"""
def __init__(self):
# Load tools once
self.tools = get_tools()
# Initialize LLMs with optimal settings
self.llm = LLM(model="groq/meta-llama/llama-4-maverick-17b-128e-instruct", temperature=0.3)
@agent
def shap_agent(self) -> Agent:
return Agent(
config=self.agents_config['shap_agent'],
tools=[self.tools["shap_tool"]],
llm=self.llm,
allow_delegation=False,
verbose=False
)
@task
def shap_task(self) -> Task:
return Task(config=self.tasks_config['shap_task'])
@crew
def crew(self) -> Crew:
return Crew(
agents=self.agents,
tasks=self.tasks,
verbose=False
)