From d122252e161348853966507577cc67b0b285d201 Mon Sep 17 00:00:00 2001 From: Yiorgis Gozadinos Date: Fri, 5 Sep 2025 11:45:33 +0300 Subject: [PATCH] If a document is deleted but does not exist, say so --- src/haiku/rag/app.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/haiku/rag/app.py b/src/haiku/rag/app.py index c9083cbd..74d52d0a 100644 --- a/src/haiku/rag/app.py +++ b/src/haiku/rag/app.py @@ -50,8 +50,13 @@ class HaikuRAGApp: async def delete_document(self, doc_id: str): async with HaikuRAG(db_path=self.db_path) as self.client: - await self.client.delete_document(doc_id) - self.console.print(f"[b]Document {doc_id} deleted successfully.[/b]") + deleted = await self.client.delete_document(doc_id) + if deleted: + self.console.print(f"[b]Document {doc_id} deleted successfully.[/b]") + else: + self.console.print( + f"[yellow]Document with id {doc_id} not found.[/yellow]" + ) async def search(self, query: str, limit: int = 5): async with HaikuRAG(db_path=self.db_path) as self.client: