mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-30 23:02:50 +00:00
fix: serialize callbacks to string only in JSON mode to preserve closures during copy
This commit is contained in:
@@ -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"}),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user