pub struct ModelRole {
pub model: ModelId,
pub max_output_tokens: Option<u32>,
pub max_input_tokens: Option<u32>,
pub reasoning_effort: Option<ReasoningEffort>,
pub pricing: Option<Pricing>,
}Expand description
One model role, as a declaration resolves it: which model, and the ceilings the reviewer put beside it.
A manifest declares max_tokens and reasoning_effort per role
because the model is only half the decision — the role that reads hostile
content is the one whose output most needs a ceiling somebody reviewed.
Passing the id alone is how those two fields get parsed into the digest and
then dropped, so the runtime’s seams carry the whole role and
applied_to puts it on a call in one motion.
Fields§
§model: ModelId§max_output_tokens: Option<u32>Cap on generated tokens, when the declaration set one.
max_input_tokens: Option<u32>Cap on the tokens one call may send, when the declaration set one.
reasoning_effort: Option<ReasoningEffort>Requested reasoning depth, when the declaration set one.
pricing: Option<Pricing>What this role’s tokens cost, when the declaration stated it.
Implementations§
Source§impl ModelRole
impl ModelRole
Sourcepub fn new(model: ModelId) -> Self
pub fn new(model: ModelId) -> Self
A role with no declared ceilings — the driver defaults apply.
Sourcepub fn applied_to(&self, call: ModelCall) -> ModelCall
pub fn applied_to(&self, call: ModelCall) -> ModelCall
Put this role’s declared ceilings on a call.
The model itself is not applied here — a ModelCall is constructed
with its model, so applying it afterwards would be a second place the
choice is made.
Trait Implementations§
impl Eq for ModelRole
impl StructuralPartialEq for ModelRole
Auto Trait Implementations§
impl Freeze for ModelRole
impl RefUnwindSafe for ModelRole
impl Send for ModelRole
impl Sync for ModelRole
impl Unpin for ModelRole
impl UnsafeUnpin for ModelRole
impl UnwindSafe for ModelRole
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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