Skip to main content

Module typed_builder

Module typed_builder 

Source
Expand description

§Type-State Runtime Builder

A compile-time safe builder for AgentRuntime that enforces required fields (LLM port and default model) at the type level.

§Usage

use bob_runtime::typed_builder::TypedRuntimeBuilder;
use std::sync::Arc;

let runtime = TypedRuntimeBuilder::new()
    .with_llm(llm)              // transitions to HasLlm
    .with_default_model("gpt")  // transitions to Ready
    .with_store(store)          // optional
    .with_events(events)        // optional
    .build();                   // only available on Ready

Structs§

Empty
Initial state — no required fields set.
HasLlm
LLM port is set, model is not.
Ready
Both LLM port and default model are set — ready to build.
TypedRuntimeBuilder
Type-state builder that enforces required fields at compile time.