Commit 7656727
committed
refactor(agui): replace addition mode enum with merge options for flexible event merging
This change replaces the AdditionMode enum with MergeOptions for more flexible control over how addition fields are merged with event data. The StreamStateMachine class is introduced to handle streaming state management, improving tool call handling and UUID resolution in copilotkit compatibility mode. The protocol handlers are updated to use the new merge options instead of the rigid enum-based approach.
This provides better flexibility for merging additional fields while maintaining backward compatibility through the merge helper function.
feat: 使用 MergeOptions 替换 AdditionMode 枚举以实现灵活的事件合并
此变更使用 MergeOptions 替换 AdditionMode 枚举,以实现对附加字段如何与事件数据合并的更灵活控制。引入了 StreamStateMachine 类来处理流状态管理,改进了在 copilotkit 兼容模式下的工具调用处理和 UUID 解析。协议处理器已更新以使用新的合并选项,而不是基于枚举的刚性方法。
这为合并附加字段提供了更好的灵活性,同时通过合并助手函数保持向后兼容性。
Change-Id: Ic84a5a9b743e7bedbc75e5938248b34348f17591
Signed-off-by: OhYee <oyohyee@oyohyee.com>1 parent 737bbc3 commit 7656727
File tree
11 files changed
+538
-526
lines changed- agentrun
- integration/langgraph
- server
- utils
- tests/unittests
- integration
- server
11 files changed
+538
-526
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | | - | |
| 213 | + | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
120 | | - | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | 169 | | |
171 | 170 | | |
172 | 171 | | |
| |||
187 | 186 | | |
188 | 187 | | |
189 | 188 | | |
| 189 | + | |
| 190 | + | |
190 | 191 | | |
0 commit comments