mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 00:53:26 +02:00
Limit text to summarize
This commit is contained in:
@@ -44,6 +44,8 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class FragmentDialogSummarize extends FragmentDialogBase {
|
||||
private static final int MAX_SUMMARIZE_TEXT_SIZE = 10 * 1024;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
@@ -113,6 +115,8 @@ public class FragmentDialogSummarize extends FragmentDialogBase {
|
||||
|
||||
d = HtmlHelper.sanitizeView(context, d, false);
|
||||
|
||||
HtmlHelper.truncate(d, MAX_SUMMARIZE_TEXT_SIZE);
|
||||
|
||||
if (OpenAI.isAvailable(context)) {
|
||||
String model = prefs.getString("openai_model", OpenAI.DEFAULT_MODEL);
|
||||
float temperature = prefs.getFloat("openai_temperature", OpenAI.DEFAULT_TEMPERATURE);
|
||||
|
||||
Reference in New Issue
Block a user