43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
from crewai import CrewBase, Agent, Task, Crew
|
|
from crewai_tools import MCPServerAdapter
|
|
from mcp import StdioServerParameters
|
|
import os
|
|
from typing import Dict, Any
|
|
|
|
|
|
class SummariserCrew(CrewBase):
|
|
"""Summariser Crew for synthesizing review results."""
|
|
|
|
agents_config = "config/agents.yaml"
|
|
tasks_config = "config/tasks.yaml"
|
|
|
|
def __init__(self):
|
|
super().__init__()
|
|
# The summarizer doesn't need MCP server connections as it works with text results
|
|
|
|
@Agent
|
|
def summariser(self) -> Agent:
|
|
"""Senior Code Review Coordinator agent for summarizing reviews."""
|
|
return Agent(
|
|
config=self.agents_config["summariser"],
|
|
tools=[], # No tools needed for summarization
|
|
verbose=True
|
|
)
|
|
|
|
@Task
|
|
def summarise_task(self) -> Task:
|
|
"""Task for synthesizing review results."""
|
|
return Task(
|
|
config=self.tasks_config["summarise_task"],
|
|
)
|
|
|
|
@Crew
|
|
def crew(self) -> Crew:
|
|
"""Create the Summariser crew."""
|
|
return Crew(
|
|
agents=[self.summariser()],
|
|
tasks=[self.summarise_task()],
|
|
process="sequential",
|
|
verbose=True,
|
|
# No additional tools needed
|
|
) |