handleBatchToolCall 处理批量工具调用
(ctx *actor.Context, msg *BatchToolCallMsg)
| 405 | |
| 406 | // handleBatchToolCall 处理批量工具调用 |
| 407 | func (a *AgentActor) handleBatchToolCall(ctx *actor.Context, msg *BatchToolCallMsg) { |
| 408 | execCtx, cancel := a.withCancellation(msg.Ctx) |
| 409 | defer cancel() |
| 410 | |
| 411 | go func() { |
| 412 | results := a.agent.ExecuteToolsDirect(execCtx, msg.Calls) |
| 413 | |
| 414 | response := &BatchToolResultMsg{ |
| 415 | Results: results, |
| 416 | } |
| 417 | |
| 418 | if msg.ReplyTo != nil { |
| 419 | select { |
| 420 | case msg.ReplyTo <- response: |
| 421 | default: |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | if ctx.Sender != nil { |
| 426 | ctx.Reply(response) |
| 427 | } |
| 428 | }() |
| 429 | } |
| 430 | |
| 431 | // handleGetStatus 处理获取状态 |
| 432 | func (a *AgentActor) handleGetStatus(_ *actor.Context, msg *GetStatusMsg) { |
no test coverage detected