From: Vsevolod Stakhov Date: Fri, 28 Jun 2024 14:14:54 +0000 (+0100) Subject: [Minor] Allow autolearn X-Git-Tag: 3.9.0~13^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec9aadd2b7eaa848ff851d280c78d8cc2341ba4b;p=thirdparty%2Frspamd.git [Minor] Allow autolearn --- diff --git a/src/plugins/lua/gpt.lua b/src/plugins/lua/gpt.lua index 79f8882ce7..e12bcf8071 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 = {