pr_reviewer/crews/summariser_crew/summariser_crew.py
Andrew Ridgway bf6fe21ea6
Some checks failed
Build and Push Image / Build and push image (push) Failing after 1m58s
first build attempt
2026-05-19 23:24:27 +10:00

46 lines
1.2 KiB
Python

from crewai import Agent, Task, Crew
from crewai.project import CrewBase, agent, task, crew
from crewai_tools import MCPServerAdapter
from mcp import StdioServerParameters
import os
from typing import Dict, Any
from pr_reviewer.llm import get_llm
@CrewBase
class SummariserCrew:
"""Summariser Crew for synthesizing review results."""
agents_config = "config/agents.yaml"
tasks_config = "config/tasks.yaml"
def __init__(self):
self.llm = get_llm()
@agent
def summariser(self) -> Agent:
"""Senior Code Review Coordinator agent for summarizing reviews."""
return Agent(
config=self.agents_config["summariser"],
llm=self.llm,
tools=[],
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
)