diff --git a/src/crewai/memory/storage/kickoff_task_outputs_storage.py b/src/crewai/memory/storage/kickoff_task_outputs_storage.py index 57623eef80..dbb5f124b1 100644 --- a/src/crewai/memory/storage/kickoff_task_outputs_storage.py +++ b/src/crewai/memory/storage/kickoff_task_outputs_storage.py @@ -70,7 +70,7 @@ def add( task.expected_output, json.dumps(output, cls=CrewJSONEncoder), task_index, - json.dumps(inputs), + json.dumps(inputs, cls=CrewJSONEncoder), was_replayed, ), ) diff --git a/src/crewai/utilities/crew_json_encoder.py b/src/crewai/utilities/crew_json_encoder.py index 3cab07ffc7..c3f95fcf65 100644 --- a/src/crewai/utilities/crew_json_encoder.py +++ b/src/crewai/utilities/crew_json_encoder.py @@ -2,13 +2,14 @@ import json from uuid import UUID from pydantic import BaseModel +from decimal import Decimal class CrewJSONEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, BaseModel): return self._handle_pydantic_model(obj) - elif isinstance(obj, UUID): + elif isinstance(obj, UUID) or isinstance(obj, Decimal): return str(obj) elif isinstance(obj, datetime) or isinstance(obj, date):