diff --git a/lib/crewai/src/crewai/types/callback.py b/lib/crewai/src/crewai/types/callback.py index e8f2021ea..cfbff623c 100644 --- a/lib/crewai/src/crewai/types/callback.py +++ b/lib/crewai/src/crewai/types/callback.py @@ -91,6 +91,6 @@ def callable_to_string(fn: Callable[..., Any]) -> str: SerializableCallable = Annotated[ Callable[..., Any], BeforeValidator(string_to_callable), - PlainSerializer(callable_to_string, return_type=str), + PlainSerializer(callable_to_string, return_type=str, when_used="json"), WithJsonSchema({"type": "string"}), ]