pub struct ContextAssembler { /* private fields */ }Implementations§
Source§impl ContextAssembler
impl ContextAssembler
pub fn new(config: ContextAssemblerConfig) -> Self
Sourcepub fn assemble_chunks(&self, chunks: Vec<Chunk>) -> AssembledContext
pub fn assemble_chunks(&self, chunks: Vec<Chunk>) -> AssembledContext
Assemble chunks into structured XML context:
- Sort by relevance (distance ascending)
- Deduplicate similar chunks via embedding cosine distance
- Group by document, sort each group by chunk_index
- Apply token budget
- Render XML ready for LLM consumption
Sourcepub fn assemble_texts(&self, chunks: &[String]) -> AssembledContext
pub fn assemble_texts(&self, chunks: &[String]) -> AssembledContext
Assemble from plain text strings — no dedup, no XML grouping. Kept for simpler callers that don’t have document metadata.
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
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>
Converts
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>
Converts
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