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

Function NewExecutor

pkg/executionplan/executor.go:58–68  ·  view source on GitHub ↗

NewExecutor 创建执行计划执行器 toolMap: 工具名称到工具实例的映射

(toolMap map[string]tools.Tool, opts ...ExecutorOption)

Source from the content-addressed store, hash-verified

56// NewExecutor 创建执行计划执行器
57// toolMap: 工具名称到工具实例的映射
58func NewExecutor(toolMap map[string]tools.Tool, opts ...ExecutorOption) *Executor {
59 e := &Executor{
60 tools: toolMap,
61 }
62
63 for _, opt := range opts {
64 opt(e)
65 }
66
67 return e
68}
69
70// Execute 执行计划
71func (e *Executor) Execute(ctx context.Context, plan *ExecutionPlan, toolCtx *tools.ToolContext) error {

Callers 15

NewExecutionPlanManagerFunction · 0.92
executionExampleFunction · 0.92
TestNewExecutorFunction · 0.70
TestExecuteSequentialFunction · 0.70
TestExecuteWithErrorFunction · 0.70
TestExecuteParallelFunction · 0.70

Calls

no outgoing calls

Tested by 15

TestNewExecutorFunction · 0.56
TestExecuteSequentialFunction · 0.56
TestExecuteWithErrorFunction · 0.56
TestExecuteParallelFunction · 0.56
TestExecuteToolNotFoundFunction · 0.56