mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 16:18:30 +00:00
more fixes
This commit is contained in:
@@ -296,15 +296,10 @@ class LangChainAgentAdapter(BaseAgent):
|
|||||||
raw_tools = getattr(self.langchain_agent, "tools", []) or []
|
raw_tools = getattr(self.langchain_agent, "tools", []) or []
|
||||||
|
|
||||||
used_tools = []
|
used_tools = []
|
||||||
try:
|
# Use the global CrewAI Tool class (imported at the module level)
|
||||||
# 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]]
|
|
||||||
|
|
||||||
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 LocalCrewTool is not None and isinstance(tool, LocalCrewTool):
|
if isinstance(tool, Tool):
|
||||||
used_tools.append(tool.to_langchain())
|
used_tools.append(tool.to_langchain())
|
||||||
else:
|
else:
|
||||||
used_tools.append(tool)
|
used_tools.append(tool)
|
||||||
|
|||||||
1
title=src/crewai/agents/langchain_agent_adapter.py
Normal file
1
title=src/crewai/agents/langchain_agent_adapter.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
Reference in New Issue
Block a user