Get a single memory by its ID.
(&self, py: Python<'_>, memory_id: String)
| 122 | |
| 123 | /// Get a single memory by its ID. |
| 124 | fn get(&self, py: Python<'_>, memory_id: String) -> PyResult<Option<PyMemory>> { |
| 125 | let id = parse_memory_id(&memory_id)?; |
| 126 | let service = Arc::clone(&self.service); |
| 127 | let rt = get_runtime(); |
| 128 | |
| 129 | py.allow_threads(|| { |
| 130 | rt.block_on(async move { |
| 131 | let mem = service.get(&id).await.map_err(to_py_runtime_error)?; |
| 132 | Ok(mem.map(PyMemory::from)) |
| 133 | }) |
| 134 | }) |
| 135 | } |
| 136 | |
| 137 | /// Get all memories matching the given scope. |
| 138 | #[pyo3(signature = (user_id=None, agent_id=None, run_id=None))] |
no test coverage detected