mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 19:35:10 +01:00
OpenAI: added system instructions option
This commit is contained in:
@@ -87,9 +87,14 @@ public class AI {
|
||||
float temperature = prefs.getFloat("openai_temperature", OpenAI.DEFAULT_TEMPERATURE);
|
||||
boolean multimodal = prefs.getBoolean("openai_multimodal", false);
|
||||
String answer = prefs.getString("openai_answer", OpenAI.DEFAULT_ANSWER_PROMPT);
|
||||
String system = prefs.getString("openai_system", null);
|
||||
|
||||
List<OpenAI.Message> messages = new ArrayList<>();
|
||||
|
||||
if (!TextUtils.isEmpty(system))
|
||||
messages.add(new OpenAI.Message(OpenAI.SYSTEM, new OpenAI.Content[]{
|
||||
new OpenAI.Content(OpenAI.CONTENT_TEXT, system)}));
|
||||
|
||||
if (reply == null) {
|
||||
if (body instanceof Spannable && multimodal)
|
||||
messages.add(new OpenAI.Message(OpenAI.USER,
|
||||
|
||||
Reference in New Issue
Block a user