MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_build_context_string_truncation

Function test_build_context_string_truncation

atomic-repository/src/ai/mod.rs:623–638  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

621
622 #[test]
623 fn test_build_context_string_truncation() {
624 // Create enough nodes to exceed MAX_CHARS
625 let nodes: Vec<KgNode> = (0..500)
626 .map(|i| {
627 KgNode::new(
628 format!("entity:{}", i),
629 "entity",
630 format!("entity-{}", i),
631 "graph",
632 )
633 .with_summary(format!("A fairly long summary for entity number {} to help fill up the buffer quickly and test truncation behaviour", i))
634 })
635 .collect();
636 let context = build_context_string(&nodes, &[], "big query");
637 assert!(context.len() <= 4000);
638 }
639
640 #[test]
641 fn test_build_context_string_groups_by_kind() {

Callers

nothing calls this directly

Calls 2

build_context_stringFunction · 0.85
with_summaryMethod · 0.80

Tested by

no test coverage detected