(ctx context.Context, namespace, key string)
| 474 | } |
| 475 | |
| 476 | func (t *LogicMemoryUpdateTool) delete(ctx context.Context, namespace, key string) (string, error) { |
| 477 | if err := t.manager.DeleteMemory(ctx, namespace, key); err != nil { |
| 478 | return "", fmt.Errorf("failed to delete memory: %w", err) |
| 479 | } |
| 480 | |
| 481 | return fmt.Sprintf("Successfully deleted memory: **%s** from namespace %s", key, namespace), nil |
| 482 | } |
| 483 | |
| 484 | // 确保实现 Tool 接口 |
| 485 | var _ tools.Tool = (*LogicMemoryUpdateTool)(nil) |