forked from kent/consciousness
memory_links: return typed Vec<LinkInfo> with node weights
- hippocampus::memory_links now returns Vec<LinkInfo> with key, link_strength, and node_weight for each neighbor - Unified memory_tool! macro: mut/ref as token, single main rule - All tools use serde serialize/deserialize for RPC consistency - jsonargs handlers now work in client mode (RPC to daemon) - cli/graph.rs formats LinkInfo for display Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
359955f838
commit
598f0112a4
3 changed files with 67 additions and 57 deletions
|
|
@ -28,9 +28,12 @@ pub async fn cmd_link(key: &[String]) -> Result<(), String> {
|
|||
return Err("link requires a key".into());
|
||||
}
|
||||
let key = key.join(" ");
|
||||
let result = memory::memory_links(None, &key).await
|
||||
let links = memory::memory_links(None, &key).await
|
||||
.map_err(|e| e.to_string())?;
|
||||
print!("{}", result);
|
||||
println!("Neighbors of '{}':", key);
|
||||
for link in links {
|
||||
println!(" ({:.2}) {} [w={:.2}]", link.link_strength, link.key, link.node_weight);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue