From: Vsevolod Stakhov Date: Sat, 29 Jun 2024 12:27:25 +0000 (+0100) Subject: [Minor] Add from and subject to the prompt X-Git-Tag: 3.9.0~13^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1601c1c9250a637222ae4acfee6c4dec337d26fc;p=thirdparty%2Frspamd.git [Minor] Add from and subject to the prompt --- diff --git a/src/plugins/lua/gpt.lua b/src/plugins/lua/gpt.lua index e12bcf8071..a2db2123eb 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