Expand description
Dynamic runtime-script agent.
DynamicAgent executes Rhai scripts generated by the LLM at runtime.
Rhai is a safe, sandboxed scripting language for Rust — it replaces the
Python exec() approach with proper isolation.
The Rhai engine exposes a limited API to scripts:
agent_log(msg)— log a messageagent_alert(msg)— broadcast an alertagent_state_get(key)— read from persistent stateagent_state_set(key, value)— write to persistent state
Scripts must define a fn main() function that is called on each message.
Structs§
- Dynamic
Agent - A dynamically scripted agent.