]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Allow to exclude all symbols 5326/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 1 Feb 2025 08:54:04 +0000 (08:54 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 1 Feb 2025 08:54:04 +0000 (08:54 +0000)
src/plugins/lua/gpt.lua

index 2cc570e0072a0aa5e275ac7d8e4eb636dbc7a385..971bfbd292be0f982935e457bebfe17ec661ac52 100644 (file)
@@ -87,7 +87,7 @@ local settings = {
   autolearn = false,
   reason_header = nil,
   url = 'https://api.openai.com/v1/chat/completions',
-  symbols_to_except = default_symbols_to_except,
+  symbols_to_except = nil,
   allow_passthrough = false,
   allow_ham = false,
 }
@@ -658,6 +658,10 @@ if opts then
         "add 'reason' field with 1 sentence description why you have made that decision."
   end
 
+  if not settings.symbols_to_except then
+    settings.symbols_to_except = default_symbols_to_except
+  end
+
   local llm_type = types_map[settings.type]
   if not llm_type then
     rspamd_logger.warnx(rspamd_config, 'unsupported gpt type: %s', settings.type)