Set a chat conversation given a path to the conversation.
(
&mut self,
path: impl AsRef<Path>,
state: &ConversationState,
)
| 397 | |
| 398 | /// Set a chat conversation given a path to the conversation. |
| 399 | pub fn set_conversation_by_path( |
| 400 | &mut self, |
| 401 | path: impl AsRef<Path>, |
| 402 | state: &ConversationState, |
| 403 | ) -> Result<usize, DatabaseError> { |
| 404 | // We would need to encode this to support non utf8 paths. |
| 405 | let path = match path.as_ref().to_str() { |
| 406 | Some(path) => path, |
| 407 | None => return Ok(0), |
| 408 | }; |
| 409 | |
| 410 | self.set_json_entry(Table::Conversations, path, state) |
| 411 | } |
| 412 | |
| 413 | pub async fn get_secret(&self, key: &str) -> Result<Option<Secret>, DatabaseError> { |
| 414 | trace!(key, "getting secret"); |
no test coverage detected