Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Dec 26, 2024
1 parent 5160198 commit 9108d91
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from crewai import Agent, Crew, Process, Task

from langflow.base.agents.crewai.crew import BaseCrewComponent
from langflow.base.agents.crewai.crew import Agent, BaseCrewComponent

Check failure on line 3 in src/backend/base/langflow/components/crewai/sequential_crew.py

View workflow job for this annotation

GitHub Actions / Ruff Style Check (3.12)

Ruff (F811)

src/backend/base/langflow/components/crewai/sequential_crew.py:3:46: F811 Redefinition of unused `Agent` from line 1
from langflow.io import HandleInput
from langflow.schema.message import Message
from langflow.base.agents.crewai.crew import Agent


class SequentialCrewComponent(BaseCrewComponent):
Expand All @@ -18,16 +17,16 @@ class SequentialCrewComponent(BaseCrewComponent):
]

@property
def agents(self: 'SequentialCrewComponent') -> list[Agent]:
def agents(self: "SequentialCrewComponent") -> list[Agent]:
# Derive agents directly from linked tasks
return [task.agent for task in self.tasks if hasattr(task, 'agent')]
return [task.agent for task in self.tasks if hasattr(task, "agent")]

def get_tasks_and_agents(self, agents_list=None) -> tuple[list[Task], list[Agent]]:
# Use the agents property to derive agents
if not agents_list:
existing_agents = self.agents
agents_list = existing_agents + (agents_list or [])

return super().get_tasks_and_agents(agents_list=agents_list)

def build_crew(self) -> Message:
Expand Down

0 comments on commit 9108d91

Please sign in to comment.