debug completion

This commit is contained in:
Jonas Widen 2025-03-17 07:24:11 +01:00
parent dea67e2972
commit c32a484481

View File

@ -87,13 +87,21 @@ function M.get_response(prompt, context, callback)
return
end
local payload = vim.json.encode({contents = contents})
local payload = vim.json.encode({
contents = contents,
generationConfig = {
temperature = 0.1,
topK = 1,
topP = 1,
maxOutputTokens = 2048,
}
})
-- Correctly format the URL with model and API key
local url = string.format(
config.options.api_url .. "?key=%s",
config.options.model,
api_key
)
config.options.api_url,
config.options.model
) .. "?key=" .. api_key
local request = http.Request.new(url, payload)
request:execute(function(result, error)