mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
* rebuilding executor * removing langchain * Making all tests good * fixing types and adding ability for nor using system prompts * improving types * pleasing the types gods * pleasing the types gods * fixing parser, tools and executor * making sure all tests pass * final pass * fixing type * Updating Docs * preparing to cut new version
25 lines
864 B
Python
25 lines
864 B
Python
from langchain.tools import StructuredTool
|
|
from crewai.agents.agent_builder.utilities.base_agent_tool import BaseAgentTools
|
|
|
|
|
|
class AgentTools(BaseAgentTools):
|
|
"""Default tools around agent delegation"""
|
|
|
|
def tools(self):
|
|
coworkers = ", ".join([f"{agent.role}" for agent in self.agents])
|
|
tools = [
|
|
StructuredTool.from_function(
|
|
func=self.delegate_work,
|
|
name="Delegate work to coworker",
|
|
description=self.i18n.tools("delegate_work").format(
|
|
coworkers=coworkers
|
|
),
|
|
),
|
|
StructuredTool.from_function(
|
|
func=self.ask_question,
|
|
name="Ask question to coworker",
|
|
description=self.i18n.tools("ask_question").format(coworkers=coworkers),
|
|
),
|
|
]
|
|
return tools
|