From 1fad4ad80c10bec2f8ebe48677775a224a1b783c Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 9 May 2024 22:00:47 +0200 Subject: [PATCH] Gemini: default model temperature --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 2 +- .../main/java/eu/faircode/email/FragmentDialogSummarize.java | 2 +- .../java/eu/faircode/email/FragmentOptionsIntegrations.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 1f4f02c0e7..cd41d7942d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -2790,7 +2790,7 @@ public class FragmentCompose extends FragmentBase { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); String model = prefs.getString("gemini_model", "gemini-pro"); - float temperature = prefs.getFloat("gemini_temperature", 0.5f); + float temperature = prefs.getFloat("gemini_temperature", 0.9f); Gemini.Message message = new Gemini.Message(Gemini.USER, new String[]{Gemini.truncateParagraphs(body)}); diff --git a/app/src/main/java/eu/faircode/email/FragmentDialogSummarize.java b/app/src/main/java/eu/faircode/email/FragmentDialogSummarize.java index 28948430e3..f9b3e7e998 100644 --- a/app/src/main/java/eu/faircode/email/FragmentDialogSummarize.java +++ b/app/src/main/java/eu/faircode/email/FragmentDialogSummarize.java @@ -106,7 +106,7 @@ public class FragmentDialogSummarize extends FragmentDialogBase { return sb.toString(); } else if (Gemini.isAvailable(context)) { String model = prefs.getString("gemini_model", "gemini-pro"); - float temperature = prefs.getFloat("gemini_temperature", 0.5f); + float temperature = prefs.getFloat("gemini_temperature", 0.9f); String prompt = prefs.getString("gemini_summarize", Gemini.SUMMARY_PROMPT); Gemini.Message message = new Gemini.Message(Gemini.USER, new String[]{prompt, text}); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsIntegrations.java b/app/src/main/java/eu/faircode/email/FragmentOptionsIntegrations.java index 2de1d3e8db..8da3a6d4fe 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsIntegrations.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsIntegrations.java @@ -804,7 +804,7 @@ public class FragmentOptionsIntegrations extends FragmentBase implements SharedP etGeminiModel.setText(prefs.getString("gemini_model", null)); etGeminiModel.setEnabled(swGemini.isChecked()); - temperature = prefs.getFloat("gemini_temperature", 0.5f); + temperature = prefs.getFloat("gemini_temperature", 0.9f); tvGeminiTemperature.setText(getString(R.string.title_advanced_openai_temperature, NF.format(temperature))); sbGeminiTemperature.setProgress(Math.round(temperature * 10)); sbGeminiTemperature.setEnabled(swGemini.isChecked());