mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
fix: Fix code execution and multimodal tool handling
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -925,13 +925,25 @@ class Crew(BaseModel):
|
|||||||
|
|
||||||
# Add code execution tools if agent allows code execution
|
# Add code execution tools if agent allows code execution
|
||||||
if agent.allow_code_execution:
|
if agent.allow_code_execution:
|
||||||
code_tools = self._add_code_execution_tools(agent, [])
|
code_tools = agent.get_code_execution_tools()
|
||||||
final_tools.extend(code_tools)
|
if code_tools:
|
||||||
|
final_tools.extend(code_tools)
|
||||||
|
self._logger.log(
|
||||||
|
"debug",
|
||||||
|
f"Added code execution tools for agent {agent.role}: {[tool.name for tool in code_tools]}",
|
||||||
|
color="blue",
|
||||||
|
)
|
||||||
|
|
||||||
# Add multimodal tools if agent supports them
|
# Add multimodal tools if agent supports them
|
||||||
if agent and agent.multimodal:
|
if agent and agent.multimodal:
|
||||||
multimodal_tools = self._add_multimodal_tools(agent, [])
|
multimodal_tools = agent.get_multimodal_tools()
|
||||||
final_tools.extend(multimodal_tools)
|
if multimodal_tools:
|
||||||
|
final_tools.extend(multimodal_tools)
|
||||||
|
self._logger.log(
|
||||||
|
"debug",
|
||||||
|
f"Added multimodal tools for agent {agent.role}: {[tool.name for tool in multimodal_tools]}",
|
||||||
|
color="blue",
|
||||||
|
)
|
||||||
|
|
||||||
# Always add delegation tools if agent allows delegation
|
# Always add delegation tools if agent allows delegation
|
||||||
if delegation_tools:
|
if delegation_tools:
|
||||||
|
|||||||
Reference in New Issue
Block a user