Skip to content

Commit 082c8bb

Browse files
google-genai-botcopybara-github
authored andcommitted
feat: Extend google_search support to Gemini 3 in Java ADK
PiperOrigin-RevId: 867697057
1 parent 0502c21 commit 082c8bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/main/java/com/google/adk/tools/GoogleSearchTool.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import org.slf4j.LoggerFactory;
2929

3030
/**
31-
* A built-in tool that is automatically invoked by Gemini 2 models to retrieve search results from
32-
* Google Search.
31+
* A built-in tool that is automatically invoked by Gemini 2 and 3 models to retrieve search results
32+
* from Google Search.
3333
*
3434
* <p>This tool operates internally within the model and does not require or perform local code
3535
* execution.
@@ -76,7 +76,7 @@ public Completable processLlmRequest(
7676
updatedToolsBuilder.add(
7777
Tool.builder().googleSearchRetrieval(GoogleSearchRetrieval.builder().build()).build());
7878
configBuilder.tools(updatedToolsBuilder.build());
79-
} else if (model != null && model.startsWith("gemini-2")) {
79+
} else if (model != null && (model.startsWith("gemini-2") || model.startsWith("gemini-3"))) {
8080

8181
updatedToolsBuilder.add(Tool.builder().googleSearch(GoogleSearch.builder().build()).build());
8282
configBuilder.tools(updatedToolsBuilder.build());

0 commit comments

Comments
 (0)