From 1d54d514710be18d2cd49e5d0aaab0e9602e5ccd Mon Sep 17 00:00:00 2001 From: Jordi Been Date: Sun, 10 Aug 2025 22:35:35 +0200 Subject: [PATCH] allow optional temperate and/or top_p --- lua/gp/dispatcher.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/gp/dispatcher.lua b/lua/gp/dispatcher.lua index e977d1d..c420977 100644 --- a/lua/gp/dispatcher.lua +++ b/lua/gp/dispatcher.lua @@ -155,8 +155,8 @@ D.prepare_payload = function(messages, model, provider) messages = messages, system = system, max_tokens = model.max_tokens or 4096, - temperature = math.max(0, math.min(2, model.temperature or 1)), - top_p = math.max(0, math.min(1, model.top_p or 1)), + temperature = model.temperature and math.max(0, math.min(2, model.temperature)) or nil, + top_p = model.top_p and math.max(0, math.min(1, model.top_p)) or nil, } return payload end