From 127b62dee09574aecbd26a996708cc7ce8b13b64 Mon Sep 17 00:00:00 2001 From: ilya-kolchinsky Date: Wed, 9 Apr 2025 16:07:20 +0200 Subject: [PATCH] Raise an error when no vector DB IDs are provided to the query() method of the RAG (knowledge search) tool. --- llama_stack/providers/inline/tool_runtime/rag/memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama_stack/providers/inline/tool_runtime/rag/memory.py b/llama_stack/providers/inline/tool_runtime/rag/memory.py index 97c53d454..1f4b6d321 100644 --- a/llama_stack/providers/inline/tool_runtime/rag/memory.py +++ b/llama_stack/providers/inline/tool_runtime/rag/memory.py @@ -104,7 +104,7 @@ class MemoryToolRuntimeImpl(ToolsProtocolPrivate, ToolRuntime, RAGToolRuntime): query_config: Optional[RAGQueryConfig] = None, ) -> RAGQueryResult: if not vector_db_ids: - return RAGQueryResult(content=None) + raise ValueError("No vector DBs were provided to the RAG tool. Please provide at least one vector DB ID.") query_config = query_config or RAGQueryConfig() query = await generate_rag_query(