diff --git a/src/google/adk/tools/retrieval/vertex_ai_rag_retrieval.py b/src/google/adk/tools/retrieval/vertex_ai_rag_retrieval.py index 4d564ca164..f54322cc11 100644 --- a/src/google/adk/tools/retrieval/vertex_ai_rag_retrieval.py +++ b/src/google/adk/tools/retrieval/vertex_ai_rag_retrieval.py @@ -17,6 +17,7 @@ from __future__ import annotations import logging +import asyncio from typing import Any from typing import TYPE_CHECKING @@ -94,8 +95,9 @@ async def run_async( ) -> Any: from ...dependencies.vertexai import rag - response = rag.retrieval_query( - text=args['query'], + response = await asyncio.to_thread( + rag.retrieval_query, + text=args["query"], rag_resources=self.vertex_rag_store.rag_resources, rag_corpora=self.vertex_rag_store.rag_corpora, similarity_top_k=self.vertex_rag_store.similarity_top_k,