* 缓存工具调用结果
(toolName: string, input: any, result: any)
| 144 | * 缓存工具调用结果 |
| 145 | */ |
| 146 | cacheToolResult(toolName: string, input: any, result: any): void { |
| 147 | const inputHash = this.hashInput(input); |
| 148 | const key = `tool:${toolName}:${inputHash}`; |
| 149 | this.set(key, result, 30 * 60 * 1000); // 30分钟TTL |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * 获取缓存的工具调用结果 |
no test coverage detected