============== AgentActor 适配器 ============== AgentActor 将 Agent 包装为 Actor 这是适配器模式的实现,不修改原有 Agent 代码
| 134 | // AgentActor 将 Agent 包装为 Actor |
| 135 | // 这是适配器模式的实现,不修改原有 Agent 代码 |
| 136 | type AgentActor struct { |
| 137 | agent *Agent |
| 138 | |
| 139 | // 状态 |
| 140 | mu sync.RWMutex |
| 141 | isRunning bool |
| 142 | lastError error |
| 143 | |
| 144 | // 性能统计 |
| 145 | stats *AgentActorStats |
| 146 | |
| 147 | // 生命周期管理 |
| 148 | ctx context.Context |
| 149 | cancel context.CancelFunc |
| 150 | } |
| 151 | |
| 152 | // AgentActorStats Actor 统计信息 |
| 153 | type AgentActorStats struct { |
nothing calls this directly
no outgoing calls
no test coverage detected