diff options
author | Jens Erat <email@jenserat.de> | 2025-03-13 00:45:36 +0100 |
---|---|---|
committer | Jens Erat <email@jenserat.de> | 2025-03-13 00:45:36 +0100 |
commit | bda1635a4eadeb2ec605c37f6fe1ad511783201e (patch) | |
tree | 6770056b85a7282af480826a066d7fa2f0c053ea /src/plugins/lua/gpt.lua | |
parent | efd17b77423c0809bfee76279ad5149211e98873 (diff) | |
download | rspamd-bda1635a4eadeb2ec605c37f6fe1ad511783201e.tar.gz rspamd-bda1635a4eadeb2ec605c37f6fe1ad511783201e.zip |
[Fix] initialize ollama result table
similar to gpt.lua:704 for the chatgpt code path, the ollama code path needs to initialize the result table. Without, rspamd fails gpt requests with
> lua_http_finish_handler: callback call failed: /usr/share/rspamd/plugins/gpt.lua:740: attempt to index a nil value
Diffstat (limited to 'src/plugins/lua/gpt.lua')
-rw-r--r-- | src/plugins/lua/gpt.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/lua/gpt.lua b/src/plugins/lua/gpt.lua index 1d5c4b21e..98a3e38ee 100644 --- a/src/plugins/lua/gpt.lua +++ b/src/plugins/lua/gpt.lua @@ -807,6 +807,10 @@ local function ollama_check(task, content, sel_part) body.response_format = { type = "json_object" } end + results[i] = { + success = false, + checked = false + } body.model = model upstream = settings.upstreams:get_upstream_round_robin() |