* 清空所有记忆(危险操作!) * @param confirm 确认标志
(confirm: boolean = false)
| 283 | * @param confirm 确认标志 |
| 284 | */ |
| 285 | async clearAll(confirm: boolean = false): Promise<void> { |
| 286 | if (!confirm) { |
| 287 | throw new Error("Must confirm to clear all memory. Pass confirm=true."); |
| 288 | } |
| 289 | |
| 290 | await this.request("/v1/memory/clear", { |
| 291 | method: "POST", |
| 292 | body: { confirm: true }, |
| 293 | }); |
| 294 | } |
| 295 | } |