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 show_state(self, keys: &[&str]) -> Self
pub fn show_state(self, keys: &[&str]) -> Self
Show the given state keys to the model by appending them to every
phase’s instruction at runtime ([Context: key=value, …]).
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
Live::builder().phase_defaults(|d| d.context(
Ctx::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) -> Self
pub fn prompt_on_enter(self) -> Self
Prompt the model on entry to every phase (it responds immediately after the phase instruction and context are delivered).
Auto Trait Implementations§
impl Freeze for PhaseDefaults
impl !RefUnwindSafe for PhaseDefaults
impl Send for PhaseDefaults
impl Sync for PhaseDefaults
impl Unpin for PhaseDefaults
impl !UnwindSafe for PhaseDefaults
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].