diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-06-28 15:14:54 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-06-28 15:14:54 +0100 |
commit | ec9aadd2b7eaa848ff851d280c78d8cc2341ba4b (patch) | |
tree | fb08f84d430356e842ba272e91b9834cddbf50ff /src/plugins | |
parent | db08bfd4cc611f77a6ef125da23a19c67e2cf657 (diff) | |
download | rspamd-ec9aadd2b7eaa848ff851d280c78d8cc2341ba4b.tar.gz rspamd-ec9aadd2b7eaa848ff851d280c78d8cc2341ba4b.zip |
[Minor] Allow autolearn
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/gpt.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/lua/gpt.lua b/src/plugins/lua/gpt.lua index 79f8882ce..e12bcf807 100644 --- a/src/plugins/lua/gpt.lua +++ b/src/plugins/lua/gpt.lua @@ -221,13 +221,18 @@ local function openai_gpt_check(task) if reply > 0.75 then task:insert_result('GPT_SPAM', (reply - 0.75) * 4, tostring(reply)) + if settings.autolearn then + task:set_flag("learn_spam") + end elseif reply < 0.25 then task:insert_result('GPT_HAM', (0.25 - reply) * 4, tostring(reply)) + if settings.autolearn then + task:set_flag("learn_ham") + end else lua_util.debugm(N, task, "uncertain result: %s", reply) end - -- TODO: add autolearn here end local body = { |