From 673897deb5be12effac3e494c05b725af67f0f3f Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 7 Mar 2023 17:33:35 +0100 Subject: [PATCH] OpenAI: changed roles --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 5 ++--- 1 file changed, 2 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 29ec915288..874640c825 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -2629,15 +2629,14 @@ public class FragmentCompose extends FragmentBase { StringBuilder sb = new StringBuilder(); for (int i = 0; i < 3 && i < paragraphs.length; i++) sb.append(paragraphs[i]).append("\n"); - String role = (MessageHelper.equalEmail(draft.from, message.from) ? "assistant" : "user"); - messages.add(new OpenAI.Message(role, sb.toString())); + messages.add(new OpenAI.Message("assistant", sb.toString())); if (msgids.size() >= 3) break; } if (!TextUtils.isEmpty(body)) - messages.add(new OpenAI.Message("assistant", body)); + messages.add(new OpenAI.Message("user", body)); if (messages.size() == 0) return null;