Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static BatchPredictionJob createBatchPredictionGeminiJobSample(
String modelName =
String.format(
"projects/%s/locations/%s/publishers/google/models/%s",
project, location, "gemini-2.0-flash-001");
project, location, "gemini-2.5-flash");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The model name "gemini-2.5-flash" is hardcoded directly within the String.format call. For improved maintainability and to reduce the risk of typos, especially for critical API parameters like model names, it is generally a good practice to define such string literals as private static final String constants at the class level. This makes the value easier to locate and update if it changes in the future. Due to the constraint of only commenting on modified lines and providing compilable code suggestions, a direct code suggestion for adding a constant declaration is not provided here.


BatchPredictionJob batchPredictionJob =
BatchPredictionJob.newBuilder()
Expand Down