feat: supports openai o1-preview
* feat: make O1 models on openai work by handle non-streams & correct parameters * chore: set temperature automatically when using o1 models
This commit is contained in:
@@ -114,6 +114,10 @@ M.stream = function(opts)
|
||||
if data_match then Provider.parse_response(data_match, current_event_state, handler_opts) end
|
||||
end
|
||||
|
||||
local function parse_response_without_stream(data)
|
||||
Provider.parse_response_without_stream(data, current_event_state, handler_opts)
|
||||
end
|
||||
|
||||
local completed = false
|
||||
|
||||
local active_job
|
||||
@@ -170,6 +174,14 @@ M.stream = function(opts)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- If stream is not enabled, then handle the response here
|
||||
if spec.body.stream == false and result.status == 200 then
|
||||
vim.schedule(function()
|
||||
completed = true
|
||||
parse_response_without_stream(result.body)
|
||||
end)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user