المعاملات
limitintegerعدد. عدد. 200وهو أيضاً الغطاء والحد الأقصى الذي يمكن أن يحمله الحساب.
بما أنّ الغطاء والأقصى هما نفس العدد، فإنّ الإفتراض يعود بكلّ شيء. لا يوجد مائل لأنّه لا يوجد شيء لتمييزه.
القيمة المُعادة
[
{
id: "…",
name: "tone-of-voice",
description: "How this user wants to be written to",
content: "Prefers short, direct answers in French.",
type: "preference",
source: "user",
createdAt: "…",
updatedAt: "…"
}
][
{
"id": "…",
"name": "tone-of-voice",
"description": "How this user wants to be written to",
"content": "Prefers short, direct answers in French.",
"type": "preference",
"source": "user",
"createdAt": "…",
"updatedAt": "…",
}
]حساب بدون ملاحظات يعطي مصفوفة فارغة .
الـ المحتوى يأتي معه
فخلافا لما يحصل عليه العامل — اي المؤشر وحده — يعود كل شيء ، بما فيه المحتوى .
const notes = await api.memory.list();
for (const n of notes) {
console.log(`${n.name} · ${n.type} · by ${n.source}`);
console.log(` ${n.description}`);
console.log(` ${n.content}`);
}notes = api.memory.list()
for n in notes:
print(f"{n['name']} · {n['type']} · by {n['source']}")
print(f" {n['description']}")
print(f" {n['content']}")المجموعة حسب نوع النوع
| نوع | المعنى |
|---|---|
| ) | كيف يريد المستخدم أن يتم الأمر |
| مشروع مشروع | شيء ما عن العمل في يد |
| الوقائع | شيء مستقر وقابل للتحقق |
| أولاً- التصحيح | شيء ما أخطأ العميل و أخبر عنه |
| غير | الإفتراض عندما لا شيء آخر يناسب |
const byType = new Map();
for (const n of await api.memory.list()) {
byType.set(n.type, [...(byType.get(n.type) || []), n]);
}
// Corrections are the ones worth reviewing: each is something that went wrong once.
byType.get("correction")?.forEach((n) => console.log(n.name, "·", n.content));from collections import defaultdict
by_type = defaultdict(list)
for n in api.memory.list():
by_type[n["type"]].append(n)
# Corrections are the ones worth reviewing: each is something that went wrong once.
for n in by_type["correction"]:
print(n["name"], "·", n["content"])A مراجعة تستحق الركض
انحلال الذاكرة من حيث الفائدة لا من حيث الحجم: مذكرة مكتوبة عن مشروع انتهى لا يزال يقرأ في سياق كل مرة. بالنظر إلى ما لم يتغير في وقت طويل هو النسخة الرخيصة من التقطيع.
const notes = await api.memory.list();
const quarter = Date.now() - 90 * 24 * 60 * 60 * 1000;
const old = notes.filter((n) => Date.parse(n.updatedAt) < quarter && n.type === "project");
for (const n of old) {
console.log(`still remembered, last touched ${n.updatedAt}: ${n.name} — ${n.description}`);
}from datetime import datetime, timedelta, timezone
notes = api.memory.list()
quarter = datetime.now(timezone.utc) - timedelta(days=90)
old = [n for n in notes
if n["type"] == "project" and datetime.fromisoformat(n["updatedAt"].replace("Z", "+00:00")) < quarter]
for n in old:
print(f"still remembered, last touched {n['updatedAt']}: {n['name']} — {n['description']}")ملاحظة عن صاحب الحساب، لذا فحذف واحد نيابة عنهم هو قرار وليس تدبير منزلي، وإظهار القائمة لهم هو عادة أفضل خطوة.