Commit 4849dc8
Refactor event loop to use Agent object rather than individual parameters (strands-agents#359)
Update the event_loop_cycle function to accept the agent directly instead of the separate parameters that were coming directly from the agent. This simplifies + clarifies exactly what the event loop is doing with the agent. Long-term this sets us up for more easily access other agent capabilities like hooks.
There is a downside here of tighter coupling between the agent & the event_loop - an alternative implementation of this would be to abstract the object being passed - maybe something like `EventLoopContext`. I originally started implementing this approach before revisiting it as it seemed like an unnecessary abstraction.1 parent fcd7cda commit 4849dc8
File tree
8 files changed
+211
-621
lines changed- src/strands
- agent
- event_loop
- handlers
- tools
- types
- tests/strands
- agent
- event_loop
- handlers
8 files changed
+211
-621
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
131 | 130 | | |
132 | 131 | | |
133 | 132 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 133 | + | |
142 | 134 | | |
143 | 135 | | |
144 | 136 | | |
| |||
292 | 284 | | |
293 | 285 | | |
294 | 286 | | |
295 | | - | |
296 | 287 | | |
297 | 288 | | |
298 | 289 | | |
| |||
626 | 617 | | |
627 | 618 | | |
628 | 619 | | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
| 620 | + | |
637 | 621 | | |
638 | 622 | | |
639 | 623 | | |
| |||
0 commit comments