mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-07 18:19:00 +00:00
refactor: remove context parameter from task delegation (type mismatch) and add debug print statement
This commit is contained in:
@@ -78,7 +78,6 @@ class BaseAgentTool(BaseTool):
|
|||||||
description=task,
|
description=task,
|
||||||
agent=target_agent,
|
agent=target_agent,
|
||||||
expected_output=target_agent.i18n.slice("manager_request"),
|
expected_output=target_agent.i18n.slice("manager_request"),
|
||||||
context=context,
|
|
||||||
i18n=target_agent.i18n,
|
i18n=target_agent.i18n,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -91,6 +90,7 @@ class BaseAgentTool(BaseTool):
|
|||||||
target_agent.tools or [],
|
target_agent.tools or [],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
print("DEBUG CONTEXT: ", context)
|
||||||
result = target_agent.execute_task(new_task, context, tools)
|
result = target_agent.execute_task(new_task, context, tools)
|
||||||
|
|
||||||
print("\n=== Delegation Complete ===")
|
print("\n=== Delegation Complete ===")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from pydantic import BaseModel, Field, field_validator
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
from crewai.tools.agent_tools.base_agent_tools import BaseAgentTool
|
from crewai.tools.agent_tools.base_agent_tools import BaseAgentTool
|
||||||
|
|
||||||
@@ -12,10 +12,6 @@ class DelegateWorkToolSchema(BaseModel):
|
|||||||
..., description="The role/name of the coworker to delegate to"
|
..., description="The role/name of the coworker to delegate to"
|
||||||
)
|
)
|
||||||
|
|
||||||
@field_validator("context")
|
|
||||||
def flatten(cls, v):
|
|
||||||
return " ".join(v) if isinstance(v, list) else v
|
|
||||||
|
|
||||||
class DelegateWorkTool(BaseAgentTool):
|
class DelegateWorkTool(BaseAgentTool):
|
||||||
"""Tool for delegating work to coworkers"""
|
"""Tool for delegating work to coworkers"""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user