This commit is contained in:
@@ -1,37 +1,40 @@
|
||||
from crewai import CrewBase, Agent, Task, Crew
|
||||
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
|
||||
|
||||
|
||||
class SummariserCrew(CrewBase):
|
||||
@CrewBase
|
||||
class SummariserCrew:
|
||||
"""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
|
||||
self.llm = get_llm()
|
||||
|
||||
@Agent
|
||||
@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
|
||||
llm=self.llm,
|
||||
tools=[],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
@Task
|
||||
@task
|
||||
def summarise_task(self) -> Task:
|
||||
"""Task for synthesizing review results."""
|
||||
return Task(
|
||||
config=self.tasks_config["summarise_task"],
|
||||
)
|
||||
|
||||
@Crew
|
||||
@crew
|
||||
def crew(self) -> Crew:
|
||||
"""Create the Summariser crew."""
|
||||
return Crew(
|
||||
|
||||
Reference in New Issue
Block a user