Memory: byte-budgeted index, memory_search (BM25), auto extraction on compaction/exit
This commit is contained in:
1 parent
59bf45f41d
commit
8705b128ea
8 files changed
+311
-39
No files matched your search
@@ -22,6 +22,10 @@ pub fn plan(msgs: &[Message], keep: usize) -> Option<Plan> {
|
||||
}
|
||||
|
||||
impl Plan {
|
||||
pub fn transcript(&self) -> &str {
|
||||
&self.transcript
|
||||
}
|
||||
|
||||
pub fn request(&self, model: &str) -> Request {
|
||||
Request {
|
||||
model: model.into(),
|
||||
@@ -53,7 +57,7 @@ fn is_prompt(m: &Message) -> bool {
|
||||
.any(|b| matches!(b, ContentBlock::ToolResult { .. }))
|
||||
}
|
||||
|
||||
fn transcript(msgs: &[Message]) -> String {
|
||||
pub fn transcript(msgs: &[Message]) -> String {
|
||||
let cut = |s: &str| -> String {
|
||||
if s.len() > 800 {
|
||||
format!("{}…", s.chars().take(800).collect::<String>())
|
||||
|
||||
Reference in new issue
Block a user