#[non_exhaustive]pub struct ItemCostInput {
pub state: Tokens,
pub schema: Tokens,
pub images: u64,
pub image_tokens_each: u64,
pub overhead_tokens: u64,
pub max_passes: u64,
pub pass_tokens: Option<u64>,
}Expand description
What one item’s provider call is estimated from.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.state: TokensThe item’s state, billed on every pass.
schema: TokensThe schema sent with every item (fields or questions), billed once across all passes.
images: u64How many images the item carries.
image_tokens_each: u64The module’s bound on the tokens one image costs. Required; a module that does not know it states a bound, never zero.
overhead_tokens: u64The module’s bound on its per-request overhead (prompt template, system text). Required; never defaulted to zero.
max_passes: u64The module’s upper bound on how many passes the provider makes for the item, at least 1. 1 for a provider that answers in one pass.
pass_tokens: Option<u64>The provider’s per-pass token budget, when it states one. Used only to check that an exactly counted state fits in a pass; it does not decide how many passes are billed.
Implementations§
Source§impl ItemCostInput
impl ItemCostInput
pub fn new( state: Tokens, schema: Tokens, image_tokens_each: u64, overhead_tokens: u64, ) -> Self
pub fn with_images(self, images: u64) -> Self
Sourcepub fn with_max_passes(self, max_passes: u64) -> Self
pub fn with_max_passes(self, max_passes: u64) -> Self
The module’s upper bound on the passes the provider makes. Zero is
refused when the item is estimated (EstimateError::NoPasses).