From 6f045fa105490cd05e187575bd878d4ae8fc54c5 Mon Sep 17 00:00:00 2001 From: Kyu Yeon Lee Date: Fri, 8 Aug 2025 09:47:48 +0900 Subject: [PATCH 1/3] Update dispatcher.lua Somehow GPT-5 does not supports temperature and max token parameter in api --- 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 d4214aa8..22b0a5de 100644 --- a/lua/gp/dispatcher.lua +++ b/lua/gp/dispatcher.lua @@ -127,8 +127,8 @@ D.prepare_payload = function(messages, model, provider) }, }, generationConfig = { - temperature = math.max(0, math.min(2, model.temperature or 1)), - maxOutputTokens = model.max_tokens or 8192, + --temperature = math.max(0, math.min(2, model.temperature or 1)), + --maxOutputTokens = model.max_tokens or 8192, topP = math.max(0, math.min(1, model.top_p or 1)), topK = model.top_k or 100, }, From e54926838e0ee00de4ae751b0995698893416f29 Mon Sep 17 00:00:00 2001 From: Kyu Yeon Lee Date: Fri, 8 Aug 2025 09:49:47 +0900 Subject: [PATCH 2/3] gpt-5 --- lua/gp/dispatcher.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/gp/dispatcher.lua b/lua/gp/dispatcher.lua index 22b0a5de..01510f7a 100644 --- a/lua/gp/dispatcher.lua +++ b/lua/gp/dispatcher.lua @@ -127,8 +127,8 @@ D.prepare_payload = function(messages, model, provider) }, }, generationConfig = { - --temperature = math.max(0, math.min(2, model.temperature or 1)), - --maxOutputTokens = model.max_tokens or 8192, + temperature = math.max(0, math.min(2, model.temperature or 1)), + maxOutputTokens = model.max_tokens or 8192, topP = math.max(0, math.min(1, model.top_p or 1)), topK = model.top_k or 100, }, @@ -190,6 +190,13 @@ D.prepare_payload = function(messages, model, provider) output.top_p = nil end + if model.model == "gpt-5" then + -- remove max_tokens, top_p, temperature for gpt-5 models (duh) + output.max_tokens = nil + output.temperature = nil + output.top_p = nil + end + return output end From 0772fc2a5ba169646c1952cc49f184845dd3eced Mon Sep 17 00:00:00 2001 From: Kyu Yeon Lee Date: Fri, 8 Aug 2025 09:54:20 +0900 Subject: [PATCH 3/3] Update dispatcher.lua --- lua/gp/dispatcher.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/gp/dispatcher.lua b/lua/gp/dispatcher.lua index 01510f7a..62587db4 100644 --- a/lua/gp/dispatcher.lua +++ b/lua/gp/dispatcher.lua @@ -190,7 +190,7 @@ D.prepare_payload = function(messages, model, provider) output.top_p = nil end - if model.model == "gpt-5" then + if model.model == "gpt-5" or model.model == "gpt-5-mini" then -- remove max_tokens, top_p, temperature for gpt-5 models (duh) output.max_tokens = nil output.temperature = nil