pub struct Params {
pub prompt: String,
pub primary: Option<ModelSpec>,
pub fallback: Vec<ModelSpec>,
pub fusion: Vec<ModelSpec>,
pub consent_cross_tier: bool,
}Expand description
The request params a middleware may rewrite before the model call. Kept minimal and provider-agnostic for the core: the prompt text plus the routing shape a privacy-tier policy inspects. A real deployment threads richer params; the shape is what matters for the two-tier design.
The routing fields describe what a router may do with the
request, not what it has done: primary is the model the request targets,
fallback the ordered candidates a failover may swap to, and fusion the
set a response-fusion may fan out across. The TierPolicy middleware reads
these — it does not own the router — to refuse a confidentiality downgrade
before any candidate runs.
Fields§
§prompt: StringThe prompt text the input scanners run over.
primary: Option<ModelSpec>The model the request primarily targets, when known. None leaves
tier-policy a pass-through (the prompt-only core path).
fallback: Vec<ModelSpec>Ordered failover candidates the router may swap to for primary.
fusion: Vec<ModelSpec>Candidates a response-fusion may fan the request out across.
consent_cross_tier: boolThe caller explicitly accepted routing a Confidential request to a
Frontier model (a privacy downgrade). Defaults to false: fail-closed.
Implementations§
Source§impl Params
impl Params
Sourcepub fn new(prompt: impl Into<String>) -> Self
pub fn new(prompt: impl Into<String>) -> Self
Construct params from a prompt, with no routing candidates and no
cross-tier consent (fail-closed). Use the builder setters to add the
model targets a TierPolicy inspects.
Sourcepub fn with_primary(self, primary: ModelSpec) -> Self
pub fn with_primary(self, primary: ModelSpec) -> Self
Set the primary target model.
Sourcepub fn with_fallback(self, fallback: Vec<ModelSpec>) -> Self
pub fn with_fallback(self, fallback: Vec<ModelSpec>) -> Self
Set the ordered failover candidates.
Sourcepub fn with_fusion(self, fusion: Vec<ModelSpec>) -> Self
pub fn with_fusion(self, fusion: Vec<ModelSpec>) -> Self
Set the response-fusion candidate set.
Sourcepub fn with_cross_tier_consent(self, consent: bool) -> Self
pub fn with_cross_tier_consent(self, consent: bool) -> Self
Record the caller’s explicit consent to a cross-tier (Confidential → Frontier) downgrade.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Params
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnsafeUnpin for Params
impl UnwindSafe for Params
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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