mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-26 16:48:13 +00:00
fix: Fix type checking and import issues
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -36,7 +36,11 @@ from crewai.task import Task
|
|||||||
from crewai.tasks.conditional_task import ConditionalTask
|
from crewai.tasks.conditional_task import ConditionalTask
|
||||||
from crewai.tasks.task_output import TaskOutput
|
from crewai.tasks.task_output import TaskOutput
|
||||||
from crewai.telemetry import Telemetry
|
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.tools.base_tool import Tool
|
||||||
from crewai.types.usage_metrics import UsageMetrics
|
from crewai.types.usage_metrics import UsageMetrics
|
||||||
from crewai.utilities import I18N, FileHandler, Logger, RPMController
|
from crewai.utilities import I18N, FileHandler, Logger, RPMController
|
||||||
@@ -965,7 +969,7 @@ class Crew(BaseModel):
|
|||||||
# Keep track of delegation tools
|
# Keep track of delegation tools
|
||||||
delegation_tools = [
|
delegation_tools = [
|
||||||
tool for tool in existing_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
|
# Create mapping of tool names to new tools
|
||||||
@@ -1001,7 +1005,7 @@ class Crew(BaseModel):
|
|||||||
code_tools = agent.get_code_execution_tools()
|
code_tools = agent.get_code_execution_tools()
|
||||||
return self._merge_tools(tools, code_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.
|
"""Add delegation tools for the task's agent.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from crewai.agents.agent_builder.base_agent import BaseAgent
|
from crewai.agents.agent_builder.base_agent import BaseAgent
|
||||||
from crewai.tools.base_tool import BaseTool
|
from crewai.tools.base_tool import BaseTool
|
||||||
from crewai.utilities import I18N, Logger
|
from crewai.utilities import I18N, Logger
|
||||||
|
|
||||||
from .ask_question_tool import AskQuestionTool
|
from .ask_question_tool import AskQuestionTool
|
||||||
from .delegate_work_tool import DelegateWorkTool
|
from .delegate_work_tool import DelegateWorkTool
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user