mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-23 15:18:14 +00:00
more fixes
This commit is contained in:
@@ -297,14 +297,14 @@ class LangChainAgentAdapter(BaseAgent):
|
|||||||
|
|
||||||
used_tools = []
|
used_tools = []
|
||||||
try:
|
try:
|
||||||
# Import the CrewAI Tool class using a local variable name to avoid reassigning the imported type.
|
# Import the CrewAI Tool class using a different alias to avoid redefinition.
|
||||||
from crewai.tools.base_tool import Tool as CrewToolLocal
|
from crewai.tools.base_tool import Tool as LocalCrewTool
|
||||||
except ImportError:
|
except ImportError:
|
||||||
CrewToolLocal = None # type: Optional[Type[BaseTool]]
|
LocalCrewTool = None # type: Optional[Type[BaseTool]]
|
||||||
|
|
||||||
for tool in raw_tools:
|
for tool in raw_tools:
|
||||||
# If the tool is a CrewAI Tool, convert it to a LangChain compatible tool.
|
# If the tool is a CrewAI Tool, convert it to a LangChain compatible tool.
|
||||||
if CrewToolLocal is not None and isinstance(tool, CrewToolLocal):
|
if LocalCrewTool is not None and isinstance(tool, LocalCrewTool):
|
||||||
used_tools.append(tool.to_langchain())
|
used_tools.append(tool.to_langchain())
|
||||||
else:
|
else:
|
||||||
used_tools.append(tool)
|
used_tools.append(tool)
|
||||||
|
|||||||
Reference in New Issue
Block a user