Skip to content

Commit 366a7fd

Browse files
feat: streaming for o series, o3 accepts reasoning_effort (#246)
Co-authored-by: Kean Mattingly <questionableantics.km@gmail.com>
1 parent 2372d53 commit 366a7fd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lua/gp/dispatcher.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ D.prepare_payload = function(messages, model, provider)
174174
top_p = math.max(0, math.min(1, model.top_p or 1)),
175175
}
176176

177-
if provider == "openai" and model.model:sub(1, 2) == "o1" then
177+
if provider == "openai" and model.model:sub(1, 1) == "o" then
178+
if model.model:sub(1, 2) == "o3" then
179+
output.reasoning_effort = model.reasoning_effort or "medium"
180+
end
181+
178182
for i = #messages, 1, -1 do
179183
if messages[i].role == "system" then
180184
table.remove(messages, i)
@@ -184,7 +188,6 @@ D.prepare_payload = function(messages, model, provider)
184188
output.max_tokens = nil
185189
output.temperature = nil
186190
output.top_p = nil
187-
output.stream = false
188191
end
189192

190193
return output

0 commit comments

Comments
 (0)