#[non_exhaustive]pub enum RoundDecision {
Continue(RoundAdjustment),
Inject {
content: Vec<ContentBlock>,
adjust: RoundAdjustment,
},
Stop,
}Expand description
The per-turn steering seam, whole: the trait a host implements and every type its signatures make that host name.
Re-exported rather than wrapped, under the rule stated on
CancellationToken — a mentra type basis’s surface asks a caller to
write is a name basis re-exports, or the caller pins mentra in their own
manifest to spell it. And like the token, a strategy is an identity
rather than a value: TurnOptions::with_round_strategy hands mentra the
caller’s own Arc, so a basis-owned mirror of RoundDecision would be a
translation layer with opinions of its own — the opposite of a seam.
The set is exactly what implementing costs. RoundStrategy is the trait
(spelled with async_trait, which basis already
re-exports); RoundContext and RoundBoundary are its question;
RoundDecision, RoundAdjustment, ReasoningChange and
RoundToolResult are its vocabulary for answering. The last three are
here because the vocabulary’s own signatures demand them:
RoundDecision::inject takes ContentBlocks,
RoundAdjustment::with_model a ModelInfo, and
ReasoningChange::Set a ReasoningOptions — whose effort field an
Effort converts into, so switching effort mid-run never names mentra’s
own level enum.
The decision a RoundStrategy returns at a round boundary.
Construct one with RoundDecision::proceed, RoundDecision::inject, or
RoundDecision::stop for the common cases, or the variants directly to carry
a RoundAdjustment.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Continue(RoundAdjustment)
Proceed with the default flow. At RoundBoundary::AssistantMessageCommitted
this accepts the terminal message and lets the run return; at
RoundBoundary::ToolResultsCommitted it advances to the next round. Any
carried RoundAdjustment applies to subsequent rounds.
Inject
Do not end the run: append content as a corrective user turn and run
another round. At RoundBoundary::AssistantMessageCommitted this prevents
the run from returning. Any carried RoundAdjustment applies to that round.
Fields
content: Vec<ContentBlock>Corrective content appended to the transcript as a user message.
adjust: RoundAdjustmentModel/reasoning override applied before the injected round.
Stop
End the run gracefully at this boundary, committing the transcript exactly
as RunOptions::stop does. A stop request
asserts nothing about whether the run produced a valid answer.
Implementations§
Source§impl RoundDecision
impl RoundDecision
Sourcepub fn proceed() -> RoundDecision
pub fn proceed() -> RoundDecision
Continue with no model/reasoning change.
Sourcepub fn inject(content: impl Into<Vec<ContentBlock>>) -> RoundDecision
pub fn inject(content: impl Into<Vec<ContentBlock>>) -> RoundDecision
Inject corrective context and run another round, with no adjustment.
Sourcepub fn stop() -> RoundDecision
pub fn stop() -> RoundDecision
Request a graceful stop.