SDK sausage-actor; examples and agent on the SDK; agent without limits
- sausage-actor: Message, messages(), send/reply/publish, async Inbox - agent: append-only /data/history.jsonl, no caps on history, steps, waits, tool output, or reads; max_tokens only when configured (Anthropic: 32000)
This commit is contained in:
@@ -4,4 +4,6 @@ version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1"
|
||||
sausage-actor = { version = "0.1", path = "../../sdk" }
|
||||
|
||||
[workspace]
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
//! Sends {"type":"add","text":"tick N"} to `notes` every 50 ms, N = 1..=200.
|
||||
//! Does not read stdin, so the broker kills it at shutdown; that is fine.
|
||||
use std::io::Write;
|
||||
//! Send 200 notes to `notes`, 50 ms apart, then stay alive.
|
||||
use sausage_actor::{json, send};
|
||||
use std::time::Duration;
|
||||
|
||||
fn main() {
|
||||
let mut out = std::io::stdout().lock();
|
||||
for n in 1..=200 {
|
||||
let msg = serde_json::json!({"to": "notes", "body": {"type": "add", "text": format!("tick {n}")}});
|
||||
writeln!(out, "{msg}").unwrap();
|
||||
out.flush().unwrap();
|
||||
std::thread::sleep(std::time::Duration::from_millis(50));
|
||||
let _ = send("notes", json!({"type": "add", "text": format!("tick {n}")}));
|
||||
std::thread::sleep(Duration::from_millis(50));
|
||||
}
|
||||
// Stay alive without doing anything.
|
||||
loop {
|
||||
std::thread::sleep(std::time::Duration::from_secs(3600));
|
||||
std::thread::sleep(Duration::from_secs(3600));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user