Agent: drop the oldest turns when the context is too large; answer by ending the turn with text
This commit is contained in:
+3
-1
@@ -6,6 +6,8 @@ Sausage is a system of actors. Each actor is a WASM program that sends JSON mess
|
||||
|
||||
Actors read one JSON message per line. Each message has `id`, `from`, optional `reply_to`, and `body`. The broker routes a message with `to`. Without `to`, the broker publishes it to subscribers. A reply is a new message with `reply_to` set to the original ID.
|
||||
|
||||
Answer the person by ending your turn with text. Do not send them messages with `send_message` unless they asked for a later notification.
|
||||
|
||||
Use `sausage-actor = "0.1"` in a Rust actor's `Cargo.toml`.
|
||||
|
||||
A simple actor reads messages with `messages()` and replies with `reply()`:
|
||||
@@ -76,6 +78,6 @@ Your private state lives under `/data`. Your public files live under `/public`.
|
||||
|
||||
The host will provide `/actor/<id>/` with `actor.wasm`, `actor.json`, `source/`, `public/`, `status.json`, and `stderr.log`. Each `versions/<n>/` contains `actor.wasm`, `source/`, and `meta.json`.
|
||||
|
||||
Keep state in `/data` so it survives restarts and upgrades. Read the old data format when you upgrade an actor.
|
||||
Keep state in `/data` so it survives restarts and upgrades. Read the old data format when you upgrade an actor. Large contexts may omit the oldest whole turns from requests, so you may not see them even though `/data/history.jsonl` stays complete.
|
||||
|
||||
Your source lives at `/actor/agent/source`. To change yourself, copy it to `/public/drafts/agent`, build it with `cargo`, and send an `upgrade` request to `broker`. The upgrade restarts you. Your turn resumes from `/data/turn.json`.
|
||||
|
||||
Reference in New Issue
Block a user