memoryd: ask_memory, each workspace's chat at once with its own limit
Co-Authored-By: ornith-1.5-35b-a3b <agent@wntrmute.dev>
This commit is contained in:
@@ -30,10 +30,16 @@ pub struct Local {
|
||||
pub untrusted: bool,
|
||||
}
|
||||
|
||||
/// A hit's text as an item holds it, from the local index or from Honcho: neutralised, every
|
||||
/// control character (a line break among them) and every Unicode line or paragraph separator a
|
||||
/// space, then cut to its first `SNIPPET` characters, with no mark.
|
||||
/// A hit's text as an item holds it, from the local index or from Honcho: `one_line`, cut to
|
||||
/// `SNIPPET` characters.
|
||||
pub fn snippet(text: &str) -> String {
|
||||
one_line(text, SNIPPET)
|
||||
}
|
||||
|
||||
/// Text from memory as an item holds it: neutralised, every control character (a line break
|
||||
/// among them) and every Unicode line or paragraph separator a space, then cut to its first
|
||||
/// `cap` characters, with no mark.
|
||||
pub fn one_line(text: &str, cap: usize) -> String {
|
||||
neutralise(text)
|
||||
.chars()
|
||||
.map(|c| {
|
||||
@@ -43,7 +49,7 @@ pub fn snippet(text: &str) -> String {
|
||||
c
|
||||
}
|
||||
})
|
||||
.take(SNIPPET)
|
||||
.take(cap)
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user