Skip to main content

PlannerModel

Trait PlannerModel 

Source
pub trait PlannerModel {
    // Required method
    fn plan(&self, prompt: &str) -> Result<String, RedDBError>;
}
Expand description

A model that turns a planner prompt into a typed-plan JSON document.

The blanket impl over Fn(&str) -> RedDBResult<String> lets callers pass a closure wrapping the configured planner provider (production) or a canned string (tests / mock model) without a bespoke type — this is the closure-model seam the routing/refusal unit tests use.

Required Methods§

Source

fn plan(&self, prompt: &str) -> Result<String, RedDBError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> PlannerModel for F
where F: Fn(&str) -> Result<String, RedDBError>,