MCPcopy Create free account
hub / github.com/astercloud/aster / handleBatchToolCall

Method handleBatchToolCall

pkg/agent/actor.go:407–429  ·  view source on GitHub ↗

handleBatchToolCall 处理批量工具调用

(ctx *actor.Context, msg *BatchToolCallMsg)

Source from the content-addressed store, hash-verified

405
406// handleBatchToolCall 处理批量工具调用
407func (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 处理获取状态
432func (a *AgentActor) handleGetStatus(_ *actor.Context, msg *GetStatusMsg) {

Callers 1

ReceiveMethod · 0.95

Calls 4

withCancellationMethod · 0.95
cancelFunction · 0.85
ExecuteToolsDirectMethod · 0.80
ReplyMethod · 0.80

Tested by

no test coverage detected