Skip to content

Commit 3f08c09

Browse files
committed
Added comment on handling state schemas
Signed-off-by: Roberto Rodriguez <[email protected]>
1 parent ab51aaa commit 3f08c09

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dapr_agents/agents/components.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ def __init__(
101101
)
102102
bundle = DEFAULT_AGENT_WORKFLOW_BUNDLE
103103

104+
# I considered splitting into separate classes, but that would duplicate several lines
105+
# of infrastructure code (pub/sub, state operations, registry mutations). The current design
106+
# uses the Strategy Pattern to share infrastructure while maintaining type-safe schemas per
107+
# agent/orchestrator type. The "complexity" is just 5 lines of bundle extraction vs maintaining
108+
# duplicate codebases.
104109
self._state_model_cls = bundle.state_model_cls
105110
self._message_model_cls = bundle.message_model_cls
106111
self._entry_factory = bundle.entry_factory

0 commit comments

Comments
 (0)