mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-28 01:28:14 +00:00
fix: Handle exclude parameter type conversion in Task.copy
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -618,7 +618,10 @@ class Task(BaseModel):
|
|||||||
"""Create a copy of the Task."""
|
"""Create a copy of the Task."""
|
||||||
exclude_set = {"id", "agent", "context", "tools"}
|
exclude_set = {"id", "agent", "context", "tools"}
|
||||||
if exclude:
|
if exclude:
|
||||||
exclude_set.update(exclude)
|
if isinstance(exclude, (AbstractSet, set)):
|
||||||
|
exclude_set.update(str(x) for x in exclude)
|
||||||
|
elif isinstance(exclude, Mapping):
|
||||||
|
exclude_set.update(str(x) for x in exclude.keys())
|
||||||
|
|
||||||
copied_task = super().copy(
|
copied_task = super().copy(
|
||||||
include=include,
|
include=include,
|
||||||
|
|||||||
Reference in New Issue
Block a user