🔴 Required Information
Describe the Bug:
The GoogleSearchTool checks model.startsWith("gemini-2") || model.startsWith("gemini-3"), which rejects all -latest model aliases (gemini-flash-latest, gemini-pro-latest, gemini-flash-lite-latest). These are officially documented aliases: https://ai.google.dev/gemini-api/docs/models#latest
Steps to Reproduce:
- Add
com.google.adk:google-adk:1.2.0
- Run the repro below
- Observe:
gemini-2.5-flash passes, gemini-flash-latest throws
Expected Behavior:
GoogleSearchTool accepts all valid Gemini model aliases.
Observed Behavior:
IllegalArgumentException: Google search tool is not supported for model gemini-flash-latest
Environment Details:
- ADK Library Version: 1.2.0
- OS: macOS
- Java: OpenJDK 17
Model Information:
🟡 Optional Information
Regression:
Did this work in a previous version of ADK? (Yes/No) If so, which one?
Minimal Reproduction Code:
import com.google.adk.tools.GoogleSearchTool;
import com.google.adk.models.LlmRequest;
import com.google.genai.types.GenerateContentConfig;
public class ReproBug {
public static void main(String[] args) {
var tool = new GoogleSearchTool();
var working = LlmRequest.builder()
.config(GenerateContentConfig.builder().build())
.model("gemini-2.5-flash").build();
tool.processLlmRequest(working.toBuilder(), null).blockingAwait();
System.out.println("PASS: gemini-2.5-flash");
try {
var broken = LlmRequest.builder()
.config(GenerateContentConfig.builder().build())
.model("gemini-flash-latest").build();
tool.processLlmRequest(broken.toBuilder(), null).blockingAwait();
System.out.println("PASS: gemini-flash-latest");
} catch (Exception e) {
System.out.println("FAIL: " + e.getMessage());
}
}
}
How often has this issue occurred?:
🔴 Required Information
Describe the Bug:
The GoogleSearchTool checks
model.startsWith("gemini-2") || model.startsWith("gemini-3"), which rejects all-latestmodel aliases (gemini-flash-latest,gemini-pro-latest,gemini-flash-lite-latest). These are officially documented aliases: https://ai.google.dev/gemini-api/docs/models#latestSteps to Reproduce:
com.google.adk:google-adk:1.2.0gemini-2.5-flashpasses,gemini-flash-latestthrowsExpected Behavior:
GoogleSearchToolaccepts all valid Gemini model aliases.Observed Behavior:
IllegalArgumentException: Google search tool is not supported for model gemini-flash-latestEnvironment Details:
Model Information:
gemini-flash-latest🟡 Optional Information
Regression:
Did this work in a previous version of ADK? (Yes/No) If so, which one?
Minimal Reproduction Code:
How often has this issue occurred?: