Update a memory's content.
(&self, py: Python<'_>, memory_id: String, content: String)
| 164 | |
| 165 | /// Update a memory's content. |
| 166 | fn update(&self, py: Python<'_>, memory_id: String, content: String) -> PyResult<PyMemory> { |
| 167 | let id = parse_memory_id(&memory_id)?; |
| 168 | let service = Arc::clone(&self.service); |
| 169 | let rt = get_runtime(); |
| 170 | |
| 171 | py.allow_threads(|| { |
| 172 | rt.block_on(async move { |
| 173 | let mem = service |
| 174 | .update(&id, &content) |
| 175 | .await |
| 176 | .map_err(to_py_runtime_error)?; |
| 177 | Ok(PyMemory::from(mem)) |
| 178 | }) |
| 179 | }) |
| 180 | } |
| 181 | |
| 182 | /// Delete a single memory by its ID. |
| 183 | fn delete(&self, py: Python<'_>, memory_id: String) -> PyResult<()> { |
no test coverage detected