Skip to content

Commit e6ffbae

Browse files
authored
fix: updated the Google AI datasource's gemini models with options compatatible with generate command (#41415)
## Description Replace gemini-pro that has been deprecated with 5 models as below 1. gemini-2.5-flash 2. gemini-2.5-pro 3. gemini-2.0-flash 4. gemini-flash-latest 5. gemini-flash-lite-latest All these models support the generate content command as verified from this List Models API here: https://generativelanguage.googleapis.com/v1beta/models?key=<GOOGLE_API_KEY> Fixes #41105 ## Automation /ok-to-test tags="@tag.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/19674900186> > Commit: 13074e8 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=19674900186&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Tue, 25 Nov 2025 16:44:56 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Google AI plugin now supports additional AI models: Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 2.0 Flash, Gemini Flash Latest, and Gemini Flash Lite Latest, expanding your model selection options. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 0adb73d commit e6ffbae

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

app/server/appsmith-plugins/googleAiPlugin/src/main/java/com/external/plugins/constants/GoogleAIConstants.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ public class GoogleAIConstants {
2323
public static final String MESSAGES = "messages";
2424
public static final String LABEL = "label";
2525
public static final String VALUE = "value";
26-
public static final List<String> GOOGLE_AI_MODELS = List.of("gemini-pro");
26+
public static final List<String> GOOGLE_AI_MODELS = List.of(
27+
"gemini-2.5-pro",
28+
"gemini-2.5-flash",
29+
"gemini-2.0-flash",
30+
"gemini-flash-latest",
31+
"gemini-flash-lite-latest");
2732
public static final ExchangeStrategies EXCHANGE_STRATEGIES = ExchangeStrategies.builder()
2833
.codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(/* 10MB */ 10 * 1024 * 1024))
2934
.build();

app/server/appsmith-plugins/googleAiPlugin/src/test/java/com/external/plugins/GenerateContentCommandTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ public void testCreateTriggerUri() {
3232
@Test
3333
public void testCreateExecutionUri() {
3434
ActionConfiguration actionConfiguration = new ActionConfiguration();
35-
actionConfiguration.setFormData(Map.of(GENERATE_CONTENT_MODEL, Map.of(DATA, "gemini-pro")));
35+
actionConfiguration.setFormData(Map.of(GENERATE_CONTENT_MODEL, Map.of(DATA, "gemini-2.5-pro")));
3636
URI uri = generateContentCommand.createExecutionUri(actionConfiguration);
3737
Assertions.assertEquals(
38-
"https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent", uri.toString());
38+
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent",
39+
uri.toString());
3940
}
4041

4142
@Test

app/server/appsmith-plugins/googleAiPlugin/src/test/java/com/external/plugins/GoogleAiPluginTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void verifyDatasourceTriggerResultsForChatModels() {
109109
apiKeyAuth.setValue("apiKey");
110110
DatasourceConfiguration datasourceConfiguration = new DatasourceConfiguration();
111111
datasourceConfiguration.setAuthentication(apiKeyAuth);
112-
String responseBody = "[\"gemini-pro\"]";
112+
String responseBody = "[\"gemini-2.5-pro\"]";
113113
MockResponse mockResponse = new MockResponse().setBody(responseBody);
114114
mockResponse.setResponseCode(200);
115115
mockEndpoint.enqueue(mockResponse);
@@ -122,8 +122,15 @@ public void verifyDatasourceTriggerResultsForChatModels() {
122122
StepVerifier.create(datasourceTriggerResultMono)
123123
.assertNext(result -> {
124124
assertTrue(result.getTrigger() instanceof List<?>);
125-
assertEquals(((List) result.getTrigger()).size(), 1);
126-
assertEquals(result.getTrigger(), getDataToMap(List.of("gemini-pro")));
125+
assertEquals(((List) result.getTrigger()).size(), 5);
126+
assertEquals(
127+
result.getTrigger(),
128+
getDataToMap(List.of(
129+
"gemini-2.5-pro",
130+
"gemini-2.5-flash",
131+
"gemini-2.0-flash",
132+
"gemini-flash-latest",
133+
"gemini-flash-lite-latest")));
127134
})
128135
.verifyComplete();
129136
}

0 commit comments

Comments
 (0)