MCPcopy Create free account
hub / github.com/AI45Lab/Code / assemble_ranks_by_relevance

Function assemble_ranks_by_relevance

core/src/context/assembler.rs:323–343  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321
322 #[test]
323 fn assemble_ranks_by_relevance() {
324 let assembler = ContextAssembler::new(ContextBudget {
325 max_items: 10,
326 max_tokens: 100,
327 });
328 let assembly = assembler.assemble(&[result(
329 "test",
330 vec![
331 ContextItem::new("low", ContextType::Resource, "low")
332 .with_relevance(0.1)
333 .with_token_count(1),
334 ContextItem::new("high", ContextType::Resource, "high")
335 .with_relevance(0.9)
336 .with_token_count(1),
337 ],
338 )]);
339
340 assert_eq!(assembly.items[0].id, "high");
341 assert_eq!(assembly.items[1].id, "low");
342 assert!(!assembly.truncated);
343 }
344
345 #[test]
346 fn assemble_uses_priority_trust_and_freshness_as_ranking_signals() {

Callers

nothing calls this directly

Calls 2

resultFunction · 0.85
assembleMethod · 0.80

Tested by

no test coverage detected