pub struct SimpleAgent { /* private fields */ }Expand description
Canonical Agent implementation for the String → String case.
Wraps the boilerplate every example repeats: append the user
message to short-term memory, delegate to
crate::runtime::run_steps with the supplied system prompt.
Custom-typed agents (non-String input or output, alternative
turn shapes) still implement Agent by hand; SimpleAgent is
shortcut, not replacement.
use klieo_core::{Agent, SimpleAgent};
let agent = SimpleAgent::new("hello", "Be brief.", vec![]);
assert_eq!(agent.name(), "hello");
assert_eq!(agent.system_prompt(), "Be brief.");
assert!(agent.tools().is_empty());Implementations§
Source§impl SimpleAgent
impl SimpleAgent
Sourcepub fn new(
name: impl Into<String>,
system_prompt: impl Into<String>,
catalogue: Vec<ToolDef>,
) -> Self
pub fn new( name: impl Into<String>, system_prompt: impl Into<String>, catalogue: Vec<ToolDef>, ) -> Self
Build a SimpleAgent with the supplied name, system prompt,
and tool catalogue. Uses crate::runtime::RunOptions::default
— override via SimpleAgent::with_run_options.
Sourcepub fn with_run_options(self, options: RunOptions) -> Self
pub fn with_run_options(self, options: RunOptions) -> Self
Override the crate::runtime::RunOptions passed to
crate::runtime::run_steps.
Sourcepub fn with_review_policy(self, policy: Arc<dyn ReviewPolicy>) -> Self
pub fn with_review_policy(self, policy: Arc<dyn ReviewPolicy>) -> Self
Install a review policy (the ADR-045 HITL suspend gate) on this agent’s
run options. Composes with SimpleAgent::with_run_options: every other
option field keeps its configured value; only the review policy is
replaced.