style(tools, llm): 统一导入顺序与代码格式
This commit is contained in:
@@ -57,8 +57,8 @@ impl KnowledgeStore {
|
||||
}
|
||||
let now = OffsetDateTime::now_utc();
|
||||
let id = format!("{KNOWLEDGE_PREFIX}{}", page.id);
|
||||
let content = serde_json::to_string(&page)
|
||||
.map_err(|e| MemoryError::Serialization(e.to_string()))?;
|
||||
let content =
|
||||
serde_json::to_string(&page).map_err(|e| MemoryError::Serialization(e.to_string()))?;
|
||||
let item = MemoryItem {
|
||||
id,
|
||||
content,
|
||||
@@ -128,7 +128,10 @@ impl KnowledgeStore {
|
||||
.filter(|entry| {
|
||||
entry.title.to_lowercase().contains(&needle)
|
||||
|| entry.summary.to_lowercase().contains(&needle)
|
||||
|| entry.tags.iter().any(|t| t.to_lowercase().contains(&needle))
|
||||
|| entry
|
||||
.tags
|
||||
.iter()
|
||||
.any(|t| t.to_lowercase().contains(&needle))
|
||||
})
|
||||
.map(|entry| entry.id.clone())
|
||||
.collect()
|
||||
|
||||
Reference in New Issue
Block a user