more fixes

This commit is contained in:
Brandon Hancock
2025-02-13 15:11:51 -05:00
parent df21f01441
commit 1e23d37a14
2 changed files with 3 additions and 7 deletions

View File

@@ -296,15 +296,10 @@ class LangChainAgentAdapter(BaseAgent):
raw_tools = getattr(self.langchain_agent, "tools", []) or []
used_tools = []
try:
# Import the CrewAI Tool class using a different alias to avoid redefinition.
from crewai.tools.base_tool import Tool as LocalCrewTool
except ImportError:
LocalCrewTool = None # type: Optional[Type[BaseTool]]
# Use the global CrewAI Tool class (imported at the module level)
for tool in raw_tools:
# If the tool is a CrewAI Tool, convert it to a LangChain compatible tool.
if LocalCrewTool is not None and isinstance(tool, LocalCrewTool):
if isinstance(tool, Tool):
used_tools.append(tool.to_langchain())
else:
used_tools.append(tool)

View File

@@ -0,0 +1 @@