diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-06-29 13:27:25 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-06-29 13:27:25 +0100 |
commit | 1601c1c9250a637222ae4acfee6c4dec337d26fc (patch) | |
tree | c7386d413b2ad77fa993823882736732facbcd56 /src/plugins | |
parent | f78fa8767e8a78d9bc2ef0184dc5882412d4eaa1 (diff) | |
download | rspamd-1601c1c9250a637222ae4acfee6c4dec337d26fc.tar.gz rspamd-1601c1c9250a637222ae4acfee6c4dec337d26fc.zip |
[Minor] Add from and subject to the prompt
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/gpt.lua | 9 |
1 files changed, 9 insertions, 0 deletions
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', @@ -247,6 +248,14 @@ local function openai_gpt_check(task) }, { 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 } } |