pub struct ContextAssembler;Implementations§
Source§impl ContextAssembler
impl ContextAssembler
Sourcepub fn assemble(
entries: Vec<EvaluatedEntry>,
config: &LorebookConfig,
tokenizer: &dyn Tokenizer,
available_slots: &HashSet<Slot>,
) -> Vec<AssembledBlock>
pub fn assemble( entries: Vec<EvaluatedEntry>, config: &LorebookConfig, tokenizer: &dyn Tokenizer, available_slots: &HashSet<Slot>, ) -> Vec<AssembledBlock>
Assemble evaluated entries into ordered, budgeted context blocks.
Entries are:
- Filtered (empty content is dropped)
- Resolved to available slots (with fallback chain)
- Sorted by priority (descending) for budget allocation
- Fitted within token budgets (higher priority entries take precedence)
- Re-sorted by slot, then priority for final prompt ordering
available_slots is the set of slots present in the user’s
ContextDefinition template. Entries targeting unavailable slots
walk their fallback chain; if no fallback matches, the entry is
silently dropped.
Auto Trait Implementations§
impl Freeze for ContextAssembler
impl RefUnwindSafe for ContextAssembler
impl Send for ContextAssembler
impl Sync for ContextAssembler
impl Unpin for ContextAssembler
impl UnsafeUnpin for ContextAssembler
impl UnwindSafe for ContextAssembler
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
Mutably borrows from an owned value. Read more