From 2fbff69c81a284f3cf023131dbd8cf0020a615bf Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 21:10:53 +0000 Subject: [PATCH] fix: Fix type checking and import issues Co-Authored-By: Joe Moura --- src/crewai/crew.py | 10 +++++++--- src/crewai/tools/agent_tools/agent_tools.py | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/crewai/crew.py b/src/crewai/crew.py index 2f3f6e79a..b817a757d 100644 --- a/src/crewai/crew.py +++ b/src/crewai/crew.py @@ -36,7 +36,11 @@ from crewai.task import Task from crewai.tasks.conditional_task import ConditionalTask from crewai.tasks.task_output import TaskOutput from crewai.telemetry import Telemetry -from crewai.tools.agent_tools.agent_tools import AgentTools +from crewai.tools.agent_tools.agent_tools import ( + AgentTools, + ASK_QUESTION_TOOL, + DELEGATE_WORK_TOOL, +) from crewai.tools.base_tool import Tool from crewai.types.usage_metrics import UsageMetrics from crewai.utilities import I18N, FileHandler, Logger, RPMController @@ -965,7 +969,7 @@ class Crew(BaseModel): # Keep track of delegation tools delegation_tools = [ tool for tool in existing_tools - if tool.name in {"Delegate Work", "Ask Question"} + if tool.name in {DELEGATE_WORK_TOOL, ASK_QUESTION_TOOL} ] # Create mapping of tool names to new tools @@ -1001,7 +1005,7 @@ class Crew(BaseModel): code_tools = agent.get_code_execution_tools() return self._merge_tools(tools, code_tools) - def _add_delegation_tools(self, task: Task, tools: List[Tool]): + def _add_delegation_tools(self, task: Task, tools: List[Tool]) -> List[Tool]: """Add delegation tools for the task's agent. Args: diff --git a/src/crewai/tools/agent_tools/agent_tools.py b/src/crewai/tools/agent_tools/agent_tools.py index 3bf7d15c4..dc4d913a5 100644 --- a/src/crewai/tools/agent_tools/agent_tools.py +++ b/src/crewai/tools/agent_tools/agent_tools.py @@ -1,7 +1,6 @@ from crewai.agents.agent_builder.base_agent import BaseAgent from crewai.tools.base_tool import BaseTool from crewai.utilities import I18N, Logger - from .ask_question_tool import AskQuestionTool from .delegate_work_tool import DelegateWorkTool