From ec9aadd2b7eaa848ff851d280c78d8cc2341ba4b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 28 Jun 2024 15:14:54 +0100 Subject: [Minor] Allow autolearn --- src/plugins/lua/gpt.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/plugins') 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 = { -- cgit v1.2.3