8000 feat: expose more config of VertexAiSearchTool from latest Google Gen… · google/adk-python@2b5c89b · GitHub
[go: up one dir, main page]

Skip to content

Commit 2b5c89b

Browse files
seanzhougooglecopybara-github
authored andcommitted
feat: expose more config of VertexAiSearchTool from latest Google GenAI SDK
for fixing: #955 PiperOrigin-RevId: 764568728
1 parent b92e068 commit 2b5c89b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/google/adk/tools/vertex_ai_search_tool.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def __init__(
4040
*,
4141
data_store_id: Optional[str] = None,
4242
search_engine_id: Optional[str] = None,
43+
filter: Optional[str] = None,
44+
max_results: Optional[int] = None,
4345
):
4446
"""Initializes the Vertex AI Search tool.
4547
@@ -64,6 +66,8 @@ def __init__(
6466
)
6567
self.data_store_id = data_store_id
6668
self.search_engine_id = search_engine_id
69+
self.filter = filter
70+
self.max_results = max_results
6771

6872
@override
6973
async def process_llm_request(
@@ -84,7 +88,10 @@ async def process_llm_request(
8488
types.Tool(
8589
retrieval=types.Retrieval(
8690
vertex_ai_search=types.VertexAISearch(
87-
datastore=self.data_store_id, engine=self.search_engine_id
91+
datastore=self.data_store_id,
92+
engine=self.search_engine_id,
93+
filter=self.filter,
94+
max_results=self.max_results,
8895
)
8996
)
9097
)

0 commit comments

Comments
 (0)
0