Tool 工具接口
| 43 | |
| 44 | // Tool 工具接口 |
| 45 | type Tool interface { |
| 46 | // Name 工具名称 |
| 47 | Name() string |
| 48 | |
| 49 | // Description 工具描述 |
| 50 | Description() string |
| 51 | |
| 52 | // InputSchema JSON Schema定义 |
| 53 | InputSchema() map[string]any |
| 54 | |
| 55 | // Execute 执行工具 |
| 56 | Execute(ctx context.Context, input map[string]any, tc *ToolContext) (any, error) |
| 57 | |
| 58 | // Prompt 工具使用说明(可选) |
| 59 | Prompt() string |
| 60 | } |
| 61 | |
| 62 | // AnnotatedTool 带安全注解的工具接口 |
| 63 | // 实现此接口的工具可以提供安全注解,帮助权限系统做出智能决策 |
no outgoing calls
no test coverage detected