Update a memory's content by ID.
(&self, memory_id: &MemoryId, content: &str)
| 154 | |
| 155 | /// Update a memory's content by ID. |
| 156 | pub async fn update(&self, memory_id: &MemoryId, content: &str) -> GraphBitResult<Memory> { |
| 157 | let old = self |
| 158 | .store |
| 159 | .get_memory(memory_id) |
| 160 | .await? |
| 161 | .ok_or_else(|| GraphBitError::memory(format!("Memory not found: {memory_id}")))?; |
| 162 | |
| 163 | self.update_memory_internal(memory_id, content, &old.content) |
| 164 | .await |
| 165 | } |
| 166 | |
| 167 | /// Delete a single memory by its ID. |
| 168 | pub async fn delete(&self, memory_id: &MemoryId) -> GraphBitResult<()> { |
no test coverage detected