We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f973673 commit ff504edCopy full SHA for ff504ed
1 file changed
src/google/adk/tools/retrieval/vertex_ai_rag_retrieval.py
@@ -17,6 +17,7 @@
17
from __future__ import annotations
18
19
import logging
20
+import asyncio
21
from typing import Any
22
from typing import TYPE_CHECKING
23
@@ -94,13 +95,13 @@ async def run_async(
94
95
) -> Any:
96
from ...dependencies.vertexai import rag
97
- response = rag.retrieval_query(
98
+ response = asyncio.to_thread(rag.retrieval_query(
99
text=args['query'],
100
rag_resources=self.vertex_rag_store.rag_resources,
101
rag_corpora=self.vertex_rag_store.rag_corpora,
102
similarity_top_k=self.vertex_rag_store.similarity_top_k,
103
vector_distance_threshold=self.vertex_rag_store.vector_distance_threshold,
- )
104
+ ))
105
106
logging.debug('RAG raw response: %s', response)
107
0 commit comments