الأحداث

إعادة انقراض

{ type: "rewound", n, removed, files, kept, credits }

A تنفيذ إلى حرّر a رسالة هو أولاً الإيطالية الإيطالية الإيطالية الإيطالية إلى إعادة () إلى الخلف ليس إلى تراجع.

only with run({ edit })before anything elsenames what stays done
Using Python?

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

متى تنق هذه القيامة ، متى تنق متى تنق ، متى تنفخ متى ت

فقط على run({ edit: n, message }) - إن تحرير رسالة سابقة يعني العودة إليها والبدء من جديد بنص جديد، فالحدث ينبعث قبل أي شيء آخر.

await agent.run({
  edit: 2,                                  // go back to just before message 2
  message: "Actually, rename them to kebab-case.",
  onEvent: (e) => {
    if (e.type === "rewound") console.log("undid", e.removed.messages, "messages");
  },
});
def on_event(event):
    if event["type"] == "rewound":
        print("restored", len(event["files"]["restored"]), "files")

agent.run(
    edit=2,                                   # go back to just before message 2
    message="Actually, rename them to kebab-case.",
    on_event=on_event,
)

الحقول

{
  type: "rewound",
  n: 2,
  removed: { messages: 11, turns: 5 },
  files: { restored: [...], recreated: [...], deleted: [...], skipped: [...] },
  kept: ["send_mail", "deploy"],
  credits: { spent: 24, refunded: 0 }
}
{
    "type": "rewound",
    "n": 2,
    "files": {"restored": [...], "recreated": [...], "deleted": [...], "skipped": [...]},
    "kept": [],
    "credits": {"spent": 0, "refunded": 0},
}
ninteger

الرسالة عادت إلى

removedobject

كم عدد الرسائل و المساعدين الذين تركوا المحادثة

filesobject

ما كان قد استُرِد، واُعيد واُحي skippedمع سبب لكل سبب

keptarray

ما ترك الآلة وبقي القيام به - إرسال، نشر، كتابة تخزين، تدفق، قيادة.

creditsobject

{ spent, refunded: 0 }تمّت كتابة المناورات المزالة ولم يتمّ إعادتها

حفظت في الحقل لعرض

"الجرح الذي أُردّ" يصف الملفات، وليس العالم

وإذا لم يكن المحفوظ فارغا ، حدث شيء ما يعود الى الوراء لا يتراجع . واجهة تخفيه تخبر المستخدم ان الركض قد تم التراجع عنه ، وهو خاطئ — وزائف في الاتجاه المهم .

إعادة إلى الـ فشل

إنها ترمي قبل أن تُصدر أي شيء: session_required, agent_running, checkpoints_disabled, checkpoint_compacted, checkpoint_not_found, invalid_checkpointالركض لا يبدأ

إعادة تنفيذ بدون تشغيل

const outcome = await agent.rewind(2);   // the same object, returned rather than emitted
outcome = agent.rewind(2)   # the same object, returned rather than emitted