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