pub struct PerProviderQuota { /* private fields */ }Expand description
Give every provider its top k before any provider gets its k + 1th:
each provider’s best k frames, then each provider’s next k, and so on.
The difference from RoundRobinByRank is contiguity. A round robin deals
one frame per provider per turn; a quota deals k at a time, so a
provider’s block of evidence stays together in the prompt. k = 1 is a
round robin.
The quota tiers, it does not truncate. A provider’s k + 1th frame is
ranked lower, never dropped: dropping is the budget packer’s decision, and
it records a reason for the audit. A strategy that discarded frames would
leave them out of both the prompt and the record of why.
With one provider every frame sits in its own tier position in score order,
so this too degenerates to ScoreDescending.
Implementations§
Source§impl PerProviderQuota
impl PerProviderQuota
Sourcepub fn new(per_provider: usize) -> Self
pub fn new(per_provider: usize) -> Self
A quota of per_provider frames per provider per tier. 0 is read as
1: a quota of nothing would rank every frame into one tier and mean
nothing, and returning an error for a number a caller can only have
meant as “one at a time” buys the caller nothing.
Sourcepub fn per_provider(&self) -> usize
pub fn per_provider(&self) -> usize
The frames each provider contributes per tier.
Trait Implementations§
Source§impl Clone for PerProviderQuota
impl Clone for PerProviderQuota
Source§fn clone(&self) -> PerProviderQuota
fn clone(&self) -> PerProviderQuota
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PerProviderQuota
Source§impl Debug for PerProviderQuota
impl Debug for PerProviderQuota
Source§impl Default for PerProviderQuota
impl Default for PerProviderQuota
Source§fn default() -> Self
fn default() -> Self
Three frames per provider per tier — enough that a provider’s evidence
arrives as a block rather than a single frame, small enough that a
second provider is reached inside any realistic budget. A host with a
measured number should pass it to PerProviderQuota::new.