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 ReadyStructs§
- 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.
- Typed
Runtime Builder - Type-state builder that enforces required fields at compile time.