From 9a229d07173361782e35c4a18563cddba9ffcc29 Mon Sep 17 00:00:00 2001 From: Teo Date: Tue, 29 Oct 2024 17:02:31 -0600 Subject: [PATCH 1/2] fix(orchestrator.py): add exclude=True to handlers field to prevent it from being included in model serialization --- src/controlflow/orchestration/orchestrator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controlflow/orchestration/orchestrator.py b/src/controlflow/orchestration/orchestrator.py index df1de20c..c760fe86 100644 --- a/src/controlflow/orchestration/orchestrator.py +++ b/src/controlflow/orchestration/orchestrator.py @@ -51,7 +51,7 @@ class Orchestrator(ControlFlowModel): description="The strategy to use for managing agent turns", validate_default=True, ) - handlers: list[Union[Handler, AsyncHandler]] = Field(None, validate_default=True) + handlers: list[Union[Handler, AsyncHandler]] = Field(None, validate_default=True, exclude=True) @field_validator("turn_strategy", mode="before") def _validate_turn_strategy(cls, v): From 50c4dac45d3fc1ef0867a45177ad64e76778f3d3 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:36:44 -0400 Subject: [PATCH 2/2] Static formatting --- src/controlflow/orchestration/orchestrator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controlflow/orchestration/orchestrator.py b/src/controlflow/orchestration/orchestrator.py index c760fe86..08d902cc 100644 --- a/src/controlflow/orchestration/orchestrator.py +++ b/src/controlflow/orchestration/orchestrator.py @@ -51,7 +51,9 @@ class Orchestrator(ControlFlowModel): description="The strategy to use for managing agent turns", validate_default=True, ) - handlers: list[Union[Handler, AsyncHandler]] = Field(None, validate_default=True, exclude=True) + handlers: list[Union[Handler, AsyncHandler]] = Field( + None, validate_default=True, exclude=True + ) @field_validator("turn_strategy", mode="before") def _validate_turn_strategy(cls, v):