chore: make azure o series models stream

This commit is contained in:
kernitus 2025-01-27 12:29:29 +00:00 committed by yetone
parent 2ead26f809
commit 499b7a854b

View File

@ -25,12 +25,10 @@ M.parse_curl_args = function(provider, code_opts)
} }
if P.env.require_api_key(base) then headers["api-key"] = provider.parse_api_key() end if P.env.require_api_key(base) then headers["api-key"] = provider.parse_api_key() end
-- NOTE: When using "o1" set the supported parameters only -- NOTE: When using "o" series set the supported parameters only
local stream = true if O.is_o_series_model(base.model) then
if base.model and string.find(base.model, "o1") then
body_opts.max_tokens = nil body_opts.max_tokens = nil
body_opts.temperature = 1 body_opts.temperature = 1
stream = false
end end
return { return {
@ -43,7 +41,7 @@ M.parse_curl_args = function(provider, code_opts)
headers = headers, headers = headers,
body = vim.tbl_deep_extend("force", { body = vim.tbl_deep_extend("force", {
messages = M.parse_messages(code_opts), messages = M.parse_messages(code_opts),
stream = stream, stream = true,
}, body_opts), }, body_opts),
} }
end end