@@ -193,7 +193,11 @@ D.prepare_payload = function(messages, model, provider)
193
193
top_p = math.max (0 , math.min (1 , model .top_p or 1 )),
194
194
}
195
195
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
+
197
201
for i = # messages , 1 , - 1 do
198
202
if messages [i ].role == " system" then
199
203
table.remove (messages , i )
@@ -203,7 +207,6 @@ D.prepare_payload = function(messages, model, provider)
203
207
output .max_tokens = nil
204
208
output .temperature = nil
205
209
output .top_p = nil
206
- output .stream = false
207
210
end
208
211
209
212
return output
@@ -319,7 +322,7 @@ local query = function(buf, provider, payload, handler, on_exit, callback)
319
322
end
320
323
local raw_response = qt .raw_response
321
324
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
323
326
local response = vim .json .decode (raw_response )
324
327
if response .choices and response .choices [1 ] and response .choices [1 ].message and response .choices [1 ].message .content then
325
328
content = response .choices [1 ].message .content
0 commit comments