aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-06-29 13:27:25 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-06-29 13:27:25 +0100
commit1601c1c9250a637222ae4acfee6c4dec337d26fc (patch)
treec7386d413b2ad77fa993823882736732facbcd56 /src/plugins
parentf78fa8767e8a78d9bc2ef0184dc5882412d4eaa1 (diff)
downloadrspamd-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.lua9
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
}
}