pub struct PhaseDefaults { /* private fields */ }Expand description
Default modifiers and settings inherited by all phases.
Created by Live::phase_defaults and applied in PhaseBuilder::done.
Implementations§
Source§impl PhaseDefaults
impl PhaseDefaults
Sourcepub fn with_state(self, keys: &[&str]) -> Self
pub fn with_state(self, keys: &[&str]) -> Self
Append state keys to every phase’s instruction at runtime.
Sourcepub fn when(
self,
predicate: impl Fn(&State) -> bool + Send + Sync + 'static,
text: impl Into<String>,
) -> Self
pub fn when( self, predicate: impl Fn(&State) -> bool + Send + Sync + 'static, text: impl Into<String>, ) -> Self
Conditionally append text to every phase when predicate is true.
Sourcepub fn with_context(
self,
f: impl Fn(&State) -> String + Send + Sync + 'static,
) -> Self
pub fn with_context( self, f: impl Fn(&State) -> String + Send + Sync + 'static, ) -> Self
Append custom formatted context to every phase’s instruction.
Sourcepub fn context(self, ctx: ContextBuilder) -> Self
pub fn context(self, ctx: ContextBuilder) -> Self
Append a declarative gemini_adk_rs::live::context_builder::ContextBuilder to every phase’s instruction.
The builder renders accumulated state as a natural-language summary, giving the model situational awareness across all phases.
§Example
.phase_defaults(|d| d.context(
Ctx::builder()
.section("Caller")
.field("caller_name", "Name")
.flag("is_known_contact", "Known contact")
.build()
))Include phase navigation context in every phase’s instruction.
Appends the output of PhaseMachine::describe_navigation() to the
instruction, giving the model awareness of its current position,
phase history, missing state keys, and possible transitions.
Sourcepub fn prompt_on_enter(self, enabled: bool) -> Self
pub fn prompt_on_enter(self, enabled: bool) -> Self
Enable prompt_on_enter for all phases (model responds immediately on entry).