Skip to content

Commit f8ef386

Browse files
committed
chore: merge main
2 parents b7efad9 + 814f7ba commit f8ef386

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

doc/gp.nvim.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*gp.nvim.txt* For Neovim Last change: 2024 September 23
1+
*gp.nvim.txt* For Neovim Last change: 2025 April 08
22

33
==============================================================================
44
Table of Contents *gp.nvim-table-of-contents*

lua/gp/dispatcher.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ D.prepare_payload = function(messages, model, provider)
193193
top_p = math.max(0, math.min(1, model.top_p or 1)),
194194
}
195195

196-
if provider == "openai" and model.model:sub(1, 2) == "o1" then
196+
if (provider == "openai" or provider == "copilot") and model.model:sub(1, 1) == "o" then
197+
if model.model:sub(1, 2) == "o3" then
198+
output.reasoning_effort = model.reasoning_effort or "medium"
199+
end
200+
197201
for i = #messages, 1, -1 do
198202
if messages[i].role == "system" then
199203
table.remove(messages, i)
@@ -203,7 +207,6 @@ D.prepare_payload = function(messages, model, provider)
203207
output.max_tokens = nil
204208
output.temperature = nil
205209
output.top_p = nil
206-
output.stream = false
207210
end
208211

209212
return output
@@ -319,7 +322,7 @@ local query = function(buf, provider, payload, handler, on_exit, callback)
319322
end
320323
local raw_response = qt.raw_response
321324
local content = qt.response
322-
if qt.provider == 'openai' and content == "" and raw_response:match('choices') and raw_response:match("content") then
325+
if (qt.provider == 'openai' or qt.provider == 'copilot') and content == "" and raw_response:match('choices') and raw_response:match("content") then
323326
local response = vim.json.decode(raw_response)
324327
if response.choices and response.choices[1] and response.choices[1].message and response.choices[1].message.content then
325328
content = response.choices[1].message.content

0 commit comments

Comments
 (0)