api.memory

delete()

api.memory.delete(name) → Promise<{ ok, deleted }>

删除一个注单。 它告诉您是否有一个, 未知的名字是成功而不是失败 。

DELETE /api/ai/memories/:namefreenever 404
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

参数

namestring必填

便笺的名称已存储 - 转换的表格, 是一个 (列表) 显示。

返回值

await api.memory.delete("tone-of-voice");
// { ok: true, deleted: true }

await api.memory.delete("never-existed");
// { ok: true, deleted: false }   ← no error
api.memory.delete("tone-of-voice")
# {"ok": True, "deleted": True}

api.memory.delete("never-existed")
# {"ok": True, "deleted": False}   ← no error
删除的答案, OK is not

要么是成功电话。当您需要知道是否有东西时, 读取删除—— 清理工作可以忽略它, 确认信息不应该。

const { deleted } = await api.memory.delete(name);

ui.toast(deleted ? `Forgot "${name}".` : `There was nothing called "${name}".`);
deleted = api.memory.delete(name)["deleted"]

ui.toast(f'Forgot "{name}".' if deleted else f'There was nothing called "{name}".')

使用存储的名称

保存时将名称转换为 save() 可能不是注中注有的名称。 以什么删除 list() 显示,或者呼叫成功,删除任何内容。

await api.memory.save({ name: "Tone Of Voice", content: "…" });
await api.memory.delete("Tone Of Voice");   // { deleted: false } — stored as "tone-of-voice"

const notes = await api.memory.list();
const match = notes.find((n) => n.description.includes("written to"));
if (match) await api.memory.delete(match.name);   // this works
api.memory.save(name="Tone Of Voice", content="…")
api.memory.delete("Tone Of Voice")   # {"deleted": False} — stored as "tone-of-voice"

notes = api.memory.list()
match = next((n for n in notes if "written to" in n["description"]), None)
if match:
    api.memory.delete(match["name"])   # this works

不见了

笔记是几行文字 保存被遗忘的东西的复制件 将无法忘却它们

// Keep a copy yourself if you want one
const note = (await api.memory.list()).find((n) => n.name === name);
if (note) await audit.record({ action: "memory.delete", note, by: userId });
await api.memory.delete(name);
# Keep a copy yourself if you want one
note = next((n for n in api.memory.list() if n["name"] == name), None)
if note:
    audit.record(action="memory.delete", note=note, by=user_id)
api.memory.delete(name)

是谁的决定决定的

账户持有人的记事本被人们记住了。 代他们删除一个便条,让一个代表他们的人去自由空间、收拾,因为看上去老了,这是对他们的一种选择,值得留给他们,让他们看单子,让他们随便挑一个免费电话。

清空一切 很少是某人想要的东西

”忘记一切, ”执行起来容易,很难取消。如果你提供了,请说具体会忘记的东西,先列出清单。