From 1601c1c9250a637222ae4acfee6c4dec337d26fc Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 29 Jun 2024 13:27:25 +0100 Subject: [PATCH] [Minor] Add from and subject to the prompt --- src/plugins/lua/gpt.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/lua/gpt.lua b/src/plugins/lua/gpt.lua index e12bcf807..a2db2123e 100644 --- a/src/plugins/lua/gpt.lua +++ b/src/plugins/lua/gpt.lua @@ -15,6 +15,7 @@ limitations under the License. ]] -- local N = "gpt" +local E = {} if confighelp then rspamd_config:add_example(nil, 'gpt', @@ -245,6 +246,14 @@ local function openai_gpt_check(task) role = 'system', content = settings.prompt }, + { + role = 'user', + content = 'Subject: ' .. task:get_subject() or '', + }, + { + role = 'user', + content = 'From: ' .. ((task:get_from('mime') or E)[1] or E).name or '', + }, { role = 'user', content = content -- 2.39.5