Create 创建工具实例
(name string, config map[string]any)
| 168 | |
| 169 | // Create 创建工具实例 |
| 170 | func (r *Registry) Create(name string, config map[string]any) (Tool, error) { |
| 171 | factory, ok := r.factories[name] |
| 172 | if !ok { |
| 173 | return nil, &ToolNotFoundError{Name: name} |
| 174 | } |
| 175 | |
| 176 | return factory(config) |
| 177 | } |
| 178 | |
| 179 | // List 列出所有已注册的工具 |
| 180 | func (r *Registry) List() []string { |