feat: add config for ollama keep alive (#1858)

This commit is contained in:
Ricardo Maraschini
2025-04-17 04:47:51 +02:00
committed by GitHub
parent 37f4e960ae
commit cff8cbf9c5
3 changed files with 4 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ end
---@param prompt_opts AvantePromptOptions
function M:parse_curl_args(prompt_opts)
local provider_conf, request_body = P.parse_config(self)
local keep_alive = provider_conf.keep_alive or "5m"
if not provider_conf.model or provider_conf.model == "" then error("Ollama model must be specified in config") end
if not provider_conf.endpoint then error("Ollama requires endpoint configuration") end
@@ -53,6 +54,7 @@ function M:parse_curl_args(prompt_opts)
messages = self:parse_messages(prompt_opts),
stream = true,
system = prompt_opts.system_prompt,
keep_alive = keep_alive,
}, request_body),
}
end